Author: julien(a)jboss.com
Date: 2007-08-17 11:29:49 -0400 (Fri, 17 Aug 2007)
New Revision: 7981
Added:
modules/portlet/trunk/build/
modules/portlet/trunk/build/.cvsignore
modules/portlet/trunk/build/.project
modules/portlet/trunk/build/build-thirdparty.xml
modules/portlet/trunk/build/build.bat
modules/portlet/trunk/build/build.sh
modules/portlet/trunk/build/build.xml
modules/portlet/trunk/build/distrib.xml
modules/portlet/trunk/build/etc/
modules/portlet/trunk/build/etc/clustered.properties
modules/portlet/trunk/build/etc/hsqldb.properties
modules/portlet/trunk/build/etc/local.properties-example
modules/portlet/trunk/build/etc/mysql.properties
modules/portlet/trunk/build/etc/mysql5.properties
modules/portlet/trunk/build/etc/oracle.properties
modules/portlet/trunk/build/etc/oracle10gXE.properties
modules/portlet/trunk/build/etc/postgresql.properties
modules/portlet/trunk/build/etc/resources/
modules/portlet/trunk/build/etc/resources/jboss-log4j.xml.diff
modules/portlet/trunk/build/etc/single.properties
modules/portlet/trunk/build/etc/sqlserver.properties
modules/portlet/trunk/build/ide/
modules/portlet/trunk/build/ide/eclipse/
modules/portlet/trunk/build/ide/eclipse/3.1/
modules/portlet/trunk/build/ide/eclipse/3.1/config/
modules/portlet/trunk/build/ide/eclipse/3.1/config/jboss-format.xml
modules/portlet/trunk/build/ide/eclipse/3.2/
modules/portlet/trunk/build/ide/eclipse/3.2/team/
modules/portlet/trunk/build/ide/eclipse/3.2/team/anonymous-projectSet.psf
modules/portlet/trunk/build/ide/eclipse/3.2/team/commiter-projectSet.psf
modules/portlet/trunk/build/ide/intellij/
modules/portlet/trunk/build/ide/intellij/idea60/
modules/portlet/trunk/build/ide/intellij/idea60/config/
modules/portlet/trunk/build/ide/intellij/idea60/config/codestyles/
modules/portlet/trunk/build/ide/intellij/idea60/config/codestyles/jboss.xml
modules/portlet/trunk/build/ide/intellij/idea60/config/fileTemplates/
modules/portlet/trunk/build/ide/intellij/idea60/config/fileTemplates/StandartTestCasePortlet.java
modules/portlet/trunk/build/ide/intellij/idea60/config/fileTemplates/includes/
modules/portlet/trunk/build/ide/intellij/idea60/config/fileTemplates/includes/Body
Header.java
modules/portlet/trunk/build/ide/intellij/idea60/config/fileTemplates/includes/File
Header.java
modules/portlet/trunk/build/ide/intellij/idea60/config/fileTemplates/internal/
modules/portlet/trunk/build/ide/intellij/idea60/config/fileTemplates/internal/AnnotationType.java
modules/portlet/trunk/build/ide/intellij/idea60/config/fileTemplates/internal/Class.java
modules/portlet/trunk/build/ide/intellij/idea60/config/fileTemplates/internal/Enum.java
modules/portlet/trunk/build/ide/intellij/idea60/config/fileTemplates/internal/Interface.java
modules/portlet/trunk/build/ide/intellij/idea60/jboss-portal-portlet.ipr
modules/portlet/trunk/build/ide/intellij/idea60/modules/
modules/portlet/trunk/build/ide/intellij/idea60/modules/federation/
modules/portlet/trunk/build/ide/intellij/idea60/modules/federation/federation.iml
modules/portlet/trunk/build/ide/intellij/idea60/modules/jsr168api/
modules/portlet/trunk/build/ide/intellij/idea60/modules/jsr168api/jsr168api.iml
modules/portlet/trunk/build/ide/intellij/idea60/modules/portlet/
modules/portlet/trunk/build/ide/intellij/idea60/modules/portlet/portlet.iml
modules/portlet/trunk/build/ide/intellij/idea60/modules/portlet/samples.iml
modules/portlet/trunk/build/ide/intellij/idea60/modules/testsuite/
modules/portlet/trunk/build/ide/intellij/idea60/modules/testsuite/testsuite.iml
modules/portlet/trunk/build/ide/intellij/idea60/modules/thirdparty/
modules/portlet/trunk/build/ide/intellij/idea60/modules/thirdparty/thirdparty.iml
modules/portlet/trunk/build/ide/intellij/idea60/modules/tools/
modules/portlet/trunk/build/ide/intellij/idea60/modules/tools/tools.iml
modules/portlet/trunk/build/ide/intellij/idea60/readme.txt
modules/portlet/trunk/build/licences/
modules/portlet/trunk/build/licences/JBossEULA.txt
modules/portlet/trunk/federation/
modules/portlet/trunk/federation/.classpath
modules/portlet/trunk/federation/.cvsignore
modules/portlet/trunk/federation/.project
modules/portlet/trunk/federation/build.bat
modules/portlet/trunk/federation/build.sh
modules/portlet/trunk/federation/build.xml
modules/portlet/trunk/federation/src/
modules/portlet/trunk/federation/src/main/
modules/portlet/trunk/federation/src/main/org/
modules/portlet/trunk/federation/src/main/org/jboss/
modules/portlet/trunk/federation/src/main/org/jboss/portal/
modules/portlet/trunk/federation/src/main/org/jboss/portal/portlet/
modules/portlet/trunk/federation/src/main/org/jboss/portal/portlet/federation/
modules/portlet/trunk/federation/src/main/org/jboss/portal/portlet/federation/FederatedPortletInvoker.java
modules/portlet/trunk/federation/src/main/org/jboss/portal/portlet/federation/FederatingPortletInvoker.java
modules/portlet/trunk/federation/src/main/org/jboss/portal/portlet/federation/impl/
modules/portlet/trunk/federation/src/main/org/jboss/portal/portlet/federation/impl/FederatedPortlet.java
modules/portlet/trunk/federation/src/main/org/jboss/portal/portlet/federation/impl/FederatedPortletInvokerService.java
modules/portlet/trunk/federation/src/main/org/jboss/portal/portlet/federation/impl/FederatingPortletInvokerService.java
modules/portlet/trunk/federation/src/main/org/jboss/portal/portlet/federation/impl/PortletInvokerRegistrationService.java
modules/portlet/trunk/federation/src/main/org/jboss/portal/test/
modules/portlet/trunk/federation/src/main/org/jboss/portal/test/portlet/
modules/portlet/trunk/federation/src/main/org/jboss/portal/test/portlet/federation/
modules/portlet/trunk/federation/src/main/org/jboss/portal/test/portlet/federation/FederatingPortletInvokerTestCase.java
modules/portlet/trunk/federation/src/main/org/jboss/portal/test/portlet/federation/NoInvokersTestCase.java
modules/portlet/trunk/federation/src/main/org/jboss/portal/test/portlet/federation/OneInvokerNoPortletsTestCase.java
modules/portlet/trunk/jboss-portal-portlet.ipr
modules/portlet/trunk/jboss-portal-portlet.iws
modules/portlet/trunk/jsr168api/
modules/portlet/trunk/jsr168api/.classpath
modules/portlet/trunk/jsr168api/.cvsignore
modules/portlet/trunk/jsr168api/.project
modules/portlet/trunk/jsr168api/build.bat
modules/portlet/trunk/jsr168api/build.sh
modules/portlet/trunk/jsr168api/build.xml
modules/portlet/trunk/jsr168api/src/
modules/portlet/trunk/jsr168api/src/main/
modules/portlet/trunk/jsr168api/src/main/javax/
modules/portlet/trunk/jsr168api/src/main/javax/portlet/
modules/portlet/trunk/jsr168api/src/main/javax/portlet/ActionRequest.java
modules/portlet/trunk/jsr168api/src/main/javax/portlet/ActionResponse.java
modules/portlet/trunk/jsr168api/src/main/javax/portlet/GenericPortlet.java
modules/portlet/trunk/jsr168api/src/main/javax/portlet/PortalContext.java
modules/portlet/trunk/jsr168api/src/main/javax/portlet/Portlet.java
modules/portlet/trunk/jsr168api/src/main/javax/portlet/PortletConfig.java
modules/portlet/trunk/jsr168api/src/main/javax/portlet/PortletContext.java
modules/portlet/trunk/jsr168api/src/main/javax/portlet/PortletException.java
modules/portlet/trunk/jsr168api/src/main/javax/portlet/PortletMode.java
modules/portlet/trunk/jsr168api/src/main/javax/portlet/PortletModeException.java
modules/portlet/trunk/jsr168api/src/main/javax/portlet/PortletPreferences.java
modules/portlet/trunk/jsr168api/src/main/javax/portlet/PortletRequest.java
modules/portlet/trunk/jsr168api/src/main/javax/portlet/PortletRequestDispatcher.java
modules/portlet/trunk/jsr168api/src/main/javax/portlet/PortletResponse.java
modules/portlet/trunk/jsr168api/src/main/javax/portlet/PortletSecurityException.java
modules/portlet/trunk/jsr168api/src/main/javax/portlet/PortletSession.java
modules/portlet/trunk/jsr168api/src/main/javax/portlet/PortletSessionUtil.java
modules/portlet/trunk/jsr168api/src/main/javax/portlet/PortletURL.java
modules/portlet/trunk/jsr168api/src/main/javax/portlet/PreferencesValidator.java
modules/portlet/trunk/jsr168api/src/main/javax/portlet/ReadOnlyException.java
modules/portlet/trunk/jsr168api/src/main/javax/portlet/RenderRequest.java
modules/portlet/trunk/jsr168api/src/main/javax/portlet/RenderResponse.java
modules/portlet/trunk/jsr168api/src/main/javax/portlet/UnavailableException.java
modules/portlet/trunk/jsr168api/src/main/javax/portlet/ValidatorException.java
modules/portlet/trunk/jsr168api/src/main/javax/portlet/WindowState.java
modules/portlet/trunk/jsr168api/src/main/javax/portlet/WindowStateException.java
modules/portlet/trunk/portlet/
modules/portlet/trunk/portlet/.classpath
modules/portlet/trunk/portlet/.cvsignore
modules/portlet/trunk/portlet/.project
modules/portlet/trunk/portlet/build.bat
modules/portlet/trunk/portlet/build.sh
modules/portlet/trunk/portlet/build.xml
modules/portlet/trunk/portlet/src/
modules/portlet/trunk/portlet/src/main/
modules/portlet/trunk/portlet/src/main/org/
modules/portlet/trunk/portlet/src/main/org/jboss/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/ActionURL.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/InvalidPortletIdException.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/InvokerUnavailableException.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/NoSuchPortletException.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/OpaqueStateString.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/Portlet.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/PortletCloneFailedException.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/PortletContext.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/PortletInvoker.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/PortletInvokerException.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/PortletParameters.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/PortletParametersStateString.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/PortletURL.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/Properties.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/RenderURL.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/StateEvent.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/StateString.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/StatefulPortletContext.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/TransportGuarantee.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/aspects/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ConsumerCacheInterceptor.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ContextDispatcherInterceptor.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/LocalInterceptor.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ModesInterceptor.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ProducerCacheInterceptor.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/SecureTransportInterceptor.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ValveInterceptor.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/WindowStatesInterceptor.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/container/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletApplication.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletApplicationContext.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletApplicationRegistrationContext.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletApplicationRegistry.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletApplicationRegistryListener.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletContainer.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletContainerInvoker.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletInitializationException.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/deployment/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/deployment/JBossApplicationMetaDataFactory.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/deployment/PortletApplicationMetaDataFactory.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/deployment/ValueTrimmingFilter.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/PortletRequestDecoder.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/PortletRequestEncoder.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/RequestPropertiesAttributeResolver.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/container/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/container/PortletApplicationContextImpl.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/container/PortletApplicationRegistryImpl.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/APIConstants.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/DispatchedHttpServletRequest.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/DispatchedHttpServletResponse.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletAPIFactoryImpl.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletApplicationImpl.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletContainerImpl.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletInfoFactoryImpl.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletRequestAttributes.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletResourceBundleFactory.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletUtils.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/ActionRequestImpl.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/ActionResponseImpl.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/PortalContextImpl.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/PortletConfigImpl.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/PortletContextImpl.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/PortletPreferencesImpl.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/PortletRequestDispatcherImpl.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/PortletRequestImpl.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/PortletResponseImpl.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/PortletSessionImpl.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/PortletURLImpl.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/RenderRequestImpl.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/RenderResponseImpl.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContainerCacheInfo.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContainerCapabilities.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContainerMetaInfo.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContainerModeInfo.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContainerPortletInfo.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContainerPreferenceInfo.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContainerPreferencesInfo.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContainerSecurityInfo.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContainerSessionInfo.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContainerWindowStateInfo.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContentTypes.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/InfoBundle.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/Utils.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/CacheConfigMetaData.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/ContentTypeMetaData.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/ContentTypesMetaData.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/DescribableObjectMetaData.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/DescriptionMetaData.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/DisplayNameMetaData.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/LanguagesMetaData.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/LocalizedStringMetaData.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/LocalizedValueMetaData.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/ModesMetaData.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/ParameterMetaData.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/PortletApplicationMetaData.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/PortletMetaData.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/PortletModeMetaData.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/PortletPreferencesMetaData.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/PreferenceMetaData.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/SecurityConstraintMetaData.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/SecurityRoleRefMetaData.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/TransportGuaranteesMetaData.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/UserAttributeMetaData.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/WindowStateMetaData.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/WindowStatesMetaData.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/spi/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/spi/PortletAPIFactory.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/spi/PortletInfoFactory.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/taglib/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/taglib/ActionURLTag.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/taglib/DefineObjectsTag.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/taglib/DefineObjectsTagTEI.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/taglib/GenerateURLTag.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/taglib/GenerateURLTagTEI.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/taglib/NamespaceTag.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/taglib/PortletTag.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/taglib/RenderURLTag.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/taglib/URLParameterTag.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/spi/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/spi/AbstractActionContext.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/spi/AbstractPortletInvocationContext.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/spi/AbstractRenderContext.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/spi/AbstractRequestContext.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/spi/AbstractSecurityContext.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/state/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/state/StateConverterV0.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/state/StateManagementPolicyService.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/state/consumer/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/state/consumer/ConsumerPersistenceManagerService.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/state/producer/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/state/producer/PortletStateContextImpl.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/state/producer/PortletStatePersistenceManagerService.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/info/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/info/CacheInfo.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/info/CapabilitiesInfo.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/info/MetaInfo.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/info/ModeInfo.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/info/PortletInfo.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/info/PreferenceInfo.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/info/PreferencesInfo.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/info/SecurityInfo.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/info/SessionInfo.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/info/WindowStateInfo.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/ActionInvocation.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/PortletInterceptor.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/PortletInvocation.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/RenderInvocation.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/ErrorResponse.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/FragmentResponse.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/HTTPRedirectionResponse.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/InsufficientPrivilegesResponse.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/InsufficientTransportGuaranteeResponse.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/PortletInvocationResponse.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/RedirectionResponse.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/RenderResponse.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/SecurityErrorResponse.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/SecurityResponse.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/StreamResponse.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/UnavailableResponse.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/cache/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/cache/SoftTimedContent.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/cache/StrongTimedContent.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/cache/TimedContent.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/management/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/management/LocalPortletManagement.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/management/LocalPortletManagementMBean.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/management/PortletContainerManagementInterceptor.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/management/PortletContainerManagementInterceptorImpl.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/management/PortletInfo.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/metadata/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/metadata/JBossApplicationMetaData.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/metadata/JBossPortletMetaData.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/metadata/PolicyPermissionMetaData.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/metadata/SecurityConstraintMetaData.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/metadata/SessionConfigMetaData.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/spi/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/spi/ActionContext.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/spi/InstanceContext.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/spi/PortalContext.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/spi/PortletInvocationContext.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/spi/RenderContext.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/spi/RequestContext.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/spi/SecurityContext.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/spi/UserContext.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/spi/WindowContext.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/AbstractPropertyContext.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/AbstractPropertyMap.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/AccessMode.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/DestroyCloneFailure.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/InvalidStateIdException.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/NoSuchStateException.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/Property.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/PropertyChange.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/PropertyContext.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/PropertyMap.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/SimplePropertyMap.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/StateConversionException.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/StateConverter.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/StateManagementPolicy.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/consumer/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/consumer/ConsumerPersistenceManager.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/consumer/ConsumerPortlet.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/consumer/ConsumerPortletInvoker.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/consumer/ConsumerState.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/consumer/ConsumerStateContext.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/producer/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/producer/PortletState.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/producer/PortletStateChangeRequiredException.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/producer/PortletStateContext.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/producer/PortletStatePersistenceManager.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/producer/ProducerPortlet.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/producer/ProducerPortletInvoker.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/support/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/support/info/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/support/info/CacheInfoSupport.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/support/info/CapabilitiesInfoSupport.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/support/info/MetaInfoSupport.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/support/info/ModeInfoSupport.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/support/info/PortletInfoSupport.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/support/info/PreferenceInfoSupport.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/support/info/PreferencesInfoSupport.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/support/info/SecurityInfoSupport.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/support/info/SessionInfoSupport.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/support/info/WindowStateInfoSupport.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/support/spi/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/support/spi/ActionContextSupport.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/support/spi/InstanceContextSupport.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/support/spi/PortletInvocationContextSupport.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/support/spi/RenderContextSupport.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/support/spi/SecurityContextSupport.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/support/spi/UserContextSupport.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/test/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/test/ActionContextImpl.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/test/InstanceContextImpl.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/test/TestPortalContext.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/test/TestPortletInvoker.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/test/UserContextImpl.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/test/ValueMapAssert.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/test/support/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/test/support/PortletInvokerSupport.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/test/support/PortletSupport.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/Joinpoint.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/PortletTest.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/PortletTestContext.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/PortletTestDriver.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/PortletTestParameters.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/PortletTestSuite.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/TestAction.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/TestContants.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/TestDriverRegistryAccess.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/actions/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/actions/PortletActionTestAction.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/actions/PortletRenderTestAction.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/actions/ServletServiceTestAction.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/basictests/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/basictests/BasicTestSequenceBuilder.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/basictests/BasicTestSuite.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/basictests/PortletA.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/basictests/PortletB.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/basictests/classes/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/basictests/classes/JoinpointTestCase.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/basictests/classes/SequenceRegistryBuilderTestCase.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/basictests/classes/SequenceRegistryTestCase.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/basictests/classes/SequenceTestCase.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/basictests/classes/TestBuilder.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/components/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/components/AbstractTestGenericPortlet.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/components/AbstractTestPortlet.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/components/AbstractUniversalTestPortlet.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/components/AbstractUniversalTestServlet.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/ContentTypesTestCase.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/ParametersTestCase.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/PortletRequestDecoderTestCase.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/PortletRequestEncoderTestCase.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/PropertiesTestCase.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/deployment/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/deployment/UnmarshallerTestCase.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/framework/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/framework/NoopServlet.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/framework/UTP1.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/framework/UTP10.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/framework/UTP11.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/framework/UTP2.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/framework/UTP3.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/framework/UTP4.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/framework/UTP5.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/framework/UTP6.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/framework/UTP7.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/framework/UTP8.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/framework/UTP9.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/framework/UTS1.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/framework/UTS2.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/ha/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/ha/session/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/ha/session/MutableValue.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/ha/session/SessionSequenceBuilder.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/ha/session/SessionTestCase.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/info/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/info/AbstractInfoTest.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/info/CacheInfoTest.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/info/CapabilitiesInfoTest.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/info/MetaInfoTest.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/info/ModeInfoTest.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/info/PortletInfoTest.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/info/PreferenceInfoTest.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/info/SecurityInfoTest.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/info/SessionInfoTest.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/info/universal/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/info/universal/SimplePortlet.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/actionrequest/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/actionrequest/ActionRequestAPITestSuite.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/actionrequest/ActionRequestSequenceBuilder.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/actionresponse/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/actionresponse/ActionResponseAPITestSuite.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/actionresponse/ActionResponseSequenceBuilder.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portalcontext/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portalcontext/PortalContextAPITestSuite.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portalcontext/PortalContextSequenceBuilder.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletconfig/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletconfig/PortletConfigAPITestSuite.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletconfig/PortletConfigSequenceBuilder.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletcontext/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletcontext/PortletContextAPITestSuite.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletcontext/PortletContextSequenceBuilder.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletmode/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletmode/PortletModeAPITestSuite.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletmode/PortletModeSequenceBuilder.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletpreferences/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletpreferences/PortletPreferencesAPITestSuite.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletpreferences/PortletPreferencesSequenceBuilder.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsession/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsession/PortletSessionAPITestSuite.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsession/PortletSessionSequenceBuilder.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsessionutil/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsessionutil/PortletSessionUtilAPITestSuite.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsessionutil/PortletSessionUtilSequenceBuilder.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portleturl/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portleturl/PortletURLAPITestSuite.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portleturl/PortletURLSequenceBuilder.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/renderrequest/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/renderrequest/RenderRequestAPITestSuite.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/renderrequest/RenderRequestSequenceBuilder.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/renderresponse/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/renderresponse/RenderResponseAPITestSuite.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/renderresponse/RenderResponseSequenceBuilder.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/windowstate/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/windowstate/WindowStateAPITestSuite.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/windowstate/WindowStateSequenceBuilder.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/common/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/common/AbstractCacheSequenceBuilder.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/dispatcher/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/dispatcher/DispatcherSequenceBuilder.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/dispatcher/DispatchingFilter.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/dispatcher/ServletFilter.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/expiringcache/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/expiringcache/ExpiringCacheSequenceBuilder.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/neverexpiringcache/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/neverexpiringcache/NeverExpiringCacheSequenceBuilder.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/nocache/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/nocache/NoCacheSequenceBuilder.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletconfig/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletconfig/PortletConfigSequenceBuilder.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletconfig/extended/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletconfig/extended/GetResourceBundleDuringInitPortlet.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletconfig/extended/ResourceBundleCascadePortlet.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletconfig/extended/ResourceBundlePortlet.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletmode/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletmode/PortletModeSequenceBuilder.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletmode/extended/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletmode/extended/TestActionWithPortletModePortlet.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletrequests/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletrequests/PortletRequestsSequenceBuilder.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletresponses/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletresponses/PortletResponsesSequenceBuilder.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/preferences/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/preferences/PreferencesSequenceBuilder.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/session/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/session/SessionSequenceBuilder.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/misc/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/misc/log4j/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/misc/log4j/CustomLogger.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/misc/log4j/CustomLoggerFactory.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/misc/log4j/Log4jSequenceBuilder.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/misc/log4j/LoggingPortlet.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/dispatcher/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/dispatcher/DispatcherSequenceBuilder.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/dispatcher/DispatcherTestSuite.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletconfig/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletconfig/PortletConfigSequenceBuilder.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletconfig/PortletConfigTestSuite.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletconfig/spec/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletconfig/spec/InlineValuesNotInResourceBundlePortlet.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletconfig/spec/InlineValuesWithNoResourceBundleDefinedPortlet.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletcontext/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletcontext/PortletContextSequenceBuilder.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletcontext/PortletContextTestSuite.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/PortletInterfaceSequenceBuilder.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/PortletInterfaceTestSuite.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/spec/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/spec/ExceptionsDuringRequestHandlingControllerPortlet.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/spec/InitializeBeforeHandlePortlet.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/spec/MinimizedStateDontRenderPortlet.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/spec/PortletExceptionDuringInitPortlet.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/spec/PortletExceptionDuringRequestHandlingPortlet.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/spec/RuntimeExceptionDuringInitPortlet.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/spec/RuntimeExceptionDuringRequestHandlingPortlet.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/spec/UnavailableExceptionDuringInitPortlet.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/spec/UnavailableExceptionDuringProcessActionPortlet.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/spec/UnavailableExceptionDuringRenderPortlet.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletmode/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletmode/PortletModeSequenceBuilder.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletmode/PortletModeTestSuite.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletmode/spec/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletmode/spec/NotInvokeModeDeclaredForNotSupportedMarkupHelperPortlet.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletmode/spec/RequestDispatchingDependingOnModePortlet.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletrequests/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletrequests/PortletRequestTestSuite.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletrequests/PortletRequestsSequenceBuilder.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletresponses/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletresponses/PortletResponsesSequenceBuilder.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletresponses/PortletResponsesTestSuite.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletsession/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletsession/HttpSessionEvents.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletsession/HttpSessionInvalidatorServlet.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletsession/PortletSessionSequenceBuilder.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletsession/PortletSessionTestSuite.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portleturl/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portleturl/PortletURLTestSuite.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portleturl/PortletUrlSequenceBuilder.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/preferences/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/preferences/PreferencesSequenceBuilder.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/preferences/PreferencesTestSuite.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/preferences/spec/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/preferences/spec/CreateASingleInstanceOfValidatorValidator.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/preferences/spec/InvalidationCancelsStoreValidator.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/preferences/spec/ValidationStoresValidator.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/windowstates/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/windowstates/WindowStatesSequenceBuilder.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/windowstates/WindowStatesTestSuite.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/navigation/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/navigation/StateStringTestCase.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/session/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/session/ReplicatedValue.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/session/SessionSynchronizationTestCase.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/session/TestClassLoader.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/state/
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/state/AbstractStatefulPortletInvokerTestCase.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/state/ConsumerStatefulPortletInvokerTestCase.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/state/LocalStoreConsumerStatefulPortletInvokerTestCase.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/state/LocalStoreProducerStatefulPortletInvokerTestCase.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/state/ProducerStatefulPortletInvokerTestCase.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/state/RemoteStoreConsumerStatefulPortletInvokerTestCase.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/state/RemoteStoreProducerStatefulPortletInvokerTestCase.java
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/state/StateConverterV0TestCase.java
modules/portlet/trunk/portlet/src/resources/
modules/portlet/trunk/portlet/src/resources/portal-portlet-lib-jar/
modules/portlet/trunk/portlet/src/resources/portal-portlet-lib-jar/org/
modules/portlet/trunk/portlet/src/resources/portal-portlet-lib-jar/org/jboss/
modules/portlet/trunk/portlet/src/resources/portal-portlet-lib-jar/org/jboss/portal/
modules/portlet/trunk/portlet/src/resources/portal-portlet-lib-jar/org/jboss/portal/portlet/
modules/portlet/trunk/portlet/src/resources/portal-portlet-lib-jar/org/jboss/portal/portlet/portlet.tld
modules/portlet/trunk/portlet/src/resources/portlet-app_1_0.xsd
modules/portlet/trunk/portlet/src/resources/test/
modules/portlet/trunk/portlet/src/resources/test/deployment/
modules/portlet/trunk/portlet/src/resources/test/deployment/jboss-portlet.xml
modules/portlet/trunk/portlet/src/resources/test/deployment/portlet.xml
modules/portlet/trunk/portlet/src/resources/test/ha/
modules/portlet/trunk/portlet/src/resources/test/ha/test-session-war/
modules/portlet/trunk/portlet/src/resources/test/ha/test-session-war/WEB-INF/
modules/portlet/trunk/portlet/src/resources/test/ha/test-session-war/WEB-INF/jboss-portlet.xml
modules/portlet/trunk/portlet/src/resources/test/ha/test-session-war/WEB-INF/portlet.xml
modules/portlet/trunk/portlet/src/resources/test/ha/test-session-war/WEB-INF/web.xml
modules/portlet/trunk/portlet/src/resources/test/info/
modules/portlet/trunk/portlet/src/resources/test/info/test-info-sar/
modules/portlet/trunk/portlet/src/resources/test/info/test-info-sar/META-INF/
modules/portlet/trunk/portlet/src/resources/test/info/test-info-war/
modules/portlet/trunk/portlet/src/resources/test/info/test-info-war/WEB-INF/
modules/portlet/trunk/portlet/src/resources/test/info/test-info-war/WEB-INF/classes/
modules/portlet/trunk/portlet/src/resources/test/info/test-info-war/WEB-INF/classes/PrefsResource_en.properties
modules/portlet/trunk/portlet/src/resources/test/info/test-info-war/WEB-INF/classes/PrefsResource_it.properties
modules/portlet/trunk/portlet/src/resources/test/info/test-info-war/WEB-INF/classes/PrefsResource_pl.properties
modules/portlet/trunk/portlet/src/resources/test/info/test-info-war/WEB-INF/jboss-portlet.xml
modules/portlet/trunk/portlet/src/resources/test/info/test-info-war/WEB-INF/portlet.xml
modules/portlet/trunk/portlet/src/resources/test/info/test-info-war/WEB-INF/web.xml
modules/portlet/trunk/portlet/src/resources/test/jsr168/
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/actionrequest-war/
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/actionrequest-war/WEB-INF/
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/actionrequest-war/WEB-INF/portlet.xml
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/actionrequest-war/WEB-INF/web.xml
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/actionresponse-war/
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/actionresponse-war/WEB-INF/
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/actionresponse-war/WEB-INF/portlet.xml
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/actionresponse-war/WEB-INF/web.xml
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portalcontext-war/
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portalcontext-war/WEB-INF/
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portalcontext-war/WEB-INF/portlet.xml
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portalcontext-war/WEB-INF/web.xml
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletconfig-war/
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletconfig-war/WEB-INF/
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletconfig-war/WEB-INF/portlet.xml
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletconfig-war/WEB-INF/web.xml
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletcontext-war/
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletcontext-war/WEB-INF/
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletcontext-war/WEB-INF/portlet.xml
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletcontext-war/WEB-INF/web.xml
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletcontext-war/simple_resource.txt
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletmode-war/
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletmode-war/WEB-INF/
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletmode-war/WEB-INF/portlet.xml
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletmode-war/WEB-INF/web.xml
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletpreferences-war/
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletpreferences-war/WEB-INF/
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletpreferences-war/WEB-INF/portlet.xml
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletpreferences-war/WEB-INF/web.xml
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletsession-war/
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletsession-war/WEB-INF/
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletsession-war/WEB-INF/portlet.xml
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletsession-war/WEB-INF/web.xml
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletsessionutil-war/
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletsessionutil-war/WEB-INF/
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletsessionutil-war/WEB-INF/portlet.xml
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletsessionutil-war/WEB-INF/web.xml
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portleturl-war/
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portleturl-war/WEB-INF/
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portleturl-war/WEB-INF/portlet.xml
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portleturl-war/WEB-INF/web.xml
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/renderrequest-war/
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/renderrequest-war/WEB-INF/
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/renderrequest-war/WEB-INF/portlet.xml
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/renderrequest-war/WEB-INF/web.xml
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/renderresponse-war/
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/renderresponse-war/WEB-INF/
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/renderresponse-war/WEB-INF/portlet.xml
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/renderresponse-war/WEB-INF/web.xml
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/windowstate-war/
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/windowstate-war/WEB-INF/
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/windowstate-war/WEB-INF/portlet.xml
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/windowstate-war/WEB-INF/web.xml
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/dispatcher-war/
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/dispatcher-war/WEB-INF/
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/dispatcher-war/WEB-INF/portlet.xml
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/dispatcher-war/WEB-INF/web.xml
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/dispatcher-war/dispatchedFromFilter.jsp
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/expiringcache-war/
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/expiringcache-war/WEB-INF/
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/expiringcache-war/WEB-INF/portlet.xml
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/expiringcache-war/WEB-INF/web.xml
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/neverexpiringcache-war/
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/neverexpiringcache-war/WEB-INF/
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/neverexpiringcache-war/WEB-INF/portlet.xml
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/neverexpiringcache-war/WEB-INF/web.xml
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/nocache-war/
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/nocache-war/WEB-INF/
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/nocache-war/WEB-INF/portlet.xml
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/nocache-war/WEB-INF/web.xml
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletconfig-war/
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletconfig-war/WEB-INF/
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletconfig-war/WEB-INF/classes/
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletconfig-war/WEB-INF/classes/GetResourceBundleDuringInitPortlet_en.properties
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletconfig-war/WEB-INF/classes/GetResourceBundleDuringInitPortlet_it.properties
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletconfig-war/WEB-INF/classes/ResourceBundlePortlet_en.properties
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletconfig-war/WEB-INF/classes/ResourceBundlePortlet_it.properties
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletconfig-war/WEB-INF/classes/org/
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletconfig-war/WEB-INF/classes/org/jboss/
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletconfig-war/WEB-INF/classes/org/jboss/portal/
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletconfig-war/WEB-INF/classes/org/jboss/portal/test/
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletconfig-war/WEB-INF/classes/org/jboss/portal/test/portlet/
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletconfig-war/WEB-INF/classes/org/jboss/portal/test/portlet/jsr168/
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletconfig-war/WEB-INF/classes/org/jboss/portal/test/portlet/jsr168/ext/
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletconfig-war/WEB-INF/classes/org/jboss/portal/test/portlet/jsr168/ext/portletconfig/
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletconfig-war/WEB-INF/classes/org/jboss/portal/test/portlet/jsr168/ext/portletconfig/extended/
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletconfig-war/WEB-INF/classes/org/jboss/portal/test/portlet/jsr168/ext/portletconfig/extended/ResourceBundleCascadePortlet_de.properties
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletconfig-war/WEB-INF/classes/org/jboss/portal/test/portlet/jsr168/ext/portletconfig/extended/ResourceBundleCascadePortlet_de_DE.properties
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletconfig-war/WEB-INF/classes/org/jboss/portal/test/portlet/jsr168/ext/portletconfig/extended/ResourceBundleCascadePortlet_en_GB.properties
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletconfig-war/WEB-INF/classes/org/jboss/portal/test/portlet/jsr168/ext/portletconfig/extended/ResourceBundleCascadePortlet_fr.properties
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletconfig-war/WEB-INF/classes/org/jboss/portal/test/portlet/jsr168/ext/portletconfig/extended/ResourceBundleCascadePortlet_fr_FR.properties
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletconfig-war/WEB-INF/portlet.xml
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletconfig-war/WEB-INF/web.xml
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletmode-war/
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletmode-war/WEB-INF/
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletmode-war/WEB-INF/portlet.xml
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletmode-war/WEB-INF/web.xml
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletrequests-war/
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletrequests-war/WEB-INF/
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletrequests-war/WEB-INF/portlet.xml
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletrequests-war/WEB-INF/web.xml
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletresponses-war/
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletresponses-war/WEB-INF/
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletresponses-war/WEB-INF/portlet.xml
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletresponses-war/WEB-INF/web.xml
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/preferences-war/
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/preferences-war/WEB-INF/
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/preferences-war/WEB-INF/portlet.xml
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/preferences-war/WEB-INF/web.xml
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/session-war/
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/session-war/WEB-INF/
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/session-war/WEB-INF/portlet.xml
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/session-war/WEB-INF/web.xml
modules/portlet/trunk/portlet/src/resources/test/jsr168/misc/
modules/portlet/trunk/portlet/src/resources/test/jsr168/misc/log4j-war/
modules/portlet/trunk/portlet/src/resources/test/jsr168/misc/log4j-war/WEB-INF/
modules/portlet/trunk/portlet/src/resources/test/jsr168/misc/log4j-war/WEB-INF/portlet.xml
modules/portlet/trunk/portlet/src/resources/test/jsr168/misc/log4j-war/WEB-INF/web.xml
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/basic-war/
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/basic-war/WEB-INF/
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/basic-war/WEB-INF/portlet.xml
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/basic-war/WEB-INF/web.xml
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/dispatcher-war/
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/dispatcher-war/WEB-INF/
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/dispatcher-war/WEB-INF/portlet.xml
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/dispatcher-war/WEB-INF/web.xml
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletconfig-war/
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletconfig-war/WEB-INF/
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletconfig-war/WEB-INF/classes/
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletconfig-war/WEB-INF/classes/InlineValuesNotInResourceBundlePortlet_en.properties
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletconfig-war/WEB-INF/classes/InlineValuesNotInResourceBundlePortlet_it.properties
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletconfig-war/WEB-INF/portlet.xml
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletconfig-war/WEB-INF/web.xml
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletcontext-war/
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletcontext-war/WEB-INF/
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletcontext-war/WEB-INF/portlet.xml
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletcontext-war/WEB-INF/web.xml
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletcontext-war/simple_resource.txt
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletinterface-war/
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletinterface-war/WEB-INF/
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletinterface-war/WEB-INF/portlet.xml
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletinterface-war/WEB-INF/web.xml
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletmode-war/
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletmode-war/WEB-INF/
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletmode-war/WEB-INF/portlet.xml
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletmode-war/WEB-INF/web.xml
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletrequests-war/
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletrequests-war/WEB-INF/
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletrequests-war/WEB-INF/portlet.xml
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletrequests-war/WEB-INF/web.xml
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletresponses-war/
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletresponses-war/WEB-INF/
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletresponses-war/WEB-INF/portlet.xml
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletresponses-war/WEB-INF/web.xml
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletsession-war/
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletsession-war/WEB-INF/
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletsession-war/WEB-INF/portlet.xml
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletsession-war/WEB-INF/web.xml
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portleturl-war/
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portleturl-war/WEB-INF/
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portleturl-war/WEB-INF/portlet.xml
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portleturl-war/WEB-INF/web.xml
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/preferences-war/
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/preferences-war/WEB-INF/
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/preferences-war/WEB-INF/portlet.xml
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/preferences-war/WEB-INF/web.xml
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/windowstates-war/
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/windowstates-war/WEB-INF/
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/windowstates-war/WEB-INF/portlet.xml
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/windowstates-war/WEB-INF/web.xml
modules/portlet/trunk/testsuite/
modules/portlet/trunk/testsuite/.project
modules/portlet/trunk/testsuite/build.bat
modules/portlet/trunk/testsuite/build.sh
modules/portlet/trunk/testsuite/build.xml
modules/portlet/trunk/testsuite/imports/
modules/portlet/trunk/testsuite/imports/server-config.xml
modules/portlet/trunk/tools/
modules/portlet/trunk/tools/.donotremove
modules/portlet/trunk/tools/.project
modules/portlet/trunk/tools/bin/
modules/portlet/trunk/tools/bin/ant
modules/portlet/trunk/tools/bin/ant.bat
modules/portlet/trunk/tools/bin/antRun
modules/portlet/trunk/tools/bin/antRun.bat
modules/portlet/trunk/tools/bin/antRun.pl
modules/portlet/trunk/tools/bin/antx.bat
modules/portlet/trunk/tools/bin/build.bat
modules/portlet/trunk/tools/bin/build.sh
modules/portlet/trunk/tools/bin/common.shlib
modules/portlet/trunk/tools/bin/complete-ant-cmd.pl
modules/portlet/trunk/tools/bin/lcp.bat
modules/portlet/trunk/tools/bin/runant.pl
modules/portlet/trunk/tools/bin/runant.py
modules/portlet/trunk/tools/bin/ubuild.bat
modules/portlet/trunk/tools/build.xml
modules/portlet/trunk/tools/etc/
modules/portlet/trunk/tools/etc/buildfragments/
modules/portlet/trunk/tools/etc/buildfragments/autoload.properties
modules/portlet/trunk/tools/etc/buildfragments/buildmagic.ent
modules/portlet/trunk/tools/etc/buildfragments/common.properties
modules/portlet/trunk/tools/etc/buildfragments/defaults.ent
modules/portlet/trunk/tools/etc/buildfragments/modules.ent
modules/portlet/trunk/tools/etc/buildfragments/targets.ent
modules/portlet/trunk/tools/etc/buildfragments/task.properties
modules/portlet/trunk/tools/etc/buildfragments/tools.ent
modules/portlet/trunk/tools/etc/buildmagic/
modules/portlet/trunk/tools/etc/buildmagic/aliases.ent
modules/portlet/trunk/tools/etc/changelog.xsl
modules/portlet/trunk/tools/etc/checkstyle-frames.xsl
modules/portlet/trunk/tools/etc/checkstyle/
modules/portlet/trunk/tools/etc/checkstyle/checkstyle-frames.xsl
modules/portlet/trunk/tools/etc/checkstyle/checkstyle-text.xsl
modules/portlet/trunk/tools/etc/checkstyle/checkstyle-xdoc.xsl
modules/portlet/trunk/tools/etc/coverage-frames.xsl
modules/portlet/trunk/tools/etc/jbossbuild/
modules/portlet/trunk/tools/etc/jbossbuild/tasks.xml
modules/portlet/trunk/tools/etc/jdepend-frames.xsl
modules/portlet/trunk/tools/etc/jdepend.xsl
modules/portlet/trunk/tools/etc/junit-frames.xsl
modules/portlet/trunk/tools/etc/junit-noframes.xsl
modules/portlet/trunk/tools/etc/log.xsl
modules/portlet/trunk/tools/etc/maudit-frames.xsl
modules/portlet/trunk/tools/etc/mmetrics-frames.xsl
modules/portlet/trunk/tools/etc/tagdiff.xsl
modules/portlet/trunk/tools/examples/
modules/portlet/trunk/tools/examples/build.bat
modules/portlet/trunk/tools/examples/build.sh
modules/portlet/trunk/tools/lib/
modules/portlet/trunk/tools/lib/ant-junit.jar
modules/portlet/trunk/tools/lib/ant-launcher.jar
modules/portlet/trunk/tools/lib/ant-nodeps.jar
modules/portlet/trunk/tools/lib/ant.jar
modules/portlet/trunk/tools/lib/bsf.jar
modules/portlet/trunk/tools/lib/buildmagic-tasks.jar
modules/portlet/trunk/tools/lib/cargo-core-uberjar-0.8.jar
modules/portlet/trunk/tools/lib/crimson.jar
modules/portlet/trunk/tools/lib/explode.jar
modules/portlet/trunk/tools/lib/jboss-test.jar
modules/portlet/trunk/tools/lib/jbossbuild.jar
modules/portlet/trunk/tools/lib/junit.jar
modules/portlet/trunk/tools/lib/saxon.jar
modules/portlet/trunk/tools/lib/xalan.jar
modules/portlet/trunk/tools/lib/xercesImpl.jar
modules/portlet/trunk/tools/lib/xml-apis.jar
modules/portlet/trunk/tools/src/
modules/portlet/trunk/tools/src/main/
modules/portlet/trunk/tools/src/main/org/
modules/portlet/trunk/tools/src/main/org/jboss/
modules/portlet/trunk/tools/src/main/org/jboss/portal/
modules/portlet/trunk/tools/src/main/org/jboss/portal/tools/
modules/portlet/trunk/tools/src/main/org/jboss/portal/tools/dtd/
modules/portlet/trunk/tools/src/main/org/jboss/portal/tools/dtd/DTDToDocbook.java
modules/portlet/trunk/tools/src/main/org/jboss/portal/tools/dtd/Test.java
Log:
import portlet module in its new trunn
Added: modules/portlet/trunk/build/.cvsignore
===================================================================
--- modules/portlet/trunk/build/.cvsignore (rev 0)
+++ modules/portlet/trunk/build/.cvsignore 2007-08-17 15:29:49 UTC (rev 7981)
@@ -0,0 +1,3 @@
+build.log
+local.properties
+build.iml
Property changes on: modules/portlet/trunk/build/.cvsignore
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/build/.project
===================================================================
--- modules/portlet/trunk/build/.project (rev 0)
+++ modules/portlet/trunk/build/.project 2007-08-17 15:29:49 UTC (rev 7981)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>build</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ </buildSpec>
+ <natures>
+ </natures>
+</projectDescription>
Property changes on: modules/portlet/trunk/build/.project
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/build/build-thirdparty.xml
===================================================================
--- modules/portlet/trunk/build/build-thirdparty.xml (rev 0)
+++ modules/portlet/trunk/build/build-thirdparty.xml 2007-08-17 15:29:49 UTC (rev 7981)
@@ -0,0 +1,76 @@
+<?xml version="1.0"?>
+<project name="main.build"
+ default="synchronize"
+ basedir=".">
+
+ <!-- Property File definitions -->
+ <!--<property file="local.properties"/>
+ <property file="synchronize.properties"/>-->
+ <property environment="env"/>
+
+ <!-- Property Definitions -->
+ <property name="generatedLibrariesFiles"
value="../thirdparty/libraries.ent"/>
+
+
+ <property name="jboss.tasks.path"
+ value="../tools/lib/jbossbuild.jar"/>
+
+ <!-- Allow jbossbuild.repository to be set from (in order or priority)
+ + Command line -Djbossbuild.repository=...
+ + synchronize.properties jbossbuild.repository setting
+ + JBOSS_REPOSITORY environment variable
+ -->
+ <condition property="jbossbuild.repository"
value="${env.JBOSS_REPOSITORY}">
+ <isset property="env.JBOSS_REPOSITORY"/>
+ </condition>
+ <!-- Fall back to default -->
+ <property name="jbossbuild.repository"
value="http://repository.jboss.com"/>
+
+ <!-- File Imports -->
+ <import file="../tools/etc/jbossbuild/tasks.xml"/>
+
+
+ <!-- Main Definition of dependencies -->
+ <build id="jbossportal-thirdparty"
+ impltitle="JBossPortal"
+ implversion="jboss-portal-2.6.1.CR1"
+ implvendor="JBoss, a division of Red Hat Inc."
+ implurl="http://www.jboss.org"
+ description="JBoss Portal"
+ cvsroot="${cvs.prefix}@cvs.forge.jboss.com:/cvsroot/jboss"
+ thirdpartypath="../thirdparty/"
+ location="${jbossbuild.repository}"
+ targetdefs="targets">
+
+ <!--
+ The repository is in CVS under the module
repository.jboss.com whose contents
+ are pushed to the
http://repository.jboss.com site.
+ -->
+
+ <componentref name="jboss-portal/modules/common"
version="1.0.0-SNAPSHOT"/>
+ <componentref name="jboss-portal/modules/web"
version="1.0.0-SNAPSHOT"/>
+ <componentref name="jboss-portal/modules/test"
version="1.0.0-SNAPSHOT"/>
+ <componentref name="jboss/jbossxb" version="1.0.0.CR4"/>
+ <componentref name="apache-log4j" version="1.2.8"/>
+ <componentref name="junit" version="3.8.1"/>
+ <componentref name="sun-servlet" version="2.4"/>
+ <componentref name="oswego-concurrent" version="1.3.4"/>
+ <componentref name="sun-jaf" version="1.0.2"/>
+ </build>
+
+ <synchronizeinfo/>
+
+ <target name="generate-lib-file"
+ description="generate libraries.ent and thirdparty license info"
+ depends="synchronize">
+ <gen-lib-file filename="${generatedLibrariesFiles}"/>
+ <visit-componentref-graph
+
componentVisitor="org.jboss.ant.util.graph.ComponentRefGraphLicenseVisitor"/>
+ </target>
+
+ <!-- Generate the targets -->
+ <generate generate="jbossportal-thirdparty"/>
+
+
+
+</project>
Property changes on: modules/portlet/trunk/build/build-thirdparty.xml
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/build/build.bat
===================================================================
--- modules/portlet/trunk/build/build.bat (rev 0)
+++ modules/portlet/trunk/build/build.bat 2007-08-17 15:29:49 UTC (rev 7981)
@@ -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 2 2005-01-14 23:01:32Z 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: modules/portlet/trunk/build/build.bat
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/build/build.sh
===================================================================
--- modules/portlet/trunk/build/build.sh (rev 0)
+++ modules/portlet/trunk/build/build.sh 2007-08-17 15:29:49 UTC (rev 7981)
@@ -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 2 2005-01-14 23:01:32Z 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: modules/portlet/trunk/build/build.sh
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/build/build.xml
===================================================================
--- modules/portlet/trunk/build/build.xml (rev 0)
+++ modules/portlet/trunk/build/build.xml 2007-08-17 15:29:49 UTC (rev 7981)
@@ -0,0 +1,411 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE project [
+
+ <!ENTITY buildmagic SYSTEM
"../tools/etc/buildfragments/buildmagic.ent">
+ <!ENTITY modules SYSTEM "../tools/etc/buildfragments/modules.ent">
+ <!ENTITY defaults SYSTEM
"../tools/etc/buildfragments/defaults.ent">
+
+
+ ]>
+
+<!-- $Id: build.xml 7880 2007-08-09 12:38:58Z thomas.heute(a)jboss.com $ -->
+
+<!--+======================================================================+-->
+<!--| JBoss Portal: The OpenSource Portal |-->
+<!--| |-->
+<!--| 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;
+
+ <!--+====================================================================+-->
+ <!--| Initialization |-->
+ <!--| |-->
+ <!--| Initialize the build system. Other targets should depend on |-->
+ <!--| 'init'.
|-->
+ <!--+====================================================================+-->
+
+ <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">
+
+ <!--+==============================+-->
+ <!--| Project version information. |-->
+ <!--+==============================+-->
+
+ <property name="version.major" value="2"/>
+ <property name="version.minor" value="6"/>
+ <property name="version.revision" value="0"/>
+ <property name="version.tag" value="A"/>
+ <property name="version.name" value="Ninja"/>
+
+ <!-- This must be set to the CVS tag for any release -->
+ <property name="version.cvstag" value="HEAD"/>
+
+ <!-- Module name(s) & version -->
+ <property name="module.version"
+
value="${version.major}.${version.minor}.${version.revision}${version.tag}"/>
+
+ <!-- ========= -->
+ <!-- Libraries -->
+ <!-- ========= -->
+
+ <!-- The combined library classpath -->
+
+ <path id="library.classpath">
+ </path>
+
+ <!-- Configure modules -->
+ <call target="configure-modules"/>
+ <path id="dependentmodule.classpath">
+ <!-- Add dependent module classpath elements here. -->
+ </path>
+
+ <!--+=======================================+-->
+ <!--| Override any default properties here. |-->
+ <!--+=======================================+-->
+
+ <!-- Configure defaults & build tools -->
+
+ <call target="configure-defaults"/>
+
+ <!--+=======================================+-->
+ <!--| Define module specific elements here. |-->
+ <!--+=======================================+-->
+
+ <!--+================================+-->
+ <!--| Define project structure here. |-->
+ <!--+================================+-->
+
+ <!-- The group to use by default -->
+ <property name="groups" value="default"/>
+
+ <!-- Sets up the module configuration. -->
+ <moduleconfig property="modules" selected="${groups}">
+
+ <!-- Modules -->
+
+ <module name="jsr168api"/>
+ <module name="portlet"/>
+ <module name="federation"/>
+
+ <!-- Module groups -->
+
+ <group name="portlet">
+ <include
+ modules="jsr168api,portlet,federation"/>
+ </group>
+
+ <group name="default">
+ <include groups="portlet"/>
+ </group>
+
+ </moduleconfig>
+
+ <!-- Configure project defaults -->
+ <call target="configure-project"/>
+
+ </target>
+ <target name="modules-all"
depends="_buildmagic:modules:all"/>
+ <target name="modules-most"
depends="_buildmagic:modules:most"/>
+ <target name="modules-main"
depends="_buildmagic:modules:main"/>
+ <target name="modules-release"
depends="_buildmagic:modules:release"/>
+ <target name="modules-tests"
depends="_buildmagic:modules:tests"/>
+ <target name="modules-clean"
depends="_buildmagic:modules:clean"/>
+ <target name="modules-clobber"
depends="_buildmagic:modules:clobber"/>
+ <target name="modules-package-tests"
depends="_buildmagic:modules:package-tests"/>
+
+ <!--+====================================================================+-->
+ <!--| Module Pass-through Hooks |-->
+ <!--| |-->
+ <!--| These hooks are executed after the above pass-through targets have |-->
+ <!--| finished with a given module. |-->
+ <!--+====================================================================+-->
+
+ <!-- Add module pass-through hooks here. -->
+
+
+ <!--+====================================================================+-->
+ <!--| 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"/>
+
+ <!--+====================================================================+-->
+ <!--| 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="init">
+ <!-- Add module specific elements here. -->
+ </target>
+
+ <!--+====================================================================+-->
+ <!--| Documents |-->
+ <!--| |-->
+ <!--| Generate all documentation for this module. |-->
+ <!--+====================================================================+-->
+
+ <target name="docs">
+ <ant antfile="build-targets.xml"
target="_default:docs"/>
+ <!-- Add module specific elements here. -->
+ </target>
+
+ <!--+====================================================================+-->
+ <!--| Install & Release
|-->
+ <!--+====================================================================+-->
+
+ <target name="release"
+ description="Builds the default release structure."
+ depends="modules-most, output"/>
+
+ <target name="release-full"
+ description="Builds the full release structure."
+ depends="modules-all, release"/>
+
+ <!--+====================================================================+-->
+ <!--| Misc. |-->
+ <!--| |-->
+ <!--| Standard targets and pseudo-targets. |-->
+ <!--+====================================================================+-->
+
+ <target name="clean" depends="createthirdparty, modules-clean,
_buildmagic:clean"
+ description="Cleans up most generated files.">
+ <!-- Add module specific elements here. -->
+ </target>
+
+ <target name="clobber" depends="_buildmagic:clobber, clean,
modules-clobber"
+ description="Cleans up all generated files.">
+ <!-- Add module specific elements here. -->
+ </target>
+
+ <target name="main" depends="most"
+ description="Executes the default target (most)."/>
+
+ <target name="all" depends="createthirdparty, modules-all"
+ description="Executes all modules and builds everything."/>
+
+ <target name="most" depends="createthirdparty, modules-most"
+ description="Executes all modules and builds most everything."/>
+
+ <target name="help" depends="_buildmagic:help:build"
+ description="Show this help message."/>
+
+ <!--
+ | Deploy the application
+ -->
+
+ <!--<target name="initsetup">-->
+ <!--<available property="cmsdata"
file="${jboss.home}/server/${portal.deploy.dir}/data/portal"/>
-->
+ <!--</target>-->
+
+ <!--<target name="setup" depends="initsetup"
unless="cmsdata">-->
+ <!--<unzip src="../core/src/bin/setup/cms-content.zip"
dest="${jboss.home}/server/${portal.deploy.dir}/data"/>-->
+ <!--</target>-->
+
+ <target name="deploy"
+ description="Deploy."
+ depends="main">
+ <require file="${jboss.home}/server/${portal.deploy.dir}"/>
+ <copy file="../core/output/lib/jboss-portal.sar"
todir="${jboss.home}/server/${portal.deploy.dir}"
+ overwrite="true"/>
+ </target>
+
+ <target name="undeploy"
+ description="Undeploy."
+ depends="init">
+ <require file="${jboss.home}/server/${portal.deploy.dir}"/>
+ <delete
file="${jboss.home}/server/${portal.deploy.dir}/jboss-portal.sar"/>
+ </target>
+
+ <target name="deploy-all"
+ description="Deploy all archives."
+ depends="most">
+ <require file="${jboss.home}/server/${portal.deploy.dir}"/>
+ <copy file="../core/output/lib/jboss-portal.sar"
todir="${jboss.home}/server/${portal.deploy.dir}"
overwrite="true"/>
+ <copy file="../core-admin/output/lib//portal-admin.sar"
todir="${jboss.home}/server/${portal.deploy.dir}"
overwrite="true"/>
+ <copy file="../core-cms/output/lib/portal-cms.sar"
todir="${jboss.home}/server/${portal.deploy.dir}"
overwrite="true"/>
+ <copy file="../core-management/output/lib/portal-management.sar"
todir="${jboss.home}/server/${portal.deploy.dir}"
overwrite="true"/>
+ <copy file="../core-samples/output/lib/portal-basic-samples.sar"
todir="${jboss.home}/server/${portal.deploy.dir}"
overwrite="true"/>
+ <copy file="../core-samples/output/lib/portal-news-samples.war"
todir="${jboss.home}/server/${portal.deploy.dir}"
overwrite="true"/>
+ <copy file="../core-samples/output/lib/portal-jsp-samples.war"
todir="${jboss.home}/server/${portal.deploy.dir}"
overwrite="true"/>
+ <copy file="../core-samples/output/lib/portal-weather-samples.war"
todir="${jboss.home}/server/${portal.deploy.dir}"
overwrite="true"/>
+ <!--<copy file="../core-search/output/lib/portal-search.sar"
todir="${jboss.home}/server/${portal.deploy.dir}"
overwrite="true"/>-->
+ <copy file="../widget/output/lib/widget.war"
todir="${jboss.home}/server/${portal.deploy.dir}"
overwrite="true"/>
+ <copy file="../wsrp/output/lib/portal-wsrp.sar"
todir="${jboss.home}/server/${portal.deploy.dir}"
overwrite="true"/>
+ </target>
+
+ <target name="undeploy-all"
+ description="Undeploy all archives."
+ depends="init">
+ <require file="${jboss.home}/server/${portal.deploy.dir}"/>
+ <delete
file="${jboss.home}/server/${portal.deploy.dir}/jboss-portal.sar"/>
+ <delete
file="${jboss.home}/server/${portal.deploy.dir}/portal-admin.sar"/>
+ <delete
file="${jboss.home}/server/${portal.deploy.dir}/portal-cms.sar"/>
+ <delete
file="${jboss.home}/server/${portal.deploy.dir}/portal-management.sar"/>
+ <delete
file="${jboss.home}/server/${portal.deploy.dir}/portal-basic-samples.sar"/>
+ <delete
file="${jboss.home}/server/${portal.deploy.dir}/portal-news-samples.war"/>
+ <delete
file="${jboss.home}/server/${portal.deploy.dir}/portal-jsp-samples.war"/>
+ <delete
file="${jboss.home}/server/${portal.deploy.dir}/portal-weather-samples.war"/>
+ <!--<delete
file="${jboss.home}/server/${portal.deploy.dir}/portal-search.sar"/>-->
+ <delete
file="${jboss.home}/server/${portal.deploy.dir}/widget.war"/>
+ <delete
file="${jboss.home}/server/${portal.deploy.dir}/portal-wsrp.sar"/>
+ </target>
+
+ <target name="exploded-deploy"
+ description="Deploy exploded sar."
+ depends="main">
+ <require file="${jboss.home}/server/${portal.deploy.dir}"/>
+ <delete
dir="${jboss.home}/server/${portal.deploy.dir}/jboss-portal-exploded.sar"/>
+ <mkdir
dir="${jboss.home}/server/${portal.deploy.dir}/jboss-portal-exploded.sar"/>
+ <copy
todir="${jboss.home}/server/${portal.deploy.dir}/jboss-portal-exploded.sar">
+ <fileset dir="../core/output/resources/jboss-portal.sar"/>
+ </copy>
+ </target>
+
+ <target name="javadoc">
+ <mkdir dir="javadoc"/>
+ <javadoc destdir="javadoc">
+ <classpath>
+ <fileset dir="../thirdparty" includes="**/*.jar"/>
+ </classpath>
+ <packageset dir="../common/src/main">
+ <exclude name="org/jboss/portal/test/**"/>
+ </packageset>
+ <packageset dir="../web/src/main">
+ <exclude name="org/jboss/portal/test/**"/>
+ </packageset>
+ <packageset dir="../server/src/main">
+ <exclude name="org/jboss/portal/test/**"/>
+ </packageset>
+ <packageset dir="../api/src/main">
+ <exclude name="org/jboss/portal/test/**"/>
+ </packageset>
+ <packageset dir="../portlet/src/main">
+ <exclude name="org/jboss/portal/test/**"/>
+ </packageset>
+ <packageset dir="../portlet-server/src/main">
+ <exclude name="org/jboss/portal/test/**"/>
+ </packageset>
+ <packageset dir="../jems/src/main">
+ <exclude name="org/jboss/portal/test/**"/>
+ </packageset>
+ <packageset dir="../identity/src/main">
+ <exclude name="org/jboss/portal/test/**"/>
+ </packageset>
+ <packageset dir="../bridge/src/main">
+ <exclude name="org/jboss/portal/test/**"/>
+ </packageset>
+ <packageset dir="../faces/src/main">
+ <exclude name="org/jboss/portal/test/**"/>
+ </packageset>
+ <packageset dir="../portlet-federation/src/main">
+ <exclude name="org/jboss/portal/test/**"/>
+ </packageset>
+ <packageset dir="../format/src/main">
+ <exclude name="org/jboss/portal/test/**"/>
+ </packageset>
+ <packageset dir="../theme/src/main">
+ <exclude name="org/jboss/portal/test/**"/>
+ </packageset>
+ <packageset dir="../cms/src/main">
+ <exclude name="org/jboss/portal/test/**"/>
+ </packageset>
+ <packageset dir="../core/src/main">
+ <exclude name="org/jboss/portal/test/**"/>
+ </packageset>
+ <packageset dir="../core-admin/src/main">
+ <exclude name="org/jboss/portal/test/**"/>
+ </packageset>
+ <packageset dir="../core-cms/src/main">
+ <exclude name="org/jboss/portal/test/**"/>
+ </packageset>
+ <packageset dir="../core-management/src/main">
+ <exclude name="org/jboss/portal/test/**"/>
+ </packageset>
+ <packageset dir="../security/src/main">
+ <exclude name="org/jboss/portal/test/**"/>
+ </packageset>
+ <packageset dir="../wsrp/src/main">
+ <exclude name="org/jboss/portal/test/**"/>
+ </packageset>
+ <packageset dir="../wsrp/src/generated">
+ <exclude name="org/jboss/portal/test/**"/>
+ </packageset>
+ <packageset dir="../registration/src/main">
+ <exclude name="org/jboss/portal/test/**"/>
+ </packageset>
+ <packageset dir="../widget/src/main">
+ <exclude name="org/jboss/portal/test/**"/>
+ </packageset>
+ <packageset dir="../workflow/src/main">
+ <exclude name="org/jboss/portal/test/**"/>
+ </packageset>
+ <packageset dir="../search/src/main">
+ <exclude name="org/jboss/portal/test/**"/>
+ </packageset>
+ <packageset dir="../core-samples/src/main">
+ <exclude name="org/jboss/portal/test/**"/>
+ </packageset>
+ <packageset dir="../core-search/src/main">
+ <exclude name="org/jboss/portal/test/**"/>
+ </packageset>
+ </javadoc>
+ </target>
+
+ <!-- create the thirdparty folder from items in the repository -->
+ <!-- then generate a new libraries.ent file and include it in -->
+ <!-- the build -->
+ <target name="createthirdparty" unless="inhibit.downloads"
+ depends="check.inhibit.downloads">
+ <ant antfile="build-thirdparty.xml"
target="generate-lib-file"/>
+ </target>
+
+ <!-- check if thirdparty libraries are to be downloaded -->
+ <target name="check.inhibit.downloads">
+ <condition property="inhibit.downloads">
+ <or>
+ <uptodate property="dependencies.current"
+ srcfile="build-thirdparty.xml"
+ targetfile="../thirdparty/libraries.ent"/>
+ <istrue value="${nodownload}"/>
+ </or>
+ </condition>
+ </target>
+
+</project>
Property changes on: modules/portlet/trunk/build/build.xml
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/build/distrib.xml
===================================================================
--- modules/portlet/trunk/build/distrib.xml (rev 0)
+++ modules/portlet/trunk/build/distrib.xml 2007-08-17 15:29:49 UTC (rev 7981)
@@ -0,0 +1,398 @@
+<project default="main" name="JBoss Portal">
+
+ <property name="source.dir"
value="../../jboss-portal-2.6"/>
+ <property name="docs.dir" value="${source.dir}-docs"/>
+ <property name="release.version" value="2.6.1.GA"/>
+
+ <!-- -->
+ <property name="portal.release.normal.name"
value="jboss-portal-${release.version}"/>
+ <property name="portal.release.ha.name"
value="jboss-portal-ha-${release.version}"/>
+
+ <!-- -->
+ <property name="portal.build.src"
value="output/${portal.release.normal.name}-src"/>
+ <property name="portal.build.normal.bin"
value="output/${portal.release.normal.name}"/>
+ <property name="portal.build.ha.bin"
value="output/${portal.release.ha.name}"/>
+ <property name="portal.build.normal.bundled"
value="output/${portal.release.normal.name}-bundled"/>
+ <property name="portal.build.ha.bundled"
value="output/${portal.release.ha.name}-bundled"/>
+
+ <property environment="env"/>
+
+ <target name="init" unless="jboss.home">
+ <property name="jboss.home" value="${env.JBOSS_HOME}"/>
+ <echo message="Using JBoss install from $JBOSS_HOME:
${jboss.home}"/>
+ </target>
+
+ <!--
+ <property name="forums.release.name"
value="jboss-forums-${release.version}"/>
+ <property name="forums.build.bin"
value="output/${forums.release.name}"/>
+ <property name="forums.build.src"
value="output/${forums.release.name}-src"/>
+ -->
+ <!-- Licenses -->
+ <target name="licenses">
+ <fileset id="thirdparty-licenses"
dir="../thirdparty/licenses">
+ <include name="antlr.txt"/>
+ <include name="apache-2.0.txt"/>
+ <include name="bsd.txt"/>
+ <include name="cddl.txt"/>
+ <include name="cpl-1.0/txt"/>
+ <include name="day-jcr.txt"/>
+ <include name="dom4j.txt"/>
+ <include name="ehcache.txt"/>
+ <include name="gpl.txt"/>
+ <include name="hsqldb.txt"/>
+ <include name="httpunit.txt"/>
+ <include name="ironsmith.txt"/>
+ <include name="lgpl.txt"/>
+ <include name="nekohtml.txt"/>
+ <include name="oswego.txt"/>
+ <include name="public-domain.txt"/>
+ <include name="slf4j.txt"/>
+ <include name="sun-jaf.txt"/>
+ <include name="sun-javamail.txt"/>
+ <include name="xdoclet.txt"/>
+ </fileset>
+ <mkdir dir="output/docs/licenses"/>
+ <concat destfile="output/docs/licenses/thirdparty-licenses.txt">
+ <fileset refid="thirdparty-licenses"/>
+ </concat>
+ <copy todir="output/docs/licenses">
+ <fileset refid="thirdparty-licenses"/>
+ <fileset dir="licences" includes="JBossEULA.txt"/>
+ </copy>
+ </target>
+
+ <!-- Normal build -->
+ <target name="_normal.build" depends="init"
unless="normal.build.done">
+ <ant dir="${source.dir}/build" antfile="build.xml"/>
+
+ <!-- to prevent building several times -->
+ <property name="normal.build.done" value="true"/>
+ </target>
+
+ <!-- Build JBoss Portal artifacts -->
+ <target name="source.build" depends="_normal.build">
+ <!-- HA specific targets -->
+ <ant dir="${source.dir}/core" antfile="build.xml"
target="output-ha"/>
+ <ant dir="${source.dir}/core-cms" antfile="build.xml"
target="output-ha"/>
+
+ <!-- Datasource files -->
+ <ant dir="${source.dir}/core" antfile="build.xml"
target="datasource">
+ <!-- Hack because invoking the datasource generation from another build file
replace ${/} -->
+ <property name="/" value="${/}"/>
+ </ant>
+
+ <ant dir="${source.dir}/wsrp" antfile="build.xml"
target="output"/>
+ <ant dir="${source.dir}/wsrp" antfile="build.xml"
target="explode"/>
+ </target>
+
+ <!-- Build JBoss Portal documentation -->
+ <target name="doc.build" depends="_normal.build"
unless="no-doc">
+ <ant dir="${docs.dir}/referenceGuide"
antfile="build.xml"/>
+ <ant dir="${docs.dir}/userGuide" antfile="build.xml"/>
+ <ant dir="${docs.dir}/quickstartuser"
antfile="build.xml"/>
+ </target>
+
+ <!-- Build JBoss Portal -->
+ <target name="build" depends="source.build,doc.build"/>
+
+
+ <!--<macrodef name="package-doc">
+ <attribute name="todir"/>
+ <sequential>
+ <mkdir dir="${todir}"/>
+ <mkdir dir="${todir}/referenceGuide"/>
+ <copy todir="${todir}/referenceGuide">
+ <fileset dir="${docs.dir}/referenceGuide/build/en/"/>
+ </copy>
+ <mkdir dir="${todir}/userGuide"/>
+ <copy todir="${todir}/userGuide">
+ <fileset dir="${docs.dir}/userGuide/build/en/"/>
+ </copy>
+ <mkdir dir="${todir}/quickstartuser"/>
+ <copy todir="${todir}/quickstartuser">
+ <fileset dir="${docs.dir}/quickstartuser/build/en/"/>
+ </copy>
+ </sequential>
+ </macrodef>-->
+
+ <target name="package-doc">
+ <sequential>
+ <mkdir dir="${todir}"/>
+ <mkdir dir="${todir}/referenceGuide"/>
+ <copy todir="${todir}/referenceGuide">
+ <fileset dir="${docs.dir}/referenceGuide/build/en/"/>
+ </copy>
+ <mkdir dir="${todir}/userGuide"/>
+ <copy todir="${todir}/userGuide">
+ <fileset dir="${docs.dir}/userGuide/build/en/"/>
+ </copy>
+ <mkdir dir="${todir}/quickstartuser"/>
+ <copy todir="${todir}/quickstartuser">
+ <fileset dir="${docs.dir}/quickstartuser/build/en/"/>
+ </copy>
+ </sequential>
+ </target>
+
+ <target name="package-ds">
+ <sequential>
+ <mkdir dir="${todir}"/>
+ <copy todir="${todir}">
+ <fileset dir="${source.dir}/core/output/resources/setup"
includes="portal-*-ds.xml"/>
+ </copy>
+ </sequential>
+ </target>
+
+ <target name="package-samples">
+ <sequential>
+ <mkdir dir="${todir}"/>
+ <copy todir="${todir}">
+ <fileset dir="${source.dir}/core-samples/output/resources"
includes="portal-basic-samples.sar/**"/>
+ </copy>
+ <copy file="${docs.dir}/readmeFiles/samples-readme.txt"
tofile="${todir}/readme.txt"/>
+ </sequential>
+ </target>
+
+ <target name="patch-log4j">
+ <patch
patchfile="${source.dir}/build/etc/resources/jboss-log4j.xml.diff"
+ originalfile="${todir}/conf/jboss-log4j.xml"
strip="1"/>
+ </target>
+
+ <!-- use -Dno-doc=true if you simply want jboss-portal.sar without licenses
etc-->
+ <target name="package-bin" unless="no-doc">
+ <sequential>
+ <mkdir dir="${todir}"/>
+ <antcall target="package-doc">
+ <param name="todir" value="${todir}/docs"/>
+ </antcall>
+ <antcall target="package-ds">
+ <param name="todir" value="${todir}/setup"/>
+ </antcall>
+ <antcall target="package-samples">
+ <param name="todir" value="${todir}/samples"/>
+ </antcall>
+ <copy file="${docs.dir}/readmeFiles/jboss-portal-bin.README"
todir="${todir}"/>
+ <copy todir="${todir}/docs/portal/licenses">
+ <fileset dir="output/docs/licenses"/>
+ </copy>
+ </sequential>
+ </target>
+
+ <target name="package-bundled" unless="no-doc">
+ <sequential>
+ <mkdir dir="${todir}"/>
+ <antcall target="package-doc">
+ <param name="todir" value="${todir}/docs/portal"/>
+ </antcall>
+ <antcall target="package-ds">
+ <param name="todir" value="${todir}/setup"/>
+ </antcall>
+ <antcall target="package-samples">
+ <param name="todir" value="${todir}/samples"/>
+ </antcall>
+ <copy file="${docs.dir}/readmeFiles/jboss-portal-bin.README"
todir="${todir}"/>
+ <copy todir="${todir}/docs/portal/licenses">
+ <fileset dir="output/docs/licenses"/>
+ </copy>
+ </sequential>
+ </target>
+
+ <!-- -->
+ <target name="package">
+
+ <!-- Create the output directory -->
+ <mkdir dir="output"/>
+
+ <!--
+ | JBoss Portal source distribution
+ -->
+
+ <mkdir dir="${portal.build.src}"/>
+ <antcall target="package-doc">
+ <param name="todir"
value="${portal.build.src}/docs"/>
+ </antcall>
+ <copy file="${docs.dir}/readmeFiles/jboss-portal-src.README"
todir="${portal.build.src}"/>
+ <copy todir="${portal.build.src}">
+ <fileset dir="${source.dir}" includes="**/*"
+
excludes="*/output/**,**/CVS/*,**/build.log,build/local.properties,forums/**,thirdparty/**"/>
+ </copy>
+ <copy todir="${portal.build.src}/docs/portal/licenses">
+ <fileset dir="output/docs/licenses"/>
+ </copy>
+ <fixcrlf srcdir="${portal.build.src}" includes="**/*.sh"
eol="lf" eof="remove"/>
+ <fixcrlf srcdir="${portal.build.src}" includes="**/*.bat"
eol="crlf"/>
+
+ <!--
+ | JBoss Portal binaries distribution
+ -->
+
+ <antcall target="package-normal"/>
+ <antcall target="package-ha"/>
+ <antcall target="package-normal-bundled"/>
+ <antcall target="package-ha-bundled"/>
+ </target>
+
+ <!--
+ | JBoss Portal binary distribution
+ -->
+
+ <target name="package-normal" description="package
jboss-portal.sar">
+ <mkdir dir="${portal.build.normal.bin}"/>
+ <antcall target="package-bin">
+ <param name="todir"
value="${portal.build.normal.bin}"/>
+ </antcall>
+ <copy todir="${portal.build.normal.bin}/jboss-portal.sar">
+ <fileset
dir="${source.dir}/core/output/resources/jboss-portal.sar"/>
+ </copy>
+ <copy
todir="${portal.build.normal.bin}/jboss-portal.sar/portal-cms.sar">
+ <fileset
dir="${source.dir}/core-cms/output/resources/portal-cms.sar"
includes="**"/>
+ </copy>
+ <copy todir="${portal.build.normal.bin}/jboss-portal.sar">
+ <fileset dir="${source.dir}/widget/output/resources"
includes="widget.war/**"/>
+ <fileset dir="${source.dir}/core-management/output/resources"
includes="portal-management.sar/**"/>
+ <fileset dir="${source.dir}/core-admin/output/resources"
includes="portal-admin.sar/**"/>
+ </copy>
+ <copy todir="${portal.build.normal.bin}/jboss-portal.sar/samples">
+ <fileset dir="${source.dir}/core-samples/output/resources"
includes="portal-jsp-samples.war/**"/>
+ <fileset dir="${source.dir}/core-samples/output/resources"
includes="portal-news-samples.war/**"/>
+ <fileset dir="${source.dir}/core-samples/output/resources"
includes="portal-weather-samples.war/**"/>
+ </copy>
+ <mkdir
dir="${portal.build.normal.bin}/jboss-portal.sar/portal-wsrp.sar"/>
+ <copy
todir="${portal.build.normal.bin}/jboss-portal.sar/portal-wsrp.sar">
+ <fileset
dir="${source.dir}/wsrp/output/lib/portal-wsrp-exploded.sar"/>
+ </copy>
+ </target>
+
+ <!--
+ | JBoss Portal ha binaries distribution
+ -->
+ <target name="package-ha" description="package
jboss-portal-ha.sar">
+ <mkdir dir="${portal.build.ha.bin}"/>
+ <antcall target="package-bin">
+ <param name="todir" value="${portal.build.ha.bin}"/>
+ </antcall>
+ <copy todir="${portal.build.ha.bin}/jboss-portal-ha.sar">
+ <fileset
dir="${source.dir}/core/output/resources/jboss-portal-ha.sar"/>
+ </copy>
+ <copy
todir="${portal.build.ha.bin}/jboss-portal-ha.sar/portal-cms.sar">
+ <fileset
dir="${source.dir}/core-cms/output/resources/portal-cms-ha.sar"
includes="**"/>
+ </copy>
+ <copy todir="${portal.build.ha.bin}/jboss-portal-ha.sar">
+ <fileset dir="${source.dir}/widget/output/resources"
includes="widget.war/**"/>
+ <fileset dir="${source.dir}/core-management/output/resources"
includes="portal-management.sar/**"/>
+ <fileset dir="${source.dir}/core-admin/output/resources"
includes="portal-admin.sar/**"/>
+ </copy>
+ <copy todir="${portal.build.ha.bin}/jboss-portal-ha.sar/samples">
+ <fileset dir="${source.dir}/core-samples/output/resources"
includes="portal-jsp-samples.war/**"/>
+ <fileset dir="${source.dir}/core-samples/output/resources"
includes="portal-news-samples.war/**"/>
+ <fileset dir="${source.dir}/core-samples/output/resources"
includes="portal-weather-samples.war/**"/>
+ </copy>
+ <mkdir
dir="${portal.build.ha.bin}/jboss-portal-ha.sar/portal-wsrp.sar"/>
+ <copy
todir="${portal.build.ha.bin}/jboss-portal-ha.sar/portal-wsrp.sar">
+ <fileset
dir="${source.dir}/wsrp/output/lib/portal-wsrp-exploded.sar"/>
+ </copy>
+ <copy file="${docs.dir}/readmeFiles/jboss-portal-ha-bin.README"
todir="${portal.build.ha.bin}"/>
+ </target>
+
+
+ <!--
+ | JBoss Portal bundled distribution
+ -->
+ <target name="package-normal-bundled" depends="package-normal"
if="jboss.home"
+ description="package jboss-portal bundled with JBoss AS">
+ <mkdir dir="${portal.build.normal.bundled}"/>
+ <antcall target="package-bundled">
+ <param name="todir"
value="${portal.build.normal.bundled}"/>
+ </antcall>
+ <copy
todir="${portal.build.normal.bundled}/server/default/deploy/jboss-portal.sar">
+ <fileset dir="${portal.build.normal.bin}/jboss-portal.sar"/>
+ </copy>
+ <copy
todir="${portal.build.normal.bundled}/server/default/deploy">
+ <fileset dir="${portal.build.normal.bin}/setup"
includes="portal-hsqldb-ds.xml"/>
+ </copy>
+ <copy todir="${portal.build.normal.bundled}">
+ <fileset dir="${jboss.home}">
+ <include name="bin/**"/>
+ <include name="client/**"/>
+ <include name="docs/**"/>
+ <include name="lib/**"/>
+ <include name="server/default/**"/>
+ </fileset>
+ </copy>
+ <copy file="${docs.dir}/readmeFiles/jboss-portal-bin.README"
todir="${portal.build.normal.bundled}"/>
+ <antcall target="patch-log4j">
+ <param name="todir"
value="${portal.build.normal.bundled}/server/default"/>
+ </antcall>
+ </target>
+
+ <!--
+ | JBoss Portal ha bundled distribution
+ -->
+
+ <target name="package-ha-bundled" depends="package-ha"
if="jboss.home"
+ description="package jboss-portal-ha bundled with JBoss AS">
+ <mkdir dir="${portal.build.ha.bundled}"/>
+ <antcall target="package-bundled">
+ <param name="todir"
value="${portal.build.ha.bundled}"/>
+ </antcall>
+ <copy
todir="${portal.build.ha.bundled}/server/all/deploy/jboss-portal-ha.sar">
+ <fileset dir="${portal.build.ha.bin}/jboss-portal-ha.sar"/>
+ </copy>
+ <copy todir="${portal.build.ha.bundled}">
+ <fileset dir="${jboss.home}">
+ <include name="bin/**"/>
+ <include name="client/**"/>
+ <include name="docs/**"/>
+ <include name="lib/**"/>
+ <include name="server/all/**"/>
+ </fileset>
+ </copy>
+ <copy file="${docs.dir}/readmeFiles/jboss-portal-ha-bin.README"
todir="${portal.build.ha.bundled}"/>
+ <antcall target="patch-log4j">
+ <param name="todir"
value="${portal.build.normal.bundled}/server/default"/>
+ </antcall>
+
+ </target>
+
+ <!-- Create packages -->
+ <target name="zip">
+
+ <tar destfile="${portal.build.src}.tar.gz"
+ compression="gzip">
+ <tarfileset prefix="${portal.release.normal.name}-src"
filemode="775" dir="${portal.build.src}"/>
+ </tar>
+ <checksum file="${portal.build.src}.tar.gz"/>
+
+ <zip destfile="${portal.build.normal.bin}.zip">
+ <zipfileset prefix="${portal.release.normal.name}"
dir="${portal.build.normal.bin}"/>
+ </zip>
+ <checksum file="${portal.build.normal.bin}.zip"/>
+
+ <zip destfile="${portal.build.ha.bin}.zip">
+ <zipfileset prefix="${portal.release.ha.name}"
dir="${portal.build.ha.bin}"/>
+ </zip>
+ <checksum file="${portal.build.ha.bin}.zip"/>
+
+ <zip destfile="${portal.build.normal.bundled}.zip">
+ <zipfileset prefix="${portal.release.normal.name}"
dir="${portal.build.normal.bundled}"/>
+ </zip>
+ <checksum file="${portal.build.normal.bin}.zip"/>
+
+ <zip destfile="${portal.build.ha.bundled}.zip">
+ <zipfileset prefix="${portal.release.ha.name}"
dir="${portal.build.ha.bundled}"/>
+ </zip>
+ <checksum file="${portal.build.ha.bundled}.zip"/>
+
+ <!--
+ <tar destfile="${forums.build.src}.tar.gz"
+ compression="gzip">
+ <tarfileset dir="output/${forums.release.name}-src"
+ prefix="${forums.release.name}-src"/>
+ </tar>
+ <zip destfile="${forums.build.bin}.zip"
+ basedir="output/${forums.release.name}"/>
+ -->
+ </target>
+
+ <!-- Build and compress everything -->
+ <target name="main" depends="licenses,build,package,zip"
description="do everything - build source, doc, distro"/>
+</project>
Property changes on: modules/portlet/trunk/build/distrib.xml
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/build/etc/clustered.properties
===================================================================
--- modules/portlet/trunk/build/etc/clustered.properties (rev 0)
+++ modules/portlet/trunk/build/etc/clustered.properties 2007-08-17 15:29:49 UTC (rev
7981)
@@ -0,0 +1,10 @@
+portal.single=false
+portal.single.xml.open=<!--
+portal.single.xml.close=-->
+portal.clustered.xml.open=
+portal.clustered.xml.close=
+portal.web.predistributable=-->
+portal.web.postdistributable=<!--
+portal.cache.config=replicated
+portal.hibernate.cache.usage=transactional
+cms.service.code=org.jboss.portal.cms.impl.jcr.ha.HAJCRCMS
Property changes on: modules/portlet/trunk/build/etc/clustered.properties
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/build/etc/hsqldb.properties
===================================================================
--- modules/portlet/trunk/build/etc/hsqldb.properties (rev 0)
+++ modules/portlet/trunk/build/etc/hsqldb.properties 2007-08-17 15:29:49 UTC (rev 7981)
@@ -0,0 +1,5 @@
+# the cdata section is a trick because the empty chars has issues when using filtered
copy
+portal.datasource.driver=org.hsqldb.jdbcDriver
+portal.datasource.url=jdbc:hsqldb:${jboss.server.data.dir}${/}portal${/}hypersonic${/}database
+portal.datasource.username=sa
+portal.datasource.password=<![CDATA[]]>
Property changes on: modules/portlet/trunk/build/etc/hsqldb.properties
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/build/etc/local.properties-example
===================================================================
--- modules/portlet/trunk/build/etc/local.properties-example (rev
0)
+++ modules/portlet/trunk/build/etc/local.properties-example 2007-08-17 15:29:49 UTC (rev
7981)
@@ -0,0 +1,48 @@
+### ====================================================================== ###
+## ##
+## Local project properties. ##
+## ##
+## Define properties that are local to your environment here. This ##
+## file (local.properties) should not be checked in. Modify the ##
+## example to affect all users. ##
+## ##
+### ====================================================================== ###
+
+### General compiler configuration ###
+
+#build.compiler=jikes
+#build.warnings=true
+#build.pedantic=true
+#javac.depend=on
+
+### Javac/Jikes compiler configuration ###
+
+javac.optimize=off
+javac.debug=on
+javac.deprecation=on
+
+### Enable verbose build output ###
+
+#init.verbose=true
+
+### JavaDoc ###
+#docs-javadocs.disable=true
+
+### Do we build xdoclet or get it from thirdparty ###
+### uncomment for thirdparty: comment to use xdoclet module.
+### To use xdoclet module also uncomment the xdoclet line in groups in build/build.xml
+#xdoclet.xdoclet.root=${project.root}/thirdparty/xdoclet
+
+# Portal database, for now : hsqldb, mysql, postgresql are the possible values
+portal.database=mysql
+# The datasource name used in the JNDI binding
+portal.datasource.name=PortalDS
+# Context root for the portal main servlet
+portal.web.context-root=/portal
+# JBoss server/<xxx> directory for JBoss Portal, ie: $JBOSS_HOME/server/default
+portal.deploy.dir=default/deploy
+portal-ha.deploy.dir=all/deploy
+# Show SQL or not
+portal.sql.show=false
+# Uncomment if you want to use a specific JBoss home path otherwise the build will use
the JBOSS_HOME env variable
+#jboss.home=
Property changes on: modules/portlet/trunk/build/etc/local.properties-example
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/build/etc/mysql.properties
===================================================================
--- modules/portlet/trunk/build/etc/mysql.properties (rev 0)
+++ modules/portlet/trunk/build/etc/mysql.properties 2007-08-17 15:29:49 UTC (rev 7981)
@@ -0,0 +1,4 @@
+portal.datasource.driver=org.gjt.mm.mysql.Driver
+portal.datasource.url=jdbc:mysql://localhost:3306/jbossportal?useServerPrepStmts=false
+portal.datasource.username=portal
+portal.datasource.password=portalpassword
Property changes on: modules/portlet/trunk/build/etc/mysql.properties
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/build/etc/mysql5.properties
===================================================================
--- modules/portlet/trunk/build/etc/mysql5.properties (rev 0)
+++ modules/portlet/trunk/build/etc/mysql5.properties 2007-08-17 15:29:49 UTC (rev 7981)
@@ -0,0 +1,4 @@
+portal.datasource.driver=com.mysql.jdbc.Driver
+portal.datasource.url=jdbc:mysql://localhost:3306/jbossportal?useServerPrepStmts=false&jdbcCompliantTruncation=false
+portal.datasource.username=portal
+portal.datasource.password=portalpassword
Property changes on: modules/portlet/trunk/build/etc/mysql5.properties
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/build/etc/oracle.properties
===================================================================
--- modules/portlet/trunk/build/etc/oracle.properties (rev 0)
+++ modules/portlet/trunk/build/etc/oracle.properties 2007-08-17 15:29:49 UTC (rev 7981)
@@ -0,0 +1,4 @@
+portal.datasource.driver=oracle.jdbc.driver.OracleDriver
+portal.datasource.url=jdbc:oracle:thin:SYSTEM/password@localhost:1521:orcl
+portal.datasource.username=SYSTEM
+portal.datasource.password=password
Property changes on: modules/portlet/trunk/build/etc/oracle.properties
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/build/etc/oracle10gXE.properties
===================================================================
--- modules/portlet/trunk/build/etc/oracle10gXE.properties (rev
0)
+++ modules/portlet/trunk/build/etc/oracle10gXE.properties 2007-08-17 15:29:49 UTC (rev
7981)
@@ -0,0 +1,4 @@
+portal.datasource.driver=oracle.jdbc.driver.OracleDriver
+portal.datasource.url=jdbc:oracle:thin:@localhost:1521:xe
+portal.datasource.username=portal
+portal.datasource.password=portalpassword
Property changes on: modules/portlet/trunk/build/etc/oracle10gXE.properties
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/build/etc/postgresql.properties
===================================================================
--- modules/portlet/trunk/build/etc/postgresql.properties (rev 0)
+++ modules/portlet/trunk/build/etc/postgresql.properties 2007-08-17 15:29:49 UTC (rev
7981)
@@ -0,0 +1,5 @@
+portal.datasource.driver=org.postgresql.Driver
+portal.datasource.url=jdbc:postgresql:jbossportal
+portal.datasource.username=portal
+portal.datasource.password=portalpassword
+
Property changes on: modules/portlet/trunk/build/etc/postgresql.properties
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/build/etc/resources/jboss-log4j.xml.diff
===================================================================
--- modules/portlet/trunk/build/etc/resources/jboss-log4j.xml.diff
(rev 0)
+++ modules/portlet/trunk/build/etc/resources/jboss-log4j.xml.diff 2007-08-17 15:29:49 UTC
(rev 7981)
@@ -0,0 +1,22 @@
+diff -u conf.orig/jboss-log4j.xml conf/jboss-log4j.xml
+--- conf.orig/jboss-log4j.xml 2007-07-16 23:56:32.000000000 +0200
++++ conf/jboss-log4j.xml 2007-07-17 09:26:16.000000000 +0200
+@@ -164,6 +164,16 @@
+ <priority value="INFO"/>
+ </category>
+
++ <!-- Hibernate got a bit too verbose in JBoss AS 4.2.1.GA -->
++ <category name="org.hibernate.engine.loading.LoadContexts">
++ <priority value="ERROR"/>
++ </category>
++
++ <!-- JBoss Cache likes to talk a lot -->
++ <category
name="org.jboss.cache.interceptors.CacheLoaderInterceptor">
++ <priority value="ERROR"/>
++ </category>
++
+ <!-- Limit the org.jboss.serial (jboss-serialization) to INFO as its DEBUG is
verbose -->
+ <category name="org.jboss.serial">
+ <priority value="INFO"/>
+Common subdirectories: conf.orig/props and conf/props
+Common subdirectories: conf.orig/xmdesc and conf/xmdesc
Added: modules/portlet/trunk/build/etc/single.properties
===================================================================
--- modules/portlet/trunk/build/etc/single.properties (rev 0)
+++ modules/portlet/trunk/build/etc/single.properties 2007-08-17 15:29:49 UTC (rev 7981)
@@ -0,0 +1,10 @@
+portal.single=true
+portal.single.xml.open=
+portal.single.xml.close=
+portal.clustered.xml.open=<!--
+portal.clustered.xml.close=-->
+portal.web.predistributable=\u0020Comment/Uncomment to enable portal session replication
+portal.web.postdistributable=
+portal.cache.config=local
+portal.hibernate.cache.usage=read-write
+cms.service.code=org.jboss.portal.cms.impl.jcr.JCRCMS
\ No newline at end of file
Property changes on: modules/portlet/trunk/build/etc/single.properties
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/build/etc/sqlserver.properties
===================================================================
--- modules/portlet/trunk/build/etc/sqlserver.properties (rev 0)
+++ modules/portlet/trunk/build/etc/sqlserver.properties 2007-08-17 15:29:49 UTC (rev
7981)
@@ -0,0 +1,7 @@
+# This file uses a URL for the jTDS Type 4 JDBC driver (
http://jtds.sourceforge.net/)
+# Documentation for the driver URL can be found at
(
http://jtds.sourceforge.net/faq.html#urlFormat)
+hibernate.dialect=net.sf.hibernate.dialect.SQLServerDialect
+portal.datasource.driver=net.sourceforge.jtds.jdbc.Driver
+portal.datasource.url=jdbc:jtds:sqlserver://localhost:1433;tds=8.0;lastupdatecount=true
+portal.datasource.username=portal
+portal.datasource.password=portalpassword
Property changes on: modules/portlet/trunk/build/etc/sqlserver.properties
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/build/ide/eclipse/3.1/config/jboss-format.xml
===================================================================
--- modules/portlet/trunk/build/ide/eclipse/3.1/config/jboss-format.xml
(rev 0)
+++ modules/portlet/trunk/build/ide/eclipse/3.1/config/jboss-format.xml 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,244 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<profiles version="8">
+<profile name="JBoss" version="8">
+<setting id="org.eclipse.jdt.core.formatter.align_type_members_on_columns"
value="false"/>
+<setting
id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression"
value="16"/>
+<setting
id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant"
value="16"/>
+<setting
id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call"
value="16"/>
+<setting
id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation"
value="16"/>
+<setting
id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression"
value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_binary_expression"
value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_compact_if"
value="52"/>
+<setting
id="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression"
value="48"/>
+<setting
id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer"
value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_multiple_fields"
value="16"/>
+<setting
id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration"
value="16"/>
+<setting
id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration"
value="16"/>
+<setting
id="org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation"
value="16"/>
+<setting
id="org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration"
value="64"/>
+<setting
id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration"
value="16"/>
+<setting
id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration"
value="64"/>
+<setting
id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration"
value="16"/>
+<setting
id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration"
value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_imports"
value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_package"
value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_field"
value="1"/>
+<setting
id="org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration"
value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_imports"
value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_member_type"
value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_method"
value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk"
value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_package"
value="0"/>
+<setting
id="org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations"
value="1"/>
+<setting
id="org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration"
value="end_of_line"/>
+<setting
id="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration"
value="next_line"/>
+<setting
id="org.eclipse.jdt.core.formatter.brace_position_for_array_initializer"
value="next_line"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block"
value="next_line"/>
+<setting
id="org.eclipse.jdt.core.formatter.brace_position_for_block_in_case"
value="end_of_line"/>
+<setting
id="org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration"
value="next_line"/>
+<setting
id="org.eclipse.jdt.core.formatter.brace_position_for_enum_constant"
value="end_of_line"/>
+<setting
id="org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration"
value="end_of_line"/>
+<setting
id="org.eclipse.jdt.core.formatter.brace_position_for_method_declaration"
value="next_line"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_switch"
value="next_line"/>
+<setting
id="org.eclipse.jdt.core.formatter.brace_position_for_type_declaration"
value="next_line"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines"
value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.format_comments"
value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.format_header"
value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.format_html"
value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.format_source_code"
value="true"/>
+<setting
id="org.eclipse.jdt.core.formatter.comment.indent_parameter_description"
value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.indent_root_tags"
value="true"/>
+<setting
id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter"
value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.line_length"
value="80"/>
+<setting id="org.eclipse.jdt.core.formatter.compact_else_if"
value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.continuation_indentation"
value="2"/>
+<setting
id="org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer"
value="2"/>
+<setting
id="org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line"
value="false"/>
+<setting
id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header"
value="true"/>
+<setting
id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header"
value="true"/>
+<setting
id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header"
value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases"
value="true"/>
+<setting
id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_block"
value="true"/>
+<setting
id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_body"
value="true"/>
+<setting
id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases"
value="true"/>
+<setting
id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch"
value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.indentation.size"
value="4"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration"
value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_binary_operator"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional"
value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters"
value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_after_unary_operator"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_binary_operator"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters"
value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_ellipsis"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional"
value="insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard"
value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_before_unary_operator"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation"
value="do not insert"/>
+<setting
id="org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line"
value="false"/>
+<setting
id="org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line"
value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line"
value="false"/>
+<setting
id="org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line"
value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.lineSplit"
value="120"/>
+<setting
id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body"
value="0"/>
+<setting
id="org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve"
value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line"
value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.tabulation.char"
value="space"/>
+<setting id="org.eclipse.jdt.core.formatter.tabulation.size"
value="3"/>
+</profile>
+</profiles>
Property changes on: modules/portlet/trunk/build/ide/eclipse/3.1/config/jboss-format.xml
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/build/ide/eclipse/3.2/team/anonymous-projectSet.psf
===================================================================
--- modules/portlet/trunk/build/ide/eclipse/3.2/team/anonymous-projectSet.psf
(rev 0)
+++ modules/portlet/trunk/build/ide/eclipse/3.2/team/anonymous-projectSet.psf 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<psf version="2.0">
+ <provider id="org.tigris.subversion.subclipse.core.svnnature">
+ <project
reference="0.9.3,http://anonsvn.jboss.org/repos/portal/trunk/api,api...
+ <project
reference="0.9.3,http://anonsvn.jboss.org/repos/portal/trunk/bridge,...
+ <project
reference="0.9.3,http://anonsvn.jboss.org/repos/portal/trunk/build,b...
+ <project
reference="0.9.3,http://anonsvn.jboss.org/repos/portal/trunk/cms,cms...
+ <project
reference="0.9.3,http://anonsvn.jboss.org/repos/portal/trunk/common,...
+ <project
reference="0.9.3,http://anonsvn.jboss.org/repos/portal/trunk/core,co...
+ <project
reference="0.9.3,http://anonsvn.jboss.org/repos/portal/trunk/core-ad...
+ <project
reference="0.9.3,http://anonsvn.jboss.org/repos/portal/trunk/core-cm...
+ <project
reference="0.9.3,http://anonsvn.jboss.org/repos/portal/trunk/core-ma...
+ <project
reference="0.9.3,http://anonsvn.jboss.org/repos/portal/trunk/core-sa...
+ <project
reference="0.9.3,http://anonsvn.jboss.org/repos/portal/trunk/core-se...
+ <project
reference="0.9.3,http://anonsvn.jboss.org/repos/portal/trunk/faces,f...
+ <project
reference="0.9.3,http://anonsvn.jboss.org/repos/portal/trunk/format,...
+ <project
reference="0.9.3,http://anonsvn.jboss.org/repos/portal/trunk/identit...
+ <project
reference="0.9.3,http://anonsvn.jboss.org/repos/portal/trunk/jems,je...
+ <project
reference="0.9.3,http://anonsvn.jboss.org/repos/portal/trunk/portlet...
+ <project
reference="0.9.3,http://anonsvn.jboss.org/repos/portal/trunk/portlet...
+ <project
reference="0.9.3,http://anonsvn.jboss.org/repos/portal/trunk/registr...
+ <project
reference="0.9.3,http://anonsvn.jboss.org/repos/portal/trunk/samples...
+ <project
reference="0.9.3,http://anonsvn.jboss.org/repos/portal/trunk/search,...
+ <project
reference="0.9.3,http://anonsvn.jboss.org/repos/portal/trunk/securit...
+ <project
reference="0.9.3,http://anonsvn.jboss.org/repos/portal/trunk/server,...
+ <project
reference="0.9.3,http://anonsvn.jboss.org/repos/portal/trunk/test,te...
+ <project
reference="0.9.3,http://anonsvn.jboss.org/repos/portal/trunk/testsui...
+ <project
reference="0.9.3,http://anonsvn.jboss.org/repos/portal/trunk/theme,t...
+ <project
reference="0.9.3,http://anonsvn.jboss.org/repos/portal/trunk/tools,t...
+ <project
reference="0.9.3,http://anonsvn.jboss.org/repos/portal/trunk/workflo...
+ <project
reference="0.9.3,http://anonsvn.jboss.org/repos/portal/trunk/wsrp,ws...
+ </provider>
+</psf>
\ No newline at end of file
Added: modules/portlet/trunk/build/ide/eclipse/3.2/team/commiter-projectSet.psf
===================================================================
--- modules/portlet/trunk/build/ide/eclipse/3.2/team/commiter-projectSet.psf
(rev 0)
+++ modules/portlet/trunk/build/ide/eclipse/3.2/team/commiter-projectSet.psf 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<psf version="2.0">
+ <provider id="org.tigris.subversion.subclipse.core.svnnature">
+ <project
reference="0.9.3,https://svn.jboss.org/repos/portal/trunk/api,api&qu...
+ <project
reference="0.9.3,https://svn.jboss.org/repos/portal/trunk/bridge,bri...
+ <project
reference="0.9.3,https://svn.jboss.org/repos/portal/trunk/build,buil...
+ <project
reference="0.9.3,https://svn.jboss.org/repos/portal/trunk/cms,cms&qu...
+ <project
reference="0.9.3,https://svn.jboss.org/repos/portal/trunk/common,com...
+ <project
reference="0.9.3,https://svn.jboss.org/repos/portal/trunk/core,core&...
+ <project
reference="0.9.3,https://svn.jboss.org/repos/portal/trunk/core-admin...
+ <project
reference="0.9.3,https://svn.jboss.org/repos/portal/trunk/core-cms,c...
+ <project
reference="0.9.3,https://svn.jboss.org/repos/portal/trunk/core-manag...
+ <project
reference="0.9.3,https://svn.jboss.org/repos/portal/trunk/core-sampl...
+ <project
reference="0.9.3,https://svn.jboss.org/repos/portal/trunk/core-searc...
+ <project
reference="0.9.3,https://svn.jboss.org/repos/portal/trunk/faces,face...
+ <project
reference="0.9.3,https://svn.jboss.org/repos/portal/trunk/format,for...
+ <project
reference="0.9.3,https://svn.jboss.org/repos/portal/trunk/identity,i...
+ <project
reference="0.9.3,https://svn.jboss.org/repos/portal/trunk/jems,jems&...
+ <project
reference="0.9.3,https://svn.jboss.org/repos/portal/trunk/portlet,po...
+ <project
reference="0.9.3,https://svn.jboss.org/repos/portal/trunk/portlet-fe...
+ <project
reference="0.9.3,https://svn.jboss.org/repos/portal/trunk/registrati...
+ <project
reference="0.9.3,https://svn.jboss.org/repos/portal/trunk/samples,sa...
+ <project
reference="0.9.3,https://svn.jboss.org/repos/portal/trunk/search,sea...
+ <project
reference="0.9.3,https://svn.jboss.org/repos/portal/trunk/security,s...
+ <project
reference="0.9.3,https://svn.jboss.org/repos/portal/trunk/server,ser...
+ <project
reference="0.9.3,https://svn.jboss.org/repos/portal/trunk/test,test&...
+ <project
reference="0.9.3,https://svn.jboss.org/repos/portal/trunk/testsuite,...
+ <project
reference="0.9.3,https://svn.jboss.org/repos/portal/trunk/theme,them...
+ <project
reference="0.9.3,https://svn.jboss.org/repos/portal/trunk/tools,tool...
+ <project
reference="0.9.3,https://svn.jboss.org/repos/portal/trunk/workflow,w...
+ <project
reference="0.9.3,https://svn.jboss.org/repos/portal/trunk/wsrp,wsrp&...
+ </provider>
+</psf>
Added: modules/portlet/trunk/build/ide/intellij/idea60/config/codestyles/jboss.xml
===================================================================
--- modules/portlet/trunk/build/ide/intellij/idea60/config/codestyles/jboss.xml
(rev 0)
+++ modules/portlet/trunk/build/ide/intellij/idea60/config/codestyles/jboss.xml 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<code_scheme name="jboss">
+ <option name="JAVA_INDENT_OPTIONS">
+ <value>
+ <option name="INDENT_SIZE" value="3" />
+ <option name="CONTINUATION_INDENT_SIZE" value="3" />
+ <option name="TAB_SIZE" value="3" />
+ <option name="USE_TAB_CHARACTER" value="false" />
+ <option name="SMART_TABS" value="false" />
+ <option name="LABEL_INDENT_SIZE" value="0" />
+ <option name="LABEL_INDENT_ABSOLUTE" value="false" />
+ </value>
+ </option>
+ <option name="BRACE_STYLE" value="2" />
+ <option name="CLASS_BRACE_STYLE" value="2" />
+ <option name="METHOD_BRACE_STYLE" value="2" />
+ <option name="ELSE_ON_NEW_LINE" value="true" />
+ <option name="WHILE_ON_NEW_LINE" value="true" />
+ <option name="CATCH_ON_NEW_LINE" value="true" />
+ <option name="FINALLY_ON_NEW_LINE" value="true" />
+ <option name="SPACE_AFTER_TYPE_CAST" value="false" />
+ <option name="CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND" value="5000"
/>
+ <option name="WRAP_COMMENTS" value="true" />
+ <option name="IF_BRACE_FORCE" value="3" />
+ <option name="DOWHILE_BRACE_FORCE" value="3" />
+ <option name="WHILE_BRACE_FORCE" value="3" />
+ <option name="FOR_BRACE_FORCE" value="3" />
+ <option name="JD_DO_NOT_WRAP_ONE_LINE_COMMENTS" value="true"
/>
+ <option name="XML_KEEP_WHITESPACES" value="true" />
+</code_scheme>
+
Property changes on:
modules/portlet/trunk/build/ide/intellij/idea60/config/codestyles/jboss.xml
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/build/ide/intellij/idea60/config/fileTemplates/StandartTestCasePortlet.java
===================================================================
---
modules/portlet/trunk/build/ide/intellij/idea60/config/fileTemplates/StandartTestCasePortlet.java
(rev 0)
+++
modules/portlet/trunk/build/ide/intellij/idea60/config/fileTemplates/StandartTestCasePortlet.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,128 @@
+/******************************************************************************
+ * 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 ${PACKAGE_NAME};
+
+import org.jboss.portal.test.framework.container.server.result.AssertResult;
+import org.jboss.portal.test.framework.container.server.result.InvokeGetResult;
+import org.jboss.portal.test.framework.container.server.result.FailureResult;
+import org.jboss.portal.test.framework.container.server.result.ServerResult;
+import org.jboss.portal.test.framework.container.server.TestContext;
+import org.jboss.portal.test.portlet.AbstractTestPortlet;
+
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.PortletException;
+import javax.portlet.PortletSecurityException;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.PortletPreferences;
+import javax.portlet.ValidatorException;
+import javax.portlet.PortletURL;
+import java.io.IOException;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 1951 $
+
+ */
+public class ${NAME} extends AbstractTestPortlet
+{
+
+
+ private AssertResult ares;
+
+ public void doProcessAction(final ActionRequest request, ActionResponse response)
throws PortletException, PortletSecurityException, IOException
+ {
+ int requestCount = TestContext.getCurrentRequestCount();
+ if (ares == null)
+ {
+ if (requestCount == 1)
+ {
+ ares = new AssertResult();
+ ares.execute(new AssertResult.Test()
+ {
+ public void run() throws Exception
+ {
+
+ }
+ });
+ }
+ }
+ else if (!ares.isFailed())
+ {
+ if (requestCount == 2)
+ {
+ ares.execute(new AssertResult.Test()
+ {
+ public void run() throws Exception
+ {
+
+ }
+ });
+ }
+ }
+ }
+
+ public void doRender(final RenderRequest request, RenderResponse response) throws
PortletException, PortletSecurityException, IOException
+ {
+ ServerResult result = null;
+
+ int requestCount = TestContext.getCurrentRequestCount();
+ if (ares == null)
+ {
+ if (requestCount == 0)
+ {
+ PortletURL url = response.createActionURL();
+ result = new InvokeGetResult(url.toString());
+ AbstractTestPortlet.marshall(result, response,
TestContext.getCurrentTestCaseId());
+ }
+ else
+ {
+ AbstractTestPortlet.marshall(new FailureResult("The assert result was
expected to be not null"), response, TestContext.getCurrentTestCaseId());
+ }
+ }
+ else if (ares.isFailed())
+ {
+ AbstractTestPortlet.marshall(ares, response,
TestContext.getCurrentTestCaseId());
+ }
+ else
+ {
+ if (requestCount == 0)
+ {
+ AbstractTestPortlet.marshall(new FailureResult("The assert result was
expected to be not null"), response, TestContext.getCurrentTestCaseId());
+ }
+ else if (requestCount == 1)
+ {
+ PortletURL url = response.createActionURL();
+ result = new InvokeGetResult(url.toString());
+ AbstractTestPortlet.marshall(result, response,
TestContext.getCurrentTestCaseId());
+ }
+ else if (requestCount == 2)
+ {
+ AbstractTestPortlet.marshall(ares, response,
TestContext.getCurrentTestCaseId());
+ }
+ }
+ }
+
+}
Property changes on:
modules/portlet/trunk/build/ide/intellij/idea60/config/fileTemplates/StandartTestCasePortlet.java
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/build/ide/intellij/idea60/config/fileTemplates/includes/Body
Header.java
===================================================================
--- modules/portlet/trunk/build/ide/intellij/idea60/config/fileTemplates/includes/Body
Header.java (rev 0)
+++ modules/portlet/trunk/build/ide/intellij/idea60/config/fileTemplates/includes/Body
Header.java 2007-08-17 15:29:49 UTC (rev 7981)
@@ -0,0 +1,4 @@
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
Property changes on:
modules/portlet/trunk/build/ide/intellij/idea60/config/fileTemplates/includes/Body
Header.java
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/build/ide/intellij/idea60/config/fileTemplates/includes/File
Header.java
===================================================================
--- modules/portlet/trunk/build/ide/intellij/idea60/config/fileTemplates/includes/File
Header.java (rev 0)
+++ modules/portlet/trunk/build/ide/intellij/idea60/config/fileTemplates/includes/File
Header.java 2007-08-17 15:29:49 UTC (rev 7981)
@@ -0,0 +1,22 @@
+/******************************************************************************
+ * 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. *
+ ******************************************************************************/
\ No newline at end of file
Property changes on:
modules/portlet/trunk/build/ide/intellij/idea60/config/fileTemplates/includes/File
Header.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/build/ide/intellij/idea60/config/fileTemplates/internal/AnnotationType.java
===================================================================
---
modules/portlet/trunk/build/ide/intellij/idea60/config/fileTemplates/internal/AnnotationType.java
(rev 0)
+++
modules/portlet/trunk/build/ide/intellij/idea60/config/fileTemplates/internal/AnnotationType.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,5 @@
+#parse("File Header.java")
+package ${PACKAGE_NAME};
+#parse("Body Header.java")
+public @interface ${NAME} {
+}
Property changes on:
modules/portlet/trunk/build/ide/intellij/idea60/config/fileTemplates/internal/AnnotationType.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/build/ide/intellij/idea60/config/fileTemplates/internal/Class.java
===================================================================
---
modules/portlet/trunk/build/ide/intellij/idea60/config/fileTemplates/internal/Class.java
(rev 0)
+++
modules/portlet/trunk/build/ide/intellij/idea60/config/fileTemplates/internal/Class.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,5 @@
+#parse("File Header.java")
+package ${PACKAGE_NAME};
+#parse("Body Header.java")
+public class ${NAME} {
+}
Property changes on:
modules/portlet/trunk/build/ide/intellij/idea60/config/fileTemplates/internal/Class.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/build/ide/intellij/idea60/config/fileTemplates/internal/Enum.java
===================================================================
---
modules/portlet/trunk/build/ide/intellij/idea60/config/fileTemplates/internal/Enum.java
(rev 0)
+++
modules/portlet/trunk/build/ide/intellij/idea60/config/fileTemplates/internal/Enum.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,5 @@
+#parse("File Header.java")
+package ${PACKAGE_NAME};
+#parse("Body Header.java")
+public enum ${NAME} {
+}
Property changes on:
modules/portlet/trunk/build/ide/intellij/idea60/config/fileTemplates/internal/Enum.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/build/ide/intellij/idea60/config/fileTemplates/internal/Interface.java
===================================================================
---
modules/portlet/trunk/build/ide/intellij/idea60/config/fileTemplates/internal/Interface.java
(rev 0)
+++
modules/portlet/trunk/build/ide/intellij/idea60/config/fileTemplates/internal/Interface.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,5 @@
+#parse("File Header.java")
+package ${PACKAGE_NAME};
+#parse("Body Header.java")
+public interface ${NAME} {
+}
Property changes on:
modules/portlet/trunk/build/ide/intellij/idea60/config/fileTemplates/internal/Interface.java
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/build/ide/intellij/idea60/jboss-portal-portlet.ipr
===================================================================
--- modules/portlet/trunk/build/ide/intellij/idea60/jboss-portal-portlet.ipr
(rev 0)
+++ modules/portlet/trunk/build/ide/intellij/idea60/jboss-portal-portlet.ipr 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,466 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4" relativePaths="false">
+ <component name="AntConfiguration">
+ <defaultAnt bundledAnt="true" />
+ </component>
+ <component name="BuildJarProjectSettings">
+ <option name="BUILD_JARS_ON_MAKE" value="false" />
+ </component>
+ <component name="CodeStyleProjectProfileManger">
+ <option name="PROJECT_PROFILE" />
+ <option name="USE_PROJECT_LEVEL_SETTINGS" value="false" />
+ </component>
+ <component name="CodeStyleSettingsManager">
+ <option name="PER_PROJECT_SETTINGS" />
+ <option name="USE_PER_PROJECT_SETTINGS" value="false" />
+ </component>
+ <component name="CompilerConfiguration">
+ <option name="DEFAULT_COMPILER" value="Javac" />
+ <option name="DEPLOY_AFTER_MAKE" value="0" />
+ <resourceExtensions>
+ <entry name=".+\.(properties|xml|html|dtd|tld)" />
+ <entry name=".+\.(gif|png|jpeg|jpg)" />
+ </resourceExtensions>
+ <wildcardResourcePatterns>
+ <entry name="?*.properties" />
+ <entry name="?*.xml" />
+ <entry name="?*.gif" />
+ <entry name="?*.png" />
+ <entry name="?*.jpeg" />
+ <entry name="?*.jpg" />
+ <entry name="?*.html" />
+ <entry name="?*.dtd" />
+ <entry name="?*.tld" />
+ </wildcardResourcePatterns>
+ </component>
+ <component name="DataSourceManagerImpl" />
+ <component name="DependenciesAnalyzeManager">
+ <option name="myForwardDirection" value="false" />
+ </component>
+ <component name="DependencyValidationManager" />
+ <component name="EclipseCompilerSettings">
+ <option name="DEBUGGING_INFO" value="true" />
+ <option name="GENERATE_NO_WARNINGS" value="true" />
+ <option name="DEPRECATION" value="false" />
+ <option name="ADDITIONAL_OPTIONS_STRING" value="" />
+ <option name="MAXIMUM_HEAP_SIZE" value="128" />
+ </component>
+ <component name="EclipseEmbeddedCompilerSettings">
+ <option name="DEBUGGING_INFO" value="true" />
+ <option name="GENERATE_NO_WARNINGS" value="true" />
+ <option name="DEPRECATION" value="false" />
+ <option name="ADDITIONAL_OPTIONS_STRING" value="" />
+ <option name="MAXIMUM_HEAP_SIZE" value="128" />
+ </component>
+ <component name="EntryPointsManager">
+ <entry_points />
+ </component>
+ <component name="ExportToHTMLSettings">
+ <option name="PRINT_LINE_NUMBERS" value="false" />
+ <option name="OPEN_IN_BROWSER" value="false" />
+ <option name="OUTPUT_DIRECTORY" />
+ </component>
+ <component name="GUI Designer component loader factory" />
+ <component name="IdProvider"
IDEtalkID="E2A438D8B6AE84F43587A2210E562521" />
+ <component name="InspectionProjectProfileManager">
+ <option name="PROJECT_PROFILE" value="Project Default" />
+ <option name="USE_PROJECT_LEVEL_SETTINGS" value="false" />
+ <scopes />
+ <profiles>
+ <profile version="1.0" is_locked="false">
+ <option name="myName" value="Project Default" />
+ <option name="myLocal" value="false" />
+ <used_levels>
+ <error>
+ <option name="myName" value="ERROR" />
+ <option name="myVal" value="200" />
+ </error>
+ <warning>
+ <option name="myName" value="WARNING" />
+ <option name="myVal" value="100" />
+ </warning>
+ <information>
+ <option name="myName" value="INFO" />
+ <option name="myVal" value="100" />
+ </information>
+ <server>
+ <option name="myName" value="SERVER PROBLEM" />
+ <option name="myVal" value="100" />
+ </server>
+ </used_levels>
+ </profile>
+ </profiles>
+ </component>
+ <component name="JavacSettings">
+ <option name="DEBUGGING_INFO" value="true" />
+ <option name="GENERATE_NO_WARNINGS" value="false" />
+ <option name="DEPRECATION" value="true" />
+ <option name="ADDITIONAL_OPTIONS_STRING" value="" />
+ <option name="MAXIMUM_HEAP_SIZE" value="128" />
+ </component>
+ <component name="JavadocGenerationManager">
+ <option name="OUTPUT_DIRECTORY" />
+ <option name="OPTION_SCOPE" value="protected" />
+ <option name="OPTION_HIERARCHY" value="true" />
+ <option name="OPTION_NAVIGATOR" value="true" />
+ <option name="OPTION_INDEX" value="true" />
+ <option name="OPTION_SEPARATE_INDEX" value="true" />
+ <option name="OPTION_DOCUMENT_TAG_USE" value="false" />
+ <option name="OPTION_DOCUMENT_TAG_AUTHOR" value="false" />
+ <option name="OPTION_DOCUMENT_TAG_VERSION" value="false"
/>
+ <option name="OPTION_DOCUMENT_TAG_DEPRECATED" value="true"
/>
+ <option name="OPTION_DEPRECATED_LIST" value="true" />
+ <option name="OTHER_OPTIONS" value="" />
+ <option name="HEAP_SIZE" />
+ <option name="LOCALE" />
+ <option name="OPEN_IN_BROWSER" value="true" />
+ </component>
+ <component name="JikesSettings">
+ <option name="JIKES_PATH" value="" />
+ <option name="DEBUGGING_INFO" value="true" />
+ <option name="DEPRECATION" value="true" />
+ <option name="GENERATE_NO_WARNINGS" value="false" />
+ <option name="IS_EMACS_ERRORS_MODE" value="true" />
+ <option name="ADDITIONAL_OPTIONS_STRING" value="" />
+ </component>
+ <component name="LogConsolePreferences">
+ <option name="FILTER_ERRORS" value="false" />
+ <option name="FILTER_WARNINGS" value="false" />
+ <option name="FILTER_INFO" value="true" />
+ <option name="CUSTOM_FILTER" />
+ </component>
+ <component name="Palette2">
+ <group name="Swing">
+ <item class="com.intellij.uiDesigner.HSpacer"
tooltip-text="Horizontal Spacer"
icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false"
auto-create-binding="false" can-attach-label="false">
+ <default-constraints vsize-policy="1" hsize-policy="6"
anchor="0" fill="1" />
+ </item>
+ <item class="com.intellij.uiDesigner.VSpacer"
tooltip-text="Vertical Spacer"
icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false"
auto-create-binding="false" can-attach-label="false">
+ <default-constraints vsize-policy="6" hsize-policy="1"
anchor="0" fill="2" />
+ </item>
+ <item class="javax.swing.JPanel"
icon="/com/intellij/uiDesigner/icons/panel.png" removable="false"
auto-create-binding="false" can-attach-label="false">
+ <default-constraints vsize-policy="3" hsize-policy="3"
anchor="0" fill="3" />
+ </item>
+ <item class="javax.swing.JScrollPane"
icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false"
auto-create-binding="false" can-attach-label="true">
+ <default-constraints vsize-policy="7" hsize-policy="7"
anchor="0" fill="3" />
+ </item>
+ <item class="javax.swing.JButton"
icon="/com/intellij/uiDesigner/icons/button.png" removable="false"
auto-create-binding="true" can-attach-label="false">
+ <default-constraints vsize-policy="0" hsize-policy="3"
anchor="0" fill="1" />
+ <initial-values>
+ <property name="text" value="Button" />
+ </initial-values>
+ </item>
+ <item class="javax.swing.JRadioButton"
icon="/com/intellij/uiDesigner/icons/radioButton.png"
removable="false" auto-create-binding="true"
can-attach-label="false">
+ <default-constraints vsize-policy="0" hsize-policy="3"
anchor="8" fill="0" />
+ <initial-values>
+ <property name="text" value="RadioButton" />
+ </initial-values>
+ </item>
+ <item class="javax.swing.JCheckBox"
icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false"
auto-create-binding="true" can-attach-label="false">
+ <default-constraints vsize-policy="0" hsize-policy="3"
anchor="8" fill="0" />
+ <initial-values>
+ <property name="text" value="CheckBox" />
+ </initial-values>
+ </item>
+ <item class="javax.swing.JLabel"
icon="/com/intellij/uiDesigner/icons/label.png" removable="false"
auto-create-binding="false" can-attach-label="false">
+ <default-constraints vsize-policy="0" hsize-policy="0"
anchor="8" fill="0" />
+ <initial-values>
+ <property name="text" value="Label" />
+ </initial-values>
+ </item>
+ <item class="javax.swing.JTextField"
icon="/com/intellij/uiDesigner/icons/textField.png" removable="false"
auto-create-binding="true" can-attach-label="true">
+ <default-constraints vsize-policy="0" hsize-policy="6"
anchor="8" fill="1">
+ <preferred-size width="150" height="-1" />
+ </default-constraints>
+ </item>
+ <item class="javax.swing.JPasswordField"
icon="/com/intellij/uiDesigner/icons/passwordField.png"
removable="false" auto-create-binding="true"
can-attach-label="true">
+ <default-constraints vsize-policy="0" hsize-policy="6"
anchor="8" fill="1">
+ <preferred-size width="150" height="-1" />
+ </default-constraints>
+ </item>
+ <item class="javax.swing.JFormattedTextField"
icon="/com/intellij/uiDesigner/icons/formattedTextField.png"
removable="false" auto-create-binding="true"
can-attach-label="true">
+ <default-constraints vsize-policy="0" hsize-policy="6"
anchor="8" fill="1">
+ <preferred-size width="150" height="-1" />
+ </default-constraints>
+ </item>
+ <item class="javax.swing.JTextArea"
icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false"
auto-create-binding="true" can-attach-label="true">
+ <default-constraints vsize-policy="6" hsize-policy="6"
anchor="0" fill="3">
+ <preferred-size width="150" height="50" />
+ </default-constraints>
+ </item>
+ <item class="javax.swing.JTextPane"
icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false"
auto-create-binding="true" can-attach-label="true">
+ <default-constraints vsize-policy="6" hsize-policy="6"
anchor="0" fill="3">
+ <preferred-size width="150" height="50" />
+ </default-constraints>
+ </item>
+ <item class="javax.swing.JEditorPane"
icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false"
auto-create-binding="true" can-attach-label="true">
+ <default-constraints vsize-policy="6" hsize-policy="6"
anchor="0" fill="3">
+ <preferred-size width="150" height="50" />
+ </default-constraints>
+ </item>
+ <item class="javax.swing.JComboBox"
icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false"
auto-create-binding="true" can-attach-label="true">
+ <default-constraints vsize-policy="0" hsize-policy="2"
anchor="8" fill="1" />
+ </item>
+ <item class="javax.swing.JTable"
icon="/com/intellij/uiDesigner/icons/table.png" removable="false"
auto-create-binding="true" can-attach-label="false">
+ <default-constraints vsize-policy="6" hsize-policy="6"
anchor="0" fill="3">
+ <preferred-size width="150" height="50" />
+ </default-constraints>
+ </item>
+ <item class="javax.swing.JList"
icon="/com/intellij/uiDesigner/icons/list.png" removable="false"
auto-create-binding="true" can-attach-label="false">
+ <default-constraints vsize-policy="6" hsize-policy="2"
anchor="0" fill="3">
+ <preferred-size width="150" height="50" />
+ </default-constraints>
+ </item>
+ <item class="javax.swing.JTree"
icon="/com/intellij/uiDesigner/icons/tree.png" removable="false"
auto-create-binding="true" can-attach-label="false">
+ <default-constraints vsize-policy="6" hsize-policy="6"
anchor="0" fill="3">
+ <preferred-size width="150" height="50" />
+ </default-constraints>
+ </item>
+ <item class="javax.swing.JTabbedPane"
icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false"
auto-create-binding="true" can-attach-label="false">
+ <default-constraints vsize-policy="3" hsize-policy="3"
anchor="0" fill="3">
+ <preferred-size width="200" height="200" />
+ </default-constraints>
+ </item>
+ <item class="javax.swing.JSplitPane"
icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false"
auto-create-binding="false" can-attach-label="false">
+ <default-constraints vsize-policy="3" hsize-policy="3"
anchor="0" fill="3">
+ <preferred-size width="200" height="200" />
+ </default-constraints>
+ </item>
+ <item class="javax.swing.JSpinner"
icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false"
auto-create-binding="true" can-attach-label="true">
+ <default-constraints vsize-policy="0" hsize-policy="6"
anchor="8" fill="1" />
+ </item>
+ <item class="javax.swing.JSlider"
icon="/com/intellij/uiDesigner/icons/slider.png" removable="false"
auto-create-binding="true" can-attach-label="false">
+ <default-constraints vsize-policy="0" hsize-policy="6"
anchor="8" fill="1" />
+ </item>
+ <item class="javax.swing.JSeparator"
icon="/com/intellij/uiDesigner/icons/separator.png" removable="false"
auto-create-binding="false" can-attach-label="false">
+ <default-constraints vsize-policy="6" hsize-policy="6"
anchor="0" fill="3" />
+ </item>
+ <item class="javax.swing.JProgressBar"
icon="/com/intellij/uiDesigner/icons/progressbar.png"
removable="false" auto-create-binding="true"
can-attach-label="false">
+ <default-constraints vsize-policy="0" hsize-policy="6"
anchor="0" fill="1" />
+ </item>
+ <item class="javax.swing.JToolBar"
icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false"
auto-create-binding="false" can-attach-label="false">
+ <default-constraints vsize-policy="0" hsize-policy="6"
anchor="0" fill="1">
+ <preferred-size width="-1" height="20" />
+ </default-constraints>
+ </item>
+ <item class="javax.swing.JToolBar$Separator"
icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png"
removable="false" auto-create-binding="false"
can-attach-label="false">
+ <default-constraints vsize-policy="0" hsize-policy="0"
anchor="0" fill="1" />
+ </item>
+ <item class="javax.swing.JScrollBar"
icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false"
auto-create-binding="true" can-attach-label="false">
+ <default-constraints vsize-policy="6" hsize-policy="0"
anchor="0" fill="2" />
+ </item>
+ </group>
+ </component>
+ <component name="ProjectModuleManager">
+ <modules>
+ <module
fileurl="file://$PROJECT_DIR$/build/ide/intellij/idea60/modules/federation/federation.iml"
filepath="$PROJECT_DIR$/build/ide/intellij/idea60/modules/federation/federation.iml"
/>
+ <module
fileurl="file://$PROJECT_DIR$/build/ide/intellij/idea60/modules/jsr168api/jsr168api.iml"
filepath="$PROJECT_DIR$/build/ide/intellij/idea60/modules/jsr168api/jsr168api.iml"
/>
+ <module
fileurl="file://$PROJECT_DIR$/build/ide/intellij/idea60/modules/portlet/portlet.iml"
filepath="$PROJECT_DIR$/build/ide/intellij/idea60/modules/portlet/portlet.iml"
/>
+ <module
fileurl="file://$PROJECT_DIR$/build/ide/intellij/idea60/modules/testsuite/testsuite.iml"
filepath="$PROJECT_DIR$/build/ide/intellij/idea60/modules/testsuite/testsuite.iml"
/>
+ <module
fileurl="file://$PROJECT_DIR$/build/ide/intellij/idea60/modules/thirdparty/thirdparty.iml"
filepath="$PROJECT_DIR$/build/ide/intellij/idea60/modules/thirdparty/thirdparty.iml"
/>
+ <module
fileurl="file://$PROJECT_DIR$/build/ide/intellij/idea60/modules/tools/tools.iml"
filepath="$PROJECT_DIR$/build/ide/intellij/idea60/modules/tools/tools.iml"
/>
+ </modules>
+ </component>
+ <component name="ProjectRootManager" version="2"
assert-keyword="true" jdk-15="false" project-jdk-name="1.5"
project-jdk-type="JavaSDK">
+ <output url="file://$PROJECT_DIR$/output" />
+ </component>
+ <component name="ProjectRunConfigurationManager" />
+ <component name="RmicSettings">
+ <option name="IS_EANABLED" value="false" />
+ <option name="DEBUGGING_INFO" value="true" />
+ <option name="GENERATE_NO_WARNINGS" value="false" />
+ <option name="GENERATE_IIOP_STUBS" value="false" />
+ <option name="ADDITIONAL_OPTIONS_STRING" value="" />
+ </component>
+ <component name="StarteamVcsAdapter" />
+ <component name="VssVcs">
+
<SourceSafePersistencyRemovedFolder>$PROJECT_DIR$/wsrp/src/resources/test</SourceSafePersistencyRemovedFolder>
+ </component>
+ <component name="com.intellij.jsf.UserDefinedFacesConfigs">
+ <option name="USER_DEFINED_CONFIGS">
+ <value>
+ <list size="0" />
+ </value>
+ </option>
+ </component>
+ <component name="copyright">
+ <Base>
+ <setting name="state" value="1" />
+ </Base>
+ <LanguageOptions name="$TEMPLATE$">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="true" />
+ <option name="separateAfter" value="true" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="true" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="JBoss, a division of Red
Hat Copyright &#36;today.year, 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 Fr!
anklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF site:
http://www.fsf.org." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="4" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ <LanguageOptions name="CSS">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="false" />
+ <option name="separateAfter" value="false" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="false" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="Copyright (c)
&#36;today.year, Your Corporation. All Rights Reserved." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="1" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ <LanguageOptions name="HTML">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="false" />
+ <option name="separateAfter" value="false" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="false" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="Copyright (c)
&#36;today.year, Your Corporation. All Rights Reserved." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="1" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ <LanguageOptions name="JAVA">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="false" />
+ <option name="separateAfter" value="false" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="false" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="Copyright (c)
&#36;today.year, Your Corporation. All Rights Reserved." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="2" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ <LanguageOptions name="JSP">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="false" />
+ <option name="separateAfter" value="false" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="false" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="Copyright (c)
&#36;today.year, Your Corporation. All Rights Reserved." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="1" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ <LanguageOptions name="JavaScript">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="false" />
+ <option name="separateAfter" value="false" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="false" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="Copyright (c)
&#36;today.year, Your Corporation. All Rights Reserved." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="1" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ <LanguageOptions name="Properties">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="false" />
+ <option name="separateAfter" value="false" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="false" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="Copyright (c)
&#36;today.year, Your Corporation. All Rights Reserved." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="1" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ <LanguageOptions name="XML">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="false" />
+ <option name="separateAfter" value="false" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="false" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="Copyright (c)
&#36;today.year, Your Corporation. All Rights Reserved." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="2" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ </component>
+ <component name="libraryTable" />
+ <component name="uidesigner-configuration">
+ <option name="INSTRUMENT_CLASSES" value="true" />
+ <option name="COPY_FORMS_RUNTIME_TO_OUTPUT" value="true"
/>
+ <option name="DEFAULT_LAYOUT_MANAGER"
value="GridLayoutManager" />
+ </component>
+ <UsedPathMacros />
+</project>
+
Added: modules/portlet/trunk/build/ide/intellij/idea60/modules/federation/federation.iml
===================================================================
--- modules/portlet/trunk/build/ide/intellij/idea60/modules/federation/federation.iml
(rev 0)
+++
modules/portlet/trunk/build/ide/intellij/idea60/modules/federation/federation.iml 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,24 @@
+<?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$/../../../../../../federation">
+ <sourceFolder
url="file://$MODULE_DIR$/../../../../../../federation/src/main"
isTestSource="false" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root
url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss-portal/modules/common/lib/portal-common-lib.jar!/"
/>
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module" module-name="portlet" />
+ <orderEntryProperties />
+ </component>
+</module>
+
Added: modules/portlet/trunk/build/ide/intellij/idea60/modules/jsr168api/jsr168api.iml
===================================================================
--- modules/portlet/trunk/build/ide/intellij/idea60/modules/jsr168api/jsr168api.iml
(rev 0)
+++
modules/portlet/trunk/build/ide/intellij/idea60/modules/jsr168api/jsr168api.iml 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,14 @@
+<?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$/../../../../../../jsr168api">
+ <sourceFolder
url="file://$MODULE_DIR$/../../../../../../jsr168api/src/main"
isTestSource="false" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntryProperties />
+ </component>
+</module>
+
Added: modules/portlet/trunk/build/ide/intellij/idea60/modules/portlet/portlet.iml
===================================================================
--- modules/portlet/trunk/build/ide/intellij/idea60/modules/portlet/portlet.iml
(rev 0)
+++ modules/portlet/trunk/build/ide/intellij/idea60/modules/portlet/portlet.iml 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,275 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module version="4" relativePaths="true"
type="JAVA_MODULE">
+ <component name="ModuleRootManager" />
+ <component name="NewModuleRootManager"
inherit-compiler-output="false">
+ <output
url="file://$MODULE_DIR$/../../../../../../portlet/output/idea50/classes" />
+ <exclude-output />
+ <content url="file://$MODULE_DIR$/../../../../../../portlet">
+ <sourceFolder
url="file://$MODULE_DIR$/../../../../../../portlet/src/main"
isTestSource="false" />
+ <excludeFolder
url="file://$MODULE_DIR$/../../../../../../portlet/output" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root
url="jar://$MODULE_DIR$/../../../../../../thirdparty/sun-servlet/lib/jsp-api.jar!/"
/>
+ </CLASSES>
+ <JAVADOC />
+ <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>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root
url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/jbossxb/lib/jboss-xml-binding.jar!/"
/>
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root
url="jar://$MODULE_DIR$/../../../../../../thirdparty/junit/lib/junit.jar!/"
/>
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root
url="jar://$MODULE_DIR$/../../../../../../thirdparty/apache-log4j/lib/log4j.jar!/"
/>
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root
url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss-portal/modules/web/lib/portal-web-lib.jar!/"
/>
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root
url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss-portal/modules/test/lib/portal-test-lib.jar!/"
/>
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root
url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss-portal/modules/common/lib/portal-common-lib.jar!/"
/>
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root
url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss-portal/modules/common/lib/portal-common-portal-lib.jar!/"
/>
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module" module-name="jsr168api" />
+ <orderEntryProperties />
+ </component>
+ <component name="VcsManagerConfiguration">
+ <option name="ACTIVE_VCS_NAME" value="svn" />
+ <option name="USE_PROJECT_VCS" value="false" />
+ </component>
+ <component name="copyright">
+ <Base>
+ <setting name="state" value="1" />
+ </Base>
+ <LanguageOptions name="$TEMPLATE$">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="true" />
+ <option name="separateAfter" value="true" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="true" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="JBoss, a division of Red
Hat Copyright &#36;today.year, 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 Fr!
anklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF site:
http://www.fsf.org." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="4" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ <LanguageOptions name="CSS">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="false" />
+ <option name="separateAfter" value="false" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="false" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="Copyright (c)
&#36;today.year, Your Corporation. All Rights Reserved." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="2" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ <LanguageOptions name="HTML">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="false" />
+ <option name="separateAfter" value="false" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="false" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="Copyright (c)
&#36;today.year, Your Corporation. All Rights Reserved." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="2" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ <LanguageOptions name="JAVA">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="false" />
+ <option name="separateAfter" value="false" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="false" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="Copyright (c)
&#36;today.year, Your Corporation. All Rights Reserved." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="2" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ <LanguageOptions name="JSP">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="false" />
+ <option name="separateAfter" value="false" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="false" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="Copyright (c)
&#36;today.year, Your Corporation. All Rights Reserved." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="2" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ <LanguageOptions name="JavaScript">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="false" />
+ <option name="separateAfter" value="false" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="false" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="Copyright (c)
&#36;today.year, Your Corporation. All Rights Reserved." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="2" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ <LanguageOptions name="Properties">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="false" />
+ <option name="separateAfter" value="false" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="false" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="Copyright (c)
&#36;today.year, Your Corporation. All Rights Reserved." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="2" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ <LanguageOptions name="XML">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="false" />
+ <option name="separateAfter" value="false" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="false" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="Copyright (c)
&#36;today.year, Your Corporation. All Rights Reserved." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="2" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ </component>
+</module>
+
Added: modules/portlet/trunk/build/ide/intellij/idea60/modules/portlet/samples.iml
===================================================================
--- modules/portlet/trunk/build/ide/intellij/idea60/modules/portlet/samples.iml
(rev 0)
+++ modules/portlet/trunk/build/ide/intellij/idea60/modules/portlet/samples.iml 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,205 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module version="4" relativePaths="true"
type="JAVA_MODULE">
+ <component name="ModuleRootManager" />
+ <component name="NewModuleRootManager"
inherit-compiler-output="false">
+ <output
url="file://$MODULE_DIR$/../../../../../../samples/output/idea50/classes" />
+ <exclude-output />
+ <content url="file://$MODULE_DIR$/../../../../../../samples">
+ <sourceFolder
url="file://$MODULE_DIR$/../../../../../../samples/src/main"
isTestSource="false" />
+ <excludeFolder
url="file://$MODULE_DIR$/../../../../../../samples/output" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="module" module-name="api" />
+ <orderEntry type="module" module-name="common" />
+ <orderEntry type="module" module-name="portlet" />
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root
url="jar://$MODULE_DIR$/../../../../../../thirdparty/apache-log4j/lib/log4j.jar!/"
/>
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntryProperties />
+ </component>
+ <component name="VcsManagerConfiguration">
+ <option name="ACTIVE_VCS_NAME" value="svn" />
+ <option name="USE_PROJECT_VCS" value="false" />
+ </component>
+ <component name="copyright">
+ <Base>
+ <setting name="state" value="1" />
+ </Base>
+ <LanguageOptions name="$TEMPLATE$">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="true" />
+ <option name="separateAfter" value="true" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="true" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="JBoss, a division of Red
Hat Copyright &#36;today.year, 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 Fr!
anklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF site:
http://www.fsf.org." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="4" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ <LanguageOptions name="CSS">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="false" />
+ <option name="separateAfter" value="false" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="false" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="Copyright (c)
&#36;today.year, Your Corporation. All Rights Reserved." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="2" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ <LanguageOptions name="HTML">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="false" />
+ <option name="separateAfter" value="false" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="false" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="Copyright (c)
&#36;today.year, Your Corporation. All Rights Reserved." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="2" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ <LanguageOptions name="JAVA">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="false" />
+ <option name="separateAfter" value="false" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="false" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="Copyright (c)
&#36;today.year, Your Corporation. All Rights Reserved." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="2" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ <LanguageOptions name="JSP">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="false" />
+ <option name="separateAfter" value="false" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="false" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="Copyright (c)
&#36;today.year, Your Corporation. All Rights Reserved." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="2" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ <LanguageOptions name="JavaScript">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="false" />
+ <option name="separateAfter" value="false" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="false" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="Copyright (c)
&#36;today.year, Your Corporation. All Rights Reserved." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="2" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ <LanguageOptions name="Properties">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="false" />
+ <option name="separateAfter" value="false" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="false" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="Copyright (c)
&#36;today.year, Your Corporation. All Rights Reserved." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="2" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ <LanguageOptions name="XML">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="false" />
+ <option name="separateAfter" value="false" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="false" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="Copyright (c)
&#36;today.year, Your Corporation. All Rights Reserved." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="2" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ </component>
+</module>
+
Added: modules/portlet/trunk/build/ide/intellij/idea60/modules/testsuite/testsuite.iml
===================================================================
--- modules/portlet/trunk/build/ide/intellij/idea60/modules/testsuite/testsuite.iml
(rev 0)
+++
modules/portlet/trunk/build/ide/intellij/idea60/modules/testsuite/testsuite.iml 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,192 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module version="4" relativePaths="true"
type="JAVA_MODULE">
+ <component name="ModuleRootManager" />
+ <component name="NewModuleRootManager"
inherit-compiler-output="false">
+ <output url="file://$MODULE_DIR$/../../../../../../testsuite/classes"
/>
+ <exclude-output />
+ <content url="file://$MODULE_DIR$/../../../../../../testsuite">
+ <excludeFolder
url="file://$MODULE_DIR$/../../../../../../testsuite/output" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntryProperties />
+ </component>
+ <component name="VcsManagerConfiguration">
+ <option name="ACTIVE_VCS_NAME" value="svn" />
+ <option name="USE_PROJECT_VCS" value="false" />
+ </component>
+ <component name="copyright">
+ <Base>
+ <setting name="state" value="1" />
+ </Base>
+ <LanguageOptions name="$TEMPLATE$">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="true" />
+ <option name="separateAfter" value="true" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="true" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="JBoss, a division of Red
Hat Copyright &#36;today.year, 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 Fr!
anklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF site:
http://www.fsf.org." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="4" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ <LanguageOptions name="CSS">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="false" />
+ <option name="separateAfter" value="false" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="false" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="Copyright (c)
&#36;today.year, Your Corporation. All Rights Reserved." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="2" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ <LanguageOptions name="HTML">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="false" />
+ <option name="separateAfter" value="false" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="false" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="Copyright (c)
&#36;today.year, Your Corporation. All Rights Reserved." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="2" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ <LanguageOptions name="JAVA">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="false" />
+ <option name="separateAfter" value="false" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="false" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="Copyright (c)
&#36;today.year, Your Corporation. All Rights Reserved." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="2" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ <LanguageOptions name="JSP">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="false" />
+ <option name="separateAfter" value="false" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="false" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="Copyright (c)
&#36;today.year, Your Corporation. All Rights Reserved." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="2" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ <LanguageOptions name="JavaScript">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="false" />
+ <option name="separateAfter" value="false" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="false" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="Copyright (c)
&#36;today.year, Your Corporation. All Rights Reserved." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="2" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ <LanguageOptions name="Properties">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="false" />
+ <option name="separateAfter" value="false" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="false" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="Copyright (c)
&#36;today.year, Your Corporation. All Rights Reserved." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="2" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ <LanguageOptions name="XML">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="false" />
+ <option name="separateAfter" value="false" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="false" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="Copyright (c)
&#36;today.year, Your Corporation. All Rights Reserved." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="2" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ </component>
+</module>
+
Added: modules/portlet/trunk/build/ide/intellij/idea60/modules/thirdparty/thirdparty.iml
===================================================================
--- modules/portlet/trunk/build/ide/intellij/idea60/modules/thirdparty/thirdparty.iml
(rev 0)
+++
modules/portlet/trunk/build/ide/intellij/idea60/modules/thirdparty/thirdparty.iml 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,245 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module version="4" relativePaths="true"
type="JAVA_MODULE">
+ <component name="ModuleRootManager" />
+ <component name="NewModuleRootManager"
inherit-compiler-output="false">
+ <output url="file://$MODULE_DIR$/../../../../../../thirdparty/classes"
/>
+ <exclude-output />
+ <content url="file://$MODULE_DIR$/../../../../../../thirdparty">
+ <excludeFolder
url="file://$MODULE_DIR$/../../../../../../thirdparty/antlr" />
+ <excludeFolder
url="file://$MODULE_DIR$/../../../../../../thirdparty/apache-ant" />
+ <excludeFolder
url="file://$MODULE_DIR$/../../../../../../thirdparty/apache-codec" />
+ <excludeFolder
url="file://$MODULE_DIR$/../../../../../../thirdparty/apache-collections" />
+ <excludeFolder
url="file://$MODULE_DIR$/../../../../../../thirdparty/apache-fileupload" />
+ <excludeFolder
url="file://$MODULE_DIR$/../../../../../../thirdparty/apache-httpclient" />
+ <excludeFolder
url="file://$MODULE_DIR$/../../../../../../thirdparty/apache-lang" />
+ <excludeFolder
url="file://$MODULE_DIR$/../../../../../../thirdparty/apache-log4j" />
+ <excludeFolder
url="file://$MODULE_DIR$/../../../../../../thirdparty/apache-logging" />
+ <excludeFolder
url="file://$MODULE_DIR$/../../../../../../thirdparty/apache-lucene" />
+ <excludeFolder
url="file://$MODULE_DIR$/../../../../../../thirdparty/apache-myfaces" />
+ <excludeFolder
url="file://$MODULE_DIR$/../../../../../../thirdparty/apache-net" />
+ <excludeFolder
url="file://$MODULE_DIR$/../../../../../../thirdparty/apache-tomahawk" />
+ <excludeFolder
url="file://$MODULE_DIR$/../../../../../../thirdparty/apache-xerces" />
+ <excludeFolder
url="file://$MODULE_DIR$/../../../../../../thirdparty/apache-xmlsec" />
+ <excludeFolder
url="file://$MODULE_DIR$/../../../../../../thirdparty/asm" />
+ <excludeFolder
url="file://$MODULE_DIR$/../../../../../../thirdparty/aspectj" />
+ <excludeFolder
url="file://$MODULE_DIR$/../../../../../../thirdparty/beanshell" />
+ <excludeFolder
url="file://$MODULE_DIR$/../../../../../../thirdparty/cglib" />
+ <excludeFolder
url="file://$MODULE_DIR$/../../../../../../thirdparty/dbunit" />
+ <excludeFolder
url="file://$MODULE_DIR$/../../../../../../thirdparty/dom4j" />
+ <excludeFolder
url="file://$MODULE_DIR$/../../../../../../thirdparty/ehcache" />
+ <excludeFolder
url="file://$MODULE_DIR$/../../../../../../thirdparty/el" />
+ <excludeFolder
url="file://$MODULE_DIR$/../../../../../../thirdparty/facelets" />
+ <excludeFolder
url="file://$MODULE_DIR$/../../../../../../thirdparty/hibernate" />
+ <excludeFolder
url="file://$MODULE_DIR$/../../../../../../thirdparty/hsqldb" />
+ <excludeFolder
url="file://$MODULE_DIR$/../../../../../../thirdparty/httpunit" />
+ <excludeFolder
url="file://$MODULE_DIR$/../../../../../../thirdparty/ibm-wsdl4j" />
+ <excludeFolder
url="file://$MODULE_DIR$/../../../../../../thirdparty/jackrabbit" />
+ <excludeFolder
url="file://$MODULE_DIR$/../../../../../../thirdparty/jakarta-cactus" />
+ <excludeFolder
url="file://$MODULE_DIR$/../../../../../../thirdparty/jakarta-io" />
+ <excludeFolder
url="file://$MODULE_DIR$/../../../../../../thirdparty/javassist" />
+ <excludeFolder
url="file://$MODULE_DIR$/../../../../../../thirdparty/jboss" />
+ <excludeFolder
url="file://$MODULE_DIR$/../../../../../../thirdparty/jbossas" />
+ <excludeFolder
url="file://$MODULE_DIR$/../../../../../../thirdparty/jbpm" />
+ <excludeFolder
url="file://$MODULE_DIR$/../../../../../../thirdparty/jcr" />
+ <excludeFolder
url="file://$MODULE_DIR$/../../../../../../thirdparty/jetty" />
+ <excludeFolder
url="file://$MODULE_DIR$/../../../../../../thirdparty/jflex" />
+ <excludeFolder
url="file://$MODULE_DIR$/../../../../../../thirdparty/jgroups" />
+ <excludeFolder
url="file://$MODULE_DIR$/../../../../../../thirdparty/jsunit" />
+ <excludeFolder
url="file://$MODULE_DIR$/../../../../../../thirdparty/junit" />
+ <excludeFolder
url="file://$MODULE_DIR$/../../../../../../thirdparty/jwebunit" />
+ <excludeFolder
url="file://$MODULE_DIR$/../../../../../../thirdparty/licenses" />
+ <excludeFolder
url="file://$MODULE_DIR$/../../../../../../thirdparty/nekohtml" />
+ <excludeFolder
url="file://$MODULE_DIR$/../../../../../../thirdparty/odmg" />
+ <excludeFolder
url="file://$MODULE_DIR$/../../../../../../thirdparty/oswego-concurrent" />
+ <excludeFolder
url="file://$MODULE_DIR$/../../../../../../thirdparty/portals-bridges" />
+ <excludeFolder
url="file://$MODULE_DIR$/../../../../../../thirdparty/qdox" />
+ <excludeFolder
url="file://$MODULE_DIR$/../../../../../../thirdparty/sleepycat" />
+ <excludeFolder
url="file://$MODULE_DIR$/../../../../../../thirdparty/slf4j" />
+ <excludeFolder
url="file://$MODULE_DIR$/../../../../../../thirdparty/sun-jaf" />
+ <excludeFolder
url="file://$MODULE_DIR$/../../../../../../thirdparty/sun-javacc" />
+ <excludeFolder
url="file://$MODULE_DIR$/../../../../../../thirdparty/sun-javamail" />
+ <excludeFolder
url="file://$MODULE_DIR$/../../../../../../thirdparty/sun-opends" />
+ <excludeFolder
url="file://$MODULE_DIR$/../../../../../../thirdparty/sun-servlet" />
+ <excludeFolder
url="file://$MODULE_DIR$/../../../../../../thirdparty/trove" />
+ <excludeFolder
url="file://$MODULE_DIR$/../../../../../../thirdparty/wutka-dtdparser" />
+ <excludeFolder
url="file://$MODULE_DIR$/../../../../../../thirdparty/xdoclet" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntryProperties />
+ </component>
+ <component name="copyright">
+ <Base>
+ <setting name="state" value="1" />
+ </Base>
+ <LanguageOptions name="$TEMPLATE$">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="true" />
+ <option name="separateAfter" value="true" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="true" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="JBoss, a division of Red
Hat Copyright &#36;today.year, 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 Fr!
anklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF site:
http://www.fsf.org." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="4" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ <LanguageOptions name="CSS">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="false" />
+ <option name="separateAfter" value="false" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="false" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="Copyright (c)
&#36;today.year, Your Corporation. All Rights Reserved." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="2" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ <LanguageOptions name="HTML">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="false" />
+ <option name="separateAfter" value="false" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="false" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="Copyright (c)
&#36;today.year, Your Corporation. All Rights Reserved." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="2" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ <LanguageOptions name="JAVA">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="false" />
+ <option name="separateAfter" value="false" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="false" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="Copyright (c)
&#36;today.year, Your Corporation. All Rights Reserved." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="2" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ <LanguageOptions name="JSP">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="false" />
+ <option name="separateAfter" value="false" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="false" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="Copyright (c)
&#36;today.year, Your Corporation. All Rights Reserved." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="2" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ <LanguageOptions name="JavaScript">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="false" />
+ <option name="separateAfter" value="false" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="false" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="Copyright (c)
&#36;today.year, Your Corporation. All Rights Reserved." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="2" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ <LanguageOptions name="Properties">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="false" />
+ <option name="separateAfter" value="false" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="false" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="Copyright (c)
&#36;today.year, Your Corporation. All Rights Reserved." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="2" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ <LanguageOptions name="XML">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="false" />
+ <option name="separateAfter" value="false" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="false" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="Copyright (c)
&#36;today.year, Your Corporation. All Rights Reserved." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="2" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ </component>
+</module>
+
Added: modules/portlet/trunk/build/ide/intellij/idea60/modules/tools/tools.iml
===================================================================
--- modules/portlet/trunk/build/ide/intellij/idea60/modules/tools/tools.iml
(rev 0)
+++ modules/portlet/trunk/build/ide/intellij/idea60/modules/tools/tools.iml 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,201 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module version="4" relativePaths="true"
type="JAVA_MODULE">
+ <component name="ModuleRootManager" />
+ <component name="NewModuleRootManager"
inherit-compiler-output="false">
+ <output url="file://$MODULE_DIR$/../../../../../../tools/classes" />
+ <exclude-output />
+ <content url="file://$MODULE_DIR$/../../../../../../tools">
+ <sourceFolder
url="file://$MODULE_DIR$/../../../../../../tools/src/main"
isTestSource="false" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root
url="jar://$MODULE_DIR$/../../../../../../thirdparty/wutka-dtdparser/lib/dtdparser121.jar!/"
/>
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntryProperties />
+ </component>
+ <component name="VcsManagerConfiguration">
+ <option name="ACTIVE_VCS_NAME" value="svn" />
+ <option name="USE_PROJECT_VCS" value="false" />
+ </component>
+ <component name="copyright">
+ <Base>
+ <setting name="state" value="1" />
+ </Base>
+ <LanguageOptions name="$TEMPLATE$">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="true" />
+ <option name="separateAfter" value="true" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="true" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="JBoss, a division of Red
Hat Copyright &#36;today.year, 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 Fr!
anklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF site:
http://www.fsf.org." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="4" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ <LanguageOptions name="CSS">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="false" />
+ <option name="separateAfter" value="false" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="false" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="Copyright (c)
&#36;today.year, Your Corporation. All Rights Reserved." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="2" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ <LanguageOptions name="HTML">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="false" />
+ <option name="separateAfter" value="false" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="false" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="Copyright (c)
&#36;today.year, Your Corporation. All Rights Reserved." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="2" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ <LanguageOptions name="JAVA">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="false" />
+ <option name="separateAfter" value="false" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="false" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="Copyright (c)
&#36;today.year, Your Corporation. All Rights Reserved." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="2" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ <LanguageOptions name="JSP">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="false" />
+ <option name="separateAfter" value="false" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="false" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="Copyright (c)
&#36;today.year, Your Corporation. All Rights Reserved." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="2" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ <LanguageOptions name="JavaScript">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="false" />
+ <option name="separateAfter" value="false" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="false" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="Copyright (c)
&#36;today.year, Your Corporation. All Rights Reserved." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="2" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ <LanguageOptions name="Properties">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="false" />
+ <option name="separateAfter" value="false" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="false" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="Copyright (c)
&#36;today.year, Your Corporation. All Rights Reserved." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="2" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ <LanguageOptions name="XML">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="false" />
+ <option name="separateAfter" value="false" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="false" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="Copyright (c)
&#36;today.year, Your Corporation. All Rights Reserved." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="2" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ </component>
+</module>
+
Added: modules/portlet/trunk/build/ide/intellij/idea60/readme.txt
===================================================================
--- modules/portlet/trunk/build/ide/intellij/idea60/readme.txt
(rev 0)
+++ modules/portlet/trunk/build/ide/intellij/idea60/readme.txt 2007-08-17 15:29:49 UTC
(rev 7981)
@@ -0,0 +1,10 @@
+- Main project file and modules:
+Copy jboss-portal.ipr to the root of the Portal source directory. You might need to
change the JDK to use but
+it should otherwise work out the box. Alternatively, you can create a new project file at
the root of your Portal
+installation and import the module files (*.iml) found in the modules directory
manually.
+
+- Codestyles and headers:
+The config directory contains standard settings for the JBoss Portal project regarding
headers and code style. If
+you intend to commit code to JBoss Portal, you need to update your IDEA installation to
use these files. Please
+refer to the IDEA manual on how to precisely do it, the short version being that you can
replace the files found
+in your IDEA preference directory by the ones found in the config directory.
Property changes on: modules/portlet/trunk/build/ide/intellij/idea60/readme.txt
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/build/licences/JBossEULA.txt
===================================================================
--- modules/portlet/trunk/build/licences/JBossEULA.txt (rev 0)
+++ modules/portlet/trunk/build/licences/JBossEULA.txt 2007-08-17 15:29:49 UTC (rev 7981)
@@ -0,0 +1,106 @@
+LICENSE AGREEMENT
+JBOSS(r)
+
+This License Agreement governs the use of the Software Packages and any updates to the
Software
+Packages, regardless of the delivery mechanism. Each Software Package is a collective
work
+under U.S. Copyright Law. Subject to the following terms, Red Hat, Inc. ("Red
Hat") grants to
+the user ("Client") a license to the applicable collective work(s) pursuant to
the
+GNU Lesser General Public License v. 2.1 except for the following Software Packages:
+(a) JBoss Portal Forums and JBoss Transactions JTS, each of which is licensed pursuant to
the
+GNU General Public License v.2;
+
+(b) JBoss Rules, which is licensed pursuant to the Apache License v.2.0;
+
+(c) an optional download for JBoss Cache for the Berkeley DB for Java database, which is
licensed under the
+(open source) Sleepycat License (if Client does not wish to use the open source version
of this database,
+it may purchase a license from Sleepycat Software);
+
+and (d) the BPEL extension for JBoss jBPM, which is licensed under the Common Public
License v.1,
+and, pursuant to the OASIS BPEL4WS standard, requires parties wishing to redistribute to
enter various
+royalty-free patent licenses.
+
+Each of the foregoing licenses is available at
http://www.opensource.org/licenses/index.php.
+
+1. The Software. "Software Packages" refer to the various software modules
that are created and made available
+for distribution by the
JBoss.org open source community at
http://www.jboss.org. Each
of the Software Packages
+may be comprised of hundreds of software components. The end user license agreement for
each component is located in
+the component's source code. With the exception of certain image files identified in
Section 2 below,
+the license terms for the components permit Client to copy, modify, and redistribute the
component,
+in both source code and binary code forms. This agreement does not limit Client's
rights under,
+or grant Client rights that supersede, the license terms of any particular component.
+
+2. Intellectual Property Rights. The Software Packages are owned by Red Hat and others
and are protected under copyright
+and other laws. Title to the Software Packages and any component, or to any copy,
modification, or merged portion shall
+remain with the aforementioned, subject to the applicable license. The "JBoss"
trademark, "Red Hat" trademark, the
+individual Software Package trademarks, and the "Shadowman" logo are registered
trademarks of Red Hat and its affiliates
+in the U.S. and other countries. This agreement permits Client to distribute unmodified
copies of the Software Packages
+using the Red Hat trademarks that Red Hat has inserted in the Software Packages on the
condition that Client follows Red Hat's
+trademark guidelines for those trademarks located at
http://www.redhat.com/about/corporate/trademark/. Client must abide by
+these trademark guidelines when distributing the Software Packages, regardless of whether
the Software Packages have been modified.
+If Client modifies the Software Packages, then Client must replace all Red Hat trademarks
and logos identified at
+http://www.jboss.com/company/logos, unless a separate agreement with Red Hat is executed
or other permission granted.
+Merely deleting the files containing the Red Hat trademarks may corrupt the Software
Packages.
+
+3. Limited Warranty. Except as specifically stated in this Paragraph 3 or a license for
a particular
+component, to the maximum extent permitted under applicable law, the Software Packages
and the
+components are provided and licensed "as is" without warranty of any kind,
expressed or implied,
+including the implied warranties of merchantability, non-infringement or fitness for a
particular purpose.
+Red Hat warrants that the media on which Software Packages may be furnished will be free
from defects in
+materials and manufacture under normal use for a period of 30 days from the date of
delivery to Client.
+Red Hat does not warrant that the functions contained in the Software Packages will meet
Client's requirements
+or that the operation of the Software Packages will be entirely error free or appear
precisely as described
+in the accompanying documentation. This warranty extends only to the party that purchases
the Services
+pertaining to the Software Packages from Red Hat or a Red Hat authorized distributor.
+
+4. Limitation of Remedies and Liability. To the maximum extent permitted by applicable
law, the remedies
+described below are accepted by Client as its only remedies. Red Hat's entire
liability, and Client's
+exclusive remedies, shall be: If the Software media is defective, Client may return it
within 30 days of
+delivery along with a copy of Client's payment receipt and Red Hat, at its option,
will replace it or
+refund the money paid by Client for the Software. To the maximum extent permitted by
applicable law,
+Red Hat or any Red Hat authorized dealer will not be liable to Client for any incidental
or consequential
+damages, including lost profits or lost savings arising out of the use or inability to
use the Software,
+even if Red Hat or such dealer has been advised of the possibility of such damages. In
no event shall
+Red Hat's liability under this agreement exceed the amount that Client paid to Red
Hat under this
+Agreement during the twelve months preceding the action.
+
+5. Export Control. As required by U.S. law, Client represents and warrants that it:
+(a) understands that the Software Packages are subject to export controls under the
+U.S. Commerce Department's Export Administration Regulations ("EAR");
+
+(b) is not located in a prohibited destination country under the EAR or U.S. sanctions
regulations
+(currently Cuba, Iran, Iraq, Libya, North Korea, Sudan and Syria);
+
+(c) will not export, re-export, or transfer the Software Packages to any prohibited
destination, entity,
+or individual without the necessary export license(s) or authorizations(s) from the U.S.
Government;
+
+(d) will not use or transfer the Software Packages for use in any sensitive nuclear,
chemical or
+biological weapons, or missile technology end-uses unless authorized by the U.S.
Government by
+regulation or specific license;
+
+(e) understands and agrees that if it is in the United States and exports or transfers
the Software
+Packages to eligible end users, it will, as required by EAR Section 740.17(e), submit
semi-annual
+reports to the Commerce Department's Bureau of Industry & Security (BIS), which
include the name and
+address (including country) of each transferee;
+
+and (f) understands that countries other than the United States may restrict the import,
use, or
+export of encryption products and that it shall be solely responsible for compliance with
any such
+import, use, or export restrictions.
+
+6. Third Party Programs. Red Hat may distribute third party software programs with the
Software Packages
+that are not part of the Software Packages and which Client must install separately.
These third party
+programs are subject to their own license terms. The license terms either accompany the
programs or
+can be viewed at
http://www.redhat.com/licenses/. If Client does not agree to abide by
the applicable
+license terms for such programs, then Client may not install them. If Client wishes to
install the programs
+on more than one system or transfer the programs to another party, then Client must
contact the licensor
+of the programs.
+
+7. General. If any provision of this agreement is held to be unenforceable, that shall
not affect the
+enforceability of the remaining provisions. This License Agreement shall be governed by
the laws of the
+State of North Carolina and of the United States, without regard to any conflict of laws
provisions,
+except that the United Nations Convention on the International Sale of Goods shall not
apply.
+
+Copyright 2006 Red Hat, Inc. All rights reserved.
+"JBoss" and the JBoss logo are registered trademarks of Red Hat, Inc.
+All other trademarks are the property of their respective owners.
+
+ Page 1 of 1 18 October 2006
Added: modules/portlet/trunk/federation/.classpath
===================================================================
--- modules/portlet/trunk/federation/.classpath (rev 0)
+++ modules/portlet/trunk/federation/.classpath 2007-08-17 15:29:49 UTC (rev 7981)
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src/main"/>
+ <classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="lib"
path="/thirdparty/sun-servlet/lib/jsp-api.jar"/>
+ <classpathentry kind="lib"
path="/thirdparty/sun-servlet/lib/servlet-api.jar"/>
+ <classpathentry kind="lib"
path="/thirdparty/apache-log4j/lib/log4j.jar"/>
+ <classpathentry kind="lib"
path="/thirdparty/junit/lib/junit.jar"/>
+ <classpathentry kind="lib"
path="/thirdparty/sun-jaf/lib/activation.jar"/>
+ <classpathentry kind="lib"
path="/thirdparty/dom4j/lib/dom4j.jar"/>
+ <classpathentry kind="lib"
path="/thirdparty/apache-httpclient/lib/commons-httpclient.jar"/>
+ <classpathentry kind="lib"
path="/thirdparty/jboss/microcontainer/lib/jboss-microcontainer.jar"/>
+ <classpathentry kind="lib"
path="/thirdparty/jboss/microcontainer/lib/jboss-dependency.jar"/>
+ <classpathentry kind="lib"
path="/thirdparty/oswego-concurrent/lib/concurrent.jar"/>
+ <classpathentry kind="lib"
path="/thirdparty/jboss/jbossxb/lib/jboss-xml-binding.jar"/>
+ <classpathentry kind="lib"
path="/thirdparty/jbossas/core-libs/lib/jboss.jar"/>
+ <classpathentry kind="lib"
path="/thirdparty/jbossas/core-libs/lib/jboss-common.jar"/>
+ <classpathentry kind="lib"
path="/thirdparty/jbossas/core-libs/lib/jboss-jmx.jar"/>
+ <classpathentry kind="lib"
path="/thirdparty/jbossas/core-libs/lib/jboss-system.jar"/>
+ <classpathentry kind="lib"
path="/thirdparty/jbossas/core-libs/lib/jmx-invoker-adaptor-client.jar"/>
+ <classpathentry combineaccessrules="false" kind="src"
path="/jems"/>
+ <classpathentry combineaccessrules="false" kind="src"
path="/portlet"/>
+ <classpathentry kind="lib"
path="/thirdparty/jboss-portal/modules/common/lib/portal-common-lib.jar"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Property changes on: modules/portlet/trunk/federation/.classpath
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/federation/.cvsignore
===================================================================
--- modules/portlet/trunk/federation/.cvsignore (rev 0)
+++ modules/portlet/trunk/federation/.cvsignore 2007-08-17 15:29:49 UTC (rev 7981)
@@ -0,0 +1,2 @@
+bin
+output
Property changes on: modules/portlet/trunk/federation/.cvsignore
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/federation/.project
===================================================================
--- modules/portlet/trunk/federation/.project (rev 0)
+++ modules/portlet/trunk/federation/.project 2007-08-17 15:29:49 UTC (rev 7981)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>portlet-federation</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Property changes on: modules/portlet/trunk/federation/.project
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/federation/build.bat
===================================================================
--- modules/portlet/trunk/federation/build.bat (rev 0)
+++ modules/portlet/trunk/federation/build.bat 2007-08-17 15:29:49 UTC (rev 7981)
@@ -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 3144 2006-07-18 20:33:50Z julien $
+
+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: modules/portlet/trunk/federation/build.bat
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/federation/build.sh
===================================================================
--- modules/portlet/trunk/federation/build.sh (rev 0)
+++ modules/portlet/trunk/federation/build.sh 2007-08-17 15:29:49 UTC (rev 7981)
@@ -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 3144 2006-07-18 20:33:50Z julien $
+
+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: modules/portlet/trunk/federation/build.sh
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/federation/build.xml
===================================================================
--- modules/portlet/trunk/federation/build.xml (rev 0)
+++ modules/portlet/trunk/federation/build.xml 2007-08-17 15:29:49 UTC (rev 7981)
@@ -0,0 +1,210 @@
+<?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 7975 2007-08-17 14:09:05Z 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="jboss.portal/modules/common.classpath"/>
+ <path refid="jboss.portal/modules/test.classpath"/>
+ <path refid="jboss.jbossxb.classpath"/>
+ <path refid="apache.log4j.classpath"/>
+ <path refid="junit.junit.classpath"/>
+ </path>
+
+ <!-- Configure modules -->
+ <call target="configure-modules"/>
+ <path id="dependentmodule.classpath">
+ <path refid="jboss.portal-portlet.classpath"/>
+ </path>
+
+ <!--+=======================================+-->
+ <!--| Override any default properties here. |-->
+ <!--+=======================================+-->
+
+ <!-- Configure defaults & build tools -->
+ <call target="configure-defaults"/>
+ <!--<call target="configure-tools"/>-->
+
+ <!--+=======================================+-->
+ <!--| 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">
+ <!-- Add module specific elements here. -->
+ </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}"/>
+
+ <!-- Federation lib jar -->
+ <jar jarfile="${build.lib}/portal-portlet-federation-lib.jar">
+ <fileset dir="${build.classes}">
+ <exclude name="org/jboss/portal/test/**"/>
+ </fileset>
+ </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"/>
+
+ <target name="package-tests" depends="init">
+ <jar
jarfile="${build.lib}/portal-portlet-federation-test-lib.jar">
+ <fileset dir="${build.classes}"
includes="org/jboss/portal/test/**"/>
+ </jar>
+ </target>
+
+ <target name="tests" depends="init,
_buildmagic:configure:deployment">
+ <execute-tests>
+ <x-test>
+ <test todir="${test.reports}"
+
name="org.jboss.portal.test.portlet.federation.OneInvokerNoPortletsTestCase"/>
+ <test todir="${test.reports}"
+
name="org.jboss.portal.test.portlet.federation.NoInvokersTestCase"/>
+ <test todir="${test.reports}"
+
name="org.jboss.portal.test.portlet.federation.FederatingPortletInvokerTestCase"/>
+ </x-test>
+ <x-classpath>
+ <pathelement
location="${build.lib}/portal-portlet-federation-lib.jar"/>
+ <pathelement
location="${build.lib}/portal-portlet-federation-test-lib.jar"/>
+ <path refid="library.classpath"/>
+ <path refid="dependentmodule.classpath"/>
+ </x-classpath>
+ </execute-tests>
+ </target>
+</project>
Property changes on: modules/portlet/trunk/federation/build.xml
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/federation/src/main/org/jboss/portal/portlet/federation/FederatedPortletInvoker.java
===================================================================
---
modules/portlet/trunk/federation/src/main/org/jboss/portal/portlet/federation/FederatedPortletInvoker.java
(rev 0)
+++
modules/portlet/trunk/federation/src/main/org/jboss/portal/portlet/federation/FederatedPortletInvoker.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -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.federation;
+
+import org.jboss.portal.portlet.PortletInvoker;
+
+/**
+ * Provide access to a federated invoker.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ * @since 2.4
+ */
+public interface FederatedPortletInvoker extends PortletInvoker
+{
+ /**
+ * Return the invoker id.
+ *
+ * @return the invoker id
+ */
+ String getId();
+
+ /**
+ * Return the underlying portlet invoker.
+ *
+ * @return the underlying portlet invoker
+ * @since 2.6
+ */
+ PortletInvoker getPortletInvoker();
+}
Property changes on:
modules/portlet/trunk/federation/src/main/org/jboss/portal/portlet/federation/FederatedPortletInvoker.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/federation/src/main/org/jboss/portal/portlet/federation/FederatingPortletInvoker.java
===================================================================
---
modules/portlet/trunk/federation/src/main/org/jboss/portal/portlet/federation/FederatingPortletInvoker.java
(rev 0)
+++
modules/portlet/trunk/federation/src/main/org/jboss/portal/portlet/federation/FederatingPortletInvoker.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,71 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.federation;
+
+import org.jboss.portal.portlet.PortletInvoker;
+
+import java.util.Collection;
+
+/**
+ * A portlet invoker that federates other invokers.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5687 $
+ * @since 2.4
+ */
+public interface FederatingPortletInvoker extends PortletInvoker
+{
+ /**
+ * Registers an invoker.
+ *
+ * @param federatedId the invoker id to register
+ * @param registeredInvoker the invoker to register
+ * @throws IllegalArgumentException if the invoker is null or already registered
+ */
+ FederatedPortletInvoker registerInvoker(String federatedId, PortletInvoker
registeredInvoker) throws IllegalArgumentException;
+
+ /**
+ * Return a portlet invoker registered or null if not found
+ *
+ * @param federatedId the id
+ * @return the invoker
+ * @throws IllegalArgumentException if the id is null
+ */
+ FederatedPortletInvoker getFederatedInvoker(String federatedId) throws
IllegalArgumentException;
+
+ /**
+ * Return the registered portlet invokers.
+ *
+ * @return a collection that contains the portlet invokers
+ */
+ Collection getFederatedInvokers();
+
+ /**
+ * Unregisters the invoker associated with the specified identifier.
+ *
+ * @param federatedId the identifier of the invoker to unregister
+ * @throws IllegalArgumentException if the identifier is null or no invoker is
registered with this identifier
+ * @since 2.6
+ */
+ void unregisterInvoker(String federatedId);
+}
Property changes on:
modules/portlet/trunk/federation/src/main/org/jboss/portal/portlet/federation/FederatingPortletInvoker.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/federation/src/main/org/jboss/portal/portlet/federation/impl/FederatedPortlet.java
===================================================================
---
modules/portlet/trunk/federation/src/main/org/jboss/portal/portlet/federation/impl/FederatedPortlet.java
(rev 0)
+++
modules/portlet/trunk/federation/src/main/org/jboss/portal/portlet/federation/impl/FederatedPortlet.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -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.federation.impl;
+
+import org.jboss.portal.portlet.Portlet;
+import org.jboss.portal.portlet.PortletContext;
+import org.jboss.portal.portlet.federation.FederatedPortletInvoker;
+import org.jboss.portal.portlet.info.PortletInfo;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public class FederatedPortlet implements Portlet
+{
+
+ /** . */
+ final PortletContext compoundContext;
+
+ /** . */
+ final Portlet portlet;
+
+ /** . */
+ final FederatedPortletInvoker invoker;
+
+ public FederatedPortlet(FederatedPortletInvoker invoker, PortletContext
compoundContext, Portlet portlet)
+ {
+ if (invoker == null)
+ {
+ throw new IllegalArgumentException("No null invoker accepted");
+ }
+ if (compoundContext == null)
+ {
+ throw new IllegalArgumentException("No null id accepted");
+ }
+ if (portlet == null)
+ {
+ throw new IllegalArgumentException("No null portlet accepted");
+ }
+ this.invoker = invoker;
+ this.compoundContext = compoundContext;
+ this.portlet = portlet;
+ }
+
+ public String getFederatedId()
+ {
+ return invoker.getId();
+ }
+
+ public PortletContext getContext()
+ {
+ return compoundContext;
+ }
+
+ public PortletInfo getInfo()
+ {
+ return portlet.getInfo();
+ }
+
+ public boolean isRemote()
+ {
+ return portlet.isRemote();
+ }
+
+ public String toString()
+ {
+ return "FederatedPortlet[context=" + compoundContext +
",portlet=" + portlet + "]";
+ }
+}
Property changes on:
modules/portlet/trunk/federation/src/main/org/jboss/portal/portlet/federation/impl/FederatedPortlet.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/federation/src/main/org/jboss/portal/portlet/federation/impl/FederatedPortletInvokerService.java
===================================================================
---
modules/portlet/trunk/federation/src/main/org/jboss/portal/portlet/federation/impl/FederatedPortletInvokerService.java
(rev 0)
+++
modules/portlet/trunk/federation/src/main/org/jboss/portal/portlet/federation/impl/FederatedPortletInvokerService.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,234 @@
+/******************************************************************************
+ * 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.federation.impl;
+
+import org.jboss.portal.common.invocation.InvocationException;
+import org.jboss.portal.portlet.federation.FederatedPortletInvoker;
+import org.jboss.portal.portlet.federation.FederatingPortletInvoker;
+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.StateEvent;
+import org.jboss.portal.portlet.invocation.PortletInvocation;
+import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
+import org.jboss.portal.portlet.spi.InstanceContext;
+import org.jboss.portal.portlet.state.AccessMode;
+import org.jboss.portal.portlet.state.DestroyCloneFailure;
+import org.jboss.portal.portlet.state.PropertyChange;
+import org.jboss.portal.portlet.state.PropertyMap;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5943 $
+ * @since 2.4
+ */
+public class FederatedPortletInvokerService implements FederatedPortletInvoker
+{
+
+ /** . */
+ private String id;
+
+ /** . */
+ private PortletInvoker portletInvoker;
+
+ /** . */
+ private FederatingPortletInvoker federatingPortletInvoker;
+
+ public FederatedPortletInvokerService(FederatingPortletInvoker
federatingPortletInvoker, String id, PortletInvoker portletInvoker)
+ {
+ this.id = id;
+ this.portletInvoker = portletInvoker;
+ this.federatingPortletInvoker = federatingPortletInvoker;
+ }
+
+ public PortletInvoker getPortletInvoker()
+ {
+ return portletInvoker;
+ }
+
+ public String getId()
+ {
+ return id;
+ }
+
+ public FederatingPortletInvoker getFederatingPortletInvoker()
+ {
+ return federatingPortletInvoker;
+ }
+
+ public Set getPortlets() throws PortletInvokerException
+ {
+ Set federatedPortlets = new LinkedHashSet();
+ for (Iterator i = portletInvoker.getPortlets().iterator(); i.hasNext();)
+ {
+ Portlet portlet = (Portlet)i.next();
+ Portlet federatedPortlet = new FederatedPortlet(this,
reference(portlet.getContext()), portlet);
+ federatedPortlets.add(federatedPortlet);
+ }
+ return federatedPortlets;
+ }
+
+ public Portlet getPortlet(PortletContext compoundPortletContext) throws
IllegalArgumentException, PortletInvokerException
+ {
+ // Get portlet context
+ PortletContext portletContext = dereference(compoundPortletContext);
+
+ // Retrieve wrapped portlet
+ Portlet portlet = portletInvoker.getPortlet(portletContext);
+
+ // Return correct result
+ return new FederatedPortlet(this, compoundPortletContext, portlet);
+ }
+
+ private class FederatedInstanceContext implements InstanceContext
+ {
+
+ /** . */
+ private InstanceContext ctx;
+
+ public FederatedInstanceContext(InstanceContext ctx)
+ {
+ this.ctx = ctx;
+ }
+
+ public String getId()
+ {
+ return ctx.getId();
+ }
+
+ public AccessMode getAccessMode()
+ {
+ return ctx.getAccessMode();
+ }
+
+ public void onStateEvent(StateEvent event)
+ {
+ ctx.onStateEvent(new StateEvent(reference(event.getPortletContext()),
event.getType()));
+ }
+ }
+
+ public PortletInvocationResponse invoke(PortletInvocation invocation) throws
InvocationException, PortletInvokerException
+ {
+ PortletContext compoundPortletContext = invocation.getTarget();
+ PortletContext portletContext = dereference(compoundPortletContext);
+ InstanceContext instanceContext = invocation.getInstanceContext();
+ try
+ {
+ invocation.setTarget(portletContext);
+ invocation.setInstanceContext(new FederatedInstanceContext(instanceContext));
+ return portletInvoker.invoke(invocation);
+ }
+ finally
+ {
+ invocation.setTarget(compoundPortletContext);
+ invocation.setInstanceContext(instanceContext);
+ }
+ }
+
+ public PortletContext createClone(PortletContext compoundPortletContext) throws
PortletInvokerException
+ {
+ PortletContext portletContext = dereference(compoundPortletContext);
+ PortletContext cloneContext = portletInvoker.createClone(portletContext);
+ return reference(cloneContext);
+ }
+
+ public List destroyClones(List portletContexts) throws IllegalArgumentException,
PortletInvokerException, UnsupportedOperationException
+ {
+ if (portletContexts == null)
+ {
+ throw new IllegalArgumentException("Null portlet id list not
accepted");
+ }
+ if (portletContexts.size() == 0)
+ {
+ return Collections.EMPTY_LIST;
+ }
+
+ //
+ List dereferencedList = new ArrayList(portletContexts);
+ for (int i = 0; i < dereferencedList.size(); i++)
+ {
+ PortletContext compoundPortletContext =
(PortletContext)dereferencedList.get(i);
+ PortletContext portletContext = dereference(compoundPortletContext);
+ dereferencedList.set(i, portletContext);
+ }
+
+ //
+ List failures = portletInvoker.destroyClones(dereferencedList);
+ for (int i = 0; i < failures.size(); i++)
+ {
+ DestroyCloneFailure failure = (DestroyCloneFailure)failures.get(i);
+ String cloneId = failure.getPortletId();
+ failure = new DestroyCloneFailure(reference(cloneId));
+ failures.set(i, failure);
+ }
+
+ //
+ return failures;
+ }
+
+ public PropertyMap getProperties(PortletContext compoundPortletContext) throws
PortletInvokerException
+ {
+ PortletContext portletId = dereference(compoundPortletContext);
+ return portletInvoker.getProperties(portletId);
+ }
+
+ public PropertyMap getProperties(PortletContext compoundPortletContext, Set keys)
throws IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
+ {
+ PortletContext portletId = dereference(compoundPortletContext);
+ return portletInvoker.getProperties(portletId, keys);
+ }
+
+ public PortletContext setProperties(PortletContext compoundPortletContext,
PropertyChange[] changes) throws IllegalArgumentException, PortletInvokerException,
UnsupportedOperationException
+ {
+ PortletContext portletContext = dereference(compoundPortletContext);
+ portletContext = portletInvoker.setProperties(portletContext, changes);
+ return reference(portletContext);
+ }
+
+
+ private PortletContext dereference(PortletContext compoundPortletContext)
+ {
+ String portletId = compoundPortletContext.getId().substring(id.length() + 1);
+ return PortletContext.createPortletContext(portletId,
compoundPortletContext.getState());
+ }
+
+ private PortletContext reference(PortletContext portletContext)
+ {
+ String compoundPortletId = reference(portletContext.getId());
+ return PortletContext.createPortletContext(compoundPortletId,
portletContext.getState());
+ }
+
+ private String reference(String portletId)
+ {
+ return id + FederatingPortletInvokerService.SEPARATOR + portletId;
+ }
+}
+
\ No newline at end of file
Property changes on:
modules/portlet/trunk/federation/src/main/org/jboss/portal/portlet/federation/impl/FederatedPortletInvokerService.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/federation/src/main/org/jboss/portal/portlet/federation/impl/FederatingPortletInvokerService.java
===================================================================
---
modules/portlet/trunk/federation/src/main/org/jboss/portal/portlet/federation/impl/FederatingPortletInvokerService.java
(rev 0)
+++
modules/portlet/trunk/federation/src/main/org/jboss/portal/portlet/federation/impl/FederatingPortletInvokerService.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,245 @@
+/******************************************************************************
+ * 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.federation.impl;
+
+import org.jboss.portal.portlet.InvokerUnavailableException;
+import org.jboss.portal.portlet.NoSuchPortletException;
+import org.jboss.portal.portlet.Portlet;
+import org.jboss.portal.portlet.PortletContext;
+import org.jboss.portal.portlet.PortletInvokerException;
+import org.jboss.portal.portlet.PortletInvoker;
+import org.jboss.portal.portlet.federation.FederatedPortletInvoker;
+import org.jboss.portal.portlet.federation.FederatingPortletInvoker;
+import org.jboss.portal.portlet.invocation.PortletInvocation;
+import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
+import org.jboss.portal.portlet.state.PropertyChange;
+import org.jboss.portal.portlet.state.PropertyMap;
+import org.apache.log4j.Logger;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
+ * @version $Revision: 5918 $
+ * @since 2.4
+ */
+public class FederatingPortletInvokerService implements FederatingPortletInvoker
+{
+
+ /** . */
+ private static final Logger log =
Logger.getLogger(FederatingPortletInvokerService.class);
+
+ /** The separator used in the id to route to the correct invoker. */
+ static final String SEPARATOR = ".";
+
+ /** The registred FederatedPortletInvokers. */
+ private volatile Map registry = new HashMap();
+
+ public synchronized FederatedPortletInvoker registerInvoker(String federatedId,
PortletInvoker federatedInvoker)
+ {
+ if (federatedId == null)
+ {
+ throw new IllegalArgumentException("No null id");
+ }
+ if (federatedInvoker == null)
+ {
+ throw new IllegalArgumentException("No null invoker");
+ }
+ if (registry.containsKey(federatedId))
+ {
+ throw new IllegalArgumentException("Attempting dual registration of "
+ federatedId);
+ }
+ Map copy = new HashMap(registry);
+ FederatedPortletInvokerService invoker = new FederatedPortletInvokerService(this,
federatedId, federatedInvoker);
+ copy.put(federatedId, invoker);
+ registry = copy;
+ return invoker;
+ }
+
+ public synchronized void unregisterInvoker(String federatedId)
+ {
+ if (federatedId == null)
+ {
+ throw new IllegalArgumentException("No null id accepted");
+ }
+ if (!registry.containsKey(federatedId))
+ {
+ throw new IllegalArgumentException("Attempting to unregister unknown
invoker " + federatedId);
+ }
+ Map copy = new HashMap(registry);
+ copy.remove(federatedId);
+ registry = copy;
+ }
+
+ public FederatedPortletInvoker getFederatedInvoker(String federatedId) throws
IllegalArgumentException
+ {
+ if (federatedId == null)
+ {
+ throw new IllegalArgumentException("No null id provided");
+ }
+ return (FederatedPortletInvoker)registry.get(federatedId);
+ }
+
+ public Collection getFederatedInvokers()
+ {
+ return registry.values();
+ }
+
+ // PortletInvoker implementation
************************************************************************************
+
+ public Set getPortlets() throws PortletInvokerException
+ {
+ LinkedHashSet portlets = new LinkedHashSet();
+ for (Iterator iterator = registry.values().iterator(); iterator.hasNext();)
+ {
+ FederatedPortletInvoker federated = (FederatedPortletInvoker)iterator.next();
+ try
+ {
+ Set offeredPortlets = federated.getPortlets();
+ portlets.addAll(offeredPortlets);
+ }
+ catch (InvokerUnavailableException e)
+ {
+ Throwable cause = e.getCause();
+ log.debug(e.fillInStackTrace());
+ log.warn("PortletInvoker with id: " + federated.getId() + " is
not available.\nReason: " + e.getMessage()
+ + "\nCaused by:\n" + (cause == null ? e : cause));
+ }
+ }
+ return portlets;
+ }
+
+ public Portlet getPortlet(PortletContext compoundPortletContext) throws
IllegalArgumentException, PortletInvokerException
+ {
+ FederatedPortletInvoker federated =
getFederatedPortletInvokerFor(compoundPortletContext);
+ return federated.getPortlet(compoundPortletContext);
+ }
+
+ public PortletInvocationResponse invoke(PortletInvocation invocation) throws
PortletInvokerException
+ {
+ PortletContext compoundPortletContext = invocation.getTarget();
+ FederatedPortletInvoker federated =
getFederatedPortletInvokerFor(compoundPortletContext);
+ return federated.invoke(invocation);
+ }
+
+ public PortletContext createClone(PortletContext compoundPortletContext) throws
PortletInvokerException
+ {
+ FederatedPortletInvoker federated =
getFederatedPortletInvokerFor(compoundPortletContext);
+ return federated.createClone(compoundPortletContext);
+ }
+
+ public List destroyClones(List portletContexts) throws IllegalArgumentException,
PortletInvokerException, UnsupportedOperationException
+ {
+ if (portletContexts == null)
+ {
+ throw new IllegalArgumentException("No null list accepted");
+ }
+ if (portletContexts.size() == 0)
+ {
+ return Collections.EMPTY_LIST;
+ }
+
+ // Get the invoker and check that we address only one invoker (for now)
+ FederatedPortletInvoker invoker = null;
+ for (int i = 0; i < portletContexts.size(); i++)
+ {
+ PortletContext compoundPortletId = (PortletContext)portletContexts.get(i);
+ FederatedPortletInvoker federated =
getFederatedPortletInvokerFor(compoundPortletId);
+ if (invoker == null)
+ {
+ invoker = federated;
+ }
+ else if (invoker.equals(federated) == false)
+ {
+ throw new PortletInvokerException("Cannot destroy portlet lists that
requires more than one federated invoker");
+ }
+ }
+
+ //
+ return invoker.destroyClones(portletContexts);
+ }
+
+ public PropertyMap getProperties(PortletContext compoundPortletContext, Set keys)
throws PortletInvokerException
+ {
+ FederatedPortletInvoker federated =
getFederatedPortletInvokerFor(compoundPortletContext);
+ return federated.getProperties(compoundPortletContext, keys);
+ }
+
+ public PropertyMap getProperties(PortletContext compoundPortletContext) throws
PortletInvokerException
+ {
+ FederatedPortletInvoker federated =
getFederatedPortletInvokerFor(compoundPortletContext);
+ return federated.getProperties(compoundPortletContext);
+ }
+
+ public PortletContext setProperties(PortletContext compoundPortletContext,
PropertyChange[] changes) throws IllegalArgumentException, PortletInvokerException,
UnsupportedOperationException
+ {
+ FederatedPortletInvoker federated =
getFederatedPortletInvokerFor(compoundPortletContext);
+ return federated.setProperties(compoundPortletContext, changes);
+ }
+
+ // Support methods
**************************************************************************************************
+
+ /**
+ * Retrieves the portlet invoker associated with the specified compound portlet id or
null if it is not found.
+ *
+ * @param compoundPortletContext the portlet context for which the invoker is to be
retrieved
+ * @return the portlet invoker associated with the specified compound portlet id
+ * @throws IllegalArgumentException if the compound portlet id is not well formed or
null
+ */
+ private FederatedPortletInvoker getFederatedPortletInvokerFor(PortletContext
compoundPortletContext) throws IllegalArgumentException, NoSuchPortletException
+ {
+ if (compoundPortletContext == null)
+ {
+ throw new IllegalArgumentException("No null portlet id accepted");
+ }
+
+ //
+ String compoundPortletId = compoundPortletContext.getId();
+
+ //
+ int pos = compoundPortletId.indexOf(SEPARATOR);
+ if (pos == -1)
+ {
+ throw new IllegalArgumentException("Bad portlet id format " +
compoundPortletId);
+ }
+
+ //
+ String invokerId = compoundPortletId.substring(0, pos);
+ FederatedPortletInvoker federated =
(FederatedPortletInvoker)registry.get(invokerId);
+ if (federated == null)
+ {
+ throw new NoSuchPortletException(compoundPortletId);
+ }
+
+ //
+ return federated;
+ }
+}
Property changes on:
modules/portlet/trunk/federation/src/main/org/jboss/portal/portlet/federation/impl/FederatingPortletInvokerService.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/federation/src/main/org/jboss/portal/portlet/federation/impl/PortletInvokerRegistrationService.java
===================================================================
---
modules/portlet/trunk/federation/src/main/org/jboss/portal/portlet/federation/impl/PortletInvokerRegistrationService.java
(rev 0)
+++
modules/portlet/trunk/federation/src/main/org/jboss/portal/portlet/federation/impl/PortletInvokerRegistrationService.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,86 @@
+/******************************************************************************
+ * 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.federation.impl;
+
+import org.jboss.portal.portlet.federation.FederatingPortletInvoker;
+import org.jboss.portal.portlet.PortletInvoker;
+
+/**
+ * Register any portlet invoker into a federating portlet invoker.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ * @since 2.4
+ */
+public class PortletInvokerRegistrationService
+{
+
+ /** The registration id. */
+ private String id;
+
+ /** The portlet invoker to register. */
+ private PortletInvoker portletInvoker;
+
+ /** The federating portlet invoker. */
+ private FederatingPortletInvoker federatingPortletInvoker;
+
+ public String getId()
+ {
+ return id;
+ }
+
+ public void setId(String id)
+ {
+ this.id = id;
+ }
+
+ public PortletInvoker getPortletInvoker()
+ {
+ return portletInvoker;
+ }
+
+ public void setPortletInvoker(PortletInvoker portletInvoker)
+ {
+ this.portletInvoker = portletInvoker;
+ }
+
+ public FederatingPortletInvoker getFederatingPortletInvoker()
+ {
+ return federatingPortletInvoker;
+ }
+
+ public void setFederatingPortletInvoker(FederatingPortletInvoker
federatingPortletInvoker)
+ {
+ this.federatingPortletInvoker = federatingPortletInvoker;
+ }
+
+ protected void startService() throws Exception
+ {
+ federatingPortletInvoker.registerInvoker(id, portletInvoker);
+ }
+
+ protected void stopService() throws Exception
+ {
+ federatingPortletInvoker.unregisterInvoker(id);
+ }
+}
Property changes on:
modules/portlet/trunk/federation/src/main/org/jboss/portal/portlet/federation/impl/PortletInvokerRegistrationService.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/federation/src/main/org/jboss/portal/test/portlet/federation/FederatingPortletInvokerTestCase.java
===================================================================
---
modules/portlet/trunk/federation/src/main/org/jboss/portal/test/portlet/federation/FederatingPortletInvokerTestCase.java
(rev 0)
+++
modules/portlet/trunk/federation/src/main/org/jboss/portal/test/portlet/federation/FederatingPortletInvokerTestCase.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,132 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.portlet.federation;
+
+import junit.framework.TestCase;
+import org.jboss.portal.portlet.federation.FederatedPortletInvoker;
+import org.jboss.portal.portlet.federation.FederatingPortletInvoker;
+import org.jboss.portal.portlet.federation.impl.FederatingPortletInvokerService;
+import org.jboss.portal.portlet.test.support.PortletInvokerSupport;
+import org.jboss.portal.portlet.test.support.PortletSupport;
+import org.jboss.portal.portlet.PortletInvokerException;
+import org.jboss.portal.portlet.Portlet;
+import org.jboss.portal.portlet.PortletContext;
+import org.jboss.portal.portlet.info.PortletInfo;
+import org.jboss.portal.portlet.info.MetaInfo;
+import org.jboss.portal.portlet.support.info.PortletInfoSupport;
+import org.jboss.portal.common.i18n.LocalizedString;
+
+import java.util.Collection;
+import java.util.Set;
+import java.util.Locale;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class FederatingPortletInvokerTestCase extends TestCase
+{
+
+ /** . */
+ private FederatingPortletInvoker federatingInvoker;
+
+ /** . */
+ private PortletInvokerSupport federatedInvoker;
+
+ /** . */
+ private PortletSupport federatedPortlet;
+
+ /** . */
+ private Portlet portlet;
+
+ /** . */
+ private PortletContext portletContext;
+
+ protected void setUp() throws Exception
+ {
+ federatingInvoker = new FederatingPortletInvokerService();
+ federatedInvoker = new PortletInvokerSupport();
+ federatedPortlet = new PortletSupport();
+
+ // Configure
+ PortletInfoSupport fooInfo = federatedPortlet.getInfoSupport();
+ fooInfo.getMetaSupport().setDisplayName("FooPortlet");
+
+ // Wire
+ federatedInvoker.addInternalPortlet("MyPortlet", federatedPortlet);
+ federatingInvoker.registerInvoker("foo", federatedInvoker);
+
+ // Basic setup
+ Set portlets = federatingInvoker.getPortlets();
+ assertNotNull(portlets);
+ assertEquals(1, portlets.size());
+ portlet = (Portlet)portlets.iterator().next();
+ assertNotNull(portlet);
+ portletContext = portlet.getContext();
+ assertNotNull(portletContext);
+ }
+
+
+ protected void tearDown() throws Exception
+ {
+ federatedPortlet = null;
+ federatedInvoker = null;
+ federatingInvoker = null;
+ portlet = null;
+ portletContext = null;
+ }
+
+ public void testFederation() throws PortletInvokerException
+ {
+ Collection federateds = federatingInvoker.getFederatedInvokers();
+ assertNotNull(federateds);
+ assertEquals(1, federateds.size());
+ FederatedPortletInvoker federated =
(FederatedPortletInvoker)federateds.iterator().next();
+ assertNotNull(federated);
+ assertEquals("foo", federated.getId());
+ assertEquals(federatedInvoker, federated.getPortletInvoker());
+ }
+
+ public void testInfo() throws PortletInvokerException
+ {
+ PortletInfo info = portlet.getInfo();
+ assertNotNull(info);
+ MetaInfo metaInfo = info.getMeta();
+ assertNotNull(metaInfo);
+ LocalizedString description = metaInfo.getMetaValue(MetaInfo.DISPLAY_NAME);
+ assertNotNull(description);
+ assertEquals(Locale.ENGLISH, description.getDefaultLocale());
+ assertEquals("FooPortlet", description.getDefaultString());
+ }
+
+ public void testGetPortlet() throws PortletInvokerException
+ {
+ Portlet samePortlet = federatingInvoker.getPortlet(portletContext);
+ assertNotNull(samePortlet);
+ assertEquals(samePortlet.getContext(), portletContext);
+ }
+
+ public void testInvoke() throws PortletInvokerException
+ {
+ }
+}
Added:
modules/portlet/trunk/federation/src/main/org/jboss/portal/test/portlet/federation/NoInvokersTestCase.java
===================================================================
---
modules/portlet/trunk/federation/src/main/org/jboss/portal/test/portlet/federation/NoInvokersTestCase.java
(rev 0)
+++
modules/portlet/trunk/federation/src/main/org/jboss/portal/test/portlet/federation/NoInvokersTestCase.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,49 @@
+/******************************************************************************
+ * 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.federation;
+
+import junit.framework.TestCase;
+import org.jboss.portal.portlet.PortletInvokerException;
+import org.jboss.portal.portlet.federation.FederatingPortletInvoker;
+import org.jboss.portal.portlet.federation.impl.FederatingPortletInvokerService;
+
+import java.util.HashSet;
+import java.util.ArrayList;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class NoInvokersTestCase extends TestCase
+{
+ public void testNoFederated() throws PortletInvokerException
+ {
+ FederatingPortletInvoker federating = new FederatingPortletInvokerService();
+
+ //
+ assertEquals(new HashSet(), federating.getPortlets());
+
+ //
+ assertEquals(new ArrayList(), new ArrayList(federating.getFederatedInvokers()));
+ }
+}
Added:
modules/portlet/trunk/federation/src/main/org/jboss/portal/test/portlet/federation/OneInvokerNoPortletsTestCase.java
===================================================================
---
modules/portlet/trunk/federation/src/main/org/jboss/portal/test/portlet/federation/OneInvokerNoPortletsTestCase.java
(rev 0)
+++
modules/portlet/trunk/federation/src/main/org/jboss/portal/test/portlet/federation/OneInvokerNoPortletsTestCase.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,59 @@
+/******************************************************************************
+ * 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.federation;
+
+import junit.framework.TestCase;
+import org.jboss.portal.portlet.PortletInvokerException;
+import org.jboss.portal.portlet.test.support.PortletInvokerSupport;
+import org.jboss.portal.portlet.federation.FederatingPortletInvoker;
+import org.jboss.portal.portlet.federation.FederatedPortletInvoker;
+import org.jboss.portal.portlet.federation.impl.FederatingPortletInvokerService;
+
+import java.util.HashSet;
+import java.util.Collection;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class OneInvokerNoPortletsTestCase extends TestCase
+{
+
+ public void testOneFederatedWithNoPortlets() throws PortletInvokerException
+ {
+ FederatingPortletInvoker federating = new FederatingPortletInvokerService();
+ PortletInvokerSupport support = new PortletInvokerSupport();
+ federating.registerInvoker("foo", support);
+
+ //
+ assertEquals(new HashSet(), federating.getPortlets());
+
+ //
+ Collection federateds = federating.getFederatedInvokers();
+ assertNotNull(federateds);
+ assertEquals(1, federateds.size());
+ FederatedPortletInvoker federated =
(FederatedPortletInvoker)federateds.iterator().next();
+ assertEquals("foo", federated.getId());
+ assertEquals(support, federated.getPortletInvoker());
+ }
+}
Added: modules/portlet/trunk/jboss-portal-portlet.ipr
===================================================================
--- modules/portlet/trunk/jboss-portal-portlet.ipr (rev 0)
+++ modules/portlet/trunk/jboss-portal-portlet.ipr 2007-08-17 15:29:49 UTC (rev 7981)
@@ -0,0 +1,466 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4" relativePaths="false">
+ <component name="AntConfiguration">
+ <defaultAnt bundledAnt="true" />
+ </component>
+ <component name="BuildJarProjectSettings">
+ <option name="BUILD_JARS_ON_MAKE" value="false" />
+ </component>
+ <component name="CodeStyleProjectProfileManger">
+ <option name="PROJECT_PROFILE" />
+ <option name="USE_PROJECT_LEVEL_SETTINGS" value="false" />
+ </component>
+ <component name="CodeStyleSettingsManager">
+ <option name="PER_PROJECT_SETTINGS" />
+ <option name="USE_PER_PROJECT_SETTINGS" value="false" />
+ </component>
+ <component name="CompilerConfiguration">
+ <option name="DEFAULT_COMPILER" value="Javac" />
+ <option name="DEPLOY_AFTER_MAKE" value="0" />
+ <resourceExtensions>
+ <entry name=".+\.(properties|xml|html|dtd|tld)" />
+ <entry name=".+\.(gif|png|jpeg|jpg)" />
+ </resourceExtensions>
+ <wildcardResourcePatterns>
+ <entry name="?*.properties" />
+ <entry name="?*.xml" />
+ <entry name="?*.gif" />
+ <entry name="?*.png" />
+ <entry name="?*.jpeg" />
+ <entry name="?*.jpg" />
+ <entry name="?*.html" />
+ <entry name="?*.dtd" />
+ <entry name="?*.tld" />
+ </wildcardResourcePatterns>
+ </component>
+ <component name="DataSourceManagerImpl" />
+ <component name="DependenciesAnalyzeManager">
+ <option name="myForwardDirection" value="false" />
+ </component>
+ <component name="DependencyValidationManager" />
+ <component name="EclipseCompilerSettings">
+ <option name="DEBUGGING_INFO" value="true" />
+ <option name="GENERATE_NO_WARNINGS" value="true" />
+ <option name="DEPRECATION" value="false" />
+ <option name="ADDITIONAL_OPTIONS_STRING" value="" />
+ <option name="MAXIMUM_HEAP_SIZE" value="128" />
+ </component>
+ <component name="EclipseEmbeddedCompilerSettings">
+ <option name="DEBUGGING_INFO" value="true" />
+ <option name="GENERATE_NO_WARNINGS" value="true" />
+ <option name="DEPRECATION" value="false" />
+ <option name="ADDITIONAL_OPTIONS_STRING" value="" />
+ <option name="MAXIMUM_HEAP_SIZE" value="128" />
+ </component>
+ <component name="EntryPointsManager">
+ <entry_points />
+ </component>
+ <component name="ExportToHTMLSettings">
+ <option name="PRINT_LINE_NUMBERS" value="false" />
+ <option name="OPEN_IN_BROWSER" value="false" />
+ <option name="OUTPUT_DIRECTORY" />
+ </component>
+ <component name="GUI Designer component loader factory" />
+ <component name="IdProvider"
IDEtalkID="E2A438D8B6AE84F43587A2210E562521" />
+ <component name="InspectionProjectProfileManager">
+ <option name="PROJECT_PROFILE" value="Project Default" />
+ <option name="USE_PROJECT_LEVEL_SETTINGS" value="false" />
+ <scopes />
+ <profiles>
+ <profile version="1.0" is_locked="false">
+ <option name="myName" value="Project Default" />
+ <option name="myLocal" value="false" />
+ <used_levels>
+ <error>
+ <option name="myName" value="ERROR" />
+ <option name="myVal" value="200" />
+ </error>
+ <warning>
+ <option name="myName" value="WARNING" />
+ <option name="myVal" value="100" />
+ </warning>
+ <information>
+ <option name="myName" value="INFO" />
+ <option name="myVal" value="100" />
+ </information>
+ <server>
+ <option name="myName" value="SERVER PROBLEM" />
+ <option name="myVal" value="100" />
+ </server>
+ </used_levels>
+ </profile>
+ </profiles>
+ </component>
+ <component name="JavacSettings">
+ <option name="DEBUGGING_INFO" value="true" />
+ <option name="GENERATE_NO_WARNINGS" value="false" />
+ <option name="DEPRECATION" value="true" />
+ <option name="ADDITIONAL_OPTIONS_STRING" value="" />
+ <option name="MAXIMUM_HEAP_SIZE" value="128" />
+ </component>
+ <component name="JavadocGenerationManager">
+ <option name="OUTPUT_DIRECTORY" />
+ <option name="OPTION_SCOPE" value="protected" />
+ <option name="OPTION_HIERARCHY" value="true" />
+ <option name="OPTION_NAVIGATOR" value="true" />
+ <option name="OPTION_INDEX" value="true" />
+ <option name="OPTION_SEPARATE_INDEX" value="true" />
+ <option name="OPTION_DOCUMENT_TAG_USE" value="false" />
+ <option name="OPTION_DOCUMENT_TAG_AUTHOR" value="false" />
+ <option name="OPTION_DOCUMENT_TAG_VERSION" value="false"
/>
+ <option name="OPTION_DOCUMENT_TAG_DEPRECATED" value="true"
/>
+ <option name="OPTION_DEPRECATED_LIST" value="true" />
+ <option name="OTHER_OPTIONS" value="" />
+ <option name="HEAP_SIZE" />
+ <option name="LOCALE" />
+ <option name="OPEN_IN_BROWSER" value="true" />
+ </component>
+ <component name="JikesSettings">
+ <option name="JIKES_PATH" value="" />
+ <option name="DEBUGGING_INFO" value="true" />
+ <option name="DEPRECATION" value="true" />
+ <option name="GENERATE_NO_WARNINGS" value="false" />
+ <option name="IS_EMACS_ERRORS_MODE" value="true" />
+ <option name="ADDITIONAL_OPTIONS_STRING" value="" />
+ </component>
+ <component name="LogConsolePreferences">
+ <option name="FILTER_ERRORS" value="false" />
+ <option name="FILTER_WARNINGS" value="false" />
+ <option name="FILTER_INFO" value="true" />
+ <option name="CUSTOM_FILTER" />
+ </component>
+ <component name="Palette2">
+ <group name="Swing">
+ <item class="com.intellij.uiDesigner.HSpacer"
tooltip-text="Horizontal Spacer"
icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false"
auto-create-binding="false" can-attach-label="false">
+ <default-constraints vsize-policy="1" hsize-policy="6"
anchor="0" fill="1" />
+ </item>
+ <item class="com.intellij.uiDesigner.VSpacer"
tooltip-text="Vertical Spacer"
icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false"
auto-create-binding="false" can-attach-label="false">
+ <default-constraints vsize-policy="6" hsize-policy="1"
anchor="0" fill="2" />
+ </item>
+ <item class="javax.swing.JPanel"
icon="/com/intellij/uiDesigner/icons/panel.png" removable="false"
auto-create-binding="false" can-attach-label="false">
+ <default-constraints vsize-policy="3" hsize-policy="3"
anchor="0" fill="3" />
+ </item>
+ <item class="javax.swing.JScrollPane"
icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false"
auto-create-binding="false" can-attach-label="true">
+ <default-constraints vsize-policy="7" hsize-policy="7"
anchor="0" fill="3" />
+ </item>
+ <item class="javax.swing.JButton"
icon="/com/intellij/uiDesigner/icons/button.png" removable="false"
auto-create-binding="true" can-attach-label="false">
+ <default-constraints vsize-policy="0" hsize-policy="3"
anchor="0" fill="1" />
+ <initial-values>
+ <property name="text" value="Button" />
+ </initial-values>
+ </item>
+ <item class="javax.swing.JRadioButton"
icon="/com/intellij/uiDesigner/icons/radioButton.png"
removable="false" auto-create-binding="true"
can-attach-label="false">
+ <default-constraints vsize-policy="0" hsize-policy="3"
anchor="8" fill="0" />
+ <initial-values>
+ <property name="text" value="RadioButton" />
+ </initial-values>
+ </item>
+ <item class="javax.swing.JCheckBox"
icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false"
auto-create-binding="true" can-attach-label="false">
+ <default-constraints vsize-policy="0" hsize-policy="3"
anchor="8" fill="0" />
+ <initial-values>
+ <property name="text" value="CheckBox" />
+ </initial-values>
+ </item>
+ <item class="javax.swing.JLabel"
icon="/com/intellij/uiDesigner/icons/label.png" removable="false"
auto-create-binding="false" can-attach-label="false">
+ <default-constraints vsize-policy="0" hsize-policy="0"
anchor="8" fill="0" />
+ <initial-values>
+ <property name="text" value="Label" />
+ </initial-values>
+ </item>
+ <item class="javax.swing.JTextField"
icon="/com/intellij/uiDesigner/icons/textField.png" removable="false"
auto-create-binding="true" can-attach-label="true">
+ <default-constraints vsize-policy="0" hsize-policy="6"
anchor="8" fill="1">
+ <preferred-size width="150" height="-1" />
+ </default-constraints>
+ </item>
+ <item class="javax.swing.JPasswordField"
icon="/com/intellij/uiDesigner/icons/passwordField.png"
removable="false" auto-create-binding="true"
can-attach-label="true">
+ <default-constraints vsize-policy="0" hsize-policy="6"
anchor="8" fill="1">
+ <preferred-size width="150" height="-1" />
+ </default-constraints>
+ </item>
+ <item class="javax.swing.JFormattedTextField"
icon="/com/intellij/uiDesigner/icons/formattedTextField.png"
removable="false" auto-create-binding="true"
can-attach-label="true">
+ <default-constraints vsize-policy="0" hsize-policy="6"
anchor="8" fill="1">
+ <preferred-size width="150" height="-1" />
+ </default-constraints>
+ </item>
+ <item class="javax.swing.JTextArea"
icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false"
auto-create-binding="true" can-attach-label="true">
+ <default-constraints vsize-policy="6" hsize-policy="6"
anchor="0" fill="3">
+ <preferred-size width="150" height="50" />
+ </default-constraints>
+ </item>
+ <item class="javax.swing.JTextPane"
icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false"
auto-create-binding="true" can-attach-label="true">
+ <default-constraints vsize-policy="6" hsize-policy="6"
anchor="0" fill="3">
+ <preferred-size width="150" height="50" />
+ </default-constraints>
+ </item>
+ <item class="javax.swing.JEditorPane"
icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false"
auto-create-binding="true" can-attach-label="true">
+ <default-constraints vsize-policy="6" hsize-policy="6"
anchor="0" fill="3">
+ <preferred-size width="150" height="50" />
+ </default-constraints>
+ </item>
+ <item class="javax.swing.JComboBox"
icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false"
auto-create-binding="true" can-attach-label="true">
+ <default-constraints vsize-policy="0" hsize-policy="2"
anchor="8" fill="1" />
+ </item>
+ <item class="javax.swing.JTable"
icon="/com/intellij/uiDesigner/icons/table.png" removable="false"
auto-create-binding="true" can-attach-label="false">
+ <default-constraints vsize-policy="6" hsize-policy="6"
anchor="0" fill="3">
+ <preferred-size width="150" height="50" />
+ </default-constraints>
+ </item>
+ <item class="javax.swing.JList"
icon="/com/intellij/uiDesigner/icons/list.png" removable="false"
auto-create-binding="true" can-attach-label="false">
+ <default-constraints vsize-policy="6" hsize-policy="2"
anchor="0" fill="3">
+ <preferred-size width="150" height="50" />
+ </default-constraints>
+ </item>
+ <item class="javax.swing.JTree"
icon="/com/intellij/uiDesigner/icons/tree.png" removable="false"
auto-create-binding="true" can-attach-label="false">
+ <default-constraints vsize-policy="6" hsize-policy="6"
anchor="0" fill="3">
+ <preferred-size width="150" height="50" />
+ </default-constraints>
+ </item>
+ <item class="javax.swing.JTabbedPane"
icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false"
auto-create-binding="true" can-attach-label="false">
+ <default-constraints vsize-policy="3" hsize-policy="3"
anchor="0" fill="3">
+ <preferred-size width="200" height="200" />
+ </default-constraints>
+ </item>
+ <item class="javax.swing.JSplitPane"
icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false"
auto-create-binding="false" can-attach-label="false">
+ <default-constraints vsize-policy="3" hsize-policy="3"
anchor="0" fill="3">
+ <preferred-size width="200" height="200" />
+ </default-constraints>
+ </item>
+ <item class="javax.swing.JSpinner"
icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false"
auto-create-binding="true" can-attach-label="true">
+ <default-constraints vsize-policy="0" hsize-policy="6"
anchor="8" fill="1" />
+ </item>
+ <item class="javax.swing.JSlider"
icon="/com/intellij/uiDesigner/icons/slider.png" removable="false"
auto-create-binding="true" can-attach-label="false">
+ <default-constraints vsize-policy="0" hsize-policy="6"
anchor="8" fill="1" />
+ </item>
+ <item class="javax.swing.JSeparator"
icon="/com/intellij/uiDesigner/icons/separator.png" removable="false"
auto-create-binding="false" can-attach-label="false">
+ <default-constraints vsize-policy="6" hsize-policy="6"
anchor="0" fill="3" />
+ </item>
+ <item class="javax.swing.JProgressBar"
icon="/com/intellij/uiDesigner/icons/progressbar.png"
removable="false" auto-create-binding="true"
can-attach-label="false">
+ <default-constraints vsize-policy="0" hsize-policy="6"
anchor="0" fill="1" />
+ </item>
+ <item class="javax.swing.JToolBar"
icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false"
auto-create-binding="false" can-attach-label="false">
+ <default-constraints vsize-policy="0" hsize-policy="6"
anchor="0" fill="1">
+ <preferred-size width="-1" height="20" />
+ </default-constraints>
+ </item>
+ <item class="javax.swing.JToolBar$Separator"
icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png"
removable="false" auto-create-binding="false"
can-attach-label="false">
+ <default-constraints vsize-policy="0" hsize-policy="0"
anchor="0" fill="1" />
+ </item>
+ <item class="javax.swing.JScrollBar"
icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false"
auto-create-binding="true" can-attach-label="false">
+ <default-constraints vsize-policy="6" hsize-policy="0"
anchor="0" fill="2" />
+ </item>
+ </group>
+ </component>
+ <component name="ProjectModuleManager">
+ <modules>
+ <module
fileurl="file://$PROJECT_DIR$/build/ide/intellij/idea60/modules/federation/federation.iml"
filepath="$PROJECT_DIR$/build/ide/intellij/idea60/modules/federation/federation.iml"
/>
+ <module
fileurl="file://$PROJECT_DIR$/build/ide/intellij/idea60/modules/jsr168api/jsr168api.iml"
filepath="$PROJECT_DIR$/build/ide/intellij/idea60/modules/jsr168api/jsr168api.iml"
/>
+ <module
fileurl="file://$PROJECT_DIR$/build/ide/intellij/idea60/modules/portlet/portlet.iml"
filepath="$PROJECT_DIR$/build/ide/intellij/idea60/modules/portlet/portlet.iml"
/>
+ <module
fileurl="file://$PROJECT_DIR$/build/ide/intellij/idea60/modules/testsuite/testsuite.iml"
filepath="$PROJECT_DIR$/build/ide/intellij/idea60/modules/testsuite/testsuite.iml"
/>
+ <module
fileurl="file://$PROJECT_DIR$/build/ide/intellij/idea60/modules/thirdparty/thirdparty.iml"
filepath="$PROJECT_DIR$/build/ide/intellij/idea60/modules/thirdparty/thirdparty.iml"
/>
+ <module
fileurl="file://$PROJECT_DIR$/build/ide/intellij/idea60/modules/tools/tools.iml"
filepath="$PROJECT_DIR$/build/ide/intellij/idea60/modules/tools/tools.iml"
/>
+ </modules>
+ </component>
+ <component name="ProjectRootManager" version="2"
assert-keyword="true" jdk-15="false" project-jdk-name="1.5"
project-jdk-type="JavaSDK">
+ <output url="file://$PROJECT_DIR$/output" />
+ </component>
+ <component name="ProjectRunConfigurationManager" />
+ <component name="RmicSettings">
+ <option name="IS_EANABLED" value="false" />
+ <option name="DEBUGGING_INFO" value="true" />
+ <option name="GENERATE_NO_WARNINGS" value="false" />
+ <option name="GENERATE_IIOP_STUBS" value="false" />
+ <option name="ADDITIONAL_OPTIONS_STRING" value="" />
+ </component>
+ <component name="StarteamVcsAdapter" />
+ <component name="VssVcs">
+
<SourceSafePersistencyRemovedFolder>$PROJECT_DIR$/wsrp/src/resources/test</SourceSafePersistencyRemovedFolder>
+ </component>
+ <component name="com.intellij.jsf.UserDefinedFacesConfigs">
+ <option name="USER_DEFINED_CONFIGS">
+ <value>
+ <list size="0" />
+ </value>
+ </option>
+ </component>
+ <component name="copyright">
+ <Base>
+ <setting name="state" value="1" />
+ </Base>
+ <LanguageOptions name="$TEMPLATE$">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="true" />
+ <option name="separateAfter" value="true" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="true" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="JBoss, a division of Red
Hat Copyright &#36;today.year, 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 Fr!
anklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF site:
http://www.fsf.org." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="4" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ <LanguageOptions name="CSS">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="false" />
+ <option name="separateAfter" value="false" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="false" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="Copyright (c)
&#36;today.year, Your Corporation. All Rights Reserved." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="1" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ <LanguageOptions name="HTML">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="false" />
+ <option name="separateAfter" value="false" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="false" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="Copyright (c)
&#36;today.year, Your Corporation. All Rights Reserved." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="1" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ <LanguageOptions name="JAVA">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="false" />
+ <option name="separateAfter" value="false" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="false" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="Copyright (c)
&#36;today.year, Your Corporation. All Rights Reserved." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="2" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ <LanguageOptions name="JSP">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="false" />
+ <option name="separateAfter" value="false" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="false" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="Copyright (c)
&#36;today.year, Your Corporation. All Rights Reserved." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="1" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ <LanguageOptions name="JavaScript">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="false" />
+ <option name="separateAfter" value="false" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="false" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="Copyright (c)
&#36;today.year, Your Corporation. All Rights Reserved." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="1" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ <LanguageOptions name="Properties">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="false" />
+ <option name="separateAfter" value="false" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="false" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="Copyright (c)
&#36;today.year, Your Corporation. All Rights Reserved." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="1" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ <LanguageOptions name="XML">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="false" />
+ <option name="separateAfter" value="false" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="false" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="Copyright (c)
&#36;today.year, Your Corporation. All Rights Reserved." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="2" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ </component>
+ <component name="libraryTable" />
+ <component name="uidesigner-configuration">
+ <option name="INSTRUMENT_CLASSES" value="true" />
+ <option name="COPY_FORMS_RUNTIME_TO_OUTPUT" value="true"
/>
+ <option name="DEFAULT_LAYOUT_MANAGER"
value="GridLayoutManager" />
+ </component>
+ <UsedPathMacros />
+</project>
+
Added: modules/portlet/trunk/jboss-portal-portlet.iws
===================================================================
--- modules/portlet/trunk/jboss-portal-portlet.iws (rev 0)
+++ modules/portlet/trunk/jboss-portal-portlet.iws 2007-08-17 15:29:49 UTC (rev 7981)
@@ -0,0 +1,720 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4" relativePaths="false">
+ <component name="BookmarkManager" />
+ <component name="ChangeBrowserSettings">
+ <option name="MAIN_SPLITTER_PROPORTION" value="0.3" />
+ <option name="MESSAGES_SPLITTER_PROPORTION" value="0.8" />
+ <option name="USE_DATE_BEFORE_FILTER" value="false" />
+ <option name="USE_DATE_AFTER_FILTER" value="false" />
+ <option name="USE_CHANGE_BEFORE_FILTER" value="false" />
+ <option name="USE_CHANGE_AFTER_FILTER" value="false" />
+ <option name="DATE_BEFORE" value="" />
+ <option name="DATE_AFTER" value="" />
+ <option name="CHANGE_BEFORE" value="" />
+ <option name="CHANGE_AFTER" value="" />
+ <option name="USE_USER_FILTER" value="false" />
+ <option name="USER" value="" />
+ </component>
+ <component name="ChangeListManager">
+ <list default="true" name="Default" comment=""
/>
+ </component>
+ <component name="ChangeListSynchronizer" />
+ <component name="ChangesViewManager" flattened_view="true"
/>
+ <component name="CheckinPanelState" />
+ <component name="Commander">
+ <leftPanel />
+ <rightPanel />
+ <splitter proportion="0.5" />
+ </component>
+ <component name="CompilerWorkspaceConfiguration">
+ <option name="COMPILE_IN_BACKGROUND" value="false" />
+ <option name="AUTO_SHOW_ERRORS_IN_EDITOR" value="true" />
+ <option name="CLOSE_MESSAGE_VIEW_IF_SUCCESS" value="true"
/>
+ <option name="COMPILE_DEPENDENT_FILES" value="false" />
+ <option name="CLEAR_OUTPUT_DIRECTORY" value="false" />
+ <option name="ASSERT_NOT_NULL" value="true" />
+ </component>
+ <component name="CoverageDataManager" />
+ <component name="Cvs2Configuration">
+ <option name="PRUNE_EMPTY_DIRECTORIES" value="true" />
+ <option name="MERGING_MODE" value="0" />
+ <option name="MERGE_WITH_BRANCH1_NAME" value="HEAD" />
+ <option name="MERGE_WITH_BRANCH2_NAME" value="HEAD" />
+ <option name="RESET_STICKY" value="false" />
+ <option name="CREATE_NEW_DIRECTORIES" value="true" />
+ <option name="DEFAULT_TEXT_FILE_SUBSTITUTION" value="kv"
/>
+ <option name="PROCESS_UNKNOWN_FILES" value="false" />
+ <option name="PROCESS_DELETED_FILES" value="false" />
+ <option name="PROCESS_IGNORED_FILES" value="false" />
+ <option name="RESERVED_EDIT" value="false" />
+ <option name="CHECKOUT_DATE_OR_REVISION_SETTINGS">
+ <value>
+ <option name="BRANCH" value="" />
+ <option name="DATE" value="" />
+ <option name="USE_BRANCH" value="false" />
+ <option name="USE_DATE" value="false" />
+ </value>
+ </option>
+ <option name="UPDATE_DATE_OR_REVISION_SETTINGS">
+ <value>
+ <option name="BRANCH" value="" />
+ <option name="DATE" value="" />
+ <option name="USE_BRANCH" value="false" />
+ <option name="USE_DATE" value="false" />
+ </value>
+ </option>
+ <option name="SHOW_CHANGES_REVISION_SETTINGS">
+ <value>
+ <option name="BRANCH" value="" />
+ <option name="DATE" value="" />
+ <option name="USE_BRANCH" value="false" />
+ <option name="USE_DATE" value="false" />
+ </value>
+ </option>
+ <option name="SHOW_OUTPUT" value="false" />
+ <option name="ADD_WATCH_INDEX" value="0" />
+ <option name="REMOVE_WATCH_INDEX" value="0" />
+ <option name="UPDATE_KEYWORD_SUBSTITUTION" />
+ <option name="MAKE_NEW_FILES_READONLY" value="false" />
+ <option name="SHOW_CORRUPTED_PROJECT_FILES" value="0" />
+ <option name="TAG_AFTER_PROJECT_COMMIT" value="false" />
+ <option name="OVERRIDE_EXISTING_TAG_FOR_PROJECT" value="true"
/>
+ <option name="TAG_AFTER_PROJECT_COMMIT_NAME" value="" />
+ <option name="CLEAN_COPY" value="false" />
+ </component>
+ <component name="DaemonCodeAnalyzer">
+ <disable_hints />
+ </component>
+ <component name="DebuggerManager">
+ <breakpoint_any>
+ <breakpoint>
+ <option name="NOTIFY_CAUGHT" value="true" />
+ <option name="NOTIFY_UNCAUGHT" value="true" />
+ <option name="ENABLED" value="false" />
+ <option name="SUSPEND_POLICY" value="SuspendAll" />
+ <option name="LOG_ENABLED" value="false" />
+ <option name="LOG_EXPRESSION_ENABLED" value="false" />
+ <option name="COUNT_FILTER_ENABLED" value="false" />
+ <option name="COUNT_FILTER" value="0" />
+ <option name="CONDITION_ENABLED" value="false" />
+ <option name="CLASS_FILTERS_ENABLED" value="false" />
+ <option name="INSTANCE_FILTERS_ENABLED" value="false"
/>
+ <option name="CONDITION" value="" />
+ <option name="LOG_MESSAGE" value="" />
+ </breakpoint>
+ <breakpoint>
+ <option name="NOTIFY_CAUGHT" value="true" />
+ <option name="NOTIFY_UNCAUGHT" value="true" />
+ <option name="ENABLED" value="false" />
+ <option name="SUSPEND_POLICY" value="SuspendAll" />
+ <option name="LOG_ENABLED" value="false" />
+ <option name="LOG_EXPRESSION_ENABLED" value="false" />
+ <option name="COUNT_FILTER_ENABLED" value="false" />
+ <option name="COUNT_FILTER" value="0" />
+ <option name="CONDITION_ENABLED" value="false" />
+ <option name="CLASS_FILTERS_ENABLED" value="false" />
+ <option name="INSTANCE_FILTERS_ENABLED" value="false"
/>
+ <option name="CONDITION" value="" />
+ <option name="LOG_MESSAGE" value="" />
+ </breakpoint>
+ </breakpoint_any>
+ <breakpoint_rules />
+ <ui_properties />
+ </component>
+ <component name="ErrorTreeViewConfiguration">
+ <option name="IS_AUTOSCROLL_TO_SOURCE" value="false" />
+ <option name="HIDE_WARNINGS" value="false" />
+ </component>
+ <component name="FavoritesManager">
+ <favorites_list name="jboss-portal-portlet" />
+ </component>
+ <component name="FavoritesProjectViewPane" />
+ <component name="FileEditorManager">
+ <leaf />
+ </component>
+ <component name="FindManager">
+ <FindUsagesManager>
+ <setting name="OPEN_NEW_TAB" value="false" />
+ </FindUsagesManager>
+ </component>
+ <component name="HierarchyBrowserManager">
+ <option name="IS_AUTOSCROLL_TO_SOURCE" value="false" />
+ <option name="SORT_ALPHABETICALLY" value="false" />
+ <option name="HIDE_CLASSES_WHERE_METHOD_NOT_IMPLEMENTED"
value="false" />
+ </component>
+ <component name="InspectionManager">
+ <option name="AUTOSCROLL_TO_SOURCE" value="false" />
+ <option name="SPLITTER_PROPORTION" value="0.5" />
+ <option name="GROUP_BY_SEVERITY" value="false" />
+ <option name="FILTER_RESOLVED_ITEMS" value="true" />
+ <option name="ANALYZE_TEST_SOURCES" value="true" />
+ <option name="SHOW_DIFF_WITH_PREVIOUS_RUN" value="false"
/>
+ <option name="SCOPE_TYPE" value="1" />
+ <option name="CUSTOM_SCOPE_NAME" value="" />
+ <option name="SHOW_ONLY_DIFF" value="false" />
+ <option name="myCurrentProfileName" value="Default" />
+ </component>
+ <component name="J2EEProjectPane" />
+ <component name="JspContextManager" />
+ <component name="ModuleEditorState">
+ <option name="LAST_EDITED_MODULE_NAME" />
+ <option name="LAST_EDITED_TAB_NAME" />
+ </component>
+ <component name="NamedScopeManager" />
+ <component name="PackagesPane">
+ <subPane>
+ <PATH>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="jboss-portal-portlet.ipr"
/>
+ <option name="myItemType"
value="com.intellij.ide.projectView.impl.nodes.PackageViewProjectNode" />
+ </PATH_ELEMENT>
+ </PATH>
+ </subPane>
+ </component>
+ <component name="PerforceChangeBrowserSettings">
+ <option name="USE_CLIENT_FILTER" value="true" />
+ <option name="CLIENT" value="" />
+ </component>
+ <component name="PerforceDirect.Settings">
+ <option name="useP4CONFIG" value="true" />
+ <option name="port"
value="<perforce_server>:1666" />
+ <option name="client" value="" />
+ <option name="user" value="" />
+ <option name="passwd" value="" />
+ <option name="showCmds" value="false" />
+ <option name="useNativeApi" value="false" />
+ <option name="pathToExec" value="p4" />
+ <option name="useCustomPathToExec" value="false" />
+ <option name="SYNC_FORCE" value="false" />
+ <option name="SYNC_RUN_RESOLVE" value="true" />
+ <option name="REVERT_UNCHANGED_FILES" value="true" />
+ <option name="CHARSET" value="none" />
+ <option name="SHOW_BRANCHES_HISTORY" value="true" />
+ <option name="ENABLED" value="true" />
+ <option name="USE_LOGIN" value="false" />
+ <option name="LOGIN_SILENTLY" value="false" />
+ <option name="INTEGRATE_RUN_RESOLVE" value="true" />
+ <option name="INTEGRATE_REVERT_UNCHANGED" value="true" />
+ <option name="SERVER_TIMEOUT" value="20000" />
+ </component>
+ <component name="ProjectLevelVcsManager">
+ <OptionsSetting value="true" id="Add" />
+ <OptionsSetting value="true" id="Remove" />
+ <OptionsSetting value="true" id="Checkin" />
+ <OptionsSetting value="true" id="Checkout" />
+ <OptionsSetting value="true" id="Update" />
+ <OptionsSetting value="true" id="Status" />
+ <OptionsSetting value="true" id="Edit" />
+ <OptionsSetting value="true" id="Undo Check Out" />
+ <OptionsSetting value="true" id="Compare with SourceSafe
Version" />
+ <OptionsSetting value="true" id="Get Latest Version" />
+ <ConfirmationsSetting value="0" id="Add" />
+ <ConfirmationsSetting value="0" id="Remove" />
+ </component>
+ <component name="ProjectPane">
+ <subPane>
+ <PATH>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="jboss-portal-portlet.ipr"
/>
+ <option name="myItemType"
value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="tools" />
+ <option name="myItemType"
value="com.intellij.ide.projectView.impl.nodes.ProjectViewModuleNode" />
+ </PATH_ELEMENT>
+ </PATH>
+ <PATH>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="jboss-portal-portlet.ipr"
/>
+ <option name="myItemType"
value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="tools" />
+ <option name="myItemType"
value="com.intellij.ide.projectView.impl.nodes.ProjectViewModuleNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId"
value="PsiDirectory:$PROJECT_DIR$/tools" />
+ <option name="myItemType"
value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ </PATH>
+ <PATH>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="jboss-portal-portlet.ipr"
/>
+ <option name="myItemType"
value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="tools" />
+ <option name="myItemType"
value="com.intellij.ide.projectView.impl.nodes.ProjectViewModuleNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId"
value="PsiDirectory:$PROJECT_DIR$/tools" />
+ <option name="myItemType"
value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId"
value="PsiDirectory:$PROJECT_DIR$/tools/etc" />
+ <option name="myItemType"
value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ </PATH>
+ <PATH>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="jboss-portal-portlet.ipr"
/>
+ <option name="myItemType"
value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="tools" />
+ <option name="myItemType"
value="com.intellij.ide.projectView.impl.nodes.ProjectViewModuleNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId"
value="PsiDirectory:$PROJECT_DIR$/tools" />
+ <option name="myItemType"
value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId"
value="PsiDirectory:$PROJECT_DIR$/tools/etc" />
+ <option name="myItemType"
value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId"
value="PsiDirectory:$PROJECT_DIR$/tools/etc/buildfragments" />
+ <option name="myItemType"
value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ </PATH>
+ <PATH>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="jboss-portal-portlet.ipr"
/>
+ <option name="myItemType"
value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+ </PATH_ELEMENT>
+ </PATH>
+ <PATH>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="jboss-portal-portlet.ipr"
/>
+ <option name="myItemType"
value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="portlet" />
+ <option name="myItemType"
value="com.intellij.ide.projectView.impl.nodes.ProjectViewModuleNode" />
+ </PATH_ELEMENT>
+ </PATH>
+ <PATH>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="jboss-portal-portlet.ipr"
/>
+ <option name="myItemType"
value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="portlet" />
+ <option name="myItemType"
value="com.intellij.ide.projectView.impl.nodes.ProjectViewModuleNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId"
value="PsiDirectory:$PROJECT_DIR$/portlet" />
+ <option name="myItemType"
value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ </PATH>
+ <PATH>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="jboss-portal-portlet.ipr"
/>
+ <option name="myItemType"
value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="portlet" />
+ <option name="myItemType"
value="com.intellij.ide.projectView.impl.nodes.ProjectViewModuleNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId"
value="PsiDirectory:$PROJECT_DIR$/portlet" />
+ <option name="myItemType"
value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId"
value="PsiDirectory:$PROJECT_DIR$/portlet/src" />
+ <option name="myItemType"
value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId"
value="PsiDirectory:$PROJECT_DIR$/portlet/src/resources" />
+ <option name="myItemType"
value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ </PATH>
+ <PATH>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="jboss-portal-portlet.ipr"
/>
+ <option name="myItemType"
value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="portlet" />
+ <option name="myItemType"
value="com.intellij.ide.projectView.impl.nodes.ProjectViewModuleNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId"
value="PsiDirectory:$PROJECT_DIR$/portlet" />
+ <option name="myItemType"
value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId"
value="PsiDirectory:$PROJECT_DIR$/portlet/src" />
+ <option name="myItemType"
value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId"
value="PsiDirectory:$PROJECT_DIR$/portlet/src/main" />
+ <option name="myItemType"
value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId"
value="PsiDirectory:$PROJECT_DIR$/portlet/src/main/org/jboss/portal" />
+ <option name="myItemType"
value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ </PATH>
+ <PATH>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="jboss-portal-portlet.ipr"
/>
+ <option name="myItemType"
value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="jsr168api" />
+ <option name="myItemType"
value="com.intellij.ide.projectView.impl.nodes.ProjectViewModuleNode" />
+ </PATH_ELEMENT>
+ </PATH>
+ <PATH>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="jboss-portal-portlet.ipr"
/>
+ <option name="myItemType"
value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="jsr168api" />
+ <option name="myItemType"
value="com.intellij.ide.projectView.impl.nodes.ProjectViewModuleNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId"
value="PsiDirectory:$PROJECT_DIR$/jsr168api" />
+ <option name="myItemType"
value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ </PATH>
+ <PATH>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="jboss-portal-portlet.ipr"
/>
+ <option name="myItemType"
value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="federation" />
+ <option name="myItemType"
value="com.intellij.ide.projectView.impl.nodes.ProjectViewModuleNode" />
+ </PATH_ELEMENT>
+ </PATH>
+ <PATH>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="jboss-portal-portlet.ipr"
/>
+ <option name="myItemType"
value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="federation" />
+ <option name="myItemType"
value="com.intellij.ide.projectView.impl.nodes.ProjectViewModuleNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId"
value="PsiDirectory:$PROJECT_DIR$/federation" />
+ <option name="myItemType"
value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ </PATH>
+ </subPane>
+ </component>
+ <component name="ProjectReloadState">
+ <option name="STATE" value="0" />
+ </component>
+ <component name="ProjectView">
+ <navigator currentView="ProjectPane" proportions="0.11111111"
version="1" splitterProportion="0.5">
+ <flattenPackages />
+ <showMembers />
+ <showModules />
+ <showLibraryContents />
+ <hideEmptyPackages />
+ <abbreviatePackageNames />
+ <showStructure PackagesPane="false" ProjectPane="false"
/>
+ <autoscrollToSource />
+ <autoscrollFromSource />
+ <sortByType />
+ </navigator>
+ </component>
+ <component name="PropertiesComponent">
+ <property name="MemberChooser.copyJavadoc" value="false"
/>
+ <property name="GoToClass.includeLibraries" value="false"
/>
+ <property name="MemberChooser.showClasses" value="true" />
+ <property name="MemberChooser.sorted" value="false" />
+ <property name="GoToFile.includeJavaFiles" value="false"
/>
+ <property name="GoToClass.toSaveIncludeLibraries"
value="false" />
+ </component>
+ <component name="ReadonlyStatusHandler">
+ <option name="SHOW_DIALOG" value="true" />
+ </component>
+ <component name="RecentsManager" />
+ <component name="RestoreUpdateTree" />
+ <component name="RunManager">
+ <configuration default="true" type="Applet"
factoryName="Applet">
+ <module name="" />
+ <option name="MAIN_CLASS_NAME" />
+ <option name="HTML_FILE_NAME" />
+ <option name="HTML_USED" value="false" />
+ <option name="WIDTH" value="400" />
+ <option name="HEIGHT" value="300" />
+ <option name="POLICY_FILE"
value="$APPLICATION_HOME_DIR$/bin/appletviewer.policy" />
+ <option name="VM_PARAMETERS" />
+ <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false"
/>
+ <option name="ALTERNATIVE_JRE_PATH" />
+ </configuration>
+ <configuration default="true" type="JUnit"
factoryName="JUnit" enabled="false" merge="false">
+ <module name="" />
+ <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false"
/>
+ <option name="ALTERNATIVE_JRE_PATH" />
+ <option name="PACKAGE_NAME" />
+ <option name="MAIN_CLASS_NAME" />
+ <option name="METHOD_NAME" />
+ <option name="TEST_OBJECT" value="class" />
+ <option name="VM_PARAMETERS" />
+ <option name="PARAMETERS" />
+ <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$"
/>
+ <option name="ADDITIONAL_CLASS_PATH" />
+ <option name="TEST_SEARCH_SCOPE">
+ <value defaultName="wholeProject" />
+ </option>
+ </configuration>
+ <configuration default="true" type="Application"
factoryName="Application" enabled="false" merge="false">
+ <option name="MAIN_CLASS_NAME" />
+ <option name="VM_PARAMETERS" />
+ <option name="PROGRAM_PARAMETERS" />
+ <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$"
/>
+ <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false"
/>
+ <option name="ALTERNATIVE_JRE_PATH" />
+ <option name="ENABLE_SWING_INSPECTOR" value="false" />
+ <module name="" />
+ </configuration>
+ <configuration default="true" type="Remote"
factoryName="Remote">
+ <option name="USE_SOCKET_TRANSPORT" value="true" />
+ <option name="SERVER_MODE" value="false" />
+ <option name="SHMEM_ADDRESS" value="javadebug" />
+ <option name="HOST" value="localhost" />
+ <option name="PORT" value="5005" />
+ </configuration>
+ <configuration name="<template>" type="WebApp"
default="true" selected="false">
+ <Host>localhost</Host>
+ <Port>5050</Port>
+ </configuration>
+ </component>
+ <component name="ScopeViewComponent" />
+ <component name="SelectInManager" />
+ <component name="StarteamConfiguration">
+ <option name="SERVER" value="" />
+ <option name="PORT" value="49201" />
+ <option name="USER" value="" />
+ <option name="PASSWORD" value="" />
+ <option name="PROJECT" value="" />
+ <option name="VIEW" value="" />
+ <option name="ALTERNATIVE_WORKING_PATH" value="" />
+ <option name="LOCK_ON_CHECKOUT" value="false" />
+ <option name="UNLOCK_ON_CHECKIN" value="false" />
+ </component>
+ <component name="StructuralSearchPlugin" />
+ <component name="StructureViewFactory">
+ <option name="AUTOSCROLL_MODE" value="true" />
+ <option name="AUTOSCROLL_FROM_SOURCE" value="false" />
+ <option name="ACTIVE_ACTIONS" value="" />
+ </component>
+ <component name="Struts Assistant">
+ <option name="showInputs" value="true" />
+ <option name="resources">
+ <value>
+ <option name="strutsPath" />
+ <option name="strutsHelp" />
+ </value>
+ </option>
+ <option name="selectedTaglibs" />
+ <option name="selectedTaglibs" />
+ <option name="myStrutsValidationEnabled" value="true" />
+ <option name="myTilesValidationEnabled" value="true" />
+ <option name="myValidatorValidationEnabled" value="true"
/>
+ <option name="myReportErrorsAsWarnings" value="true" />
+ </component>
+ <component name="SvnChangesBrowserSettings">
+ <option name="USE_AUTHOR_FIELD" value="true" />
+ <option name="AUTHOR" value="" />
+ <option name="LOCATION" value="" />
+ <option name="USE_PROJECT_SETTINGS" value="true" />
+ <option name="USE_ALTERNATE_LOCATION" value="false" />
+ </component>
+ <component name="SvnConfiguration">
+ <option name="USER" value="" />
+ <option name="PASSWORD" value="" />
+ <option name="PROCESS_UNRESOLVED" value="false" />
+ <option name="LAST_MERGED_REVISION" />
+ <option name="UPDATE_RUN_STATUS" value="false" />
+ <option name="UPDATE_RECURSIVELY" value="true" />
+ <option name="MERGE_DRY_RUN" value="false" />
+ <configuration
useDefault="false">/Users/julien/.subversion</configuration>
+ </component>
+ <component name="TodoView" selected-index="0">
+ <todo-panel id="selected-file">
+ <are-packages-shown value="false" />
+ <are-modules-shown value="false" />
+ <flatten-packages value="false" />
+ <is-autoscroll-to-source value="true" />
+ </todo-panel>
+ <todo-panel id="all">
+ <are-packages-shown value="true" />
+ <are-modules-shown value="false" />
+ <flatten-packages value="false" />
+ <is-autoscroll-to-source value="true" />
+ </todo-panel>
+ </component>
+ <component name="ToolWindowManager">
+ <frame x="3" y="34" width="1680"
height="958" extended-state="0" />
+ <editor active="false" />
+ <layout>
+ <window_info id="UI Designer" active="false"
anchor="left" auto_hide="false" internal_type="DOCKED"
type="DOCKED" visible="false" weight="0.33"
order="3" />
+ <window_info id="CVS" active="false"
anchor="bottom" auto_hide="false" internal_type="DOCKED"
type="DOCKED" visible="false" weight="0.33"
order="8" />
+ <window_info id="IDEtalk" active="false"
anchor="right" auto_hide="false" internal_type="DOCKED"
type="DOCKED" visible="false" weight="0.33"
order="3" />
+ <window_info id="TODO" active="false"
anchor="bottom" auto_hide="false" internal_type="DOCKED"
type="DOCKED" visible="false" weight="0.33"
order="7" />
+ <window_info id="Project" active="true"
anchor="left" auto_hide="false" internal_type="DOCKED"
type="DOCKED" visible="true" weight="0.329859"
order="0" />
+ <window_info id="Find" active="false"
anchor="bottom" auto_hide="false" internal_type="DOCKED"
type="DOCKED" visible="false" weight="0.329849"
order="1" />
+ <window_info id="Structure" active="false"
anchor="left" auto_hide="false" internal_type="DOCKED"
type="DOCKED" visible="false" weight="0.25"
order="1" />
+ <window_info id="Messages" active="false"
anchor="bottom" auto_hide="false" internal_type="DOCKED"
type="DOCKED" visible="false" weight="0.33"
order="8" />
+ <window_info id="Inspection" active="false"
anchor="bottom" auto_hide="false" internal_type="DOCKED"
type="DOCKED" visible="false" weight="0.4"
order="6" />
+ <window_info id="Module Dependencies" active="false"
anchor="right" auto_hide="false" internal_type="DOCKED"
type="DOCKED" visible="false" weight="0.33"
order="3" />
+ <window_info id="Dependency Viewer" active="false"
anchor="bottom" auto_hide="false" internal_type="DOCKED"
type="DOCKED" visible="false" weight="0.33"
order="8" />
+ <window_info id="Palette" active="false"
anchor="right" auto_hide="false" internal_type="DOCKED"
type="DOCKED" visible="false" weight="0.33"
order="3" />
+ <window_info id="Ant Build" active="false"
anchor="right" auto_hide="false" internal_type="DOCKED"
type="DOCKED" visible="false" weight="0.25"
order="1" />
+ <window_info id="Changes" active="false"
anchor="bottom" auto_hide="false" internal_type="DOCKED"
type="DOCKED" visible="false" weight="0.33"
order="8" />
+ <window_info id="Run" active="false"
anchor="bottom" auto_hide="false" internal_type="DOCKED"
type="DOCKED" visible="false" weight="0.33"
order="2" />
+ <window_info id="Hierarchy" active="false"
anchor="right" auto_hide="false" internal_type="DOCKED"
type="DOCKED" visible="false" weight="0.25"
order="2" />
+ <window_info id="File View" active="false"
anchor="right" auto_hide="false" internal_type="DOCKED"
type="DOCKED" visible="false" weight="0.33"
order="3" />
+ <window_info id="Debug" active="false"
anchor="bottom" auto_hide="false" internal_type="DOCKED"
type="DOCKED" visible="false" weight="0.4"
order="4" />
+ <window_info id="Commander" active="false"
anchor="right" auto_hide="false" internal_type="DOCKED"
type="DOCKED" visible="false" weight="0.4"
order="0" />
+ <window_info id="IDEtalk Messages" active="false"
anchor="bottom" auto_hide="false" internal_type="DOCKED"
type="DOCKED" visible="false" weight="0.33"
order="8" />
+ <window_info id="Version Control" active="false"
anchor="bottom" auto_hide="false" internal_type="DOCKED"
type="DOCKED" visible="false" weight="0.33"
order="8" />
+ <window_info id="Message" active="false"
anchor="bottom" auto_hide="false" internal_type="DOCKED"
type="DOCKED" visible="false" weight="0.33"
order="0" />
+ <window_info id="Web" active="false" anchor="left"
auto_hide="false" internal_type="DOCKED" type="DOCKED"
visible="false" weight="0.25" order="2" />
+ <window_info id="EJB" active="false"
anchor="bottom" auto_hide="false" internal_type="DOCKED"
type="DOCKED" visible="false" weight="0.25"
order="3" />
+ <window_info id="Cvs" active="false"
anchor="bottom" auto_hide="false" internal_type="DOCKED"
type="DOCKED" visible="false" weight="0.25"
order="5" />
+ </layout>
+ </component>
+ <component name="VCS.FileViewConfiguration">
+ <option name="SELECTED_STATUSES" value="DEFAULT" />
+ <option name="SELECTED_COLUMNS" value="DEFAULT" />
+ <option name="SHOW_FILTERS" value="true" />
+ <option name="CUSTOMIZE_VIEW" value="true" />
+ <option name="SHOW_FILE_HISTORY_AS_TREE" value="true" />
+ </component>
+ <component name="VcsManagerConfiguration">
+ <option name="OFFER_MOVE_TO_ANOTHER_CHANGELIST_ON_PARTIAL_COMMIT"
value="true" />
+ <option name="CHECK_CODE_SMELLS_BEFORE_PROJECT_COMMIT"
value="true" />
+ <option name="PERFORM_UPDATE_IN_BACKGROUND" value="false"
/>
+ <option name="PERFORM_COMMIT_IN_BACKGROUND" value="false"
/>
+ <option name="PUT_FOCUS_INTO_COMMENT" value="false" />
+ <option name="FORCE_NON_EMPTY_COMMENT" value="false" />
+ <option name="LAST_COMMIT_MESSAGE" />
+ <option name="SAVE_LAST_COMMIT_MESSAGE" value="true" />
+ <option name="CHECKIN_DIALOG_SPLITTER_PROPORTION" value="0.8"
/>
+ <option name="OPTIMIZE_IMPORTS_BEFORE_PROJECT_COMMIT"
value="false" />
+ <option name="REFORMAT_BEFORE_PROJECT_COMMIT" value="false"
/>
+ <option name="REFORMAT_BEFORE_FILE_COMMIT" value="false"
/>
+ <option name="FILE_HISTORY_DIALOG_COMMENTS_SPLITTER_PROPORTION"
value="0.8" />
+ <option name="FILE_HISTORY_DIALOG_SPLITTER_PROPORTION"
value="0.5" />
+ <option name="ERROR_OCCURED" value="false" />
+ <option name="ACTIVE_VCS_NAME" />
+ <option name="UPDATE_GROUP_BY_PACKAGES" value="false" />
+ <option name="SHOW_FILE_HISTORY_AS_TREE" value="false" />
+ <option name="FILE_HISTORY_SPLITTER_PROPORTION" value="0.6"
/>
+ </component>
+ <component name="VssConfiguration">
+ <option name="CLIENT_PATH" value="" />
+ <option name="SRCSAFEINI_PATH" value="" />
+ <option name="USER_NAME" value="" />
+ <option name="PWD" value="" />
+ <option name="VSS_IS_INITIALIZED" value="true" />
+ <CheckoutOptions>
+ <option name="COMMENT" value="" />
+ <option name="DO_NOT_GET_LATEST_VERSION" value="false"
/>
+ <option name="REPLACE_WRITABLE" value="false" />
+ <option name="RECURSIVE" value="false" />
+ </CheckoutOptions>
+ <CheckinOptions>
+ <option name="COMMENT" value="" />
+ <option name="KEEP_CHECKED_OUT" value="false" />
+ <option name="RECURSIVE" value="false" />
+ </CheckinOptions>
+ <AddOptions>
+ <option name="STORE_ONLY_LATEST_VERSION" value="false"
/>
+ <option name="CHECK_OUT_IMMEDIATELY" value="false" />
+ <option name="FILE_TYPE" value="0" />
+ </AddOptions>
+ <UndocheckoutOptions>
+ <option name="MAKE_WRITABLE" value="false" />
+ <option name="REPLACE_LOCAL_COPY" value="0" />
+ <option name="RECURSIVE" value="false" />
+ </UndocheckoutOptions>
+ <GetOptions>
+ <option name="REPLACE_WRITABLE" value="0" />
+ <option name="MAKE_WRITABLE" value="false" />
+ <option name="ANSWER_NEGATIVELY" value="false" />
+ <option name="ANSWER_POSITIVELY" value="false" />
+ <option name="RECURSIVE" value="false" />
+ <option name="VERSION" />
+ </GetOptions>
+ <VssConfigurableExcludedFilesTag />
+ </component>
+ <component name="antWorkspaceConfiguration">
+ <option name="IS_AUTOSCROLL_TO_SOURCE" value="false" />
+ <option name="FILTER_TARGETS" value="false" />
+ </component>
+ <component
name="com.intellij.ide.util.scopeChooser.ScopeChooserConfigurable"
proportions="" version="1">
+ <option name="myLastEditedConfigurable" />
+ </component>
+ <component
name="com.intellij.openapi.roots.ui.configuration.projectRoot.ProjectRootMasterDetailsConfigurable"
proportions="0.11111111" version="1">
+ <option name="myPlainMode" value="false" />
+ <option name="myLastEditedConfigurable" value="federation"
/>
+ </component>
+ <component name="com.intellij.profile.ui.ErrorOptionsConfigurable"
proportions="" version="1">
+ <option name="myLastEditedConfigurable" />
+ </component>
+ <component name="editorHistoryManager">
+ <entry
file="file://$PROJECT_DIR$/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletContainerImpl.java">
+ <provider selected="true" editor-type-id="text-editor">
+ <state line="24" column="0"
selection-start="1808" selection-end="1808"
vertical-scroll-proportion="0.04522613">
+ <folding>
+ <element signature="imports" expanded="true" />
+ </folding>
+ </state>
+ </provider>
+ </entry>
+ <entry
file="file://$PROJECT_DIR$/portlet/src/main/org/jboss/portal/portlet/invocation/response/ErrorResponse.java">
+ <provider selected="true" editor-type-id="text-editor">
+ <state line="24" column="0"
selection-start="1816" selection-end="1816"
vertical-scroll-proportion="0.044389643">
+ <folding>
+ <element signature="imports" expanded="true" />
+ </folding>
+ </state>
+ </provider>
+ </entry>
+ <entry file="file://$PROJECT_DIR$/tools/build.xml">
+ <provider selected="true" editor-type-id="text-editor">
+ <state line="0" column="0" selection-start="0"
selection-end="0" vertical-scroll-proportion="0.0">
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ <entry file="file://$PROJECT_DIR$/jsr168api/build.xml">
+ <provider selected="true" editor-type-id="text-editor">
+ <state line="144" column="40"
selection-start="7470" selection-end="7470"
vertical-scroll-proportion="0.42540073">
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ <entry file="file://$PROJECT_DIR$/federation/build.xml">
+ <provider selected="true" editor-type-id="text-editor">
+ <state line="100" column="35"
selection-start="5549" selection-end="5549"
vertical-scroll-proportion="0.6806412">
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ <entry file="file://$PROJECT_DIR$/portlet/build.xml">
+ <provider selected="true" editor-type-id="text-editor">
+ <state line="104" column="35"
selection-start="5752" selection-end="5752"
vertical-scroll-proportion="0.54747224">
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ <entry
file="file://$PROJECT_DIR$/tools/etc/buildfragments/modules.ent">
+ <provider selected="true" editor-type-id="text-editor">
+ <state line="24" column="62"
selection-start="1388" selection-end="1388"
vertical-scroll-proportion="0.35511714">
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ </component>
+</project>
+
Added: modules/portlet/trunk/jsr168api/.classpath
===================================================================
--- modules/portlet/trunk/jsr168api/.classpath (rev 0)
+++ modules/portlet/trunk/jsr168api/.classpath 2007-08-17 15:29:49 UTC (rev 7981)
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src/main"/>
+ <classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Property changes on: modules/portlet/trunk/jsr168api/.classpath
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/jsr168api/.cvsignore
===================================================================
--- modules/portlet/trunk/jsr168api/.cvsignore (rev 0)
+++ modules/portlet/trunk/jsr168api/.cvsignore 2007-08-17 15:29:49 UTC (rev 7981)
@@ -0,0 +1,2 @@
+bin
+output
Property changes on: modules/portlet/trunk/jsr168api/.cvsignore
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/jsr168api/.project
===================================================================
--- modules/portlet/trunk/jsr168api/.project (rev 0)
+++ modules/portlet/trunk/jsr168api/.project 2007-08-17 15:29:49 UTC (rev 7981)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>api</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Property changes on: modules/portlet/trunk/jsr168api/.project
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/jsr168api/build.bat
===================================================================
--- modules/portlet/trunk/jsr168api/build.bat (rev 0)
+++ modules/portlet/trunk/jsr168api/build.bat 2007-08-17 15:29:49 UTC (rev 7981)
@@ -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 2 2005-01-14 23:01:32Z 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: modules/portlet/trunk/jsr168api/build.bat
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/jsr168api/build.sh
===================================================================
--- modules/portlet/trunk/jsr168api/build.sh (rev 0)
+++ modules/portlet/trunk/jsr168api/build.sh 2007-08-17 15:29:49 UTC (rev 7981)
@@ -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 2 2005-01-14 23:01:32Z 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: modules/portlet/trunk/jsr168api/build.sh
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/jsr168api/build.xml
===================================================================
--- modules/portlet/trunk/jsr168api/build.xml (rev 0)
+++ modules/portlet/trunk/jsr168api/build.xml 2007-08-17 15:29:49 UTC (rev 7981)
@@ -0,0 +1,181 @@
+<?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 7910 2007-08-14 09:46:27Z 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">
+
+ <!-- Override the javadoc packages to javax.portlet.* -->
+ <property name="javadoc.packages"
value="javax.portlet.*,org.jboss.portal.*"/>
+
+ <!-- Configure thirdparty libraries -->
+ &libraries;
+ <path id="library.classpath">
+ <path refid="junit.junit.classpath"/>
+ </path>
+
+ <!-- Configure modules -->
+ <call target="configure-modules"/>
+ <path id="dependentmodule.classpath">
+ </path>
+
+ <!--+=======================================+-->
+ <!--| Override any default properties here. |-->
+ <!--+=======================================+-->
+
+ <!-- Configure defaults & build tools -->
+ <call target="configure-defaults"/>
+ <call target="configure-tools"/>
+
+ <!--+=======================================+-->
+ <!--| 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">
+ <!-- Add module specific elements here. -->
+ </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}"/>
+
+ <jar jarfile="${build.lib}/portal-portlet-jsr168api-lib.jar">
+ <fileset dir="${build.classes}"/>
+ </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"/>
+
+ <target name="package-tests"></target>
+
+</project>
Property changes on: modules/portlet/trunk/jsr168api/build.xml
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/jsr168api/src/main/javax/portlet/ActionRequest.java
===================================================================
--- modules/portlet/trunk/jsr168api/src/main/javax/portlet/ActionRequest.java
(rev 0)
+++ modules/portlet/trunk/jsr168api/src/main/javax/portlet/ActionRequest.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,115 @@
+/******************************************************************************
+ * 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 javax.portlet;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.UnsupportedEncodingException;
+
+/**
+ * The <CODE>ActionRequest</CODE> represents the request sent to the portlet
to handle an action. It extends the
+ * PortletRequest interface to provide action request information to portlets.<br>
The portlet container creates an
+ * <CODE>ActionRequest</CODE> object and passes it as argument to the
portlet's <CODE>processAction</CODE> method.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5441 $
+ * @see PortletRequest
+ * @see RenderRequest
+ */
+public interface ActionRequest extends PortletRequest
+{
+ /**
+ * Returns the name of the character encoding used in the body of this request. This
method returns <code>null</code>
+ * if the request does not specify a character encoding.
+ *
+ * @return a <code>String</code> containing the name of the chararacter
encoding, or <code>null</code> if the
+ * request does not specify a character encoding.
+ */
+ String getCharacterEncoding();
+
+ /**
+ * Returns the length, in bytes, of the request body which is made available by the
input stream, or -1 if the length
+ * is not known.
+ *
+ * @return an integer containing the length of the request body or -1 if the length is
not known
+ */
+ int getContentLength();
+
+ /**
+ * Returns the MIME type of the body of the request, or null if the type is not
known.
+ *
+ * @return a <code>String</code> containing the name of the MIME type of
the request, or null if the type is not
+ * known.
+ */
+ String getContentType();
+
+ /**
+ * Retrieves the body of the HTTP request from client to portal as binary data using
an <CODE>InputStream</CODE>.
+ * Either this method or {@link #getReader} may be called to read the body, but not
both.
+ * <p/>
+ * For HTTP POST data of type application/x-www-form-urlencoded this method throws an
+ * <code>IllegalStateException</code> as this data has been already
processed by the portal/portlet-container and is
+ * available as request parameters.
+ *
+ * @return an input stream containing the body of the request
+ * @throws java.lang.IllegalStateException
+ * if getReader was already called, or it is a HTTP POST
data of type
+ * application/x-www-form-urlencoded
+ * @throws java.io.IOException if an input or output exception occurred
+ */
+ InputStream getPortletInputStream() throws IllegalStateException, IOException;
+
+ /**
+ * Retrieves the body of the HTTP request from the client to the portal as character
data using a
+ * <code>BufferedReader</code>. The reader translates the character data
according to the character encoding used on
+ * the body. Either this method or {@link #getPortletInputStream} may be called to
read the body, not both.
+ * <p/>
+ * For HTTP POST data of type application/x-www-form-urlencoded this method throws an
+ * <code>IllegalStateException</code> as this data has been already
processed by the portal/portlet-container and is
+ * available as request parameters.
+ *
+ * @throws java.io.UnsupportedEncodingException
+ * if the character set encoding used is not supported and
the text cannot be decoded
+ * @throws java.lang.IllegalStateException
+ * if {@link #getPortletInputStream} method has been
called on this request, it is a
+ * HTTP POST data of type
application/x-www-form-urlencoded.
+ * @throws java.io.IOException if an input or output exception occurred
+ * @return a <code>BufferedReader</code> containing the body of the
request
+ * @see #getPortletInputStream
+ */
+ BufferedReader getReader() throws UnsupportedEncodingException, IllegalStateException,
IOException;
+
+ /**
+ * Overrides the name of the character encoding used in the body of this request. This
method must be called prior to
+ * reading input using {@link #getReader} or {@link #getPortletInputStream}.
+ * <p/>
+ * This method only sets the character set for the Reader that the {@link #getReader}
method returns.
+ *
+ * @param enc a <code>String</code> containing the name of the
chararacter encoding.
+ * @exception java.io.UnsupportedEncodingException if this is not a valid encoding
+ * @exception java.lang.IllegalStateException if this method is called after reading
request parameters or reading
+ * input using <code>getReader()</code>
+ */
+ void setCharacterEncoding(String enc) throws UnsupportedEncodingException,
IllegalStateException;
+}
Property changes on:
modules/portlet/trunk/jsr168api/src/main/javax/portlet/ActionRequest.java
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/jsr168api/src/main/javax/portlet/ActionResponse.java
===================================================================
--- modules/portlet/trunk/jsr168api/src/main/javax/portlet/ActionResponse.java
(rev 0)
+++ modules/portlet/trunk/jsr168api/src/main/javax/portlet/ActionResponse.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,151 @@
+/******************************************************************************
+ * 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 javax.portlet;
+
+import java.io.IOException;
+import java.util.Map;
+
+/**
+ * The <CODE>ActionResponse</CODE> interface represents the portlet response
to an action request. It extends the
+ * <CODE>PortletResponse</CODE> interface to provide specific action response
functionality to portlets.<br> The portlet
+ * container creates an <CODE>ActionResponse</CODE> object and passes it as
argument to the portlet's
+ * <CODE>processAction</CODE> method.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5441 $
+ * @see ActionRequest
+ * @see PortletResponse
+ */
+public interface ActionResponse extends PortletResponse
+{
+ /**
+ * Sets the window state of a portlet to the given window state.
+ * <p/>
+ * Possible values are the standard window states and any custom window states
supported by the portal and the
+ * portlet. Standard window states are: <ul> <li>MINIMIZED
<li>NORMAL <li>MAXIMIZED </ul>
+ *
+ * @param windowState the new portlet window state
+ * @throws WindowStateException if the portlet cannot switch to the specified window
state. To avoid this exception
+ * the portlet can check the allowed window states with
<code>Request.isWindowStateAllowed()</code>.
+ * @throws java.lang.IllegalStateException
+ * if the method is invoked after
<code>sendRedirect</code> has been called.
+ * @see WindowState
+ */
+ void setWindowState(WindowState windowState) throws WindowStateException;
+
+ /**
+ * Sets the portlet mode of a portlet to the given portlet mode.
+ * <p/>
+ * Possible values are the standard portlet modes and any custom portlet modes
supported by the portal and the
+ * portlet. Portlets must declare in the deployment descriptor the portlet modes they
support for each markup type.
+ * Standard portlet modes are: <ul> <li>EDIT <li>HELP <li>VIEW
</ul>
+ * <p/>
+ * Note: The portlet may still be called in a different window state in the next
render call, depending on the
+ * portlet container / portal.
+ *
+ * @param portletMode the new portlet mode
+ * @throws PortletModeException if the portlet cannot switch to this portlet mode,
because the portlet or portal does
+ * not support it for this markup, or the current user is
not allowed to switch to this
+ * portlet mode. To avoid this exception the portlet can
check the allowed portlet modes
+ * with
<code>Request.isPortletModeAllowed()</code>.
+ * @throws java.lang.IllegalStateException
+ * if the method is invoked after
<code>sendRedirect</code> has been called.
+ */
+ void setPortletMode(PortletMode portletMode) throws PortletModeException;
+
+ /**
+ * Instructs the portlet container to send a redirect response to the client using the
specified redirect location
+ * URL.
+ * <p/>
+ * This method only accepts an absolute URL (e.g.
<code>http://my.co/myportal/mywebap/myfolder/myresource.gif</code>)
+ * or a full path URI (e.g.
<code>/myportal/mywebap/myfolder/myresource.gif</code>). If required, the
portlet
+ * container may encode the given URL before the redirection is issued to the client.
+ * <p/>
+ * The sendRedirect method can not be invoked after any of the following methods of
the ActionResponse interface has
+ * been called: <ul> <li>setPortletMode <li>setWindowState
<li>setRenderParameter <li>setRenderParameters </ul>
+ *
+ * @throws java.lang.IllegalStateException
+ * if the method is invoked after any of above mentioned methods of the
ActionResponse interface has been
+ * called.
+ * @param location the redirect location URL
+ * @exception java.io.IOException if an input or output exception occurs.
+ * @exception java.lang.IllegalArgumentException if a relative path URL is given
+ */
+ void sendRedirect(String location) throws IOException, IllegalArgumentException,
IllegalStateException;
+
+ /**
+ * Sets a parameter map for the render request.
+ * <p/>
+ * All previously set render parameters are cleared.
+ * <p/>
+ * These parameters will be accessible in all sub-sequent render calls via the
<code>PortletRequest.getParameter</code>
+ * call until a new request is targeted to the portlet.
+ * <p/>
+ * The given parameters do not need to be encoded prior to calling this method.
+ *
+ * @param parameters Map containing parameter names for the render phase as keys and
parameter values as map values.
+ * The keys in the parameter map must be of type String. The values
in the parameter map must be of
+ * type String array (<code>String[]</code>).
+ * @throws java.lang.IllegalStateException
+ * if the method is invoked after <code>sendRedirect</code> has
been called.
+ * @exception java.lang.IllegalArgumentException if parameters is
<code>null</code>, if any of the key/values in the
+ * Map are <code>null</code>, if any of the keys is not a String, or if
any of the values is not a String array.
+ */
+ void setRenderParameters(Map parameters) throws IllegalArgumentException,
IllegalStateException;
+
+ /**
+ * Sets a String parameter for the render request.
+ * <p/>
+ * These parameters will be accessible in all sub-sequent render calls via the
<code>PortletRequest.getParameter</code>
+ * call until a request is targeted to the portlet.
+ * <p/>
+ * This method replaces all parameters with the given key.
+ * <p/>
+ * The given parameter do not need to be encoded prior to calling this method.
+ *
+ * @param key key of the render parameter
+ * @param value value of the render parameter
+ * @throws java.lang.IllegalStateException
+ * if the method is invoked after <code>sendRedirect</code> has
been called.
+ * @exception java.lang.IllegalArgumentException if key or value are
<code>null</code>.
+ */
+ void setRenderParameter(String key, String value) throws IllegalArgumentException,
IllegalStateException;
+
+ /**
+ * Sets a String array parameter for the render request.
+ * <p/>
+ * These parameters will be accessible in all sub-sequent render calls via the
<code>PortletRequest.getParameter</code>
+ * call until a request is targeted to the portlet.
+ * <p/>
+ * This method replaces all parameters with the given key.
+ * <p/>
+ * The given parameter do not need to be encoded prior to calling this method.
+ *
+ * @param key key of the render parameter
+ * @param values values of the render parameter
+ * @throws java.lang.IllegalStateException
+ * if the method is invoked after <code>sendRedirect</code> has
been called.
+ * @exception java.lang.IllegalArgumentException if key or value are
<code>null</code>.
+ */
+ void setRenderParameter(String key, String[] values) throws IllegalArgumentException,
IllegalStateException;
+}
Property changes on:
modules/portlet/trunk/jsr168api/src/main/javax/portlet/ActionResponse.java
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/jsr168api/src/main/javax/portlet/GenericPortlet.java
===================================================================
--- modules/portlet/trunk/jsr168api/src/main/javax/portlet/GenericPortlet.java
(rev 0)
+++ modules/portlet/trunk/jsr168api/src/main/javax/portlet/GenericPortlet.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,317 @@
+/******************************************************************************
+ * 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 javax.portlet;
+
+import java.io.IOException;
+import java.util.Enumeration;
+import java.util.Locale;
+import java.util.ResourceBundle;
+
+/**
+ * The <CODE>GenericPortlet</CODE> class provides a default implementation
for the <CODE>Portlet</CODE> interface.
+ * <p/>
+ * It provides an abstract class to be subclassed to create portlets. A subclass of
<CODE>GenericPortlet</CODE> should
+ * override at least one method, usually one of the following: <ul>
<li>processAction, to handle action requests</li>
+ * <li>doView, to handle render requests when in VIEW mode</li>
<li>doEdit, to handle render requests when in EDIT
+ * mode</li> <li>doHelp, to handle render request when in HELP
mode</li> <li>init and destroy, to manage resources that
+ * are held for the life of the servlet</li> </ul>
+ * <p/>
+ * Normally there is no need to override the render or the doDispatch methods. Render
handles render requests setting
+ * the title of the portlet in the response and invoking doDispatch. doDispatch
dispatches the request to one of the
+ * doView, doEdit or doHelp method depending on the portlet mode indicated in the
request.
+ * <p/>
+ * Portlets typically run on multithreaded servers, so please note that a portlet must
handle concurrent requests and be
+ * careful to synchronize access to shared resources. Shared resources include in-memory
data such as instance or
+ * class variables and external objects such as files, database connections, and network
connections.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5441 $
+ */
+public abstract class GenericPortlet implements Portlet
+{
+
+ private PortletConfig config;
+
+ /** Does nothing. */
+ protected GenericPortlet()
+ {
+ }
+
+ /**
+ * A convenience method which can be overridden so that there's no need to call
<code>super.init(config)</code>.
+ * <p/>
+ * <p>Instead of overriding {@link #init(PortletConfig)}, simply override this
method and it will be called by
+ * <code>GenericPortlet.init(PortletConfig config)</code>. The
<code>PortletConfig</code> object can still be
+ * retrieved via {@link #getPortletConfig}.
+ *
+ * @throws PortletException if an exception has occurred that interferes with the
portlet normal operation.
+ * @throws UnavailableException if the portlet is unavailable to perform init
+ */
+ public void init() throws PortletException
+ {
+ }
+
+ /**
+ * Returns the PortletConfig object of this portlet.
+ *
+ * @return the PortletConfig object of this portlet
+ */
+ public PortletConfig getPortletConfig()
+ {
+ return config;
+ }
+
+ /**
+ * Returns the name of this portlet.
+ *
+ * @return the portlet name
+ * @see PortletConfig#getPortletName()
+ */
+ public String getPortletName()
+ {
+ return config.getPortletName();
+ }
+
+ /**
+ * Returns the <code>PortletContext</code> of the portlet application the
portlet is in.
+ *
+ * @return the portlet application context
+ */
+ public PortletContext getPortletContext()
+ {
+ return config.getPortletContext();
+ }
+
+ /**
+ * The default implementation of this method routes the render request to a set of
helper methods depending on the
+ * current portlet mode the portlet is currently in. These methods are: <ul>
<li><code>doView</code> for handling
+ * <code>view</code> requests <li><code>doEdit</code>
for handling <code>edit</code> requests
<li><code>doHelp</code>
+ * for handling <code>help</code> requests </ul>
+ * <p/>
+ * If the window state of this portlet is <code>minimized</code>, this
method does not invoke any of the portlet mode
+ * rendering methods.
+ * <p/>
+ * For handling custom portlet modes the portlet should override this method.
+ *
+ * @param request the render request
+ * @param response the render response
+ * @throws PortletException if the portlet cannot fulfilling the request
+ * @throws UnavailableException if the portlet is unavailable to perform render at
this time
+ * @throws PortletSecurityException if the portlet cannot fullfill this request
because of security reasons
+ * @throws java.io.IOException if the streaming causes an I/O problem
+ * @see #doView(RenderRequest,RenderResponse)
+ * @see #doEdit(RenderRequest,RenderResponse)
+ * @see #doHelp(RenderRequest,RenderResponse)
+ */
+ protected void doDispatch(RenderRequest request, RenderResponse response) throws
PortletException, PortletSecurityException, IOException
+ {
+ if (!WindowState.MINIMIZED.equals(request.getWindowState()))
+ {
+ PortletMode portletMode = request.getPortletMode();
+ if (PortletMode.VIEW.equals(portletMode))
+ {
+ doView(request, response);
+ }
+ else if (PortletMode.HELP.equals(portletMode))
+ {
+ doHelp(request, response);
+ }
+ else if (PortletMode.EDIT.equals(portletMode))
+ {
+ doEdit(request, response);
+ }
+ }
+ }
+
+ /**
+ * Helper method to serve up the mandatory <code>view</code> mode.
+ * <p/>
+ * The default implementation throws an exception.
+ *
+ * @param request the portlet request
+ * @param response the render response
+ * @throws PortletException if the portlet cannot fulfilling the request
+ * @throws UnavailableException if the portlet is unavailable to perform render at
this time
+ * @throws PortletSecurityException if the portlet cannot fullfill this request
because of security reasons
+ * @throws java.io.IOException if the streaming causes an I/O problem
+ */
+ protected void doView(RenderRequest request, RenderResponse response) throws
PortletException, PortletSecurityException, IOException
+ {
+ throw new PortletException();
+ }
+
+ /**
+ * Helper method to serve up the <code>help</code> mode.
+ * <p/>
+ * The default implementation throws an exception.
+ *
+ * @param request the portlet request
+ * @param response the render response
+ * @throws PortletException if the portlet cannot fulfilling the request
+ * @throws UnavailableException if the portlet is unavailable to perform render at
this time
+ * @throws PortletSecurityException if the portlet cannot fullfill this request
because of security reasons
+ * @throws java.io.IOException if the streaming causes an I/O problem
+ */
+ protected void doHelp(RenderRequest request, RenderResponse response) throws
PortletException, PortletSecurityException, IOException
+ {
+ throw new PortletException();
+ }
+
+ /**
+ * Helper method to serve up the <code>edit</code> mode.
+ * <p/>
+ * The default implementation throws an exception.
+ *
+ * @param request the portlet request
+ * @param response the render response
+ * @throws PortletException if the portlet cannot fulfilling the request
+ * @throws UnavailableException if the portlet is unavailable to perform render at
this time
+ * @throws PortletSecurityException if the portlet cannot fullfill this request
because of security reasons
+ * @throws java.io.IOException if the streaming causes an I/O problem
+ */
+ protected void doEdit(RenderRequest request, RenderResponse response) throws
PortletException, PortletSecurityException, IOException
+ {
+ throw new PortletException();
+ }
+
+ /**
+ * Gets the resource bundle for the given locale based on the resource bundle defined
in the deployment descriptor
+ * with <code>resource-bundle</code> tag or the inlined resources defined
in the deployment descriptor.
+ *
+ * @return the resource bundle for the given locale
+ */
+ public ResourceBundle getResourceBundle(Locale locale)
+ {
+ return getPortletConfig().getResourceBundle(locale);
+ }
+
+ /**
+ * Used by the render method to get the title.
+ * <p/>
+ * The default implementation gets the title from the ResourceBundle of the
PortletConfig of the portlet. The title
+ * is retrieved using the 'javax.portlet.title' resource name.
+ * <p/>
+ * Portlets can overwrite this method to provide dynamic titles (e.g. based on locale,
client, and session
+ * information). Examples are: <UL> <LI>language-dependant titles for
multi-lingual portals <LI>shorter titles for
+ * WAP phones <LI>the number of messages in a mailbox portlet </UL>
+ *
+ * @return the portlet title for this window
+ */
+ protected String getTitle(RenderRequest request)
+ {
+ ResourceBundle bundle = getResourceBundle(request.getLocale());
+ return bundle.getString("javax.portlet.title");
+ }
+
+ /**
+ * Returns a String containing the value of the named initialization parameter, or
null if the parameter does not
+ * exist.
+ *
+ * @param name a <code>String</code> specifying the name of the
initialization parameter
+ * @return a <code>String</code> containing the value of the
initialization parameter
+ * @exception java.lang.IllegalArgumentException if name is
<code>null</code>.
+ */
+ public String getInitParameter(String name) throws IllegalArgumentException
+ {
+ return getPortletConfig().getInitParameter(name);
+ }
+
+ /**
+ * Returns the names of the portlet initialization parameters as an Enumeration of
String objects, or an empty
+ * Enumeration if the portlet has no initialization parameters.
+ *
+ * @return an <code>Enumeration</code> of <code>String</code>
objects containing the names of the portlet
+ * initialization parameters, or an empty Enumeration if the portlet has no
initialization parameters.
+ */
+ public Enumeration getInitParameterNames()
+ {
+ return getPortletConfig().getInitParameterNames();
+ }
+
+ /**
+ * Called by the portlet container to indicate to a portlet that the portlet is being
placed into service.
+ * <p/>
+ * The default implementation just stores the <code>PortletConfig</code>
object. <p>The portlet container calls the
+ * <code>init</code> method exactly once after instantiating the portlet.
The <code>init</code> method must complete
+ * successfully before the portlet can receive any requests.
+ * <p/>
+ * <p>The portlet container cannot place the portlet into service if the
<code>init</code> method does one of the
+ * following: <ol> <li>it throws a
<code>PortletException</code> <li>it does not return within a time
period defined
+ * by the Web server </ol>
+ *
+ * @param config a <code>PortletConfig</code> object containing the
portlet configuration and initialization
+ * parameters
+ * @throws PortletException if an exception has occurred that interferes with the
portlet normal operation.
+ * @throws UnavailableException if the portlet cannot perform the initialization at
this time.
+ */
+ public void init(PortletConfig config) throws PortletException
+ {
+ this.config = config;
+ init();
+ }
+
+ /**
+ * Called by the portlet container to allow the portlet to process an action request.
This method is called if the
+ * client request was originated by a URL created (by the portlet) with the
<code>RenderResponse.createActionURL()</code>
+ * method.
+ * <p/>
+ * The default implementation throws an exception.
+ *
+ * @param request the action request
+ * @param response the action response
+ * @throws PortletException if the portlet cannot fulfilling the request
+ * @throws UnavailableException if the portlet is unavailable to process the
action at this time
+ * @throws PortletSecurityException if the portlet cannot fullfill this request
because of security reasons
+ * @throws java.io.IOException if the streaming causes an I/O problem
+ */
+ public void processAction(ActionRequest request, ActionResponse response) throws
PortletException, PortletSecurityException, IOException
+ {
+ throw new PortletException();
+ }
+
+ /**
+ * The default implementation of this method sets the title using the
<code>getTitle</code> method and invokes the
+ * <code>doDispatch</code> method.
+ *
+ * @param request the render request
+ * @param response the render response
+ * @throws PortletException if the portlet cannot fulfilling the request
+ * @throws UnavailableException if the portlet is unavailable to perform render at
this time
+ * @throws PortletSecurityException if the portlet cannot fullfill this request
because of security reasons
+ * @throws java.io.IOException if the streaming causes an I/O problem
+ */
+ public void render(RenderRequest request, RenderResponse response) throws
PortletException, PortletSecurityException, IOException
+ {
+ response.setTitle(getTitle(request));
+ doDispatch(request, response);
+ }
+
+ /**
+ * Called by the portlet container to indicate to a portlet that the portlet is being
taken out of service.
+ * <p/>
+ * The default implementation does nothing.
+ */
+ public void destroy()
+ {
+ }
+}
Property changes on:
modules/portlet/trunk/jsr168api/src/main/javax/portlet/GenericPortlet.java
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/jsr168api/src/main/javax/portlet/PortalContext.java
===================================================================
--- modules/portlet/trunk/jsr168api/src/main/javax/portlet/PortalContext.java
(rev 0)
+++ modules/portlet/trunk/jsr168api/src/main/javax/portlet/PortalContext.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,84 @@
+/******************************************************************************
+ * 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 javax.portlet;
+
+import java.util.Enumeration;
+
+/**
+ * The <CODE>PortalContext</CODE> interface gives the portlet the ability to
retrieve information about the portal
+ * calling this portlet.
+ * <p/>
+ * The portlet can only read the <CODE>PortalContext</CODE> data.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5441 $
+ */
+public interface PortalContext
+{
+ /**
+ * Returns information about the portal like vendor, version, etc.
+ * <p/>
+ * The form of the returned string is <I>servername/versionnumber</I>. For
example, the reference implementation
+ * Pluto may return the string <CODE>Pluto/1.0</CODE>.
+ * <p/>
+ * The portlet container may return other optional information after the primary
string in parentheses, for example,
+ * <CODE>Pluto/1.0 (JDK 1.3.1; Windows NT 4.0 x86)</CODE>.
+ *
+ * @return a <CODE>String</CODE> containing at least the portal name and
version number
+ */
+ String getPortalInfo();
+
+ /**
+ * Returns the portal property with the given name, or a <code>null</code>
if there is no property by that name.
+ *
+ * @param name property name
+ * @return portal property with key <code>name</code>
+ * @exception java.lang.IllegalArgumentException if name is
<code>null</code>.
+ */
+ String getProperty(String name);
+
+ /**
+ * Returns all portal property names, or an empty <code>Enumeration</code>
if there are no property names.
+ *
+ * @return All portal property names as an <code>Enumeration</code> of
<code>String</code> objects
+ */
+ Enumeration getPropertyNames();
+
+ /**
+ * Returns all supported portlet modes by the portal as an enumertation of
<code>PorltetMode</code> objects.
+ * <p/>
+ * The portlet modes must at least include the standard portlet modes
<code>EDIT, HELP, VIEW</code>.
+ *
+ * @return All supported portal modes by the portal as an enumertation of
<code>PorltetMode</code> objects.
+ */
+ Enumeration getSupportedPortletModes();
+
+ /**
+ * Returns all supported window states by the portal as an enumertation of
<code>WindowState</code> objects.
+ * <p/>
+ * The window states must at least include the standard window states <code>
MINIMIZED, NORMAL, MAXIMIZED</code>.
+ *
+ * @return All supported window states by the portal as an enumertation of
<code>WindowState</code> objects.
+ */
+ Enumeration getSupportedWindowStates();
+}
Property changes on:
modules/portlet/trunk/jsr168api/src/main/javax/portlet/PortalContext.java
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/jsr168api/src/main/javax/portlet/Portlet.java
===================================================================
--- modules/portlet/trunk/jsr168api/src/main/javax/portlet/Portlet.java
(rev 0)
+++ modules/portlet/trunk/jsr168api/src/main/javax/portlet/Portlet.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,114 @@
+/******************************************************************************
+ * 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 javax.portlet;
+
+import java.io.IOException;
+
+/**
+ * The <CODE>Portlet</CODE> interface is used by the portlet container to
invoke the portlets. Every portlet has to
+ * implement this interface, either by directly implementing it, or by using an existing
class implementing the Portlet
+ * interface.
+ * <p/>
+ * A portlet is a Java technology-based web component. It is managed by the portlet
container and processes requests and
+ * generates dynamic content as response. Portlets are used by portals as pluggable user
interface components.
+ * <p/>
+ * The content generated by a portlet is called a fragment. A fragment is a piece of
markup (e.g. HTML, XHTML, WML)
+ * adhering to certain rules and can be aggregated with other fragments into a complete
document. The content of a
+ * portlet is normally aggregated with the content of other portlets into the portal
page.
+ * <p/>
+ * The portlet container instanciates portlets, manages their lifecycle and invoking them
to process requests. The
+ * lifecycle consists of: <ul> <li>initializing the portlet using using the
<code>init</code> method <li>request
+ * processsing <li>taking the portlet out of service using the
<code>destroy</code> method </ul>
+ * <p/>
+ * Request processing is divided into two types: <ul> <li>action requests
handled through the <code>processAction</code>
+ * method, to perform actions targeted to the portlet <li>render requests handled
through the <code>render</code>
+ * method, to perform the render operation </ul>
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5441 $
+ */
+public interface Portlet
+{
+ /**
+ * Called by the portlet container to indicate to a portlet that the portlet is being
placed into service.
+ * <p/>
+ * <p>The portlet container calls the <code>init</code> method
exactly once after instantiating the portlet. The
+ * <code>init</code> method must complete successfully before the portlet
can receive any requests.
+ * <p/>
+ * <p>The portlet container cannot place the portlet into service if the
<code>init</code> method <ol> <li>Throws a
+ * <code>PortletException</code> <li>Does not return within a time
period defined by the portlet container. </ol>
+ *
+ * @param config a <code>PortletConfig</code> object containing the
portlet's configuration and initialization
+ * parameters
+ * @throws PortletException if an exception has occurred that interferes with the
portlet's normal operation.
+ * @throws UnavailableException if the portlet cannot perform the initialization at
this time.
+ */
+ void init(PortletConfig config) throws PortletException;
+
+ /**
+ * Called by the portlet container to allow the portlet to process an action request.
This method is called if the
+ * client request was originated by a URL created (by the portlet) with the
<code>RenderResponse.createActionURL()</code>
+ * method.
+ * <p/>
+ * Typically, in response to an action request, a portlet updates state based on the
information sent in the action
+ * request parameters. In an action the portlet may: <ul> <li>issue a
redirect <li>change its window state <li>change
+ * its portlet mode <li>modify its persistent state <li>set render
parameters </ul>
+ * <p/>
+ * A client request triggered by an action URL translates into one action request and
many render requests, one per
+ * portlet in the portal page. The action processing must be finished before the
render requests can be issued.
+ *
+ * @param request the action request
+ * @param response the action response
+ * @throws PortletException if the portlet has problems fulfilling the
request
+ * @throws UnavailableException if the portlet is unavailable to process the
action at this time
+ * @throws PortletSecurityException if the portlet cannot fullfill this request
because of security reasons
+ * @throws IOException if the streaming causes an I/O problem
+ */
+ void processAction(ActionRequest request, ActionResponse response) throws
PortletException, PortletSecurityException, IOException;
+
+ /**
+ * Called by the portlet container to allow the portlet to generate the content of the
response based on its current
+ * state.
+ *
+ * @param request the render request
+ * @param response the render response
+ * @throws PortletException if the portlet has problems fulfilling the
rendering request
+ * @throws UnavailableException if the portlet is unavailable to perform render at
this time
+ * @throws PortletSecurityException if the portlet cannot fullfill this request
because of security reasons
+ * @throws java.io.IOException if the streaming causes an I/O problem
+ */
+ void render(RenderRequest request, RenderResponse response) throws PortletException,
PortletSecurityException, IOException;
+
+ /**
+ * Called by the portlet container to indicate to a portlet that the portlet is being
taken out of service.
+ * <p/>
+ * Before the portlet container calls the destroy method, it should allow any threads
that are currently processing
+ * requests within the portlet object to complete execution. To avoid waiting forever,
the portlet container can
+ * optionally wait for a predefined time before destroying the portlet object.
+ * <p/>
+ * <p>This method enables the portlet to do the following: <ul>
<li>clean up any resources that it holds (for
+ * example, memory, file handles, threads) <li>make sure that any persistent
state is synchronized with the portlet
+ * current state in memory. </ul>
+ */
+ void destroy();
+}
Property changes on: modules/portlet/trunk/jsr168api/src/main/javax/portlet/Portlet.java
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/jsr168api/src/main/javax/portlet/PortletConfig.java
===================================================================
--- modules/portlet/trunk/jsr168api/src/main/javax/portlet/PortletConfig.java
(rev 0)
+++ modules/portlet/trunk/jsr168api/src/main/javax/portlet/PortletConfig.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,88 @@
+/******************************************************************************
+ * 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 javax.portlet;
+
+import java.util.Enumeration;
+import java.util.Locale;
+import java.util.ResourceBundle;
+
+/**
+ * The <CODE>PortletConfig</CODE> interface provides the portlet with its
configuration. The configuration holds
+ * information about the portlet that is valid for all users. The configuration is
retrieved from the portlet definition
+ * in the deployment descriptor. The portlet can only read the configuration data.
+ * <p/>
+ * The configuration information contains the portlet name, the portlet initialization
parameters, the portlet resource
+ * bundle and the portlet application context.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5441 $
+ * @see Portlet
+ */
+public interface PortletConfig
+{
+ /**
+ * Returns the name of the portlet.
+ * <p/>
+ * The name may be provided via server administration, assigned in the portlet
application deployment descriptor with
+ * the <code>portlet-name</code> tag.
+ *
+ * @return the portlet name
+ */
+ String getPortletName();
+
+ /**
+ * Returns the <code>PortletContext</code> of the portlet application the
portlet is in.
+ *
+ * @return a <code>PortletContext</code> object, used by the caller to
interact with its portlet container
+ * @see PortletContext
+ */
+ PortletContext getPortletContext();
+
+ /**
+ * Gets the resource bundle for the given locale based on the resource bundle defined
in the deployment descriptor
+ * with <code>resource-bundle</code> tag or the inlined resources defined
in the deployment descriptor.
+ *
+ * @param locale the locale for which to retrieve the resource bundle
+ * @return the resource bundle for the given locale
+ */
+ ResourceBundle getResourceBundle(Locale locale);
+
+ /**
+ * Returns a String containing the value of the named initialization parameter, or
null if the parameter does not
+ * exist.
+ *
+ * @param name a <code>String</code> specifying the name of the
initialization parameter
+ * @return a <code>String</code> containing the value of the
initialization parameter
+ * @exception java.lang.IllegalArgumentException if name is
<code>null</code>.
+ */
+ String getInitParameter(String name) throws IllegalArgumentException;
+
+ /**
+ * Returns the names of the portlet initialization parameters as an
<code>Enumeration</code> of String objects, or an
+ * empty <code>Enumeration</code> if the portlet has no initialization
parameters.
+ *
+ * @return an <code>Enumeration</code> of <code>String</code>
objects containing the names of the portlet
+ * initialization parameters, or an empty <code>Enumeration</code> if the
portlet has no initialization parameters.
+ */
+ Enumeration getInitParameterNames();
+}
Property changes on:
modules/portlet/trunk/jsr168api/src/main/javax/portlet/PortletConfig.java
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/jsr168api/src/main/javax/portlet/PortletContext.java
===================================================================
--- modules/portlet/trunk/jsr168api/src/main/javax/portlet/PortletContext.java
(rev 0)
+++ modules/portlet/trunk/jsr168api/src/main/javax/portlet/PortletContext.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,300 @@
+/******************************************************************************
+ * 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 javax.portlet;
+
+import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.Enumeration;
+import java.util.Set;
+
+/**
+ * The <CODE>PortletContext</CODE> interface defines a portlet view of the
portlet container. The
+ * <CODE>PortletContext</CODE> also makes resources available to the portlet.
Using the context, a portlet can access
+ * the portlet log, and obtain URL references to resources.
+ * <p/>
+ * <p>There is one context per "portlet application" per Java Virtual
Machine. (A "portlet application" is a collection
+ * of portlets, servlets, and content installed under a specific subset of the server URL
namespace, such as
+ * <code>/catalog</code>. They are possibly installed via a
<code>.war</code> file.) As a web application, a portlet
+ * application also has a servlet context. The portlet context leverages most of its
functionality from the servlet
+ * context of the portlet application.
+ * <p/>
+ * Attibutes stored in the context are global for <I>all</I> users and
<I>all</I> components in the portlet
+ * application.
+ * <p/>
+ * In the case of a web application marked "distributed" in its deployment
descriptor, there will be one context
+ * instance for each virtual machine. In this situation, the context cannot be used as a
location to share global
+ * information (because the information is not truly global). Use an external resource,
such as a database to achieve
+ * sharing on a global scope.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5441 $
+ */
+public interface PortletContext
+{
+ /**
+ * Returns the name and version of the portlet container in which the portlet is
running.
+ * <p/>
+ * <p/>
+ * The form of the returned string is
<code>containername/versionnumber</code>.
+ *
+ * @return the string containing at least name and version number
+ */
+ String getServerInfo();
+
+ /**
+ * Returns a {@link PortletRequestDispatcher} object that acts as a wrapper for the
resource located at the given
+ * path. A <code>PortletRequestDispatcher</code> object can be used
include the resource in a response. The resource
+ * can be dynamic or static.
+ * <p/>
+ * <p>The pathname must begin with a slash (<code> / </code>) and is
interpreted as relative to the current context
+ * root.
+ * <p/>
+ * <p>This method returns <code>null</code> if the
<code>PortletContext</code> cannot return a
+ * <code>PortletRequestDispatcher</code> for any reason.
+ *
+ * @param path a <code>String</code> specifying the pathname to the
resource
+ * @return a <code>PortletRequestDispatcher</code> object that acts as a
wrapper for the resource at the specified
+ * path.
+ * @see PortletRequestDispatcher
+ */
+
+ PortletRequestDispatcher getRequestDispatcher(String path);
+
+ /**
+ * Returns a {@link PortletRequestDispatcher} object that acts as a wrapper for the
named servlet.
+ * <p/>
+ * <p>Servlets (and also JSP pages) may be given names via server administration
or via a web application deployment
+ * descriptor.
+ * <p/>
+ * <p>This method returns <code>null</code> if the
<code>PortletContext</code> cannot return a
+ * <code>PortletRequestDispatcher</code> for any reason.
+ *
+ * @param name a <code>String</code> specifying the name of a servlet to
be wrapped
+ * @return a <code>PortletRequestDispatcher</code> object that acts as a
wrapper for the named servlet
+ * @see PortletRequestDispatcher
+ */
+ PortletRequestDispatcher getNamedDispatcher(String name);
+
+ /**
+ * Returns the resource located at the given path as an InputStream object. The data
in the InputStream can be of any
+ * type or length. The method returns null if no resource exists at the given path.
+ * <p/>
+ * In order to access protected resources the path has to be prefixed with
<code>/WEB-INF/</code> (for example
+ * <code>/WEB-INF/myportlet/myportlet.jsp</code>). Otherwise, the direct
path is used (for example
+ * <code>/myportlet/myportlet.jsp</code>).
+ *
+ * @param path the path to the resource
+ * @return the input stream
+ */
+ InputStream getResourceAsStream(String path);
+
+ /**
+ * Returns the major version of the Portlet API that this portlet container supports.
+ *
+ * @return the major version
+ * @see #getMinorVersion()
+ */
+ int getMajorVersion();
+
+ /**
+ * Returns the minor version of the Portlet API that this portlet container supports.
+ *
+ * @return the minor version
+ * @see #getMajorVersion()
+ */
+ int getMinorVersion();
+
+ /**
+ * Returns the MIME type of the specified file, or <code>null</code> if
the MIME type is not known. The MIME type is
+ * determined by the configuration of the portlet container and may be specified in a
web application deployment
+ * descriptor. Common MIME types are <code>text/html</code> and
<code>image/gif</code>.
+ *
+ * @param file a <code>String</code> specifying the name of a file
+ * @return a <code>String</code> specifying the MIME type of the file
+ */
+ String getMimeType(String file);
+
+ /**
+ * Returns a <code>String</code> containing the real path for a given
virtual path. For example, the path
+ * <code>/index.html</code> returns the absolute file path of the portlet
container file system.
+ * <p/>
+ * <p>The real path returned will be in a form appropriate to the computer and
operating system on which the portlet
+ * container is running, including the proper path separators. This method returns
<code>null</code> if the portlet
+ * container cannot translate the virtual path to a real path for any reason (such as
when the content is being made
+ * available from a <code>.war</code> archive).
+ *
+ * @param path a <code>String</code> specifying a virtual path
+ * @return a <code>String</code> specifying the real path, or null if the
transformation cannot be performed.
+ */
+ String getRealPath(String path);
+
+ /**
+ * Returns a directory-like listing of all the paths to resources within the web
application longest sub-path of
+ * which matches the supplied path argument. Paths indicating subdirectory paths end
with a slash (<code>/</code>).
+ * The returned paths are all relative to the root of the web application and have a
leading slash. For example, for
+ * a web application containing<br><br> <code>
/welcome.html<br> /catalog/index.html<br> /catalog/products.html<br>
+ * /catalog/offers/books.html<br> /catalog/offers/music.html<br>
/customer/login.jsp<br> /WEB-INF/web.xml<br>
+ * /WEB-INF/classes/com.acme.OrderPortlet.class,<br><br> </code>
+ * <p/>
+ * <code>getResourcePaths("/")</code> returns
<code>{"/welcome.html", "/catalog/", "/customer/",
+ * "/WEB-INF/"}</code><br>
<code>getResourcePaths("/catalog/")</code> returns
<code>{"/catalog/index.html",
+ * "/catalog/products.html",
"/catalog/offers/"}</code>.<br>
+ *
+ * @param path the partial path used to match the resources, which must start with a
slash
+ * @return a Set containing the directory listing, or <code>null</code> if
there are no resources in the web
+ * application of which the path begins with the supplied path.
+ */
+ Set getResourcePaths(String path);
+
+ /**
+ * Returns a URL to the resource that is mapped to a specified path. The path must
begin with a slash
+ * (<code>/</code>) and is interpreted as relative to the current context
root.
+ * <p/>
+ * <p>This method allows the portlet container to make a resource available to
portlets from any source. Resources
+ * can be located on a local or remote file system, in a database, or in a
<code>.war</code> file.
+ * <p/>
+ * <p>The portlet container must implement the URL handlers and
<code>URLConnection</code> objects that are necessary
+ * to access the resource.
+ * <p/>
+ * <p>This method returns <code>null</code> if no resource is mapped
to the pathname.
+ * <p/>
+ * <p>Some containers may allow writing to the URL returned by this method using
the methods of the URL class.
+ * <p/>
+ * <p>The resource content is returned directly, so be aware that requesting a
<code>.jsp</code> page returns the JSP
+ * source code. Use a <code>RequestDispatcher</code> instead to include
results of an execution.
+ * <p/>
+ * <p>This method has a different purpose than
<code>java.lang.Class.getResource</code>, which looks up resources
+ * based on a class loader. This method does not use class loaders.
+ *
+ * @param path a <code>String</code> specifying the path to the resource
+ * @return the resource located at the named path, or <code>null</code> if
there is no resource at that path
+ * @throws MalformedURLException if the pathname is not given in the correct form
+ */
+ URL getResource(String path) throws MalformedURLException;
+
+ /**
+ * Returns the portlet container attribute with the given name, or null if there is no
attribute by that name. An
+ * attribute allows a portlet container to give the portlet additional information not
already provided by this
+ * interface. A list of supported attributes can be retrieved using
<code>getAttributeNames</code>.
+ * <p/>
+ * <p>The attribute is returned as a <code>java.lang.Object</code>
or some subclass. Attribute names should follow
+ * the same convention as package names. The Java Portlet API specification reserves
names matching
+ * <code>java.*</code>, <code>javax.*</code>, and
<code>sun.*</code>.
+ *
+ * @param name a <code>String</code> specifying the name of the attribute
+ * @return an <code>Object</code> containing the value of the attribute,
or <code>null</code> if no attribute exists
+ * matching the given name
+ * @exception java.lang.IllegalArgumentException if name is
<code>null</code>.
+ * @see #getAttributeNames
+ */
+ Object getAttribute(String name) throws IllegalArgumentException;
+
+ /**
+ * Returns an <code>Enumeration</code> containing the attribute names
available within this portlet context, or an
+ * emtpy <code>Enumeration</code> if no attributes are available. Use the
{@link #getAttribute} method with an
+ * attribute name to get the value of an attribute.
+ *
+ * @return an <code>Enumeration</code> of attribute names
+ * @see #getAttribute
+ */
+ Enumeration getAttributeNames();
+
+ /**
+ * Returns a String containing the value of the named context-wide initialization
parameter, or <code>null</code> if
+ * the parameter does not exist. This method provides configuration information which
may be useful for an entire
+ * "portlet application".
+ *
+ * @return a <code>String</code> containing the value of the
initialization parameter, or <code>null</code> if the
+ * parameter does not exist.
+ * @param name a <code>String</code> containing the name of the
requested parameter
+ * @exception java.lang.IllegalArgumentException if name is
<code>null</code>.
+ * @see #getInitParameterNames
+ */
+ String getInitParameter(String name) throws IllegalArgumentException;
+
+ /**
+ * Returns the names of the context initialization parameters as an
<code>Enumeration</code> of String objects, or an
+ * empty Enumeration if the context has no initialization parameters.
+ *
+ * @return an <code>Enumeration</code> of <code>String</code>
objects containing the names of the context
+ * initialization parameters
+ * @see #getInitParameter
+ */
+ Enumeration getInitParameterNames();
+
+ /**
+ * Writes the specified message to a portlet log file, usually an event log. The name
and type of the portlet log
+ * file is specific to the portlet container.
+ * <p/>
+ * This method mapps to the <code>ServletContext.log</code> method. The
portlet container may in addition log this
+ * message in a portlet container specific log file.
+ *
+ * @param msg a <code>String</code> specifying the message to be written
to the log file
+ */
+ void log(String msg);
+
+ /**
+ * Writes an explanatory message and a stack trace for a given Throwable exception to
the portlet log file. The name
+ * and type of the portlet log file is specific to the portlet container, usually an
event log.
+ * <p/>
+ * This method is mapped to the <code>ServletContext.log</code> method.
The portlet container may in addition log
+ * this message in a portlet container specific log file.
+ *
+ * @param msg a <code>String</code> that describes the error or
exception
+ * @param throwable the <code>Throwable</code> error or exception
+ */
+ void log(String msg, Throwable throwable);
+
+ /**
+ * Removes the attribute with the given name from the portlet context. After removal,
subsequent calls to {@link
+ * #getAttribute} to retrieve the attribute's value will return
<code>null</code>.
+ *
+ * @param name a <code>String</code> specifying the name of the attribute
to be removed
+ * @exception java.lang.IllegalArgumentException if name is
<code>null</code>.
+ */
+ void removeAttribute(String name) throws IllegalArgumentException;
+
+ /**
+ * Binds an object to a given attribute name in this portlet context. If the name
specified is already used for an
+ * attribute, this method removes the old attribute and binds the name to the new
attribute.
+ * <p/>
+ * If a null value is passed, the effect is the same as calling
<code>removeAttribute()</code>.
+ * <p/>
+ * <p>Attribute names should follow the same convention as package names. The
Java Portlet API specification reserves
+ * names matching <code>java.*</code>, <code>javax.*</code>,
and <code>sun.*</code>.
+ *
+ * @param name a <code>String</code> specifying the name of the
attribute
+ * @param object an <code>Object</code> representing the attribute to be
bound
+ * @exception java.lang.IllegalArgumentException if name is
<code>null</code>.
+ */
+ void setAttribute(String name, Object object) throws IllegalArgumentException;
+
+ /**
+ * Returns the name of this portlet application correponding to this PortletContext as
specified in the
+ * <code>web.xml</code> deployment descriptor for this web application by
the <code>display-name</code> element.
+ *
+ * @return The name of the web application or null if no name has been declared in the
deployment descriptor.
+ */
+ String getPortletContextName();
+}
Property changes on:
modules/portlet/trunk/jsr168api/src/main/javax/portlet/PortletContext.java
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/jsr168api/src/main/javax/portlet/PortletException.java
===================================================================
--- modules/portlet/trunk/jsr168api/src/main/javax/portlet/PortletException.java
(rev 0)
+++
modules/portlet/trunk/jsr168api/src/main/javax/portlet/PortletException.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,76 @@
+/******************************************************************************
+ * 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 javax.portlet;
+
+/**
+ * The <CODE>PortletException</CODE> class defines a general exception that a
portlet can throw when it is unable to
+ * perform its operation successfully.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5441 $
+ */
+public class PortletException extends Exception
+{
+
+ /** The serialVersionUID */
+ private static final long serialVersionUID = -5042678869822737513L;
+
+ /** Constructs a new portlet exception. */
+ public PortletException()
+ {
+ super();
+ }
+
+ /**
+ * Constructs a new portlet exception with the given text. The portlet container may
use the text write it to a log.
+ *
+ * @param text the exception text
+ */
+ public PortletException(String text)
+ {
+ super(text);
+ }
+
+ /**
+ * Constructs a new portlet exception when the portlet needs to do the following:
<ul> <li>throw an exception
+ * <li>include the "root cause" exception <li>include a
description message </ul>
+ *
+ * @param text the exception text
+ * @param cause the root cause
+ */
+ public PortletException(String text, Throwable cause)
+ {
+ super(text, cause);
+ }
+
+ /**
+ * Constructs a new portlet exception when the portlet needs to throw an exception.
The exception's message is based
+ * on the localized message of the underlying exception.
+ *
+ * @param cause the root cause
+ */
+ public PortletException(Throwable cause)
+ {
+ super(cause);
+ }
+}
Property changes on:
modules/portlet/trunk/jsr168api/src/main/javax/portlet/PortletException.java
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/jsr168api/src/main/javax/portlet/PortletMode.java
===================================================================
--- modules/portlet/trunk/jsr168api/src/main/javax/portlet/PortletMode.java
(rev 0)
+++ modules/portlet/trunk/jsr168api/src/main/javax/portlet/PortletMode.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,142 @@
+/******************************************************************************
+ * 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 javax.portlet;
+
+import java.util.Locale;
+
+/**
+ * The <CODE>PortletMode</CODE> class represents the possible modes that a
portlet can assume.
+ * <p/>
+ * A portlet mode indicates the function a portlet is performing. Normally, portlets
perform different tasks and create
+ * different content depending on the function they are currently performing. When
invoking a portlet, the portlet
+ * container provides the current portlet mode to the portlet.
+ * <p/>
+ * Portlets can programmatically change their portlet mode when processing an action
request.
+ * <p/>
+ * This class defines the default portlet modes <code>EDIT, HELP,
VIEW</code>. Additional portlet modes may be defined
+ * by calling the constructor of this class. If a portal/portlet-container does not
support a custom portlet mode
+ * defined in the portlet application deployment descriptor, the custom portlet mode will
be ignored by the
+ * portal/portlet container.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 6047 $
+ */
+public class PortletMode
+{
+
+ /**
+ * Within the <code>EDIT</code> portlet mode, a portlet should provide
content and logic that lets a user customize
+ * the behavior of the portlet. The EDIT portlet mode may include one or more screens
among which users can navigate
+ * to enter their customization data.
+ * <p/>
+ * Typically, portlets in <code>EDIT</code> portlet mode will set or
update portlet preferences.
+ * <p/>
+ * This mode is optional.
+ * <p/>
+ * The string value for this mode is <code>"edit"</code>.
+ */
+ public static final PortletMode EDIT = new PortletMode("edit");
+
+ /**
+ * When in <code>HELP</code> portlet mode, a portlet should provide help
information about the portlet. This help
+ * information could be a simple help screen explaining the entire portlet in coherent
text or it could be
+ * context-sensitive help.
+ * <p/>
+ * This mode is optional.
+ * <p/>
+ * The string value for this mode is <code>"help"</code>.
+ */
+ public static final PortletMode HELP = new PortletMode("help");
+
+ /**
+ * The expected functionality for a portlet in <code>VIEW</code> portlet
mode is to generate markup reflecting the
+ * current state of the portlet. For example, the <code>VIEW</code>
portlet mode of a portlet may include one or more
+ * screens that the user can navigate and interact with, or it may consist of static
content that does not require
+ * any user interaction.
+ * <p/>
+ * This mode must be supported by the portlet.
+ * <p/>
+ * The string value for this mode is <code>"view"</code>.
+ */
+ public static final PortletMode VIEW = new PortletMode("view");
+
+ private String name;
+
+ /**
+ * Creates a new portlet mode with the given name.
+ * <p/>
+ * Upper case letters in the name are converted to lower case letters.
+ *
+ * @param name The name of the portlet mode
+ */
+ public PortletMode(String name)
+ {
+ if (name == null)
+ {
+ throw new NullPointerException();
+ }
+ this.name = name.toLowerCase(Locale.ENGLISH);
+ }
+
+ /**
+ * Compares the specified object with this portlet mode for equality. Returns
<code>true</code> if the Strings
+ * <code>equals</code> method for the String representing the two portlet
modes returns <code>true</code>.
+ *
+ * @param o portlet mode to compare this portlet mode with
+ * @return true, if the specified object is equal with this portlet mode
+ */
+ public boolean equals(Object o)
+ {
+ if (o == this)
+ {
+ return true;
+ }
+ if (o instanceof PortletMode)
+ {
+ PortletMode that = (PortletMode)o;
+ return name.equals(that.name);
+ }
+ return false;
+ }
+
+ /**
+ * Returns the hash code value for this portlet mode. The hash code is constructed by
producing the hash value of the
+ * String value of this mode.
+ *
+ * @return hash code value for this portlet mode
+ */
+ public int hashCode()
+ {
+ return name.hashCode();
+ }
+
+ /**
+ * Returns a String representation of this portlet mode. Portlet mode names are always
lower case names.
+ *
+ * @return String representation of this portlet mode
+ */
+ public String toString()
+ {
+ return name;
+ }
+}
Property changes on:
modules/portlet/trunk/jsr168api/src/main/javax/portlet/PortletMode.java
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/jsr168api/src/main/javax/portlet/PortletModeException.java
===================================================================
--- modules/portlet/trunk/jsr168api/src/main/javax/portlet/PortletModeException.java
(rev 0)
+++
modules/portlet/trunk/jsr168api/src/main/javax/portlet/PortletModeException.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,105 @@
+/******************************************************************************
+ * 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 javax.portlet;
+
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+
+/**
+ * The <CODE>PortletModeException</CODE> is thrown when a portlet tries to
use or set a portlet mode that is not
+ * supported by the current runtime environment or the portlet. s *
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5527 $
+ */
+public class PortletModeException extends PortletException
+{
+
+ /** The serialVersionUID */
+ private static final long serialVersionUID = -6950436767343780823L;
+
+ private transient PortletMode mode;
+
+ /**
+ * Constructs a new portlet mode exception with the given text and the portlet mode
that caused this exception. The
+ * portlet container may use the text and portlet mode write it to a log.
+ *
+ * @param text the exception text
+ * @param mode the mode causing the exception
+ */
+ public PortletModeException(String text, PortletMode mode)
+ {
+ super(text);
+ this.mode = mode;
+ }
+
+ /**
+ * Constructs a new portlet mode exception when the portlet needs to do the following:
<ul> <il>throw an exception
+ * <li>include a message about the "root cause" that interfered with
its normal operation <li>include a description
+ * message <li>include the portlet mode that caused this exception </ul>
+ *
+ * @param text the exception text
+ * @param cause the root cause
+ * @param mode the mode causing the exception
+ */
+ public PortletModeException(String text, Throwable cause, PortletMode mode)
+ {
+ super(text, cause);
+ this.mode = mode;
+ }
+
+ /**
+ * Constructs a new portlet mode exception when the portlet needs to throw an
exception. The exception message is
+ * based on the localized message of the underlying exception and the portlet mode
that caused this exception.
+ *
+ * @param cause the root cause
+ * @param mode the mode causing the exception
+ */
+ public PortletModeException(Throwable cause, PortletMode mode)
+ {
+ super(cause);
+ this.mode = mode;
+ }
+
+ /**
+ * Returns the unsupported portlet mode causing this exception.
+ *
+ * @return the portlet mode that caused this exception
+ */
+ public PortletMode getMode()
+ {
+ return mode;
+ }
+
+ private void writeObject(ObjectOutputStream out) throws IOException
+ {
+ out.writeUTF(mode.toString());
+ }
+
+ private void readObject(ObjectInputStream in) throws IOException,
ClassNotFoundException
+ {
+ String s = in.readUTF();
+ mode = new PortletMode(s);
+ }
+}
Property changes on:
modules/portlet/trunk/jsr168api/src/main/javax/portlet/PortletModeException.java
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/jsr168api/src/main/javax/portlet/PortletPreferences.java
===================================================================
--- modules/portlet/trunk/jsr168api/src/main/javax/portlet/PortletPreferences.java
(rev 0)
+++
modules/portlet/trunk/jsr168api/src/main/javax/portlet/PortletPreferences.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,193 @@
+/******************************************************************************
+ * 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 javax.portlet;
+
+import java.io.IOException;
+import java.util.Enumeration;
+import java.util.Map;
+
+/**
+ * The <CODE>PortletPreferences</CODE> interface allows the portlet to store
configuration data. It is not the purpose
+ * of this interface to replace general purpose databases.
+ * <p/>
+ * There are two different types of preferences: <ul> <li>modifiable
preferences - these preferences can be changed by
+ * the portlet in any standard portlet mode (<code>EDIT, HELP, VIEW</code>).
Per default every preference is modifiable.
+ * <li>read-only preferences - these preferences cannot be changed by the portlet
in any standard portlet mode, but may
+ * be changed by administrative modes. Preferences are read-only, if the are defined in
the deployment descriptor with
+ * <code>read-only</code> set to <code>true</code>, or if the
portlet container restricts write access. </ul>
+ * <p/>
+ * Changes are persisted when the <code>store</code> method is called. The
<code>store</code> method can only be invoked
+ * within the scope of a <code>processAction</code> call. Changes that are
not persisted are discarded when the
+ * <code>processAction</code> or <code>render</code> method
ends.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5441 $
+ */
+public interface PortletPreferences
+{
+ /**
+ * Returns a <code>Map</code> of the preferences.
+ * <p/>
+ * The values in the returned <code>Map</code> are from type String array
(<code>String[]</code>).
+ * <p/>
+ * If no preferences exist this method returns an empty <code>Map</code>.
+ *
+ * @return an immutable <code>Map</code> containing preference names as
keys and preference values as map values, or
+ * an empty <code>Map</code> if no preference exist. The keys in
the preference map are of type String. The
+ * values in the preference map are of type String array
(<code>String[]</code>).
+ */
+ Map getMap();
+
+ /**
+ * Returns all of the keys that have an associated value, or an empty
<code>Enumeration</code> if no keys are
+ * available.
+ *
+ * @return an Enumeration of the keys that have an associated value, or an empty
<code>Enumeration</code> if no keys
+ * are available.
+ */
+ Enumeration getNames();
+
+ /**
+ * Returns the first String value associated with the specified key of this
preference. If there is one or more
+ * preference values associated with the given key it returns the first associated
value. If there are no preference
+ * values associated with the given key, or the backing preference database is
unavailable, it returns the given
+ * default value.
+ *
+ * @param key key for which the associated value is to be returned
+ * @param def the value to be returned in the event that there is no value available
associated with this
+ * <code>key</code>.
+ * @return the value associated with <code>key</code>, or
<code>def</code> if no value is associated with
+ * <code>key</code>, or the backing store is inaccessible.
+ * @throws java.lang.IllegalArgumentException
+ * if <code>key</code> is <code>null</code>. (A
<code>null</code> value for <code>def</code>
<i>is</i>
+ * permitted.)
+ * @see #getValues(String,String[])
+ */
+ String getValue(String key, String def) throws IllegalArgumentException;
+
+ /**
+ * Returns the String array value associated with the specified key in this
preference.
+ * <p/>
+ * <p>Returns the specified default if there is no value associated with the
key, or if the backing store is
+ * inaccessible.
+ * <p/>
+ * <p>If the implementation supports <i>stored defaults</i> and such
a default exists and is accessible, it is used
+ * in favor of the specified default.
+ *
+ * @param key key for which associated value is to be returned.
+ * @param def the value to be returned in the event that this preference node has no
value associated with
+ * <code>key</code> or the associated value cannot be
interpreted as a String array, or the backing store
+ * is inaccessible.
+ * @return the String array value associated with <code>key</code>, or
<code>def</code> if the associated value does
+ * not exist.
+ * @throws java.lang.IllegalArgumentException
+ * if <code>key</code> is <code>null</code>. (A
<code>null</code> value for <code>def</code>
<i>is</i>
+ * permitted.)
+ * @see #getValue(String,String)
+ */
+ String[] getValues(String key, String[] def) throws IllegalArgumentException;
+
+ /**
+ * Returns true, if the value of this key cannot be modified by the user.
+ * <p/>
+ * Modifiable preferences can be changed by the portlet in any standard portlet mode
(<code>EDIT, HELP, VIEW</code>).
+ * Per default every preference is modifiable.
+ * <p/>
+ * Read-only preferences cannot be changed by the portlet in any standard portlet
mode, but inside of custom modes it
+ * may be allowed changing them. Preferences are read-only, if they are defined in the
deployment descriptor with
+ * <code>read-only</code> set to <code>true</code>, or if the
portlet container restricts write access.
+ *
+ * @return false, if the value of this key can be changed, or if the key is not known
+ * @throws java.lang.IllegalArgumentException
+ * if <code>key</code> is <code>null</code>.
+ */
+ boolean isReadOnly(String key) throws IllegalArgumentException;
+
+ /**
+ * Resets or removes the value associated with the specified key.
+ * <p/>
+ * If this implementation supports stored defaults, and there is such a default for
the specified preference, the
+ * given key will be reset to the stored default.
+ * <p/>
+ * If there is no default available the key will be removed.
+ *
+ * @param key to reset
+ * @throws java.lang.IllegalArgumentException
+ * if key is <code>null</code>.
+ * @throws ReadOnlyException if this preference cannot be modified for this request
+ */
+ void reset(String key) throws IllegalArgumentException, ReadOnlyException;
+
+ /**
+ * Associates the specified String value with the specified key in this preference.
+ * <p/>
+ * The key cannot be <code>null</code>, but <code>null</code>
values for the value parameter are allowed.
+ *
+ * @param key key with which the specified value is to be associated.
+ * @param value value to be associated with the specified key.
+ * @throws ReadOnlyException if this preference cannot be modified for this request
+ * @throws java.lang.IllegalArgumentException
+ * if key is <code>null</code>, or
<code>key.length()</code> or <code>value.length</code>
+ * are to long. The maximum length for key and value are
implementation specific.
+ * @see #setValues(String,String[])
+ */
+ void setValue(String key, String value) throws IllegalArgumentException,
ReadOnlyException;
+
+ /**
+ * Associates the specified String array value with the specified key in this
preference.
+ * <p/>
+ * The key cannot be <code>null</code>, but <code>null</code>
values in the values parameter are allowed.
+ *
+ * @param key key with which the value is to be associated
+ * @param values values to be associated with key
+ * @throws java.lang.IllegalArgumentException
+ * if key is <code>null</code>, or
<code>key.length()</code> is to long or
+ * <code>value.size</code> is to large. The
maximum length for key and maximum size for
+ * value are implementation specific.
+ * @throws ReadOnlyException if this preference cannot be modified for this request
+ * @see #setValue(String,String)
+ */
+ void setValues(String key, String[] values) throws IllegalArgumentException,
ReadOnlyException;
+
+ /**
+ * Commits all changes made to the preferences via the <code>set</code>
methods in the persistent store.
+ * <p/>
+ * If this call returns succesfull, all changes are made persistent. If this call
fails, no changes are made in the
+ * persistent store. This call is an atomic operation regardless of how many
preference attributes have been
+ * modified.
+ * <p/>
+ * All changes made to preferences not followed by a call to the
<code>store</code> method are discarded when the
+ * portlet finishes the <code>processAction</code> method.
+ * <p/>
+ * If a validator is defined for this preferences in the deployment descriptor, this
validator is called before the
+ * actual store is performed to check wether the given preferences are vaild. If this
check fails a
+ * <code>ValidatorException</code> is thrown.
+ *
+ * @throws java.io.IOException if changes cannot be written into the backend store
+ * @throws ValidatorException if the validation performed by the associated validator
fails
+ * @throws java.lang.IllegalStateException
+ * if this method is called inside a render call
+ * @see PreferencesValidator
+ */
+ void store() throws IOException, ValidatorException;
+}
Property changes on:
modules/portlet/trunk/jsr168api/src/main/javax/portlet/PortletPreferences.java
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/jsr168api/src/main/javax/portlet/PortletRequest.java
===================================================================
--- modules/portlet/trunk/jsr168api/src/main/javax/portlet/PortletRequest.java
(rev 0)
+++ modules/portlet/trunk/jsr168api/src/main/javax/portlet/PortletRequest.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,449 @@
+/******************************************************************************
+ * 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 javax.portlet;
+
+import java.security.Principal;
+import java.util.Enumeration;
+import java.util.Locale;
+import java.util.Map;
+
+/**
+ * The <CODE>PortletRequest</CODE> defines the base interface to provide
client request information to a portlet. The
+ * portlet container uses two specialized versions of this interface when invoking a
portlet, <CODE>ActionRequest</CODE>
+ * and <CODE>RenderRequest</CODE>. The portlet container creates these
objects and passes them as arguments to the
+ * portlet's <CODE>processAction</CODE> and
<CODE>render</CODE> methods.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5441 $
+ * @see ActionRequest
+ * @see RenderRequest
+ */
+public interface PortletRequest
+{
+
+ /** String identifier for Basic authentication. Value "BASIC". */
+ String BASIC_AUTH = "BASIC";
+
+ /** String identifier for Form based authentication. Value "FORM". */
+ String FORM_AUTH = "FORM";
+
+ /** String identifier for Certification based authentication. Value
"CLIENT_CERT". */
+ String CLIENT_CERT_AUTH = "CLIENT_CERT";
+
+ /** String identifier for Digest based authentication. Value "DIGEST". */
+ String DIGEST_AUTH = "DIGEST";
+
+ /**
+ * Used to retrieve user information attributes with the
<code>getAttribute</code> call. The user information is
+ * returned as a <code>Map</code> object. The portlet must define the user
information attribute it is interested in
+ * inside the <code>user-attribute</code> section of the deployment
descriptor. If an attribute is not supported by
+ * the current runtime system it will not show up in the user attribute map.<BR>
If the user-attribute is supported
+ * by the runtime system, but not defined for a particular user, then for that user
the attribute exists in the
+ * returned map and the attribute has a <code>null</code> value.
+ * <p/>
+ * If the user-attribute is not defined for the current user it will not show up in
the Map.
+ * <p/>
+ * The value is <code>javax.portlet.userinfo</code>.
+ */
+ String USER_INFO = "javax.portlet.userinfo";
+
+ /**
+ * Returns true, if the given window state is valid to be set for this portlet in the
context of the current
+ * request.
+ *
+ * @param state window state to checked
+ * @return true, if it is valid for this portlet in this request to change to the
given window state
+ */
+ boolean isWindowStateAllowed(WindowState state);
+
+ /**
+ * Returns true, if the given portlet mode is a valid one to set for this portlet in
the context of the current
+ * request.
+ *
+ * @param mode portlet mode to check
+ * @return true, if it is valid for this portlet in this request to change to the
given portlet mode
+ */
+ boolean isPortletModeAllowed(PortletMode mode);
+
+ /**
+ * Returns the current portlet mode of the portlet.
+ *
+ * @return the portlet mode
+ */
+ PortletMode getPortletMode();
+
+ /**
+ * Returns the current window state of the portlet.
+ *
+ * @return the window state
+ */
+ WindowState getWindowState();
+
+ /**
+ * Returns the preferences object associated with the portlet.
+ *
+ * @return the portlet preferences
+ */
+ PortletPreferences getPreferences();
+
+ /**
+ * Returns the current portlet session or, if there is no current session, creates one
and returns the new session.
+ * <p/>
+ * Creating a new portlet session will result in creating a new
<code>HttpSession</code> on which the portlet
+ * session is based on.
+ *
+ * @return the portlet session
+ */
+ PortletSession getPortletSession();
+
+ /**
+ * Returns the current portlet session or, if there is no current session and the
given flag is <CODE>true</CODE>,
+ * creates one and returns the new session.
+ * <p/>
+ * If the given flag is <CODE>false</CODE> and there is no current portlet
session, this method returns
+ * <CODE>null</CODE>.
+ * <p/>
+ * Creating a new portlet session will result in creating a new
<code>HttpSession</code> on which the portlet
+ * session is based on.
+ *
+ * @param create <CODE>true</CODE> to create a new session, <BR>
<CODE>false</CODE> to return <CODE>null</CODE> if
+ * there is no current session
+ * @return the portlet session
+ */
+ PortletSession getPortletSession(boolean create);
+
+ /**
+ * Returns the value of the specified request property as a
<code>String</code>. If the request did not include a
+ * property of the specified name, this method returns <code>null</code>.
+ * <p/>
+ * A portlet can access portal/portlet-container specific properties through this
method and, if available, the
+ * headers of the HTTP client request.
+ * <p/>
+ * This method should only be used if the property has only one value. If the property
might have more than one
+ * value, use {@link #getProperties}.
+ * <p/>
+ * If this method is used with a multivalued parameter, the value returned is equal to
the first value in the
+ * Enumeration returned by <code>getProperties</code>.
+ *
+ * @param name a <code>String</code> specifying the property name
+ * @throws java.lang.IllegalArgumentException
+ * if name is <code>null</code>.
+ * @return a <code>String</code> containing the value of the requested
property, or <code>null</code> if the
+ * request does not have a property of that name.
+ */
+ String getProperty(String name) throws IllegalArgumentException;
+
+ /**
+ * Returns all the values of the specified request property as a
<code>Enumeration</code> of <code>String</code>
+ * objects.
+ * <p/>
+ * If the request did not include any propertys of the specified name, this method
returns an empty
+ * <code>Enumeration</code>. The property name is case insensitive. You
can use this method with any request
+ * property.
+ *
+ * @param name a <code>String</code> specifying the property name
+ * @throws java.lang.IllegalArgumentException
+ * if name is <code>null</code>.
+ * @return a <code>Enumeration</code> containing the values of the
requested property. If the request does not have
+ * any properties of that name return an empty <code>Enumeration</code>.
+ */
+ Enumeration getProperties(String name) throws IllegalArgumentException;
+
+ /**
+ * Returns a <code>Enumeration</code> of all the property names this
request contains. If the request has no
+ * properties, this method returns an empty <code>Enumeration</code>.
+ *
+ * @return an <code>Enumeration</code> of all the property names sent with
this request; if the request has no
+ * properties, an empty <code>Enumeration</code>.
+ */
+ Enumeration getPropertyNames();
+
+ /**
+ * Returns the context of the calling portal.
+ *
+ * @return the context of the calling portal
+ */
+ PortalContext getPortalContext();
+
+ /**
+ * Returns the name of the authentication scheme used for the connection between
client and portal, for example,
+ * <code>BASIC_AUTH</code>, <code>CLIENT_CERT_AUTH</code>, a
custom one or <code>null</code> if there was no
+ * authentication.
+ *
+ * @return one of the static members <code>BASIC_AUTH</code>,
<code>FORM_AUTH</code>,
+ * <code>CLIENT_CERT_AUTH</code>, <code>DIGEST_AUTH</code>
(suitable for == comparison) indicating the
+ * authentication scheme, a custom one, or <code>null</code> if the
request was not authenticated.
+ */
+ String getAuthType();
+
+ /**
+ * Returns the context path which is the path prefix associated with the deployed
portlet application. If the
+ * portlet application is rooted at the base of the web server URL namespace (also
known as "default" context), this
+ * path must be an empty string. Otherwise, it must be the path the portlet
application is rooted to, the path must
+ * start with a '/' and it must not end with a '/' character.
+ * <p/>
+ * To encode a URL the {@link PortletResponse#encodeURL} method must be used.
+ *
+ * @return a <code>String</code> specifying the portion of the request URL
that indicates the context of the
+ * request
+ * @see PortletResponse#encodeURL
+ */
+ String getContextPath();
+
+ /**
+ * Returns the login of the user making this request, if the user has been
authenticated, or null if the user has
+ * not been authenticated.
+ *
+ * @return a <code>String</code> specifying the login of the user making
this request, or <code>null</code> if the
+ * user login is not known.
+ */
+ String getRemoteUser();
+
+ /**
+ * Returns a java.security.Principal object containing the name of the current
authenticated user.
+ *
+ * @return a <code>java.security.Principal</code> containing the name of
the user making this request, or
+ * <code>null</code> if the user has not been authenticated.
+ */
+ Principal getUserPrincipal();
+
+ /**
+ * Returns a boolean indicating whether the authenticated user is included in the
specified logical "role". Roles
+ * and role membership can be defined using deployment descriptors. If the user has
not been authenticated, the
+ * method returns <code>false</code>.
+ *
+ * @param role a <code>String</code> specifying the name of the role
+ * @return a <code>boolean</code> indicating whether the user making this
request belongs to a given role;
+ * <code>false</code> if the user has not been authenticated.
+ */
+ boolean isUserInRole(String role);
+
+ /**
+ * Returns the value of the named attribute as an <code>Object</code>, or
<code>null</code> if no attribute of the
+ * given name exists.
+ * <p/>
+ * Attribute names should follow the same conventions as package names. This
specification reserves names matching
+ * <code>java.*</code>, and <code>javax.*</code>.
+ * <p/>
+ * In a distributed portlet web application the <code>Object</code> needs
to be serializable.
+ *
+ * @param name a <code>String</code> specifying the name of the attribute
+ * @throws java.lang.IllegalArgumentException
+ * if name is <code>null</code>.
+ * @return an <code>Object</code> containing the value of the attribute,
or <code>null</code> if the attribute does
+ * not exist.
+ */
+ Object getAttribute(String name) throws IllegalArgumentException;
+
+ /**
+ * Returns an <code>Enumeration</code> containing the names of the
attributes available to this request. This method
+ * returns an empty <code>Enumeration</code> if the request has no
attributes available to it.
+ *
+ * @return an <code>Enumeration</code> of strings containing the names of
the request attributes, or an empty
+ * <code>Enumeration</code> if the request has no attributes available to
it.
+ */
+ Enumeration getAttributeNames();
+
+ /**
+ * Returns the value of a request parameter as a <code>String</code>, or
<code>null</code> if the parameter does not
+ * exist. Request parameters are extra information sent with the request. The returned
parameter are
+ * "x-www-form-urlencoded" decoded.
+ * <p/>
+ * Only parameters targeted to the current portlet are accessible.
+ * <p/>
+ * This method should only be used if the parameter has only one value. If the
parameter might have more than one
+ * value, use {@link #getParameterValues}.
+ * <p/>
+ * If this method is used with a multivalued parameter, the value returned is equal to
the first value in the array
+ * returned by <code>getParameterValues</code>.
+ *
+ * @param name a <code>String</code> specifying the name of the parameter
+ * @throws java.lang.IllegalArgumentException
+ * if name is <code>null</code>.
+ * @return a <code>String</code> representing the single value of the
parameter
+ * @see #getParameterValues
+ */
+ String getParameter(String name) throws IllegalArgumentException;
+
+ /**
+ * Returns an <code>Enumeration</code> of <code>String</code>
objects containing the names of the parameters
+ * contained in this request. If the request has no parameters, the method returns an
empty
+ * <code>Enumeration</code>.
+ * <p/>
+ * Only parameters targeted to the current portlet are returned.
+ *
+ * @return an <code>Enumeration</code> of <code>String</code>
objects, each <code>String</code> containing the name
+ * of a request parameter; or an empty <code>Enumeration</code> if the
request has no parameters.
+ */
+ Enumeration getParameterNames();
+
+ /**
+ * Returns an array of <code>String</code> objects containing all of the
values the given request parameter has, or
+ * <code>null</code> if the parameter does not exist. The returned
parameters are "x-www-form-urlencoded" decoded.
+ * <p/>
+ * If the parameter has a single value, the array has a length of 1.
+ *
+ * @param name a <code>String</code> containing the name of the parameter
the value of which is requested
+ * @throws java.lang.IllegalArgumentException
+ * if name is <code>null</code>.
+ * @return an array of <code>String</code> objects containing the
parameter values.
+ * @see #getParameter
+ */
+ String[] getParameterValues(String name) throws IllegalArgumentException;
+
+ /**
+ * Returns a <code>Map</code> of the parameters of this request. Request
parameters are extra information sent with
+ * the request. The returned parameters are "x-www-form-urlencoded"
decoded.
+ * <p/>
+ * The values in the returned <code>Map</code> are from type String array
(<code>String[]</code>).
+ * <p/>
+ * If no parameters exist this method returns an empty <code>Map</code>.
+ *
+ * @return an immutable <code>Map</code> containing parameter names as
keys and parameter values as map values, or
+ * an empty <code>Map</code> if no parameters exist. The keys in
the parameter map are of type String. The
+ * values in the parameter map are of type String array
(<code>String[]</code>).
+ */
+ Map getParameterMap();
+
+ /**
+ * Returns a boolean indicating whether this request was made using a secure channel
between client and the portal,
+ * such as HTTPS.
+ *
+ * @return true, if the request was made using a secure channel.
+ */
+ boolean isSecure();
+
+ /**
+ * Stores an attribute in this request.
+ * <p/>
+ * <p>Attribute names should follow the same conventions as package names. Names
beginning with <code>java.*</code>,
+ * <code>javax.*</code>, and <code>com.sun.*</code> are
reserved for use by Sun Microsystems. <br> If the value
+ * passed into this method is <code>null</code>, the effect is the same as
calling {@link #removeAttribute}.
+ *
+ * @param name a <code>String</code> specifying the name of the attribute
+ * @param o the <code>Object</code> to be stored
+ * @throws java.lang.IllegalArgumentException
+ * if name is <code>null</code>.
+ */
+ void setAttribute(String name, Object o) throws IllegalArgumentException;
+
+ /**
+ * Removes an attribute from this request. This method is not generally needed, as
attributes only persist as long
+ * as the request is being handled.
+ * <p/>
+ * <p>Attribute names should follow the same conventions as package names. Names
beginning with <code>java.*</code>,
+ * <code>javax.*</code>, and <code>com.sun.*</code> are
reserved for use by Sun Microsystems.
+ *
+ * @param name a <code>String</code> specifying the name of the attribute
to be removed
+ * @throws java.lang.IllegalArgumentException
+ * if name is <code>null</code>.
+ */
+ void removeAttribute(String name) throws IllegalArgumentException;
+
+ /**
+ * Returns the session ID indicated in the client request. This session ID may not be
a valid one, it may be an old
+ * one that has expired or has been invalidated. If the client request did not specify
a session ID, this method
+ * returns <code>null</code>.
+ *
+ * @return a <code>String</code> specifying the session ID, or
<code>null</code> if the request did not specify a
+ * session ID
+ * @see #isRequestedSessionIdValid
+ */
+ String getRequestedSessionId();
+
+ /**
+ * Checks whether the requested session ID is still valid.
+ *
+ * @return <code>true</code> if this request has an id for a valid
session in the current session context;
+ * <code>false</code> otherwise
+ * @see #getRequestedSessionId
+ * @see #getPortletSession
+ */
+ boolean isRequestedSessionIdValid();
+
+ /**
+ * Returns the portal preferred content type for the response.
+ * <p/>
+ * The content type only includes the MIME type, not the character set.
+ * <p/>
+ * Only content types that the portlet has defined in its deployment descriptor are
valid return values for this
+ * method call. If the portlet has defined <code>'*'</code> or
<code>'* / *'</code> as supported content types,
+ * these may also be valid return values.
+ *
+ * @return preferred MIME type of the response
+ */
+ String getResponseContentType();
+
+ /**
+ * Gets a list of content types which the portal accepts for the response. This list
is ordered with the most
+ * preferable types listed first.
+ * <p/>
+ * The content type only includes the MIME type, not the character set.
+ * <p/>
+ * Only content types that the portlet has defined in its deployment descriptor are
valid return values for this
+ * method call. If the portlet has defined <code>'*'</code> or
<code>'* / *'</code> as supported content types,
+ * these may also be valid return values.
+ *
+ * @return ordered list of MIME types for the response
+ */
+ Enumeration getResponseContentTypes();
+
+ /**
+ * Returns the preferred Locale in which the portal will accept content. The Locale
may be based on the
+ * Accept-Language header of the client.
+ *
+ * @return the prefered Locale in which the portal will accept content.
+ */
+ Locale getLocale();
+
+ /**
+ * Returns an Enumeration of Locale objects indicating, in decreasing order starting
with the preferred locale in
+ * which the portal will accept content for this request. The Locales may be based on
the Accept-Language header of
+ * the client.
+ *
+ * @return an Enumeration of Locales, in decreasing order, in which the portal will
accept content for this request
+ */
+ Enumeration getLocales();
+
+ /**
+ * Returns the name of the scheme used to make this request. For example,
<code>http</code>, <code>https</code>, or
+ * <code>ftp</code>. Different schemes have different rules for
constructing URLs, as noted in RFC 1738.
+ *
+ * @return a <code>String</code> containing the name of the scheme used to
make this request
+ */
+ String getScheme();
+
+ /**
+ * Returns the host name of the server that received the request.
+ *
+ * @return a <code>String</code> containing the name of the server to
which the request was sent
+ */
+ String getServerName();
+
+ /**
+ * Returns the port number on which this request was received.
+ *
+ * @return an integer specifying the port number
+ */
+ int getServerPort();
+}
Property changes on:
modules/portlet/trunk/jsr168api/src/main/javax/portlet/PortletRequest.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/jsr168api/src/main/javax/portlet/PortletRequestDispatcher.java
===================================================================
--- modules/portlet/trunk/jsr168api/src/main/javax/portlet/PortletRequestDispatcher.java
(rev 0)
+++
modules/portlet/trunk/jsr168api/src/main/javax/portlet/PortletRequestDispatcher.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,52 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package javax.portlet;
+
+import java.io.IOException;
+
+/**
+ * The <code>PortletRequestDispatcher</code> interface defines an object that
receives requests from the client and
+ * sends them to the specified resources (such as a servlet, HTML file, or JSP file) on
the server. The portlet
+ * container creates the <code>PortletRequestDispatcher</code> object, which
is used as a wrapper around a server
+ * resource located at a particular path or given by a particular name.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5441 $
+ */
+public interface PortletRequestDispatcher
+{
+ /**
+ * Includes the content of a resource (servlet, JSP page, HTML file) in the response.
In essence, this method enables
+ * programmatic server-side includes.
+ * <p/>
+ * The included servlet cannot set or change the response status code or set headers;
any attempt to make a change is
+ * ignored.
+ *
+ * @param request a {@link RenderRequest} object that contains the client request
+ * @param response a {@link RenderResponse} object that contains the render response
+ * @throws PortletException if the included resource throws a ServletException, or
other exceptions that are not
+ * Runtime- or IOExceptions.
+ * @throws java.io.IOException if the included resource throws this exception
+ */
+ void include(RenderRequest request, RenderResponse response) throws PortletException,
IOException;
+}
Property changes on:
modules/portlet/trunk/jsr168api/src/main/javax/portlet/PortletRequestDispatcher.java
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/jsr168api/src/main/javax/portlet/PortletResponse.java
===================================================================
--- modules/portlet/trunk/jsr168api/src/main/javax/portlet/PortletResponse.java
(rev 0)
+++ modules/portlet/trunk/jsr168api/src/main/javax/portlet/PortletResponse.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,83 @@
+/******************************************************************************
+ * 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 javax.portlet;
+
+/**
+ * The <CODE>PortletResponse</CODE> defines the base interface to assist a
portlet in creating and sending a response to
+ * the client. The portlet container uses two specialized versions of this interface when
invoking a portlet,
+ * <CODE>ActionResponse</CODE> and <CODE>RenderResponse</CODE>.
The portlet container creates these objects and passes
+ * them as arguments to the portlet's <CODE>processAction</CODE> and
<CODE>render</CODE> methods.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5441 $
+ * @see ActionResponse
+ * @see RenderResponse
+ */
+public interface PortletResponse
+{
+ /**
+ * Adds a String property to an existing key to be returned to the portal.
+ * <p/>
+ * This method allows response properties to have multiple values.
+ * <p/>
+ * Properties can be used by portlets to provide vendor specific information to the
portal.
+ *
+ * @param key the key of the property to be returned to the portal
+ * @param value the value of the property to be returned to the portal
+ * @throws java.lang.IllegalArgumentException
+ * if key is <code>null</code>.
+ */
+ void addProperty(String key, String value) throws IllegalArgumentException;
+
+ /**
+ * Sets a String property to be returned to the portal.
+ * <p/>
+ * Properties can be used by portlets to provide vendor specific information to the
portal.
+ * <p/>
+ * This method resets all properties previously added with the same key.
+ *
+ * @param key the key of the property to be returned to the portal
+ * @param value the value of the property to be returned to the portal
+ * @throws java.lang.IllegalArgumentException
+ * if key is <code>null</code>.
+ */
+ void setProperty(String key, String value) throws IllegalArgumentException;
+
+ /**
+ * Returns the encoded URL of the resource, like servlets, JSPs, images and other
static files, at the given path.
+ * <p/>
+ * Some portal/portlet-container implementation may require those URLs to contain
implementation specific data
+ * encoded in it. Because of that, portlets should use this method to create such
URLs.
+ * <p/>
+ * The <code>encodeURL</code> method may include the session ID and other
portal/portlet-container specific
+ * information into the URL. If encoding is not needed, it returns the URL unchanged.
+ *
+ * @param path the URI path to the resource. This must be either an absolute URL
(e.g.
+ *
<code>http://my.co/myportal/mywebap/myfolder/myresource.gif</code>) or a full
path URI (e.g.
+ * <code>/myportal/mywebap/myfolder/myresource.gif</code>).
+ * @return the encoded resource URL as string
+ * @throws java.lang.IllegalArgumentException
+ * if path doesn't have a leading slash or is not an absolute URL
+ */
+ String encodeURL(String path) throws IllegalArgumentException;
+}
Property changes on:
modules/portlet/trunk/jsr168api/src/main/javax/portlet/PortletResponse.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/jsr168api/src/main/javax/portlet/PortletSecurityException.java
===================================================================
--- modules/portlet/trunk/jsr168api/src/main/javax/portlet/PortletSecurityException.java
(rev 0)
+++
modules/portlet/trunk/jsr168api/src/main/javax/portlet/PortletSecurityException.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,72 @@
+/******************************************************************************
+ * 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 javax.portlet;
+
+/**
+ * A portlet should throw a <CODE>PortletSecurityException</CODE> when a call
fails because of security reasons.<br>
+ * Additionally it can be thrown by the portal/portlet-container.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5441 $
+ */
+public class PortletSecurityException extends PortletException
+{
+
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 8583073199398660179L;
+
+ /**
+ * Constructs a new security exception with the given text. The portlet container may
use the text write it to a
+ * log.
+ *
+ * @param text the exception text
+ */
+ public PortletSecurityException(String text)
+ {
+ super(text);
+ }
+
+ /**
+ * Constructs a new portlet security exception when the portlet needs to do the
following: <ul> <il>throw an
+ * exception <li>include a message about the "root cause" that
interfered with its normal operation <li>include a
+ * description message </ul>
+ *
+ * @param text the exception text
+ * @param cause the root cause
+ */
+ public PortletSecurityException(String text, Throwable cause)
+ {
+ super(text, cause);
+ }
+
+ /**
+ * Constructs a new portlet security exception when the portlet needs to throw an
exception. The exception message is
+ * based on the localized message of the underlying exception.
+ *
+ * @param cause the root cause
+ */
+ public PortletSecurityException(Throwable cause)
+ {
+ super(cause);
+ }
+}
Property changes on:
modules/portlet/trunk/jsr168api/src/main/javax/portlet/PortletSecurityException.java
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/jsr168api/src/main/javax/portlet/PortletSession.java
===================================================================
--- modules/portlet/trunk/jsr168api/src/main/javax/portlet/PortletSession.java
(rev 0)
+++ modules/portlet/trunk/jsr168api/src/main/javax/portlet/PortletSession.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,263 @@
+/******************************************************************************
+ * 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 javax.portlet;
+
+import java.util.Enumeration;
+
+/**
+ * The <CODE>PortletSession</CODE> interface provides a way to identify a
user across more than one request and to store
+ * transient information about that user.
+ * <p/>
+ * A <code>PortletSession</code> is created per user client per portlet
application.
+ * <p/>
+ * A portlet can bind an object attribute into a <code>PortletSession</code>
by name. The <code>PortletSession</code>
+ * interface defines two scopes for storing objects: <ul>
<li><code>APPLICATION_SCOPE</code>
+ * <li><code>PORTLET_SCOPE</code> </ul> All objects stored in the
session using the <code>APPLICATION_SCOPE</code> must
+ * be available to all the portlets, servlets and JSPs that belongs to the same portlet
application and that handles a
+ * request identified as being a part of the same session. Objects stored in the session
using the
+ * <code>PORTLET_SCOPE</code> must be available to the portlet during
requests for the same portlet window that the
+ * objects where stored from. Attributes stored in the
<code>PORTLET_SCOPE</code> are not protected from other web
+ * components of the portlet application. They are just conveniently namespaced.
+ * <p/>
+ * The portlet session is based on the <code>HttpSession</code>. Therefore
all <code>HttpSession</code> listeners do
+ * apply to the portlet session and attributes set in the portlet session are visible in
the <code>HttpSession</code>
+ * and vice versa.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5441 $
+ */
+public interface PortletSession
+{
+ /**
+ * This constant defines an application wide scope for the session attribute.
<code>APPLICATION_SCOPE</code> session
+ * attributes enable Portlets within one portlet application to share data.
+ * <p/>
+ * Portlets may need to prefix attributes set in this scope with some ID, to avoid
overwriting each other's
+ * attributes in the case where two portlets of the same portlet definition are
created.
+ * <p/>
+ * Value: <code>0x01</code>
+ */
+ int APPLICATION_SCOPE = 0x01;
+
+ /**
+ * This constant defines the scope of the session attribute to be private to the
portlet and its included resources.
+ * <p/>
+ * Value: <code>0x02</code>
+ */
+ int PORTLET_SCOPE = 0x02;
+
+ /**
+ * Returns the object bound with the specified name in this session under the
<code>PORTLET_SCOPE</code>, or
+ * <code>null</code> if no object is bound under the name in that scope.
+ *
+ * @param name a string specifying the name of the object
+ * @throws java.lang.IllegalStateException
+ * if this method is called on an invalidated session.
+ * @throws java.lang.IllegalArgumentException
+ * if name is <code>null</code>.
+ * @return the object with the specified name for the
<code>PORTLET_SCOPE</code>.
+ */
+ Object getAttribute(String name) throws IllegalStateException,
IllegalArgumentException;
+
+ /**
+ * Returns the object bound with the specified name in this session, or
<code>null</code> if no object is bound under
+ * the name in the given scope.
+ *
+ * @param name a string specifying the name of the object
+ * @param scope session scope of this attribute
+ * @throws java.lang.IllegalStateException
+ * if this method is called on an invalidated session
+ * @throws java.lang.IllegalArgumentException
+ * if name is <code>null</code>.
+ * @return the object with the specified name
+ */
+ Object getAttribute(String name, int scope) throws IllegalStateException,
IllegalArgumentException;
+
+ /**
+ * Returns an <code>Enumeration</code> of String objects containing the
names of all the objects bound to this
+ * session under the <code>PORTLET_SCOPE</code>, or an empty
<code>Enumeration</code> if no attributes are
+ * available.
+ *
+ * @throws java.lang.IllegalStateException
+ * if this method is called on an invalidated session
+ * @return an <code>Enumeration</code> of <code>String</code>
objects specifying the names of all the objects bound
+ * to this session, or an empty <code>Enumeration</code> if no attributes
are available.
+ */
+ Enumeration getAttributeNames() throws IllegalStateException;
+
+ /**
+ * Returns an <code>Enumeration</code> of String objects containing the
names of all the objects bound to this
+ * session in the given scope, or an empty <code>Enumeration</code> if no
attributes are available in the given
+ * scope.
+ *
+ * @param scope session scope of the attribute names
+ * @throws java.lang.IllegalStateException
+ * if this method is called on an invalidated session
+ * @return an <code>Enumeration</code> of <code>String</code>
objects specifying the names of all the objects bound
+ * to this session, or an empty <code>Enumeration</code> if no attributes
are available in the given scope.
+ */
+ Enumeration getAttributeNames(int scope) throws IllegalStateException;
+
+ /**
+ * Returns the time when this session was created, measured in milliseconds since
midnight January 1, 1970 GMT.
+ *
+ * @throws java.lang.IllegalStateException
+ * if this method is called on an invalidated session
+ * @return a <code>long</code> specifying when this session was created,
expressed in milliseconds since 1/1/1970
+ * GMT
+ */
+ long getCreationTime() throws IllegalStateException;
+
+ /**
+ * Returns a string containing the unique identifier assigned to this session.
+ *
+ * @return a string specifying the identifier assigned to this session
+ */
+ String getId();
+
+ /**
+ * Returns the last time the client sent a request associated with this session, as
the number of milliseconds since
+ * midnight January 1, 1970 GMT.
+ * <p/>
+ * <p>Actions that your portlet takes, such as getting or setting a value
associated with the session, do not affect
+ * the access time.
+ *
+ * @return a <code>long</code> representing the last time the client sent
a request associated with this session,
+ * expressed in milliseconds since 1/1/1970 GMT
+ */
+ long getLastAccessedTime();
+
+ /**
+ * Returns the maximum time interval, in seconds, for which the portlet container
keeps this session open between
+ * client accesses. After this interval, the portlet container invalidates the
session. The maximum time interval
+ * can be set with the <code>setMaxInactiveInterval</code> method. A
negative time indicates the session should never
+ * timeout.
+ *
+ * @return an integer specifying the number of seconds this session remains open
between client requests
+ * @see #setMaxInactiveInterval
+ */
+ int getMaxInactiveInterval();
+
+ /**
+ * Returns the portlet application context associated with this session.
+ *
+ * @return the portlet application context
+ */
+ PortletContext getPortletContext();
+
+ /**
+ * Invalidates this session (all scopes) and unbinds any objects bound to it.
+ * <p/>
+ * Invalidating the portlet session will result in invalidating the underlying
<code>HttpSession</code>
+ *
+ * @throws java.lang.IllegalStateException
+ * if this method is called on a session which has already been invalidated
+ */
+ void invalidate() throws IllegalStateException;
+
+ /**
+ * Returns true if the client does not yet know about the session or if the client
chooses not to join the session.
+ *
+ * @return <code>true</code> if the server has created a session, but the
client has not joined yet.
+ * @throws java.lang.IllegalStateException
+ * if this method is called on a session which has already been invalidated
+ */
+ boolean isNew() throws IllegalStateException;
+
+ /**
+ * Removes the object bound with the specified name under the
<code>PORTLET_SCOPE</code> from this session. If the
+ * session does not have an object bound with the specified name, this method does
nothing.
+ *
+ * @param name the name of the object to be removed from this session in the
<code> PORTLET_SCOPE</code>.
+ * @throws java.lang.IllegalStateException
+ * if this method is called on a session which has been invalidated
+ * @throws java.lang.IllegalArgumentException
+ * if name is <code>null</code>.
+ */
+ void removeAttribute(String name) throws IllegalStateException,
IllegalArgumentException;
+
+ /**
+ * Removes the object bound with the specified name and the given scope from this
session. If the session does not
+ * have an object bound with the specified name, this method does nothing.
+ *
+ * @param name the name of the object to be removed from this session
+ * @param scope session scope of this attribute
+ * @throws java.lang.IllegalStateException
+ * if this method is called on a session which has been invalidated
+ * @throws java.lang.IllegalArgumentException
+ * if name is <code>null</code>.
+ */
+ void removeAttribute(String name, int scope) throws IllegalStateException,
IllegalArgumentException;
+
+ /**
+ * Binds an object to this session under the <code>PORTLET_SCOPE</code>,
using the name specified. If an object of
+ * the same name in this scope is already bound to the session, that object is
replaced.
+ * <p/>
+ * <p>After this method has been executed, and if the new object implements
<code>HttpSessionBindingListener</code>,
+ * the container calls <code>HttpSessionBindingListener.valueBound</code>.
The container then notifies any
+ * <code>HttpSessionAttributeListeners</code> in the web application.
<p>If an object was already bound to this
+ * session that implements <code>HttpSessionBindingListener</code>, its
<code>HttpSessionBindingListener.valueUnbound</code>
+ * method is called.
+ * <p/>
+ * <p>If the value is <code>null</code>, this has the same effect as
calling <code>removeAttribute()</code>.
+ *
+ * @param name the name to which the object is bound under the
<code>PORTLET_SCOPE</code>; this cannot be
+ * <code>null</code>.
+ * @param value the object to be bound
+ * @throws java.lang.IllegalStateException
+ * if this method is called on a session which has been invalidated
+ * @throws java.lang.IllegalArgumentException
+ * if name is <code>null</code>.
+ */
+ void setAttribute(String name, Object value) throws IllegalStateException,
IllegalArgumentException;
+
+ /**
+ * Binds an object to this session in the given scope, using the name specified. If an
object of the same name in
+ * this scope is already bound to the session, that object is replaced.
+ * <p/>
+ * <p>After this method has been executed, and if the new object implements
<code>HttpSessionBindingListener</code>,
+ * the container calls <code>HttpSessionBindingListener.valueBound</code>.
The container then notifies any
+ * <code>HttpSessionAttributeListeners</code> in the web application.
<p>If an object was already bound to this
+ * session that implements <code>HttpSessionBindingListener</code>, its
<code>HttpSessionBindingListener.valueUnbound</code>
+ * method is called.
+ * <p/>
+ * <p>If the value is <code>null</code>, this has the same effect as
calling <code>removeAttribute()</code>.
+ *
+ * @param name the name to which the object is bound; this cannot be
<code>null</code>.
+ * @param value the object to be bound
+ * @param scope session scope of this attribute
+ * @throws java.lang.IllegalStateException
+ * if this method is called on a session which has been invalidated
+ * @throws java.lang.IllegalArgumentException
+ * if name is <code>null</code>.
+ */
+ void setAttribute(String name, Object value, int scope) throws IllegalStateException,
IllegalArgumentException;
+
+ /**
+ * Specifies the time, in seconds, between client requests, before the portlet
container invalidates this session. A
+ * negative time indicates the session should never timeout.
+ *
+ * @param interval An integer specifying the number of seconds
+ */
+ void setMaxInactiveInterval(int interval);
+}
Property changes on:
modules/portlet/trunk/jsr168api/src/main/javax/portlet/PortletSession.java
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/jsr168api/src/main/javax/portlet/PortletSessionUtil.java
===================================================================
--- modules/portlet/trunk/jsr168api/src/main/javax/portlet/PortletSessionUtil.java
(rev 0)
+++
modules/portlet/trunk/jsr168api/src/main/javax/portlet/PortletSessionUtil.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,70 @@
+/******************************************************************************
+ * 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 javax.portlet;
+
+/**
+ * The <CODE>PortletSessionUtil</CODE> class helps identify and decode
attributes in the <CODE>PORTLET_SCOPE</CODE>
+ * scope of the PortletSession when accessed through the HttpSession an from within calls
to methods of the
+ * HttpSessionBindingListener interface.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5441 $
+ */
+public class PortletSessionUtil
+{
+
+ /**
+ * Returns the attribute name of an attribute in the
<code>PORTLET_SCOPE</code>. If the attribute is in the
+ * <code>APPLICATION_SCOPE</code> it returns the attribute name
unchanged.
+ *
+ * @param name a string specifying the name of the encoded portlet attribute
+ * @return the decoded attribute name
+ */
+ public static String decodeAttributeName(String name)
+ {
+ int position = name.indexOf('?');
+ if (position != -1 && name.startsWith("javax.portlet.p."))
+ {
+ return name.substring(position + 1);
+ }
+ return name;
+ }
+
+ /**
+ * Returns the portlet attribute scope from an encoded portlet attribute.
<br>Possible return values are: <ul>
+ * <li><code>PortletSession.APPLICATION_SCOPE</code></li>
<li><code>PortletSession.PORTLET_SCOPE</code></li> </ul>
+ *
+ * @param name a string specifying the name of the encoded portlet attribute
+ * @return the decoded attribute scope
+ * @see PortletSession
+ */
+ public static int decodeScope(String name)
+ {
+ int position = name.indexOf('?');
+ if (position != -1 && name.startsWith("javax.portlet.p."))
+ {
+ return PortletSession.PORTLET_SCOPE;
+ }
+ return PortletSession.APPLICATION_SCOPE;
+ }
+}
Property changes on:
modules/portlet/trunk/jsr168api/src/main/javax/portlet/PortletSessionUtil.java
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/jsr168api/src/main/javax/portlet/PortletURL.java
===================================================================
--- modules/portlet/trunk/jsr168api/src/main/javax/portlet/PortletURL.java
(rev 0)
+++ modules/portlet/trunk/jsr168api/src/main/javax/portlet/PortletURL.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,155 @@
+/******************************************************************************
+ * 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 javax.portlet;
+
+import java.util.Map;
+
+/**
+ * The <CODE>PortletURL</CODE> interface represents a URL that reference the
portlet itself.
+ * <p/>
+ * A PortletURL is created through the <CODE>RenderResponse</CODE>.
Parameters, a portlet mode, a window state and a
+ * security level can be added to <CODE>PortletURL</CODE> objects. The
PortletURL must be converted to a String in order
+ * to embed it into the markup generated by the portlet.
+ * <p/>
+ * There are two types of PortletURLs: <ul> <li>Action URLs, they are created
with
+ * <CODE>RenderResponse.createActionURL</CODE>, and trigger an action request
followed by a render request. <li>Render
+ * URLs, they are created with <CODE>RenderResponse.createRenderURL</CODE>,
and trigger a render request. </ul>
+ * <p/>
+ * The string reprensentation of a PortletURL does not need to be a valid URL at the time
the portlet is generating its
+ * content. It may contain special tokens that will be converted to a valid URL, by the
portal, before the content is
+ * returned to the client.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5441 $
+ */
+public interface PortletURL
+{
+ /**
+ * Sets the given String parameter to this URL.
+ * <p/>
+ * This method replaces all parameters with the given key.
+ * <p/>
+ * The <code>PortletURL</code> implementation
'x-www-form-urlencoded' encodes all parameter names and values.
+ * Developers should not encode them.
+ * <p/>
+ * A portlet container may prefix the attribute names internally in order to preserve
a unique namespace for the
+ * portlet.
+ *
+ * @param name the parameter name
+ * @param value the parameter value
+ * @throws java.lang.IllegalArgumentException
+ * if name or value are <code>null</code>.
+ */
+ void setParameter(String name, String value) throws IllegalArgumentException;
+
+ /**
+ * Sets the given String array parameter to this URL.
+ * <p/>
+ * This method replaces all parameters with the given key.
+ * <p/>
+ * The <code>PortletURL</code> implementation
'x-www-form-urlencoded' encodes all parameter names and values.
+ * Developers should not encode them.
+ * <p/>
+ * A portlet container may prefix the attribute names internally in order to preserve
a unique namespace for the
+ * portlet.
+ *
+ * @param name the parameter name
+ * @param values the parameter values
+ * @throws java.lang.IllegalArgumentException
+ * if name or values are <code>null</code>.
+ */
+ void setParameter(String name, String[] values) throws IllegalArgumentException;
+
+ /**
+ * Sets a parameter map for this URL.
+ * <p/>
+ * All previously set parameters are cleared.
+ * <p/>
+ * The <code>PortletURL</code> implementation
'x-www-form-urlencoded' encodes all parameter names and values.
+ * Developers should not encode them.
+ * <p/>
+ * A portlet container may prefix the attribute names internally, in order to preserve
a unique namespace for the
+ * portlet.
+ *
+ * @param parameters Map containing parameter names for the render phase as keys and
parameter values as map values.
+ * The keys in the parameter map must be of type String. The values
in the parameter map must be of
+ * type String array (<code>String[]</code>).
+ * @exception java.lang.IllegalArgumentException if parameters is
<code>null</code>, if any of the key/values in the
+ * Map are <code>null</code>, if any of the keys is not a String, or if
any of the values is not a String array.
+ */
+ void setParameters(Map parameters) throws IllegalArgumentException;
+
+ /**
+ * Indicates the portlet mode the portlet must be in, if this portlet URL triggers a
request.
+ * <p/>
+ * A URL can not have more than one portlet mode attached to it. If more than one
portlet mode is set only the last
+ * one set is attached to the URL.
+ *
+ * @param portletMode the portlet mode
+ * @throws PortletModeException if the portlet cannot switch to this mode, because the
portal does not support this
+ * mode, the portlet has not declared in its deployment
descriptor that it supports this
+ * mode for the current markup, or the current user is
not allowed to switch to this
+ * mode. The
<code>PortletRequest.isPortletModeAllowed()</code> method can be used to
+ * check if the portlet can set a given portlet mode.
+ * @see PortletRequest#isPortletModeAllowed
+ */
+ void setPortletMode(PortletMode portletMode) throws PortletModeException;
+
+ /**
+ * Indicated the security setting for this URL.
+ * <p/>
+ * Secure set to <code>true</code> indicates that the portlet requests a
secure connection between the client and the
+ * portlet window for this URL. Secure set to <code>false</code> indicates
that the portlet does not need a secure
+ * connection for this URL. If the security is not set for a URL, it will stay the
same as the current request.
+ *
+ * @param secure true, if portlet requests to have a secure connection between its
portlet window and the client;
+ * false, if the portlet does not require a secure connection.
+ * @throws PortletSecurityException if the run-time environment does not support the
indicated setting
+ */
+ void setSecure(boolean secure) throws PortletSecurityException;
+
+ /**
+ * Indicates the window state the portlet should be in, if this portlet URL triggers a
request.
+ * <p/>
+ * A URL can not have more than one window state attached to it. If more than one
window state is set only the last
+ * one set is attached to the URL.
+ *
+ * @param windowState the portlet window state
+ * @throws WindowStateException if the portlet cannot switch to this state, because
the portal does not support this
+ * state, the portlet has not declared in its deployment
descriptor that it supports
+ * this state, or the current user is not allowed to
switch to this state. The
+ *
<code>PortletRequest.isWindowStateAllowed()</code> method can be used to check
if the
+ * portlet can set a given window state.
+ * @see PortletRequest#isWindowStateAllowed
+ */
+ void setWindowState(WindowState windowState) throws WindowStateException;
+
+ /**
+ * Returns the portlet URL string representation to be embedded in the
markup.<br> Note that the returned String may
+ * not be a valid URL, as it may be rewritten by the portal/portlet-container before
returning the markup to the
+ * client.
+ *
+ * @return the encoded URL as a string
+ */
+ String toString();
+}
Property changes on:
modules/portlet/trunk/jsr168api/src/main/javax/portlet/PortletURL.java
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/jsr168api/src/main/javax/portlet/PreferencesValidator.java
===================================================================
--- modules/portlet/trunk/jsr168api/src/main/javax/portlet/PreferencesValidator.java
(rev 0)
+++
modules/portlet/trunk/jsr168api/src/main/javax/portlet/PreferencesValidator.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,45 @@
+/******************************************************************************
+ * 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 javax.portlet;
+
+/**
+ * The <CODE>PreferencesValidator</CODE> allows to validate the set of
preferences of the associated portlet just before
+ * they are stored in the persistent store.
+ * <p/>
+ * The portlet container invokes the <code>validate</code> method as part of
the invocation of the <code>store</code>
+ * method of the <code>PortletPreferences</code>.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5441 $
+ */
+public interface PreferencesValidator
+{
+ /**
+ * If the preferences values are successfully validated the call to this method must
finish gracefully. Otherwise it
+ * must throw a <code>ValidatorException</code>.
+ *
+ * @param preferences preferences to validate
+ * @throws ValidatorException if the given preferences contains invalid settings
+ */
+ void validate(PortletPreferences preferences) throws ValidatorException;
+}
Property changes on:
modules/portlet/trunk/jsr168api/src/main/javax/portlet/PreferencesValidator.java
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/jsr168api/src/main/javax/portlet/ReadOnlyException.java
===================================================================
--- modules/portlet/trunk/jsr168api/src/main/javax/portlet/ReadOnlyException.java
(rev 0)
+++
modules/portlet/trunk/jsr168api/src/main/javax/portlet/ReadOnlyException.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,72 @@
+/******************************************************************************
+ * 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 javax.portlet;
+
+/**
+ * The <CODE>ReadOnlyException</CODE> is thrown when a portlet tries to
change the value for a read-only preference
+ * attribute.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5441 $
+ */
+public class ReadOnlyException extends PortletException
+{
+
+ /** The serialVersionUID */
+ private static final long serialVersionUID = -5825945164244814308L;
+
+ /**
+ * Constructs a new read-only exception with the given text. The portlet container may
use the text write it to a
+ * log.
+ *
+ * @param text the exception text
+ */
+ public ReadOnlyException(String text)
+ {
+ super(text);
+ }
+
+ /**
+ * Constructs a new read-only exception when the portlet needs to do the following:
<ul> <il>throw an exception
+ * <li>include a message about the "root cause" that interfered with
its normal operation <li>include a description
+ * message </ul>
+ *
+ * @param text the exception text
+ * @param cause the root cause
+ */
+ public ReadOnlyException(String text, Throwable cause)
+ {
+ super(text, cause);
+ }
+
+ /**
+ * Constructs a new read-only exception when the portlet needs to throw an exception.
The exception message is based
+ * on the localized message of the underlying exception.
+ *
+ * @param cause the root cause
+ */
+ public ReadOnlyException(Throwable cause)
+ {
+ super(cause);
+ }
+}
Property changes on:
modules/portlet/trunk/jsr168api/src/main/javax/portlet/ReadOnlyException.java
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/jsr168api/src/main/javax/portlet/RenderRequest.java
===================================================================
--- modules/portlet/trunk/jsr168api/src/main/javax/portlet/RenderRequest.java
(rev 0)
+++ modules/portlet/trunk/jsr168api/src/main/javax/portlet/RenderRequest.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -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 javax.portlet;
+
+/**
+ * The <CODE>RenderRequest</CODE> represents the request sent to the portlet
to handle a render. It extends the
+ * PortletRequest interface to provide render request information to portlets.<br>
The portlet container creates a
+ * <CODE>RenderRequest</CODE> object and passes it as argument to the
portlet's <CODE>render</CODE> method.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5441 $
+ * @see PortletRequest
+ * @see ActionRequest
+ */
+public interface RenderRequest extends PortletRequest
+{
+}
Property changes on:
modules/portlet/trunk/jsr168api/src/main/javax/portlet/RenderRequest.java
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/jsr168api/src/main/javax/portlet/RenderResponse.java
===================================================================
--- modules/portlet/trunk/jsr168api/src/main/javax/portlet/RenderResponse.java
(rev 0)
+++ modules/portlet/trunk/jsr168api/src/main/javax/portlet/RenderResponse.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,257 @@
+/******************************************************************************
+ * 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 javax.portlet;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.PrintWriter;
+import java.util.Locale;
+
+/**
+ * The <CODE>RenderResponse</CODE> defines an object to assist a portlet in
sending a response to the portal. It extends
+ * the <CODE>PortletResponse</CODE> interface to provide specific render
response functionality to portlets.<br> The
+ * portlet container creates a <CODE>RenderResponse</CODE> object and passes
it as argument to the portlet's
+ * <CODE>render</CODE> method.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5441 $
+ * @see RenderRequest
+ * @see PortletResponse
+ */
+public interface RenderResponse extends PortletResponse
+{
+ /**
+ * Property to set the expiration time in seconds for this response using the
<code>setProperty</code> method.
+ * <p/>
+ * If the expiration value is set to 0, caching is disabled for this portlet; if the
value is set to -1, the cache
+ * does not expire.
+ * <p/>
+ * The value is <code>"portlet.expiration-cache"</code>.
+ */
+ public static final String EXPIRATION_CACHE = "portlet.expiration-cache";
+
+ /**
+ * Returns the MIME type that can be used to contribute markup to the render
response.
+ * <p/>
+ * If no content type was set previously using the {@link #setContentType} method this
method retuns
+ * <code>null</code>.
+ *
+ * @return the MIME type of the response, or <code>null</code> if no
content type is set
+ * @see #setContentType
+ */
+
+ String getContentType();
+
+ /**
+ * Creates a portlet URL targeting the portlet. If no portlet mode, window state or
security modifier is set in the
+ * PortletURL the current values are preserved. If a request is triggered by the
PortletURL, it results in a render
+ * request.
+ * <p/>
+ * The returned URL can be further extended by adding portlet-specific parameters and
portlet modes and window
+ * states.
+ * <p/>
+ * The created URL will per default not contain any parameters of the current render
request.
+ *
+ * @return a portlet render URL
+ */
+ PortletURL createRenderURL();
+
+ /**
+ * Creates a portlet URL targeting the portlet. If no portlet mode, window state or
security modifier is set in the
+ * PortletURL the current values are preserved. If a request is triggered by the
PortletURL, it results in an action
+ * request.
+ * <p/>
+ * The returned URL can be further extended by adding portlet-specific parameters and
portlet modes and window
+ * states.
+ * <p/>
+ * The created URL will per default not contain any parameters of the current render
request.
+ *
+ * @return a portlet action URL
+ */
+ PortletURL createActionURL();
+
+ /**
+ * The value returned by this method should be prefixed or appended to elements, such
as JavaScript variables or
+ * function names, to ensure they are unique in the context of the portal page.
+ *
+ * @return the namespace
+ */
+ String getNamespace();
+
+ /**
+ * This method sets the title of the portlet.
+ * <p/>
+ * The value can be a text String
+ *
+ * @param title portlet title as text String or resource URI
+ */
+ void setTitle(String title);
+
+ /**
+ * Sets the MIME type for the render response. The portlet must set the content type
before calling {@link
+ * #getWriter} or {@link #getPortletOutputStream}.
+ * <p/>
+ * Calling <code>setContentType</code> after
<code>getWriter</code> or <code>getOutputStream</code> does not
change
+ * the content type.
+ *
+ * @param type the content MIME type
+ * @throws java.lang.IllegalArgumentException
+ * if the given type is not in the list returned by
<code>PortletRequest.getResponseContentTypes</code>
+ * @see RenderRequest#getResponseContentTypes
+ * @see #getContentType
+ */
+ void setContentType(String type) throws IllegalArgumentException;
+
+ /**
+ * Returns the name of the charset used for the MIME body sent in this response.
+ * <p/>
+ * <p>See <a
href="http://ds.internic.net/rfc/rfc2045.txt">RFC
2047</a> for more information about character encoding
+ * and MIME.
+ *
+ * @return a <code>String</code> specifying the name of the charset, for
example, <code>ISO-8859-1</code>
+ */
+ String getCharacterEncoding();
+
+ /**
+ * Returns a PrintWriter object that can send character text to the portal.
+ * <p/>
+ * Before calling this method the content type of the render response must be set
using the {@link #setContentType}
+ * method.
+ * <p/>
+ * Either this method or {@link #getPortletOutputStream} may be called to write the
body, not both.
+ *
+ * @return a <code>PrintWriter</code> object that can return character
data to the portal
+ * @throws java.io.IOException if an input or output exception occurred
+ * @throws java.lang.IllegalStateException
+ * if the <code>getPortletOutputStream</code>
method has been called on this response, or
+ * if no content type was set using the
<code>setContentType</code> method.
+ * @see #setContentType
+ * @see #getPortletOutputStream
+ */
+ PrintWriter getWriter() throws IOException, IllegalStateException;
+
+ /**
+ * Returns the locale assigned to the response.
+ *
+ * @return Locale of this response
+ */
+ Locale getLocale();
+
+ /**
+ * Sets the preferred buffer size for the body of the response. The portlet container
will use a buffer at least as
+ * large as the size requested.
+ * <p/>
+ * This method must be called before any response body content is written; if content
has been written, or the
+ * portlet container does not support buffering, this method may throw an
<code>IllegalStateException</code>.
+ *
+ * @param size the preferred buffer size
+ * @throws java.lang.IllegalStateException
+ * if this method is called after content has been written, or the portlet
container does not support
+ * buffering
+ * @see #getBufferSize
+ * @see #flushBuffer
+ * @see #isCommitted
+ * @see #reset
+ */
+ void setBufferSize(int size) throws IllegalStateException;
+
+ /**
+ * Returns the actual buffer size used for the response. If no buffering is used,
this method returns 0.
+ *
+ * @return the actual buffer size used
+ * @see #setBufferSize
+ * @see #flushBuffer
+ * @see #isCommitted
+ * @see #reset
+ */
+ int getBufferSize();
+
+ /**
+ * Forces any content in the buffer to be written to the client. A call to this
method automatically commits the
+ * response.
+ *
+ * @throws java.io.IOException if an error occured when writing the output
+ * @see #setBufferSize
+ * @see #getBufferSize
+ * @see #isCommitted
+ * @see #reset
+ */
+ void flushBuffer() throws IOException;
+
+ /**
+ * Clears the content of the underlying buffer in the response without clearing
properties set. If the response has
+ * been committed, this method throws an
<code>IllegalStateException</code>.
+ *
+ * @throws IllegalStateException if this method is called after response is comitted
+ * @see #setBufferSize
+ * @see #getBufferSize
+ * @see #isCommitted
+ * @see #reset
+ */
+ void resetBuffer() throws IllegalStateException;
+
+ /**
+ * Returns a boolean indicating if the response has been committed.
+ *
+ * @return a boolean indicating if the response has been committed
+ * @see #setBufferSize
+ * @see #getBufferSize
+ * @see #flushBuffer
+ * @see #reset
+ */
+ boolean isCommitted();
+
+ /**
+ * Clears any data that exists in the buffer as well as the properties set. If the
response has been committed, this
+ * method throws an <code>IllegalStateException</code>.
+ *
+ * @throws java.lang.IllegalStateException
+ * if the response has already been committed
+ * @see #setBufferSize
+ * @see #getBufferSize
+ * @see #flushBuffer
+ * @see #isCommitted
+ */
+ void reset() throws IllegalStateException;
+
+ /**
+ * Returns a <code>OutputStream</code> suitable for writing binary data in
the response. The portlet container does
+ * not encode the binary data.
+ * <p/>
+ * Before calling this method the content type of the render response must be set
using the {@link #setContentType}
+ * method.
+ * <p/>
+ * Calling <code>flush()</code> on the OutputStream commits the response.
+ * <p/>
+ * Either this method or {@link #getWriter} may be called to write the body, not
both.
+ *
+ * @throws java.lang.IllegalStateException
+ * if the <code>getWriter</code> method has
been called on this response, or if no
+ * content type was set using the
<code>setContentType</code> method.
+ * @throws java.io.IOException if an input or output exception occurred
+ * @return a <code>OutputStream</code> for writing binary data
+ * @see #setContentType
+ * @see #getWriter
+ */
+ OutputStream getPortletOutputStream() throws IllegalStateException, IOException;
+}
Property changes on:
modules/portlet/trunk/jsr168api/src/main/javax/portlet/RenderResponse.java
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/jsr168api/src/main/javax/portlet/UnavailableException.java
===================================================================
--- modules/portlet/trunk/jsr168api/src/main/javax/portlet/UnavailableException.java
(rev 0)
+++
modules/portlet/trunk/jsr168api/src/main/javax/portlet/UnavailableException.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,102 @@
+/******************************************************************************
+ * 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 javax.portlet;
+
+/**
+ * The portlet should throw the <CODE>UnavailableException</CODE> when the
portlet is either temporarily or permanently
+ * unavailable to handle requests.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5441 $
+ */
+public class UnavailableException extends PortletException
+{
+
+ /** The serialVersionUID */
+ private static final long serialVersionUID = -7461927853991648173L;
+
+ private boolean permanent;
+ private int unavailableSeconds;
+
+ /**
+ * Constructs a new exception with a descriptive message indicating that the portlet
is permanently unavailable.
+ *
+ * @param text a <code>String</code> specifying the descriptive message
+ */
+ public UnavailableException(String text)
+ {
+ super(text);
+ this.unavailableSeconds = 0;
+ this.permanent = true;
+ }
+
+ /**
+ * Constructs a new exception with a descriptive message indicating that the portlet
is temporarily unavailable and
+ * giving an estimate of how long it will be unavailable.
+ * <p/>
+ * <p>In some cases, the portlet cannot make an estimate. For example, the
portlet might know that a server it needs
+ * is not running, but it might not be able to report how long it will take to be
restored to functionality. This can
+ * be indicated with a negative or zero value for the <code>seconds</code>
argument.
+ *
+ * @param text a <code>String</code> specifying the
descriptive message. This message can be written to
+ * a log file or displayed for the user.
+ * @param unavailableSeconds an integer specifying the number of seconds for which the
portlet expects to be
+ * unavailable; if this is zero or negative, it indicates
that the portlet cannot make an
+ * estimate.
+ */
+ public UnavailableException(String text, int unavailableSeconds)
+ {
+ super(text);
+ this.unavailableSeconds = unavailableSeconds;
+ this.permanent = false;
+ }
+
+ /**
+ * Returns the time in seconds for which the portlet can be expected to be
unavailable.
+ * <p/>
+ * If the portlet is called again while it is still unavailable, it indicates the same
time estimate. No effort is
+ * made to correct for the time elapsed since the exception was first reported.
+ * <p/>
+ * If this method returns zero or a negative number, the portlet is permanently
unavailable or cannot provide an
+ * estimate of how long it will be unavailable.
+ *
+ * @return an integer specifying the number of seconds the portlet will be temporarily
unavailable, or zero or a
+ * negative number if the portlet is permanently unavailable or cannot make an
estimate.
+ */
+ public int getUnavailableSeconds()
+ {
+ return unavailableSeconds;
+ }
+
+ /**
+ * Returns a <code>boolean</code> indicating whether the portlet is
permanently unavailable. If so, something is
+ * wrong with the portlet, and the system administrator must take some corrective
action.
+ *
+ * @return <code>true</code> if the portlet is permanently
unavailable; <code>false</code> if the portlet is
+ * temporarily unavailable.
+ */
+ public boolean isPermanent()
+ {
+ return permanent;
+ }
+}
Property changes on:
modules/portlet/trunk/jsr168api/src/main/javax/portlet/UnavailableException.java
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/jsr168api/src/main/javax/portlet/ValidatorException.java
===================================================================
--- modules/portlet/trunk/jsr168api/src/main/javax/portlet/ValidatorException.java
(rev 0)
+++
modules/portlet/trunk/jsr168api/src/main/javax/portlet/ValidatorException.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,145 @@
+/******************************************************************************
+ * 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 javax.portlet;
+
+import java.util.Collection;
+import java.util.Enumeration;
+import java.util.Iterator;
+import java.util.NoSuchElementException;
+
+/**
+ * The <CODE>ValidatorException</CODE> is thrown by the
<CODE>validate</CODE> method of a PreferencesValidator when the
+ * validation of a preference failed.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5441 $
+ */
+public class ValidatorException extends PortletException
+{
+
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 298939407901896813L;
+
+ private static final Enumeration EMPTY_ENUMERATION = new Enumeration()
+ {
+ public boolean hasMoreElements()
+ {
+ return false;
+ }
+
+ public Object nextElement()
+ {
+ throw new NoSuchElementException();
+ }
+ };
+
+ private Collection failedKeys;
+ private Enumeration failedKeysEnumeration;
+
+ /**
+ * Constructs a new validator exception with the given text. The portlet container may
use the text write it to a
+ * log.
+ * <p/>
+ * The collection of failed keys may contain all failed keys, only the first key that
failed validation, or may be
+ * <code>null</code>.
+ *
+ * @param text the exception text
+ * @param failedKeys keys that failed the validation; may be
<code>null</code>
+ */
+ public ValidatorException(String text, Collection failedKeys)
+ {
+ super(text);
+ this.failedKeys = failedKeys;
+ this.failedKeysEnumeration = null;
+ }
+
+ /**
+ * Constructs a new portlet validator exception. Used, when the portlet needs to do
one of the following: <ul>
+ * <il>throw an exception <li>include a message about the "root
cause" that interfered with its normal operation
+ * <li>include a description message </ul>
+ * <p/>
+ * The Collection of failed keys may contain all failed keys, only the first key that
failed validation, or may be
+ * <code>null</code>.
+ *
+ * @param text the exception text
+ * @param cause the root cause
+ * @param failedKeys keys that failed the validation; may be
<code>null</code>
+ */
+ public ValidatorException(String text, Throwable cause, Collection failedKeys)
+ {
+ super(text, cause);
+ this.failedKeys = failedKeys;
+ }
+
+ /**
+ * Constructs a new portlet validator exception when the portlet needs to throw an
exception. The exception message
+ * is based on the localized message of the underlying exception.
+ * <p/>
+ * The Collection of failed keys may contain all failed keys, only the first key that
failed validation, or may be
+ * <code>null</code>.
+ *
+ * @param cause the root cause
+ * @param failedKeys keys that failed the validation; may be
<code>null</code>
+ */
+ public ValidatorException(Throwable cause, Collection failedKeys)
+ {
+ super(cause);
+ this.failedKeys = failedKeys;
+ }
+
+ /**
+ * Returns the keys that failed the validation.
+ * <p/>
+ * The Enumeration of failed keys may contain all failed keys, only the first key that
failed validation, or an empty
+ * <code>Enumeration</code> if no failed keys are available.
+ *
+ * @return the keys that failed validation, or an empty
<code>Enumeration</code> if no failed keys are available.
+ */
+ public Enumeration getFailedKeys()
+ {
+ if (failedKeysEnumeration == null)
+ {
+ if (failedKeys != null)
+ {
+ final Iterator iterator = failedKeys.iterator();
+ failedKeysEnumeration = new Enumeration()
+ {
+ public boolean hasMoreElements()
+ {
+ return iterator.hasNext();
+ }
+
+ public Object nextElement()
+ {
+ return iterator.next();
+ }
+ };
+ }
+ else
+ {
+ failedKeysEnumeration = EMPTY_ENUMERATION;
+ }
+ }
+ return failedKeysEnumeration;
+ }
+}
Property changes on:
modules/portlet/trunk/jsr168api/src/main/javax/portlet/ValidatorException.java
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/jsr168api/src/main/javax/portlet/WindowState.java
===================================================================
--- modules/portlet/trunk/jsr168api/src/main/javax/portlet/WindowState.java
(rev 0)
+++ modules/portlet/trunk/jsr168api/src/main/javax/portlet/WindowState.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,126 @@
+/******************************************************************************
+ * 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 javax.portlet;
+
+import java.util.Locale;
+
+/**
+ * The <CODE>WindowState</CODE> class represents the possible window states
that a portlet window can assume.
+ * <p/>
+ * This class defines a standard set of the most basic portlet window states. Additional
window states may be defined by
+ * calling the constructor of this class. If a portal/portlet-container does not support
a custom window state defined
+ * in the portlet application deployment descriptor, the custom window state will be
ignored by the portal/portlet
+ * container.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 6047 $
+ */
+public class WindowState
+{
+
+ /**
+ * The <code>NORMAL</code> window state indicates that a portlet may be
sharing the page with other portlets. It may
+ * also indicate that the target device has limited display capabilities. Therefore, a
portlet should restrict the
+ * size of its rendered output in this window state.
+ * <p/>
+ * The string value for this state is <code>"normal"</code>.
+ */
+ public static final WindowState NORMAL = new WindowState("normal");
+
+ /**
+ * When a portlet is in <code>MINIMIZED</code> window state, the portlet
should only render minimal output or no
+ * output at all.
+ * <p/>
+ * The string value for this state is <code>"minimized"</code>.
+ */
+ public static final WindowState MINIMIZED = new WindowState("minimized");
+
+ /**
+ * The <code>MAXIMIZED</code> window state is an indication that a portlet
may be the only portlet being rendered in
+ * the portal page, or that the portlet has more space compared to other portlets in
the portal page. A portlet may
+ * generate richer content when its window state is
<code>MAXIMIZED</code>.
+ * <p/>
+ * The string value for this state is <code>"maximized"</code>.
+ */
+ public static final WindowState MAXIMIZED = new WindowState("maximized");
+
+ private String name;
+
+ /**
+ * Creates a new window state with the given name.
+ * <p/>
+ * Upper case letters in the name are converted to lower case letters.
+ *
+ * @param name The name of the portlet mode
+ */
+ public WindowState(String name)
+ {
+ if (name == null)
+ {
+ throw new NullPointerException();
+ }
+ this.name = name.toLowerCase(Locale.ENGLISH);
+ }
+
+ /**
+ * Compares the specified object with this window state for equality. Returns
<code>true</code> if the Strings
+ * <code>equals</code> method for the String representing the two window
states returns <code>true</code>.
+ *
+ * @param o the window state to compare this window state with.
+ * @return true, if the specified object is equal with this window state.
+ */
+ public boolean equals(Object o)
+ {
+ if (o == this)
+ {
+ return true;
+ }
+ if (o instanceof WindowState)
+ {
+ WindowState that = (WindowState)o;
+ return name.equals(that.name);
+ }
+ return false;
+ }
+
+ /**
+ * Returns the hash code value for this window state. The hash code is constructed by
producing the hash value of the
+ * String value of this window state.
+ *
+ * @return hash code value for this window state
+ */
+ public int hashCode()
+ {
+ return name.hashCode();
+ }
+
+ /**
+ * Returns a String representation of this window state. Window state names are always
lower case names.
+ *
+ * @return String representation of this window state.
+ */
+ public String toString()
+ {
+ return name;
+ }
+}
Property changes on:
modules/portlet/trunk/jsr168api/src/main/javax/portlet/WindowState.java
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/jsr168api/src/main/javax/portlet/WindowStateException.java
===================================================================
--- modules/portlet/trunk/jsr168api/src/main/javax/portlet/WindowStateException.java
(rev 0)
+++
modules/portlet/trunk/jsr168api/src/main/javax/portlet/WindowStateException.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,105 @@
+/******************************************************************************
+ * 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 javax.portlet;
+
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.IOException;
+
+/**
+ * The <CODE>WindowStateException</CODE> is thrown when a portlet tries to
use a window state that is not supported by
+ * the current runtime environment or the portlet.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5527 $
+ */
+public class WindowStateException extends PortletException
+{
+
+ /** The serialVersionUID */
+ private static final long serialVersionUID = -7034467327478096995L;
+
+ private transient WindowState state;
+
+ /**
+ * Constructs a new portlet state exception with the given text. The portlet container
may use the text write it to a
+ * log.
+ *
+ * @param text the exception text
+ * @param state the state causing the exception
+ */
+ public WindowStateException(String text, WindowState state)
+ {
+ super(text);
+ this.state = state;
+ }
+
+ /**
+ * Constructs a new portlet state exception when the portlet needs to do the
following: <ul> <il>throw an exception
+ * <li>include a message about the "root cause" that interfered with
its normal operation <li>include a description
+ * message </ul>
+ *
+ * @param text the exception text
+ * @param cause the root cause
+ * @param state the state causing the exception
+ */
+ public WindowStateException(String text, Throwable cause, WindowState state)
+ {
+ super(text, cause);
+ this.state = state;
+ }
+
+ /**
+ * Constructs a new portlet state exception when the portlet needs to throw an
exception. The exception message is
+ * based on the localized message of the underlying exception.
+ *
+ * @param cause the root cause
+ * @param state the state causing the exception
+ */
+ public WindowStateException(Throwable cause, WindowState state)
+ {
+ super(cause);
+ this.state = state;
+ }
+
+ /**
+ * Returns the portlet state causing this exception.
+ *
+ * @return the window state causing this exception
+ */
+ public WindowState getState()
+ {
+ return state;
+ }
+
+ private void writeObject(ObjectOutputStream out) throws IOException
+ {
+ out.writeUTF(state.toString());
+ }
+
+ private void readObject(ObjectInputStream in) throws IOException,
ClassNotFoundException
+ {
+ String s = in.readUTF();
+ state = new WindowState(s);
+ }
+}
Property changes on:
modules/portlet/trunk/jsr168api/src/main/javax/portlet/WindowStateException.java
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/portlet/.classpath
===================================================================
--- modules/portlet/trunk/portlet/.classpath (rev 0)
+++ modules/portlet/trunk/portlet/.classpath 2007-08-17 15:29:49 UTC (rev 7981)
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src/main"/>
+ <classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="lib"
path="/thirdparty/sun-servlet/lib/jsp-api.jar"/>
+ <classpathentry kind="lib"
path="/thirdparty/sun-servlet/lib/servlet-api.jar"/>
+ <classpathentry kind="lib"
path="/thirdparty/oswego-concurrent/lib/concurrent.jar"/>
+ <classpathentry kind="lib"
path="/thirdparty/apache-httpclient/lib/commons-httpclient.jar"/>
+ <classpathentry kind="lib"
path="/thirdparty/dom4j/lib/dom4j.jar"/>
+ <classpathentry kind="lib"
path="/thirdparty/jbossas/core-libs/lib/jboss.jar"/>
+ <classpathentry kind="lib"
path="/thirdparty/jbossas/core-libs/lib/jboss-common.jar"/>
+ <classpathentry kind="lib"
path="/thirdparty/jbossas/core-libs/lib/jboss-jmx.jar"/>
+ <classpathentry kind="lib"
path="/thirdparty/jbossas/core-libs/lib/jboss-system.jar"/>
+ <classpathentry kind="lib"
path="/thirdparty/jbossas/core-libs/lib/jboss-xml-binding.jar"/>
+ <classpathentry kind="lib"
path="/thirdparty/jbossas/core-libs/lib/jmx-invoker-adaptor-client.jar"/>
+ <classpathentry kind="lib"
path="/thirdparty/sun-jaf/lib/activation.jar"/>
+ <classpathentry kind="lib"
path="/thirdparty/junit/lib/junit.jar"/>
+ <classpathentry kind="lib"
path="/thirdparty/jboss/microcontainer/lib/jboss-container.jar"/>
+ <classpathentry kind="lib"
path="/thirdparty/jboss/microcontainer/lib/jboss-dependency.jar"/>
+ <classpathentry kind="lib"
path="/thirdparty/jboss/microcontainer/lib/jboss-microcontainer.jar"/>
+ <classpathentry kind="lib"
path="/thirdparty/apache-log4j/lib/log4j.jar"/>
+ <classpathentry combineaccessrules="false" kind="src"
path="/server"/>
+ <classpathentry combineaccessrules="false" kind="src"
path="/jems"/>
+ <classpathentry combineaccessrules="false" kind="src"
path="/test"/>
+ <classpathentry combineaccessrules="false" kind="src"
path="/api"/>
+ <classpathentry combineaccessrules="false" kind="src"
path="/security"/>
+ <classpathentry kind="lib"
path="/thirdparty/jboss-portal/modules/common/lib/portal-common-lib.jar"/>
+ <classpathentry kind="lib"
path="/thirdparty/jboss-portal/modules/web/lib/portal-web-lib.jar"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Property changes on: modules/portlet/trunk/portlet/.classpath
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/portlet/.cvsignore
===================================================================
--- modules/portlet/trunk/portlet/.cvsignore (rev 0)
+++ modules/portlet/trunk/portlet/.cvsignore 2007-08-17 15:29:49 UTC (rev 7981)
@@ -0,0 +1,2 @@
+bin
+output
Property changes on: modules/portlet/trunk/portlet/.cvsignore
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/portlet/.project
===================================================================
--- modules/portlet/trunk/portlet/.project (rev 0)
+++ modules/portlet/trunk/portlet/.project 2007-08-17 15:29:49 UTC (rev 7981)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>portlet</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Property changes on: modules/portlet/trunk/portlet/.project
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/portlet/build.bat
===================================================================
--- modules/portlet/trunk/portlet/build.bat (rev 0)
+++ modules/portlet/trunk/portlet/build.bat 2007-08-17 15:29:49 UTC (rev 7981)
@@ -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: modules/portlet/trunk/portlet/build.bat
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/portlet/build.sh
===================================================================
--- modules/portlet/trunk/portlet/build.sh (rev 0)
+++ modules/portlet/trunk/portlet/build.sh 2007-08-17 15:29:49 UTC (rev 7981)
@@ -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: modules/portlet/trunk/portlet/build.sh
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/portlet/build.xml
===================================================================
--- modules/portlet/trunk/portlet/build.xml (rev 0)
+++ modules/portlet/trunk/portlet/build.xml 2007-08-17 15:29:49 UTC (rev 7981)
@@ -0,0 +1,368 @@
+<?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 7969 2007-08-17 09:29:00Z 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="jboss.portal/modules/common.classpath"/>
+ <path refid="jboss.portal/modules/web.classpath"/>
+ <path refid="jboss.portal/modules/test.classpath"/>
+ <path refid="jboss.jbossxb.classpath"/>
+ <path refid="oswego.concurrent.classpath"/>
+ <path refid="sun.jaf.classpath"/>
+ <path refid="apache.log4j.classpath"/>
+ <path refid="junit.junit.classpath"/>
+ <path refid="sun.servlet.classpath"/>
+ </path>
+
+ <!-- Configure modules -->
+ <call target="configure-modules"/>
+ <path id="dependentmodule.classpath">
+ <path refid="jboss.portal-portlet-jsr168api.classpath"/>
+ </path>
+
+ <!--+=======================================+-->
+ <!--| Override any default properties here. |-->
+ <!--+=======================================+-->
+
+ <!-- Configure defaults & build tools -->
+ <call target="configure-defaults"/>
+ <!--<call target="configure-tools"/>-->
+
+ <!--+=======================================+-->
+ <!--| 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">
+ <!-- Add module specific elements here. -->
+ </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 lib jar -->
+ <jar jarfile="${build.lib}/portal-portlet-lib.jar">
+ <fileset dir="${build.classes}">
+ <exclude name="org/jboss/portal/test/**"/>
+ </fileset>
+ <fileset dir="${build.resources}/portal-portlet-lib-jar"/>
+ </jar>
+
+ <!-- Portlet test lib jar -->
+ <jar jarfile="${build.lib}/portal-portlet-test-framework-lib.jar">
+ <fileset dir="${build.classes}"
includes="org/jboss/portal/test/framework/portlet/**"/>
+ </jar>
+ </target>
+
+ <macrodef name="package-misc-test">
+ <attribute name="test"/>
+ <sequential>
+ <mkdir
dir="${build.resources}/test/jsr168/misc/@{test}-war/WEB-INF/classes"/>
+ <copy
todir="${build.resources}/test/jsr168/misc/@{test}-war/WEB-INF/classes">
+ <fileset dir="${build.classes}"
includes="org/jboss/portal/test/portlet/jsr168/misc/@{test}/**"/>
+ <fileset dir="${build.classes}"
includes="org/jboss/portal/test/portlet/framework/**"/>
+ </copy>
+ <mkdir
dir="${build.resources}/test/jsr168/misc/@{test}-war/WEB-INF/lib"/>
+ <jar jarfile="${build.lib}/test-jsr168-misc-(a){test}.war">
+ <fileset
dir="${build.resources}/test/jsr168/misc/@{test}-war"/>
+ </jar>
+ </sequential>
+ </macrodef>
+
+ <macrodef name="package-ext-test">
+ <attribute name="test"/>
+ <sequential>
+ <mkdir
dir="${build.resources}/test/jsr168/ext/@{test}-war/WEB-INF/classes"/>
+ <copy
todir="${build.resources}/test/jsr168/ext/@{test}-war/WEB-INF/classes">
+ <fileset dir="${build.classes}"
includes="org/jboss/portal/test/portlet/jsr168/ext/common/**"/>
+ <fileset dir="${build.classes}"
includes="org/jboss/portal/test/portlet/jsr168/ext/@{test}/**"/>
+ <fileset dir="${build.classes}"
includes="org/jboss/portal/test/portlet/framework/**"/>
+ </copy>
+ <mkdir
dir="${build.resources}/test/jsr168/ext/@{test}-war/WEB-INF/lib"/>
+ <jar jarfile="${build.lib}/test-jsr168-ext-(a){test}.war">
+ <fileset
dir="${build.resources}/test/jsr168/ext/@{test}-war"/>
+ </jar>
+ </sequential>
+ </macrodef>
+
+ <macrodef name="package-tck-test">
+ <attribute name="test"/>
+ <sequential>
+ <mkdir
dir="${build.resources}/test/jsr168/tck/@{test}-war/WEB-INF/classes"/>
+ <copy
todir="${build.resources}/test/jsr168/tck/@{test}-war/WEB-INF/classes">
+ <fileset dir="${build.classes}"
includes="org/jboss/portal/test/portlet/jsr168/tck/@{test}/**"/>
+ <fileset dir="${build.classes}"
includes="org/jboss/portal/test/portlet/framework/**"/>
+ </copy>
+ <mkdir
dir="${build.resources}/test/jsr168/tck/@{test}-war/WEB-INF/lib"/>
+ <jar jarfile="${build.lib}/test-jsr168-(a){test}.war">
+ <fileset
dir="${build.resources}/test/jsr168/tck/@{test}-war"/>
+ </jar>
+ </sequential>
+ </macrodef>
+
+ <macrodef name="package-api-test">
+ <attribute name="test"/>
+ <sequential>
+ <mkdir
dir="${build.resources}/test/jsr168/api/@{test}-war/WEB-INF/classes"/>
+ <copy
todir="${build.resources}/test/jsr168/api/@{test}-war/WEB-INF/classes">
+ <fileset dir="${build.classes}"
includes="org/jboss/portal/test/portlet/jsr168/api/@{test}/**"/>
+ <fileset dir="${build.classes}"
includes="org/jboss/portal/test/portlet/framework/**"/>
+ </copy>
+ <mkdir
dir="${build.resources}/test/jsr168/api/@{test}-war/WEB-INF/lib"/>
+ <jar jarfile="${build.lib}/test-jsr168-api-(a){test}.war">
+ <fileset
dir="${build.resources}/test/jsr168/api/@{test}-war"/>
+ </jar>
+ </sequential>
+ </macrodef>
+
+ <!-- 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-info.jar">
+ <fileset dir="${build.classes}"
includes="org/jboss/portal/test/portlet/info/**"/>
+ </jar>
+ <jar jarfile="${build.lib}/test-info.war">
+ <fileset dir="${build.resources}/test/info/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/**"/>
+ <fileset dir="${build.classes}"
includes="org/jboss/portal/test/framework/portlet/**"/>
+ <fileset dir="${build.classes}"
includes="org/jboss/portal/test/portlet/framework/**"/>
+ </jar>
+
+ <!-- JSR 168 test case packaging -->
+ <package-tck-test test="portletinterface"/>
+ <package-tck-test test="dispatcher"/>
+ <package-tck-test test="basic"/>
+ <package-tck-test test="portletrequests"/>
+ <package-tck-test test="portletmode"/>
+ <package-tck-test test="portletconfig"/>
+ <package-tck-test test="portletresponses"/>
+ <package-tck-test test="preferences"/>
+ <package-tck-test test="portletsession"/>
+ <package-tck-test test="portleturl"/>
+ <package-tck-test test="windowstates"/>
+ <package-tck-test test="portletcontext"/>
+
+ <!-- API tests -->
+ <package-api-test test="portletconfig"/>
+ <package-api-test test="portletmode"/>
+ <package-api-test test="windowstate"/>
+ <package-api-test test="portletsessionutil"/>
+ <package-api-test test="portalcontext"/>
+ <package-api-test test="portletcontext"/>
+ <package-api-test test="portleturl"/>
+ <package-api-test test="portletpreferences"/>
+ <package-api-test test="portletsession"/>
+ <package-api-test test="actionrequest"/>
+ <package-api-test test="renderrequest"/>
+ <package-api-test test="actionresponse"/>
+ <package-api-test test="renderresponse"/>
+
+ <!-- Ext tests -->
+ <package-ext-test test="nocache"/>
+ <package-ext-test test="expiringcache"/>
+ <package-ext-test test="neverexpiringcache"/>
+ <package-ext-test test="preferences"/>
+ <package-ext-test test="session"/>
+ <package-ext-test test="portletresponses"/>
+ <package-ext-test test="portletrequests"/>
+ <package-ext-test test="portletmode"/>
+ <package-ext-test test="portletconfig"/>
+ <package-ext-test test="dispatcher"/>
+
+ <!-- Misc tests -->
+ <package-misc-test test="log4j"/>
+ </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="tests" depends="init,
_buildmagic:configure:deployment">
+ <antcall target="test-framework"/>
+ </target>
+
+ <target name="test-framework" depends="init">
+ <execute-tests>
+ <x-test>
+ <test todir="${test.reports}"
name="org.jboss.portal.test.portlet.deployment.UnmarshallerTestCase"/>
+ <test todir="${test.reports}"
name="org.jboss.portal.test.portlet.state.LocalStoreProducerStatefulPortletInvokerTestCase"/>
+ <test todir="${test.reports}"
name="org.jboss.portal.test.portlet.state.RemoteStoreProducerStatefulPortletInvokerTestCase"/>
+ <test todir="${test.reports}"
name="org.jboss.portal.test.portlet.state.LocalStoreConsumerStatefulPortletInvokerTestCase"/>
+ <test todir="${test.reports}"
name="org.jboss.portal.test.portlet.state.RemoteStoreConsumerStatefulPortletInvokerTestCase"/>
+ <test todir="${test.reports}"
name="org.jboss.portal.test.portlet.state.StateConverterV0TestCase"/>
+ <test todir="${test.reports}"
name="org.jboss.portal.test.portlet.PortletRequestDecoderTestCase"/>
+ <test todir="${test.reports}"
name="org.jboss.portal.test.portlet.PortletRequestEncoderTestCase"/>
+ <test todir="${test.reports}"
name="org.jboss.portal.test.portlet.ParametersTestCase"/>
+ <test todir="${test.reports}"
name="org.jboss.portal.test.portlet.PropertiesTestCase"/>
+ </x-test>
+ <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=8787,server=y,suspend=y"/>
+-->
+ </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>
+
+</project>
Property changes on: modules/portlet/trunk/portlet/build.xml
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/ActionURL.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/ActionURL.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/ActionURL.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,44 @@
+/******************************************************************************
+ * 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;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public interface ActionURL extends PortletURL
+{
+ /**
+ * Return the interaction state.
+ *
+ * @return the interaction state
+ */
+ StateString getInteractionState();
+
+ /**
+ * Return the navigational state.
+ *
+ * @return the navigational state
+ */
+ StateString getNavigationalState();
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/ActionURL.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/InvalidPortletIdException.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/InvalidPortletIdException.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/InvalidPortletIdException.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,64 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.portlet;
+
+/**
+ * Thrown by the portlet invoker when a portlet id that is not valid.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5989 $
+ */
+public class InvalidPortletIdException extends PortletInvokerException
+{
+
+ private String portletId;
+
+ public InvalidPortletIdException(String portletId)
+ {
+ super("Invalid portlet id " + portletId);
+ this.portletId = portletId;
+ }
+
+ public InvalidPortletIdException(String message, String portletId)
+ {
+ super(message);
+ this.portletId = portletId;
+ }
+
+ public InvalidPortletIdException(Throwable cause, String portletId)
+ {
+ super(cause);
+ this.portletId = portletId;
+ }
+
+ public InvalidPortletIdException(String message, Throwable cause, String portletId)
+ {
+ super(message, cause);
+ this.portletId = portletId;
+ }
+
+ public String getPortletId()
+ {
+ return portletId;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/InvalidPortletIdException.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/InvokerUnavailableException.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/InvokerUnavailableException.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/InvokerUnavailableException.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -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;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
+ * @version $Revision: 5448 $
+ * @since 2.4 (May 11, 2006)
+ */
+public class InvokerUnavailableException extends PortletInvokerException
+{
+ public InvokerUnavailableException()
+ {
+ }
+
+ public InvokerUnavailableException(String message)
+ {
+ super(message);
+ }
+
+ public InvokerUnavailableException(Throwable cause)
+ {
+ super(cause);
+ }
+
+ public InvokerUnavailableException(String message, Throwable cause)
+ {
+ super(message, cause);
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/InvokerUnavailableException.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/NoSuchPortletException.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/NoSuchPortletException.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/NoSuchPortletException.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,53 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.portlet;
+
+/**
+ * Thrown by the portlet invoker when a portlet id does not exist.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5989 $
+ */
+public class NoSuchPortletException extends InvalidPortletIdException
+{
+
+ public NoSuchPortletException(String portletId)
+ {
+ super("No such portlet " + portletId, portletId);
+ }
+
+ public NoSuchPortletException(String message, String portletId)
+ {
+ super(message, portletId);
+ }
+
+ public NoSuchPortletException(Throwable cause, String portletId)
+ {
+ super(cause, portletId);
+ }
+
+ public NoSuchPortletException(String message, Throwable cause, String portletId)
+ {
+ super(message, cause, portletId);
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/NoSuchPortletException.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/OpaqueStateString.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/OpaqueStateString.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/OpaqueStateString.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -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.portlet;
+
+/**
+ * An opaque implementation of the navigational state.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public class OpaqueStateString extends StateString
+{
+
+ private String value;
+
+ public OpaqueStateString(String value)
+ {
+ if (value == null)
+ {
+ throw new IllegalArgumentException("No null value accepted");
+ }
+ this.value = value;
+ }
+
+ public String getStringValue()
+ {
+ return value;
+ }
+
+ public int hashCode()
+ {
+ return value.hashCode();
+ }
+
+ public boolean equals(Object o)
+ {
+ if (o == this)
+ {
+ return true;
+ }
+ if (o instanceof OpaqueStateString)
+ {
+ OpaqueStateString that = (OpaqueStateString)o;
+ return value.equals(that.value);
+ }
+ return false;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/OpaqueStateString.java
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/Portlet.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/Portlet.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/Portlet.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,56 @@
+/******************************************************************************
+ * 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;
+
+import org.jboss.portal.portlet.info.PortletInfo;
+
+/**
+ * Defines a logical portlet.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public interface Portlet
+{
+ /**
+ * Return the portlet context.
+ *
+ * @return the portlet context
+ */
+ PortletContext getContext();
+
+ /**
+ * Return the portlet info.
+ *
+ * @return the portlet info
+ */
+ PortletInfo getInfo();
+
+ /**
+ * Determines whether the described portlet is remote or not.
+ *
+ * @return <code>true</code> if the described portlet runs in a remote
context (such as WSRP), <code>false</code>
+ * otherwise
+ */
+ boolean isRemote();
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/Portlet.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/PortletCloneFailedException.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/PortletCloneFailedException.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/PortletCloneFailedException.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,62 @@
+/******************************************************************************
+ * 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;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public class PortletCloneFailedException extends PortletInvokerException
+{
+
+ private String portletId;
+
+ public PortletCloneFailedException(String portletId)
+ {
+ super("Portlet clone failure of portlet id " + portletId);
+ this.portletId = portletId;
+ }
+
+ public PortletCloneFailedException(String message, String portletId)
+ {
+ super(message);
+ this.portletId = portletId;
+ }
+
+ public PortletCloneFailedException(Throwable cause, String portletId)
+ {
+ super(cause);
+ this.portletId = portletId;
+ }
+
+ public PortletCloneFailedException(String message, Throwable cause, String portletId)
+ {
+ super(message, cause);
+ this.portletId = portletId;
+ }
+
+ public String getPortletId()
+ {
+ return portletId;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/PortletCloneFailedException.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/PortletContext.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/PortletContext.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/PortletContext.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,121 @@
+/******************************************************************************
+ * 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;
+
+import org.jboss.portal.common.util.ParameterValidation;
+
+import java.io.Serializable;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
+ * @version $Revision: 6890 $
+ * @since 2.6
+ */
+public class PortletContext implements Serializable
+{
+
+ /** . */
+ protected final String id;
+
+ PortletContext(String id) throws IllegalArgumentException
+ {
+ ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(id, "portlet
id", "PortletContext");
+ this.id = id;
+ }
+
+
+ public boolean equals(Object o)
+ {
+ if (this == o)
+ {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass())
+ {
+ return false;
+ }
+
+ PortletContext that = (PortletContext)o;
+
+ return id.equals(that.id);
+ }
+
+ public int hashCode()
+ {
+ return id.hashCode();
+ }
+
+ public String getId()
+ {
+ return id;
+ }
+
+ public String toString()
+ {
+ return "PortletContext[" + id + "]";
+ }
+
+ public byte[] getState()
+ {
+ return null;
+ }
+
+ /**
+ * Create a PortletContext based on id and optional state.
+ *
+ * @param id the portlet id
+ * @param state the optional state
+ * @return a new PortletContext based on the provided information
+ */
+ public static PortletContext createPortletContext(String id, byte[] state)
+ {
+ if (state != null && state.length > 0)
+ {
+ return new StatefulPortletContext(id, state);
+ }
+ else
+ {
+ return new PortletContext(id);
+ }
+ }
+
+ /**
+ * Create a PortletContext based on given id and required state: this method will fail
if state is not valid. Use
+ * this method instead of {@link #createPortletContext(String,byte[])} for cases when
a state is expected and the
+ * creation of the PortletContext should fail if no state was given.
+ *
+ * @param id the portlet id
+ * @param state the mandatory state
+ * @return a new PortletContext
+ */
+ public static PortletContext createStatefulPortletContext(String id, byte[] state)
+ {
+ return new StatefulPortletContext(id, state);
+ }
+
+ public static PortletContext createPortletContext(String portletId)
+ {
+ return createPortletContext(portletId, null);
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/PortletInvoker.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/PortletInvoker.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/PortletInvoker.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,114 @@
+/******************************************************************************
+ * 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;
+
+import org.jboss.portal.portlet.invocation.PortletInvocation;
+import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
+import org.jboss.portal.portlet.state.PropertyChange;
+import org.jboss.portal.portlet.state.PropertyMap;
+
+import java.util.List;
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public interface PortletInvoker
+{
+ /**
+ * Return the set of portlet exposed.
+ *
+ * @return the set of exposed portlets
+ */
+ Set getPortlets() throws PortletInvokerException;
+
+ /**
+ * Get information about a specific portlet.
+ *
+ * @param portletContext the portlet context in the scope of this invoker
+ * @return the <code>PortletInfo</code> for the specified portlet
+ * @throws IllegalArgumentException if the portlet context is null
+ */
+ Portlet getPortlet(PortletContext portletContext) throws IllegalArgumentException,
PortletInvokerException;
+
+ /**
+ * Invoke an operation on a specific portlet.
+ *
+ * @param invocation the portlet invocation
+ * @return the invocation response
+ * @throws IllegalArgumentException if the invocation is null
+ */
+ PortletInvocationResponse invoke(PortletInvocation invocation) throws
IllegalArgumentException, PortletInvokerException;
+
+ /**
+ * Clone a portlet.
+ *
+ * @return the clone id
+ * @throws IllegalArgumentException if the portletId is null
+ * @throws UnsupportedOperationException if the invoker does not support this
operation
+ */
+ PortletContext createClone(PortletContext portletContext) throws
IllegalArgumentException, PortletInvokerException, UnsupportedOperationException;
+
+ /**
+ * Destroy a cloned portlet.
+ *
+ * @param portletContexts a list of portlet contexts to destroy
+ * @return a list of {@link org.jboss.portal.portlet.state.DestroyCloneFailure}, one
per clone that couldn't be
+ * destroyed
+ * @throws IllegalArgumentException if the portletContext is null
+ * @throws UnsupportedOperationException if the invoker does not support this
operation
+ */
+ List destroyClones(List portletContexts) throws IllegalArgumentException,
PortletInvokerException, UnsupportedOperationException;
+
+ /**
+ * Return a subset of the properties of the specified portlet.
+ *
+ * @param portletContext the portlet context
+ * @param keys the set of keys to retrieve
+ * @return the properties
+ * @throws IllegalArgumentException if the portletContext or the keys arguments
are null
+ * @throws UnsupportedOperationException if the invoker does not support this
operation
+ */
+ PropertyMap getProperties(PortletContext portletContext, Set keys) throws
IllegalArgumentException, PortletInvokerException, UnsupportedOperationException;
+
+ /**
+ * Return all the properties of the specified portlet.
+ *
+ * @param portletContext the portlet context
+ * @return the properties
+ * @throws IllegalArgumentException if the portletContext is null
+ * @throws UnsupportedOperationException if the invoker does not support this
operation
+ */
+ PropertyMap getProperties(PortletContext portletContext) throws
IllegalArgumentException, PortletInvokerException, UnsupportedOperationException;
+
+ /**
+ * Set the properties on the specified portlet.
+ *
+ * @param portletContext the portlet context
+ * @param changes the changes
+ * @throws IllegalArgumentException if the portletContext or the properties is
null
+ * @throws UnsupportedOperationException if the invoker does not support this
operation
+ */
+ PortletContext setProperties(PortletContext portletContext, PropertyChange[] changes)
throws IllegalArgumentException, PortletInvokerException, UnsupportedOperationException;
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/PortletInvokerException.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/PortletInvokerException.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/PortletInvokerException.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,49 @@
+/******************************************************************************
+ * 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;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public class PortletInvokerException extends Exception
+{
+ public PortletInvokerException()
+ {
+ }
+
+ public PortletInvokerException(String message)
+ {
+ super(message);
+ }
+
+ public PortletInvokerException(String message, Throwable cause)
+ {
+ super(message, cause);
+ }
+
+ public PortletInvokerException(Throwable cause)
+ {
+ super(cause);
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/PortletInvokerException.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/PortletParameters.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/PortletParameters.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/PortletParameters.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,161 @@
+/******************************************************************************
+ * 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;
+
+import org.jboss.portal.common.util.ParameterMap;
+
+import java.io.Serializable;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+
+/**
+ * A set of parameters.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 7209 $
+ */
+public final class PortletParameters extends ParameterMap implements Serializable
+{
+
+ /** The serialVersionUID */
+ private static final long serialVersionUID = -8529807471117491810L;
+
+ /** Creates an empty parameter set. */
+ public PortletParameters()
+ {
+ super(new HashMap());
+ }
+
+ /**
+ * Copy the parameter map to initialize the object state.
+ *
+ * @throws IllegalArgumentException if the parameter map is null or not valid
+ * @throws NullPointerException if the map contains a null key or a null value
+ * @throws IllegalArgumentException if the map is null or it contains a value with a
zero length array or a null
+ * element in the array
+ * @throws ClassCastException if the map contains a key that is not a string or
a value that is not a string
+ * array
+ */
+ public PortletParameters(Map parameterMap) throws NullPointerException,
ClassCastException, IllegalArgumentException
+ {
+ super(new HashMap());
+
+ //
+ if (parameterMap == null)
+ {
+ throw new IllegalArgumentException("No null map accepted");
+ }
+
+ //
+ replace(parameterMap);
+ }
+
+ /**
+ * Append the content of the argument map to that map. If both maps contains an entry
sharing the same key, then the
+ * string arrays or the two entries will be concatenated into a single array. Each
entry present on the argument map
+ * and not in the current map will be kept as is. The argument validation is performed
before the state is updated.
+ *
+ * @param params the parameters to appends
+ * @throws NullPointerException if the map contains a null key or a null value
+ * @throws IllegalArgumentException if the map is null or it contains a value with a
zero length array or a null
+ * element in the array
+ * @throws ClassCastException if the map contains a key that is not a string or
a value that is not a string
+ * array
+ */
+ public void append(Map params) throws ClassCastException, NullPointerException,
IllegalArgumentException
+ {
+ String[] appendedNames = new String[params.size()];
+ String[][] appendedValues = new String[params.size()][];
+
+ // Unwrap all first and validate so we have the atomic behavior guarantee
+ int index = 0;
+ for (Iterator entries = params.entrySet().iterator(); entries.hasNext();)
+ {
+ Map.Entry entry = (Map.Entry)entries.next();
+ appendedNames[index] = (String)unwrapKey(entry.getKey());
+ appendedValues[index++] = (String[])unwrapValue(entry.getValue());
+ }
+
+ // Merge or use appended values
+ Map delegate = getDelegate(true);
+ while (--index >= 0)
+ {
+ String appendedName = appendedNames[index];
+ String[] appendedValue = appendedValues[index];
+
+ //
+ String[] value = (String[])delegate.get(appendedName);
+ if (value != null)
+ {
+ String[] tmp = new String[value.length + appendedValue.length];
+ System.arraycopy(value, 0, tmp, 0, value.length);
+ System.arraycopy(appendedValue, 0, tmp, value.length, appendedValue.length);
+ appendedValue = tmp;
+ }
+
+ //
+ delegate.put(appendedName, appendedValue);
+ }
+ }
+
+ public String toString()
+ {
+ StringBuffer buffer = new StringBuffer("Parameters[");
+ Map delegate = getDelegate(false);
+ for (Iterator i = delegate.entrySet().iterator(); i.hasNext();)
+ {
+ Map.Entry entry = (Map.Entry)i.next();
+ String name = (String)entry.getKey();
+ String[] values = (String[])entry.getValue();
+ buffer.append(name);
+ for (int j = 0; j < values.length; j++)
+ {
+ buffer.append(j > 0 ? ',' : '=').append(values[j]);
+ }
+ if (i.hasNext())
+ {
+ buffer.append(" | ");
+ }
+ }
+ buffer.append(']');
+ return buffer.toString();
+ }
+
+ /**
+ * Safely wrap the map as a portlet parameters object. If the map is already a portlet
parameter object, just return
+ * that object otherwise return a wrapper around the map.
+ */
+ public static PortletParameters wrap(Map map)
+ {
+ if (map instanceof PortletParameters)
+ {
+ return (PortletParameters)map;
+ }
+ else
+ {
+ return new PortletParameters(map);
+ }
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/PortletParameters.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/PortletParametersStateString.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/PortletParametersStateString.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/PortletParametersStateString.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,312 @@
+/******************************************************************************
+ * 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;
+
+import org.jboss.portal.common.util.Base64;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.Serializable;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+/**
+ * A set of parameters.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 6549 $
+ */
+public class PortletParametersStateString extends StateString implements Serializable
+{
+ /** . */
+ public static final String JBPNS_PREFIX = "JBPNS_";
+
+ /** The serialVersionUID */
+ private static final long serialVersionUID = -8529807471117491810L;
+
+ /** . */
+ private static final String EOF = "__EOF__";
+
+ /** The data. */
+ private PortletParameters parameters;
+
+ /**
+ * Factory method that will create the most appropriate form.
+ */
+ public static StateString create(String opaqueValue)
+ {
+ if (opaqueValue == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ if (opaqueValue.startsWith(JBPNS_PREFIX))
+ {
+ return new PortletParametersStateString(opaqueValue);
+ }
+ else
+ {
+ return new OpaqueStateString(opaqueValue);
+ }
+ }
+
+ public static PortletParametersStateString create(Map parameterMap)
+ {
+ PortletParameters params = PortletParameters.wrap(parameterMap);
+ return new PortletParametersStateString(params);
+ }
+
+ public PortletParametersStateString(String opaqueValue)
+ {
+ if (opaqueValue == null)
+ {
+ throw new IllegalArgumentException("No navigational state provided");
+ }
+ if (!opaqueValue.startsWith(JBPNS_PREFIX))
+ {
+ throw new IllegalArgumentException("Bad format");
+ }
+ opaqueValue = opaqueValue.substring(JBPNS_PREFIX.length());
+ if (opaqueValue.length() > 0)
+ {
+ try
+ {
+ byte[] bytes = Base64.decode(opaqueValue, true);
+ ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
+ ObjectInputStream ois = new ObjectInputStream(bais);
+ Map params = new HashMap();
+
+ String[] values = null;
+
+ // read the first String which should be a param name
+ String current = ois.readUTF();
+
+ // keep reading until we haven't reached the EOF marker
+ while (!EOF.equals(current))
+ {
+ // next is the size of the value array
+ int length = ois.readInt();
+ values = new String[length];
+
+ // read as many Strings as are supposed to be in the array
+ for (int i = 0; i < length; i++)
+ {
+ values[i] = ois.readUTF();
+ }
+
+ // we're done for this param, add it to the param map
+ params.put(current, values);
+
+ // read the next string to loop
+ current = ois.readUTF();
+ }
+
+ parameters = new PortletParameters(params);
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+ else
+ {
+ parameters = new PortletParameters();
+ }
+ }
+
+ /** Creates an empty parameter set. */
+ public PortletParametersStateString()
+ {
+ this.parameters = new PortletParameters();
+ }
+
+ /**
+ * Copy the parameter map to initialize the object state.
+ *
+ * @throws IllegalArgumentException if the parameter map is null or not valid
+ */
+ public PortletParametersStateString(PortletParameters parameterMap)
+ {
+ this.parameters = new PortletParameters(parameterMap);
+ }
+
+ /**
+ * Return the parameter value or null if it does not exist.
+ *
+ * @param name the parameter name
+ * @return the parameter value or null if it does not exist
+ * @throws IllegalArgumentException if the name is null
+ */
+ public String getValue(String name) throws IllegalArgumentException
+ {
+ return parameters.getValue(name);
+ }
+
+ /**
+ * Return the parameter values or null if it does not exist.
+ *
+ * @param name the value to get
+ * @return the parameter values
+ * @throws IllegalArgumentException if the name is null
+ */
+ public String[] getValues(String name) throws IllegalArgumentException
+ {
+ return parameters.getValues(name);
+ }
+
+ /** Clear all the parameters. */
+ public void clear()
+ {
+ parameters.clear();
+ }
+
+ /**
+ * Replace all the parameters.
+ *
+ * @throws IllegalArgumentException if the map is not valid
+ */
+ public void replace(Map map)
+ {
+ this.parameters.replace(map);
+ }
+
+ /**
+ * Set the a parameter value.
+ *
+ * @param name the parameter name
+ * @param value the parameter value
+ * @throws IllegalArgumentException if the name is null
+ * @throws IllegalArgumentException if the value is null
+ */
+ public void setValue(String name, String value)
+ {
+ parameters.setValue(name, value);
+ }
+
+ /**
+ * Set the parameter values. This method does not make a defensive copy of the
values.
+ *
+ * @param name the parameter name
+ * @param values the parameter values
+ * @throws IllegalArgumentException if the name is null
+ */
+ public void setValues(String name, String[] values)
+ {
+ parameters.setValues(name, values);
+ }
+
+ /**
+ * Remove a parameter.
+ *
+ * @throws IllegalArgumentException if the name is null
+ */
+ public void remove(String name)
+ {
+ parameters.remove(name);
+ }
+
+ /** Return the size. */
+ public int getSize()
+ {
+ return parameters.size();
+ }
+
+ /**
+ * Return the underlying parameter object.
+ *
+ * @return the parameter object
+ */
+ public PortletParameters getParameters()
+ {
+ return parameters;
+ }
+
+ /**
+ * Retrieves the opaque version associated with this navigational state.
+ *
+ * @return a URL-safe String representation of this navigational state.
+ */
+ public String getStringValue()
+ {
+ if (parameters != null && parameters.size() != 0)
+ {
+ try
+ {
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ ObjectOutputStream oos = new ObjectOutputStream(baos);
+ for (Iterator entries = parameters.entrySet().iterator();
entries.hasNext();)
+ {
+ Map.Entry entry = (Map.Entry)entries.next();
+ String name = (String)entry.getKey();
+ oos.writeUTF(name);
+ String[] values = (String[])entry.getValue();
+ int length = values.length;
+ oos.writeInt(length);
+ for (int i = 0; i < values.length; i++)
+ {
+ oos.writeUTF(values[i]);
+ }
+ }
+ oos.writeUTF(EOF);
+ oos.close();
+ byte[] bytes = baos.toByteArray();
+ return JBPNS_PREFIX + Base64.encodeBytes(bytes, true);
+ }
+ catch (IOException e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+ else
+ {
+ return JBPNS_PREFIX;
+ }
+ }
+
+ public int hashCode()
+ {
+ return getParameters().hashCode();
+ }
+
+ public boolean equals(Object o)
+ {
+ if (o == this)
+ {
+ return true;
+ }
+ if (o instanceof PortletParametersStateString)
+ {
+ PortletParametersStateString that = (PortletParametersStateString)o;
+ return that.parameters.equals(parameters);
+ }
+ return false;
+ }
+
+ public String toString()
+ {
+ return "StateString[" + parameters + "]";
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/PortletParametersStateString.java
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/PortletURL.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/PortletURL.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/PortletURL.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,47 @@
+/******************************************************************************
+ * 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;
+
+import org.jboss.portal.Mode;
+import org.jboss.portal.WindowState;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public interface PortletURL
+{
+ /**
+ * The mode that may be null.
+ *
+ * @return the mode
+ */
+ Mode getMode();
+
+ /**
+ * The window state that may be null.
+ *
+ * @return the window state
+ */
+ WindowState getWindowState();
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/PortletURL.java
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/Properties.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/Properties.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/Properties.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,179 @@
+/******************************************************************************
+ * 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;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * A set of multi valued properties produced by a response.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public class Properties
+{
+
+ private Map content;
+
+ public Properties()
+ {
+ }
+
+ /**
+ * @param name the property name
+ * @param value the property value
+ * @throws IllegalArgumentException if name or value is null
+ */
+ public void addProperty(String name, String value)
+ {
+ if (name == null)
+ {
+ throw new IllegalArgumentException("Name cannot be null");
+ }
+ if (value == null)
+ {
+ throw new IllegalArgumentException("Value cannot be null");
+ }
+ if (content == null)
+ {
+ content = new HashMap();
+ }
+ Object o = content.get(name);
+ if (o == null)
+ {
+ content.put(name, value);
+ }
+ else if (o instanceof String)
+ {
+ ArrayList values = new ArrayList();
+ values.add(o);
+ values.add(value);
+ content.put(name, values);
+ }
+ else
+ {
+ ArrayList values = (ArrayList)o;
+ values.add(value);
+ }
+ }
+
+ /**
+ * @param name the property name
+ * @param value the property value
+ * @throws IllegalArgumentException if name or value is null
+ */
+ public void setProperty(String name, String value)
+ {
+ if (name == null)
+ {
+ throw new IllegalArgumentException("Name cannot be null");
+ }
+ if (value == null)
+ {
+ throw new IllegalArgumentException("Value cannot be null");
+ }
+ if (content == null)
+ {
+ content = new HashMap();
+ }
+ content.put(name, value);
+ }
+
+ /** Clear the properties. */
+ public void clear()
+ {
+ if (content != null)
+ {
+ content.clear();
+ }
+ }
+
+ public String getProperty(String name)
+ {
+ if (name == null)
+ {
+ throw new IllegalArgumentException("Name cannot be null");
+ }
+ if (content == null)
+ {
+ return null;
+ }
+ Object o = content.get(name);
+ if (o == null)
+ {
+ return null;
+ }
+ else if (o instanceof String)
+ {
+ return (String)o;
+ }
+ else
+ {
+ return (String)((ArrayList)o).get(0);
+ }
+ }
+
+ /**
+ * @param name the property name
+ * @return the list of properties for the specified name or null if it does not exist
+ * @throws IllegalArgumentException if name is null
+ */
+ public List getProperties(String name)
+ {
+ if (name == null)
+ {
+ throw new IllegalArgumentException("Name cannot be null");
+ }
+ if (content == null)
+ {
+ return null;
+ }
+ Object o = content.get(name);
+ if (o == null)
+ {
+ return null;
+ }
+ if (o instanceof String)
+ {
+ return Collections.singletonList(o);
+ }
+ else
+ {
+ return (List)o;
+ }
+ }
+
+ public Set getPropertyNames()
+ {
+ if (content == null)
+ {
+ return Collections.EMPTY_SET;
+ }
+ return content.keySet();
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/Properties.java
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/RenderURL.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/RenderURL.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/RenderURL.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -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;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 2748 $
+ */
+public interface RenderURL extends PortletURL
+{
+ /**
+ * Return the navigational state that may be null.
+ *
+ * @return the navigational state
+ */
+ StateString getNavigationalState();
+}
Added: modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/StateEvent.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/StateEvent.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/StateEvent.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,74 @@
+/******************************************************************************
+ * 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;
+
+import org.jboss.portal.common.util.ParameterValidation;
+
+/**
+ * An event that signals state modifications
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
+ * @version $Revision: 7267 $
+ * @since 2.6
+ */
+public class StateEvent
+{
+ private final PortletContext context;
+ private final StateEventType type;
+ public static final StateEventType PORTLET_CLONED_EVENT = new
StateEventType("Portlet Cloned Event");
+ public static final StateEventType PORTLET_MODIFIED_EVENT = new
StateEventType("Portlet Modified Event");
+
+ public StateEvent(PortletContext context, StateEventType type)
+ {
+ ParameterValidation.throwIllegalArgExceptionIfNull(context, "Portlet
context");
+ ParameterValidation.throwIllegalArgExceptionIfNull(type, "StateEvent
type");
+ this.context = context;
+ this.type = type;
+ }
+
+ public PortletContext getPortletContext()
+ {
+ return context;
+ }
+
+ public StateEventType getType()
+ {
+ return type;
+ }
+
+ public static final class StateEventType
+ {
+ private String name;
+
+ private StateEventType(String name)
+ {
+ this.name = name;
+ }
+
+ public String toString()
+ {
+ return name;
+ }
+ }
+}
Added: modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/StateString.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/StateString.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/StateString.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,51 @@
+/******************************************************************************
+ * 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;
+
+import java.io.Serializable;
+
+/**
+ * Encapsulate state as a string.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public abstract class StateString implements Serializable
+{
+ /** Return the value of the navigational state of the portlet. */
+ public abstract String getStringValue();
+
+ public static StateString createFrom(String opaqueValue)
+ {
+ if (opaqueValue == null)
+ {
+ return null;
+ }
+ return new OpaqueStateString(opaqueValue);
+ }
+
+ public abstract int hashCode();
+
+ public abstract boolean equals(Object o);
+
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/StateString.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/StatefulPortletContext.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/StatefulPortletContext.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/StatefulPortletContext.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,87 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.portlet;
+
+import org.jboss.portal.common.util.ParameterValidation;
+
+import java.util.Arrays;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
+ * @version $Revision: 1.1 $
+ * @since 2.6
+ */
+public class StatefulPortletContext extends PortletContext
+{
+
+ /** . */
+ private final byte[] marshalledState;
+
+ StatefulPortletContext(String id, byte[] marshalledState) throws
IllegalArgumentException
+ {
+ super(id);
+
+ ParameterValidation.throwIllegalArgExceptionIfNull(marshalledState, "Portlet
state");
+
+ this.marshalledState = marshalledState;
+ }
+
+
+ public boolean equals(Object o)
+ {
+ if (this == o)
+ {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass())
+ {
+ return false;
+ }
+ if (!super.equals(o))
+ {
+ return false;
+ }
+
+ StatefulPortletContext that = (StatefulPortletContext)o;
+
+ return Arrays.equals(marshalledState, that.marshalledState);
+ }
+
+ public int hashCode()
+ {
+ int result = super.hashCode();
+ result = 31 * result + (marshalledState != null ? marshalledState.hashCode() : 0);
+ return result;
+ }
+
+ public byte[] getState()
+ {
+ return marshalledState;
+ }
+
+ public String toString()
+ {
+ return "StatefulPortletContext[" + id + "," +
marshalledState.length + "]";
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/TransportGuarantee.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/TransportGuarantee.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/TransportGuarantee.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,119 @@
+/******************************************************************************
+ * 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;
+
+/**
+ * Type safe enumeration class for transport guarantee.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public class TransportGuarantee
+{
+ /**
+ *
+ */
+ public static final TransportGuarantee NONE = new TransportGuarantee(0);
+
+ /**
+ *
+ */
+ public static final TransportGuarantee INTEGRAL = new TransportGuarantee(1);
+
+ /**
+ *
+ */
+ public static final TransportGuarantee CONFIDENTIAL = new TransportGuarantee(2);
+
+ /**
+ *
+ */
+ private static final TransportGuarantee[] ALL = {NONE, INTEGRAL, CONFIDENTIAL};
+
+ /**
+ *
+ */
+// private static final boolean[][] IMPLIES =
+// {
+// { true, false, false },
+// { true, true, true },
+// { true, true, true }
+// };
+
+ /**
+ *
+ */
+ private static final String[] NAMES = {"NONE", "INTEGRAL",
"CONFIDENTIAL"};
+
+ public static TransportGuarantee decode(String name)
+ {
+ for (int i = 0; i < NAMES.length; i++)
+ {
+ if (NAMES[i].equals(name))
+ {
+ return ALL[i];
+ }
+ }
+ throw new IllegalArgumentException();
+ }
+
+ private int ordinal;
+
+ private TransportGuarantee(int ordinal)
+ {
+ this.ordinal = ordinal;
+ }
+
+ public String getName()
+ {
+ return NAMES[ordinal];
+ }
+
+// public boolean implies(TransportGuarantee that)
+// {
+// if (that == null)
+// {
+// throw new IllegalArgumentException();
+// }
+// return IMPLIES[this.ordinal][that.ordinal];
+// }
+
+ public int hashCode()
+ {
+ return ordinal;
+ }
+
+ public boolean equals(Object obj)
+ {
+ if (obj == this)
+ {
+ return true;
+ }
+ if (obj instanceof TransportGuarantee)
+ {
+ TransportGuarantee that = (TransportGuarantee)obj;
+ return this.ordinal == that.ordinal;
+ }
+ return false;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/TransportGuarantee.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ConsumerCacheInterceptor.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ConsumerCacheInterceptor.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ConsumerCacheInterceptor.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,234 @@
+/******************************************************************************
+ * 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.portlet.invocation.PortletInterceptor;
+import org.jboss.portal.portlet.invocation.PortletInvocation;
+import org.jboss.portal.portlet.invocation.RenderInvocation;
+import org.jboss.portal.portlet.invocation.response.cache.TimedContent;
+import org.jboss.portal.portlet.invocation.response.cache.StrongTimedContent;
+import org.jboss.portal.portlet.invocation.response.FragmentResponse;
+import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
+import org.jboss.portal.portlet.StateString;
+import org.jboss.portal.portlet.PortletParametersStateString;
+import org.jboss.portal.portlet.spi.RenderContext;
+import org.jboss.portal.common.invocation.InvocationException;
+import org.jboss.portal.common.invocation.AttributeResolver;
+import org.jboss.portal.WindowState;
+import org.jboss.portal.Mode;
+
+import java.io.Serializable;
+
+/**
+ * Cache markup on the portal.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class ConsumerCacheInterceptor extends PortletInterceptor
+{
+
+ protected Object invoke(PortletInvocation invocation) throws Exception,
InvocationException
+ {
+ // Compute the cache key
+ String scopeKey = "cached_markup." +
invocation.getWindowContext().getId();
+
+ // We use the principal scope to avoid security issues like a user loggedout seeing
a cached entry
+ // by a previous logged in user
+ AttributeResolver resolver =
invocation.getContext().getAttributeResolver(PortletInvocation.PRINCIPAL_SCOPE);
+
+ //
+ if (invocation instanceof RenderInvocation)
+ {
+ RenderContext renderCtx = (RenderContext)invocation.getContext();
+
+ //
+ StateString navState = renderCtx.getNavigationalState();
+ WindowState windowState = renderCtx.getWindowState();
+ Mode mode = renderCtx.getMode();
+
+ //
+ CacheEntry cachedEntry = (CacheEntry)resolver.getAttribute(scopeKey);
+
+ //
+ FragmentResponse fragment = null;
+ if (cachedEntry != null)
+ {
+ long currentTimeMillis = System.currentTimeMillis();
+
+ // Check time validity for fragment
+ boolean useEntry = false;
+ if (currentTimeMillis < cachedEntry.getExpirationTimeMillis())
+ {
+ StateString entryNavState = cachedEntry.getNavigationalState();
+
+ // Then check nav state equality
+ if (navState == null)
+ {
+ if (entryNavState == null)
+ {
+ useEntry = true;
+ }
+ else if (entryNavState instanceof PortletParametersStateString)
+ {
+ // We consider a parameters state string empty equivalent to a null
value
+ useEntry = ((PortletParametersStateString)entryNavState).getSize()
== 0;
+ }
+ }
+ else if (entryNavState == null)
+ {
+ if (navState instanceof PortletParametersStateString)
+ {
+ useEntry = ((PortletParametersStateString)navState).getSize() == 0;
+ }
+ }
+ else
+ {
+ useEntry = navState.equals(entryNavState);
+ }
+
+ // Then check window state equality
+ useEntry &= windowState.equals(cachedEntry.getWindowState());
+
+ // Then check mode equality
+ useEntry &= mode.equals(cachedEntry.getMode());
+ }
+
+ // Use the entry
+ if (useEntry)
+ {
+ fragment = cachedEntry.getContent();
+ }
+
+ // Clean if it is null
+ if (fragment == null)
+ {
+ resolver.setAttribute(scopeKey, null);
+ }
+ }
+
+ // If no fragment we must invoke
+ if (fragment == null)
+ {
+ // Invoke
+ PortletInvocationResponse response =
(PortletInvocationResponse)invocation.invokeNext();
+
+ // Try to cache any fragment result
+ if (response instanceof FragmentResponse)
+ {
+ FragmentResponse renderResult = (FragmentResponse)response;
+
+ // Compute expiration time, i.e when it will expire
+ long expirationTimeMillis = 0;
+ if (renderResult.getExpirationSecs() == -1)
+ {
+ expirationTimeMillis = Long.MAX_VALUE;
+ }
+ else if (renderResult.getExpirationSecs() > 0)
+ {
+ expirationTimeMillis = System.currentTimeMillis() +
renderResult.getExpirationSecs() * 1000;
+ }
+
+ // Cache if we can
+ if (expirationTimeMillis > 0)
+ {
+ CacheEntry cacheEntry = new CacheEntry(navState, windowState, mode,
renderResult, expirationTimeMillis);
+ resolver.setAttribute(scopeKey, cacheEntry);
+ }
+ }
+
+ //
+ return response;
+ }
+ else
+ {
+ // Use the cached fragment
+ return fragment;
+ }
+ }
+ else
+ {
+ // Invalidate
+ resolver.setAttribute(scopeKey, null);
+
+ // Invoke
+ return invocation.invokeNext();
+ }
+ }
+
+ /**
+ * Encapsulate cache information.
+ */
+ public static class CacheEntry implements Serializable
+ {
+
+ /** The entry navigational state. */
+ private final StateString navigationalState;
+
+ /** . */
+ private WindowState windowState;
+
+ /** . */
+ private Mode mode;
+
+ /** The timed content. */
+ private final TimedContent cachedResult;
+
+ public CacheEntry(StateString navigationalState, WindowState windowState, Mode
mode, FragmentResponse result, long expirationTimeMillis)
+ {
+ if (expirationTimeMillis <= 0)
+ {
+ throw new IllegalArgumentException();
+ }
+ this.navigationalState = navigationalState;
+ this.windowState = windowState;
+ this.mode = mode;
+ this.cachedResult = new StrongTimedContent(result, expirationTimeMillis);
+ }
+
+ public StateString getNavigationalState()
+ {
+ return navigationalState;
+ }
+
+ public WindowState getWindowState()
+ {
+ return windowState;
+ }
+
+ public Mode getMode()
+ {
+ return mode;
+ }
+
+ public long getExpirationTimeMillis()
+ {
+ return cachedResult.getExpirationTimeMillis();
+ }
+
+ public FragmentResponse getContent()
+ {
+ return cachedResult.getContent();
+ }
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ContextDispatcherInterceptor.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ContextDispatcherInterceptor.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ContextDispatcherInterceptor.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,100 @@
+/******************************************************************************
+ * 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.container.PortletApplication;
+import org.jboss.portal.portlet.container.PortletContainer;
+import org.jboss.portal.portlet.container.PortletContainerInvoker;
+import org.jboss.portal.web.spi.ServletContainerContext;
+import org.jboss.portal.web.RequestDispatchCallback;
+import org.jboss.portal.portlet.invocation.PortletInterceptor;
+import org.jboss.portal.portlet.invocation.PortletInvocation;
+import org.jboss.portal.portlet.spi.RequestContext;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.ServletContext;
+
+/**
+ * This interceptor dispatch the call to the target web application.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 7226 $
+ */
+public class ContextDispatcherInterceptor extends PortletInterceptor
+{
+
+ /** . */
+ public static final String REQ_ATT_COMPONENT_INVOCATION =
"org.jboss.portal.attribute.component_invocation";
+
+ /** . */
+ private ServletContainerContext servletContainerContext;
+
+ public ServletContainerContext getServletContainerContext()
+ {
+ return servletContainerContext;
+ }
+
+ public void setServletContainerContext(ServletContainerContext
servletContainerContext)
+ {
+ this.servletContainerContext = servletContainerContext;
+ }
+
+ protected Object invoke(PortletInvocation invocation) throws Exception,
InvocationException
+ {
+ PortletContainer container =
(PortletContainer)invocation.getAttribute(PortletInvocation.INVOCATION_SCOPE,
PortletContainerInvoker.PORTLET_CONTAINER);
+ PortletApplication portletApplication = container.getApplication();
+ RequestContext reqCtx = invocation.getRequestContext();
+ ServletContext targetCtx = portletApplication.getContext().getServletContext();
+ return reqCtx.dispatch(servletContainerContext, targetCtx, callback, invocation);
+ }
+
+ private static final RequestDispatchCallback callback = new RequestDispatchCallback()
+ {
+ public Object doCallback(ServletContext dispatchedServletContext,
HttpServletRequest req, HttpServletResponse resp, Object handback) throws Exception
+ {
+ PortletInvocation invocation = (PortletInvocation)handback;
+
+ //
+ try
+ {
+
+ // Set dispatched request and response and invocation
+ invocation.setDispatchedRequest(req);
+ invocation.setDispatchedResponse(resp);
+ invocation.getDispatchedRequest().setAttribute(REQ_ATT_COMPONENT_INVOCATION,
invocation);
+
+ //
+ return invocation.invokeNext();
+ }
+ finally
+ {
+ // Clear dispatched request and response
+ invocation.getDispatchedRequest().setAttribute(REQ_ATT_COMPONENT_INVOCATION,
null);
+ invocation.setDispatchedRequest(null);
+ invocation.setDispatchedResponse(null);
+ }
+ }
+ };
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ContextDispatcherInterceptor.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/LocalInterceptor.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/LocalInterceptor.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/LocalInterceptor.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,58 @@
+/******************************************************************************
+ * 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.portlet.invocation.PortletInterceptor;
+import org.jboss.portal.portlet.invocation.PortletInvocation;
+import org.jboss.portal.common.invocation.InvocationException;
+
+/**
+ * An interceptor whose purpose is to detect invocation from the local portal.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class LocalInterceptor extends PortletInterceptor
+{
+
+ /** . */
+ private static final ThreadLocal local = new ThreadLocal();
+
+ public static boolean isLocal()
+ {
+ return Boolean.TRUE.equals(local.get());
+ }
+
+ protected Object invoke(PortletInvocation invocation) throws Exception,
InvocationException
+ {
+ try
+ {
+ local.set(Boolean.TRUE);
+ return invocation.invokeNext();
+ }
+ finally
+ {
+ local.set(null);
+ }
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ModesInterceptor.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ModesInterceptor.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ModesInterceptor.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,100 @@
+/******************************************************************************
+ * 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.info.CapabilitiesInfo;
+import org.jboss.portal.portlet.info.ModeInfo;
+import org.jboss.portal.portlet.info.PortletInfo;
+import org.jboss.portal.portlet.invocation.PortletInterceptor;
+import org.jboss.portal.portlet.invocation.PortletInvocation;
+import org.jboss.portal.portlet.container.PortletContainerInvoker;
+import org.jboss.portal.portlet.container.PortletContainer;
+import org.jboss.portal.common.util.ContentInfo;
+
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Set;
+
+/**
+ * The ModesInterceptor computes the mode for the request as well as the supported
modes.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 7226 $
+ */
+public class ModesInterceptor extends PortletInterceptor
+{
+
+ protected Object invoke(PortletInvocation invocation) throws Exception,
InvocationException
+ {
+ if ((invocation.getPortletContext()).getMode() == null)
+ {
+ throw new InvocationException("No mode has been provided");
+ }
+
+ // Compute the supported modes.
+ Set modes = getModes(invocation);
+
+ // Set the modes on the invocation
+ invocation.setSupportedModes(modes);
+
+ // Continue the invocation
+ return invocation.invokeNext();
+ }
+
+ /** Compute the supported modes for this invocation. */
+ protected Set getModes(PortletInvocation invocation)
+ {
+ // Get content type
+ ContentInfo si = invocation.getPortletContext().getMarkupInfo();
+ String contentType = si.getContentType().toString();
+
+ // Get the modes for this content type
+ PortletContainer container =
(PortletContainer)invocation.getAttribute(PortletInvocation.INVOCATION_SCOPE,
PortletContainerInvoker.PORTLET_CONTAINER);
+ PortletInfo containerInfo = container.getInfo();
+ CapabilitiesInfo capabilities = containerInfo.getCapabilities();
+
+ // Add all the modes
+ Set modes = new HashSet();
+ for (Iterator i = capabilities.getModes(contentType).iterator(); i.hasNext();)
+ {
+ ModeInfo modeInfo = (ModeInfo)i.next();
+ modes.add(modeInfo.getMode());
+ }
+
+ // Restrict with what the portal can provide
+ Set portalModes = invocation.getPortalContext().getModes();
+ modes.retainAll(portalModes);
+
+ // If user is not logged in then remove the edit mode
+ // commenting out for now since it breaks tests
+// AccessMode accessMode = invocation.getInstanceContext().getAccessMode();
+// if (accessMode == AccessMode.READ_ONLY)
+// {
+// modes.remove(Mode.EDIT);
+// }
+
+ //
+ return modes;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ModesInterceptor.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ProducerCacheInterceptor.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ProducerCacheInterceptor.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ProducerCacheInterceptor.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,99 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.aspects.portlet;
+
+import org.jboss.portal.common.invocation.InvocationException;
+import org.jboss.portal.portlet.info.CacheInfo;
+import org.jboss.portal.portlet.info.PortletInfo;
+import org.jboss.portal.portlet.invocation.ActionInvocation;
+import org.jboss.portal.portlet.invocation.PortletInterceptor;
+import org.jboss.portal.portlet.invocation.PortletInvocation;
+import org.jboss.portal.portlet.invocation.RenderInvocation;
+import org.jboss.portal.portlet.invocation.response.FragmentResponse;
+import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
+import org.jboss.portal.portlet.container.PortletContainerInvoker;
+import org.jboss.portal.portlet.container.PortletContainer;
+import org.apache.log4j.Logger;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 7226 $
+ */
+public class ProducerCacheInterceptor extends PortletInterceptor
+{
+
+ /** . */
+ private final Logger log = Logger.getLogger(ProducerCacheInterceptor.class);
+
+ protected Object invoke(PortletInvocation invocation) throws Exception,
InvocationException
+ {
+ if (invocation instanceof ActionInvocation)
+ {
+ // Invoke
+ return invocation.invokeNext();
+ }
+ else if (invocation instanceof RenderInvocation)
+ {
+ // Invoke
+ PortletInvocationResponse response =
(PortletInvocationResponse)invocation.invokeNext();
+
+ //
+ if (response instanceof FragmentResponse)
+ {
+ FragmentResponse fragmentResult = (FragmentResponse)response;
+
+ // Get config
+ PortletContainer container =
(PortletContainer)invocation.getAttribute(PortletInvocation.INVOCATION_SCOPE,
PortletContainerInvoker.PORTLET_CONTAINER);
+ PortletInfo info = container.getInfo();
+ CacheInfo cacheInfo = info.getCache();
+
+ // Update the fragment cache info from the meta info
+ fragmentResult.setExpirationSecs(cacheInfo.getExpirationSecs());
+
+ // Override with value provided by portlet if any
+ String portletValue =
(String)invocation.getAttribute(PortletInvocation.RESPONSE_PROPERTIES_SCOPE,
"portlet.expiration-cache");
+ if (portletValue != null)
+ {
+ try
+ {
+ int expirationSecs = Integer.parseInt(portletValue);
+ fragmentResult.setExpirationSecs(expirationSecs);
+ }
+ catch (NumberFormatException e)
+ {
+ log.warn("Portlet " + invocation.getTarget() +
+ " set a non integer cache value override during render
" + portletValue, e);
+ }
+ }
+
+ }
+
+ //
+ return response;
+ }
+ else
+ {
+ throw new InvocationException("impossible");
+ }
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ProducerCacheInterceptor.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/SecureTransportInterceptor.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/SecureTransportInterceptor.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/SecureTransportInterceptor.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,76 @@
+/******************************************************************************
+ * 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.TransportGuarantee;
+import org.jboss.portal.portlet.container.PortletContainerInvoker;
+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.portlet.invocation.PortletInterceptor;
+import org.jboss.portal.portlet.invocation.PortletInvocation;
+import
org.jboss.portal.portlet.invocation.response.InsufficientTransportGuaranteeResponse;
+import org.jboss.portal.portlet.spi.SecurityContext;
+
+/**
+ * Implement security constaint defined by the portlet spec.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 7226 $
+ */
+public class SecureTransportInterceptor extends PortletInterceptor
+{
+
+ protected Object invoke(PortletInvocation invocation) throws Exception,
InvocationException
+ {
+ PortletContainer container =
(PortletContainer)invocation.getAttribute(PortletInvocation.INVOCATION_SCOPE,
PortletContainerInvoker.PORTLET_CONTAINER);
+ PortletInfo containerInfo = container.getInfo();
+ SecurityInfo securityInfo = containerInfo.getSecurity();
+ SecurityContext securityContext = invocation.getSecurityContext();
+ boolean invoke = true;
+ if (!securityContext.isSecure())
+ {
+ if (securityInfo.containsTransportGuarantee(TransportGuarantee.CONFIDENTIAL))
+ {
+ invoke = false;
+ }
+ else if (securityInfo.containsTransportGuarantee(TransportGuarantee.INTEGRAL))
+ {
+ invoke = false;
+ }
+ }
+
+ //
+ if (invoke)
+ {
+ // Invoke
+ return invocation.invokeNext();
+ }
+ else
+ {
+ // Significate to the caller that this component should be executed with an
higher security level
+ return new InsufficientTransportGuaranteeResponse();
+ }
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/SecureTransportInterceptor.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ValveInterceptor.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ValveInterceptor.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ValveInterceptor.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,87 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.aspects.portlet;
+
+import org.jboss.portal.common.concurrent.Valve;
+import org.jboss.portal.common.invocation.InvocationException;
+import org.jboss.portal.portlet.container.PortletContainer;
+import org.jboss.portal.portlet.container.PortletApplication;
+import org.jboss.portal.portlet.container.PortletApplicationContext;
+import org.jboss.portal.portlet.container.PortletContainerInvoker;
+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.invocation.response.UnavailableResponse;
+
+/**
+ * This aspect has two responsabilities :<br/> <ul> <li>continue the
request only if the portlet container valve is
+ * open. When the valle is closed, it will return an unavailable response to the caller.
When the valve is open then the
+ * current thread of execution enters the valve for the duration of the call.</li>
<li> if the response from the next
+ * aspect is an unavailable result, stop the container in order to destroy the portlet
and implement this part of the
+ * portlet specification.</li> </ul>
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 7226 $
+ */
+public class ValveInterceptor extends PortletInterceptor
+{
+ protected Object invoke(PortletInvocation invocation) throws Exception,
InvocationException
+ {
+ PortletContainer container =
(PortletContainer)invocation.getAttribute(PortletInvocation.INVOCATION_SCOPE,
PortletContainerInvoker.PORTLET_CONTAINER);
+ Valve valve = container.getValve();
+
+ // Try to aquire the valve
+ if (valve.beforeInvocation())
+ {
+ PortletInvocationResponse response = null;
+
+ try
+ {
+ response = (PortletInvocationResponse)invocation.invokeNext();
+ }
+ finally
+ {
+ // Release the valve
+ valve.afterInvocation();
+ }
+
+ // Stop the container if necessary
+ if (response instanceof UnavailableResponse)
+ {
+ // This call will wait until all the current threads have exited the
component valve.
+ // Perhaps this should be done asynchronously as it may lead to a long delay
?
+ // It could be made parametrizable too, so the deployer can choose what mode
is preferable
+ PortletApplication application = container.getApplication();
+ PortletApplicationContext applicationContext = application.getContext();
+ applicationContext.stopPortletContainer(container.getId());
+ }
+
+ //
+ return response;
+ }
+ else
+ {
+ return new UnavailableResponse();
+ }
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ValveInterceptor.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/WindowStatesInterceptor.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/WindowStatesInterceptor.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/WindowStatesInterceptor.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,63 @@
+/******************************************************************************
+ * 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;
+
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * The WindowStatesInterceptor computes the window state for the request as well as the
supported window states.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 7028 $
+ */
+public class WindowStatesInterceptor extends PortletInterceptor
+{
+
+ protected Object invoke(PortletInvocation invocation) throws Exception,
InvocationException
+ {
+ if (invocation.getPortletContext().getWindowState() == null)
+ {
+ throw new InvocationException("No window state has been provided");
+ }
+
+ // Compute the supported window states
+ Set windowStates = getWindowStates(invocation);
+
+ //
+ invocation.setSupportedWindowStates(windowStates);
+
+ // Continue the invocation
+ return invocation.invokeNext();
+ }
+
+ /** Compute the supported window states for this invocation. */
+ protected Set getWindowStates(PortletInvocation invocation) throws
InvocationException
+ {
+ return new HashSet(invocation.getPortalContext().getWindowStates());
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/WindowStatesInterceptor.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletApplication.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletApplication.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletApplication.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,58 @@
+/******************************************************************************
+ * 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;
+
+import java.util.Set;
+
+/**
+ * A portlet application.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 6733 $
+ */
+public interface PortletApplication
+{
+ /** Return the web app id. */
+ String getId();
+
+ /** Return the set of components part of this web application. */
+ Set getPortletContainers();
+
+ /** Return a specific component. */
+ PortletContainer getPortletContainer(String id);
+
+ /** Return the porlet application context. */
+ PortletApplicationContext getContext();
+
+ /**
+ * Starts the application only. It does not take care of starting its components.
+ *
+ * @throws Exception any exception preventing the start
+ */
+ void start() throws Exception;
+
+ /**
+ * Stops the application only. It does not take care of stopping its components.
+ */
+ void stop();
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletApplication.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletApplicationContext.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletApplicationContext.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletApplicationContext.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,74 @@
+/******************************************************************************
+ * 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;
+
+import javax.servlet.ServletContext;
+
+/**
+ * The context provided to a portlet application. For now it manages the application
external resources
+ * such as the servlet context and the application classloader. It manages also the life
cycle of the
+ * application and its components.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 6733 $
+ */
+public interface PortletApplicationContext
+{
+ /**
+ * Return the servlet context.
+ *
+ * @return the servlet context
+ */
+ ServletContext getServletContext();
+
+ /**
+ * Return the classloader.
+ *
+ * @return the classloader
+ */
+ ClassLoader getClassLoader();
+
+ /**
+ * Start the portlet application and its components.
+ */
+ void startPortletApplication() throws Exception;
+
+ /**
+ * Stop the portlet application and its components.
+ */
+ void stopPortletApplication();
+
+ /**
+ * Start a portlet container.
+ *
+ * @param portletName the container name
+ */
+ void startPortletContainer(String portletName) throws Exception;
+
+ /**
+ * Stop a portlet container.
+ *
+ * @param portletName the container name
+ */
+ void stopPortletContainer(String portletName);
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletApplicationContext.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletApplicationRegistrationContext.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletApplicationRegistrationContext.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletApplicationRegistrationContext.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,47 @@
+/******************************************************************************
+ * 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;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public interface PortletApplicationRegistrationContext
+{
+
+ /**
+ * Register a portlet.
+ *
+ * @param portletContainer the portlet container
+ */
+ void registerPortlet(PortletContainer portletContainer);
+
+ /**
+ * Unregister a portlet.
+ *
+ * @param portletContainer the portlet container
+ */
+ void unregisterPortlet(PortletContainer portletContainer);
+
+
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletApplicationRegistry.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletApplicationRegistry.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletApplicationRegistry.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,69 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.container;
+
+import java.util.Collection;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @version $Revision: 6699 $
+ */
+public interface PortletApplicationRegistry
+{
+ /**
+ * Register a portlet application.
+ *
+ * @param portletApplication the portlet application to register
+ * @throws IllegalArgumentException if the portlet application is null or already
registered
+ */
+ PortletApplicationRegistrationContext registerPortletApplication(PortletApplication
portletApplication) throws IllegalArgumentException;
+
+ /**
+ * Unregister a portlet application.
+ *
+ * @param portletApplication the portlet application to unregister
+ * @throws IllegalArgumentException if the portlet application is null or not
registered
+ */
+ void unregisterPortletApplication(PortletApplication portletApplication) throws
IllegalArgumentException;
+
+ /** Return an immutable list all the known portlet application in the registry. */
+ Collection getPortletApplications();
+
+ /** Return a portlet app using its id or null if it does not exist. */
+ PortletApplication getPortletApplication(String id);
+
+ /**
+ * Adds a portlet container registry listener.
+ *
+ * @param listener
+ */
+ void addListener(PortletApplicationRegistryListener listener);
+
+ /**
+ * Removes a portlet container registry listener.
+ *
+ * @param listener
+ */
+ void removeListener(PortletApplicationRegistryListener listener);
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletApplicationRegistry.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletApplicationRegistryListener.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletApplicationRegistryListener.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletApplicationRegistryListener.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,41 @@
+/******************************************************************************
+ * 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;
+
+/**
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ */
+public interface PortletApplicationRegistryListener
+{
+
+ /**
+ * A portlet container has been registered.
+ */
+ void portletContainerRegistered(PortletContainer portletContainer);
+
+ /**
+ * A portlet container has been unregistered.
+ */
+ void portletContainerUnregistered(PortletContainer portletContainer);
+
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletContainer.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletContainer.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletContainer.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,81 @@
+/******************************************************************************
+ * 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;
+
+import org.jboss.portal.common.concurrent.Valve;
+import org.jboss.portal.common.invocation.InvocationException;
+import org.jboss.portal.portlet.PortletInvokerException;
+import org.jboss.portal.portlet.info.PortletInfo;
+import org.jboss.portal.portlet.invocation.PortletInvocation;
+import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 7226 $
+ */
+public interface PortletContainer
+{
+
+ /**
+ * Return the portlet container id, unique within the context of the parent
application.
+ *
+ * @return the id
+ */
+ String getId();
+
+ /**
+ * Returns the runtime meta data of the container.
+ *
+ * @return the info
+ */
+ PortletInfo getInfo();
+
+ /**
+ * Return the portlet application of this container.
+ *
+ * @return the application
+ */
+ PortletApplication getApplication();
+
+ /**
+ *
+ */
+ Valve getValve();
+
+ /**
+ *
+ */
+ PortletInvocationResponse dispatch(PortletInvocation invocation) throws
PortletInvokerException, InvocationException;
+
+ /**
+ * Starts the portlet container.
+ *
+ * @throws Exception any exception preventing the start
+ */
+ void start() throws Exception;
+
+ /**
+ * Stops the portlet container.
+ */
+ void stop();
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletContainer.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletContainerInvoker.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletContainerInvoker.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletContainerInvoker.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,316 @@
+/******************************************************************************
+ * 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;
+
+import org.jboss.portal.common.invocation.InterceptorStackFactory;
+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.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.impl.jsr168.info.ContainerPortletInfo;
+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.portlet.invocation.PortletInvocation;
+import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
+import org.jboss.portal.portlet.state.PropertyChange;
+import org.jboss.portal.portlet.state.PropertyMap;
+import org.jboss.portal.portlet.state.SimplePropertyMap;
+
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * An implementation of portlet invoker that makes a call to a portlet container.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 7226 $
+ */
+public class PortletContainerInvoker implements PortletInvoker,
PortletApplicationRegistryListener
+{
+
+ /** The key under which the portlet container is stored in the request scope of the
invocation. */
+ public static final String PORTLET_CONTAINER = "PORTLET_CONTAINER";
+
+ /** . */
+ private PortletApplicationRegistry registry;
+
+ /** . */
+ private InterceptorStackFactory stackFactory;
+
+ /** . */
+ private Map portlets;
+
+ /** . */
+ private InvocationHandler handler = new InvocationHandler()
+ {
+ public Object invoke(Invocation invocation) throws Exception,
org.jboss.portal.common.invocation.InvocationException
+ {
+ PortletInvocation portletInvocation = (PortletInvocation)invocation;
+
+ //
+ try
+ {
+ portletInvocation.setHandler(null);
+
+ //
+ PortletContainer container =
(PortletContainer)invocation.getAttribute(PortletInvocation.INVOCATION_SCOPE,
PortletContainerInvoker.PORTLET_CONTAINER);
+ return container.dispatch(portletInvocation);
+ }
+ finally
+ {
+ portletInvocation.setHandler(this);
+ }
+ }
+ };
+
+ public PortletApplicationRegistry getRegistry()
+ {
+ return registry;
+ }
+
+ public void setRegistry(PortletApplicationRegistry registry)
+ {
+ this.registry = registry;
+ }
+
+ public InterceptorStackFactory getStackFactory()
+ {
+ return stackFactory;
+ }
+
+ public void setStackFactory(InterceptorStackFactory stackFactory)
+ {
+ this.stackFactory = stackFactory;
+ }
+
+ public synchronized void portletContainerRegistered(PortletContainer
portletContainer)
+ {
+ Map portlets = new HashMap(this.portlets);
+ PortletImpl portlet = new PortletImpl(portletContainer);
+ portlets.put(portlet.getContext().getId(), portlet);
+
+ //
+ this.portlets = portlets;
+ }
+
+ public synchronized void portletContainerUnregistered(PortletContainer
portletContainer)
+ {
+ Map portlets = new HashMap(this.portlets);
+ PortletImpl portlet = new PortletImpl(portletContainer);
+ portlets.remove(portlet.getContext().getId());
+
+ //
+ this.portlets = portlets;
+ }
+
+ public synchronized void start() throws Exception
+ {
+ Map portlets = new HashMap();
+ for (Iterator i = registry.getPortletApplications().iterator(); i.hasNext();)
+ {
+ PortletApplication portletApplication = (PortletApplication)i.next();
+ for (Iterator j = portletApplication.getPortletContainers().iterator();
j.hasNext();)
+ {
+ PortletContainer portletContainer = (PortletContainer)j.next();
+ PortletImpl portlet = new PortletImpl(portletContainer);
+ portlets.put(portlet.getContext().getId(), portlet);
+ }
+ }
+
+ //
+ this.portlets = portlets;
+
+ //
+ registry.addListener(this);
+ }
+
+ public synchronized void stop() throws Exception
+ {
+ registry.removeListener(this);
+
+ //
+ portlets = new HashMap();
+ }
+
+ public Set getPortlets()
+ {
+ return new HashSet(portlets.values());
+ }
+
+ public Portlet getPortlet(PortletContext portletContext) throws
IllegalArgumentException, PortletInvokerException
+ {
+ if (portletContext == null)
+ {
+ throw new IllegalArgumentException("No null portlet id accepted");
+ }
+ String portletId = portletContext.getId();
+ PortletImpl portlet = (PortletImpl)portlets.get(portletId);
+ if (portlet == null)
+ {
+ throw new NoSuchPortletException(portletId);
+ }
+ return portlet;
+ }
+
+ public PortletInvocationResponse invoke(PortletInvocation invocation) throws
PortletInvokerException, InvocationException
+ {
+ // Get portlet container
+ PortletContext ctx = invocation.getTarget();
+ PortletImpl portlet = (PortletImpl)getPortlet(ctx);
+ PortletContainer container = portlet.container;
+
+ //
+ InvocationHandler prevHandler = invocation.getHandler();
+ try
+ {
+
+ invocation.setHandler(handler);
+ invocation.setAttribute(PortletInvocation.INVOCATION_SCOPE,
PortletContainerInvoker.PORTLET_CONTAINER, container);
+ return
(PortletInvocationResponse)invocation.invoke(stackFactory.getInterceptorStack());
+ }
+ catch (Exception e)
+ {
+ if (e instanceof PortletInvokerException)
+ {
+ throw (PortletInvokerException)e;
+ }
+ else if (e instanceof RuntimeException)
+ {
+ throw (RuntimeException)e;
+ }
+ else
+ {
+ throw new PortletInvokerException(e);
+ }
+ }
+ finally
+ {
+ invocation.setHandler(prevHandler);
+ invocation.removeAttribute(PortletInvocation.INVOCATION_SCOPE,
PortletContainerInvoker.PORTLET_CONTAINER);
+ }
+ }
+
+ public PropertyMap getProperties(PortletContext portletContext, Set keys) throws
IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
+ {
+ PortletImpl portlet = (PortletImpl)portlets.get(portletContext.getId());
+ if (portlet == null)
+ {
+ throw new NoSuchPortletException(portletContext.getId());
+ }
+ ContainerPortletInfo info = (ContainerPortletInfo)portlet.getInfo();
+ ContainerPreferencesInfo prefs = (ContainerPreferencesInfo)info.getPreferences();
+ PropertyMap result = new SimplePropertyMap();
+ for (Iterator i = keys.iterator();i.hasNext();)
+ {
+ String key = (String)i.next();
+ ContainerPreferenceInfo pref = prefs.getContainerPreference(key);
+ if (pref != null)
+ {
+ result.put(key, pref.getDefaultValue());
+ }
+ }
+ return result;
+ }
+
+ public PropertyMap getProperties(PortletContext portletContext) throws
IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
+ {
+ PortletImpl portlet = (PortletImpl)portlets.get(portletContext.getId());
+ if (portlet == null)
+ {
+ throw new NoSuchPortletException(portletContext.getId());
+ }
+ ContainerPortletInfo info = (ContainerPortletInfo)portlet.getInfo();
+ ContainerPreferencesInfo prefs = (ContainerPreferencesInfo)info.getPreferences();
+ PropertyMap result = new SimplePropertyMap();
+ for (Iterator i = prefs.getKeys().iterator();i.hasNext();)
+ {
+ String key = (String)i.next();
+ ContainerPreferenceInfo pref = prefs.getContainerPreference(key);
+ if (pref != null)
+ {
+ result.put(key, pref.getDefaultValue());
+ }
+ }
+ return result;
+ }
+
+ public PortletContext createClone(PortletContext portletContext) throws
IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public List destroyClones(List portletContexts) throws IllegalArgumentException,
PortletInvokerException, UnsupportedOperationException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public PortletContext setProperties(PortletContext portletContext, PropertyChange[]
changes) throws IllegalArgumentException, PortletInvokerException,
UnsupportedOperationException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ private static class PortletImpl implements Portlet
+ {
+
+ /** . */
+ private final PortletContainer container;
+
+ /** . */
+ private final PortletContext context;
+
+ public PortletImpl(PortletContainer container)
+ {
+ this.container = container;
+ this.context =
PortletContext.createPortletContext(container.getApplication().getId() + "." +
container.getId());
+ }
+
+ public PortletContext getContext()
+ {
+ return context;
+ }
+
+ public PortletInfo getInfo()
+ {
+ return container.getInfo();
+ }
+
+ public boolean isRemote()
+ {
+ return false;
+ }
+
+ public String toString()
+ {
+ return "Portlet[context=" + context + ",container=" +
container + "]";
+ }
+ }
+}
\ No newline at end of file
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletContainerInvoker.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletInitializationException.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletInitializationException.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletInitializationException.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -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;
+
+/**
+ * This exception is thrown when the portlet has thrown an exception during its
<code>init()</code> invocation.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public class PortletInitializationException extends Exception
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 6793359008144953223L;
+
+ public PortletInitializationException(String message)
+ {
+ super(message);
+ }
+
+ public PortletInitializationException(Throwable cause)
+ {
+ super(cause);
+ }
+
+ public PortletInitializationException(String message, Throwable cause)
+ {
+ super(message, cause);
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletInitializationException.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/deployment/JBossApplicationMetaDataFactory.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/deployment/JBossApplicationMetaDataFactory.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/deployment/JBossApplicationMetaDataFactory.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,263 @@
+/******************************************************************************
+ * 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;
+
+import org.jboss.portal.common.transaction.Transactions;
+import org.jboss.portal.portlet.impl.jsr168.info.ContainerCacheInfo;
+import org.jboss.portal.portlet.metadata.JBossApplicationMetaData;
+import org.jboss.portal.portlet.metadata.JBossPortletMetaData;
+import org.jboss.portal.portlet.metadata.PolicyPermissionMetaData;
+import org.jboss.xb.binding.GenericObjectModelFactory;
+import org.jboss.xb.binding.UnmarshallingContext;
+import org.xml.sax.Attributes;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 6720 $
+ */
+public class JBossApplicationMetaDataFactory implements GenericObjectModelFactory
+{
+
+ public Object newRoot(Object root,
+ UnmarshallingContext nav,
+ String nsURI,
+ String localName,
+ Attributes attrs)
+ {
+ if (root == null)
+ {
+ root = new JBossApplicationMetaData();
+ }
+ return root;
+ }
+
+ public Object completeRoot(Object root, UnmarshallingContext nav, String uri, String
name)
+ {
+ return root;
+ }
+
+ public Object newChild(Object object, UnmarshallingContext nav, String nsURI, String
localName, Attributes attrs)
+ {
+ if (object instanceof JBossApplicationMetaData)
+ {
+ if ("portlet".equals(localName))
+ {
+ 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 PolicyPermissionMetaData)
+ {
+ if ("unchecked".equals(localName))
+ {
+ return "unchecked";
+ }
+ }
+ return null;
+ }
+
+ public void addChild(Object parent, Object child, UnmarshallingContext nav, String
nsURI, String localName)
+ {
+ if (parent instanceof JBossApplicationMetaData)
+ {
+ JBossApplicationMetaData app = (JBossApplicationMetaData)parent;
+ if (child instanceof JBossPortletMetaData)
+ {
+ JBossPortletMetaData portlet = (JBossPortletMetaData)child;
+ app.getPortlets().put(portlet.getName(), portlet);
+ 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);
+// }
+// }
+ }
+
+ public void setValue(Object object, UnmarshallingContext nav, String nsURI, String
localName, String value)
+ {
+ if (object instanceof JBossApplicationMetaData)
+ {
+ JBossApplicationMetaData app = (JBossApplicationMetaData)object;
+ if ("remotable".equals(localName))
+ {
+ if ("true".equalsIgnoreCase(value))
+ {
+ app.setRemotable(Boolean.TRUE);
+ }
+ else if ("false".equalsIgnoreCase(value))
+ {
+ app.setRemotable(Boolean.FALSE);
+ }
+ else
+ {
+ throw new RuntimeException();
+ }
+ }
+ }
+ else if (object instanceof JBossPortletMetaData)
+ {
+ JBossPortletMetaData portlet = (JBossPortletMetaData)object;
+ if ("portlet-name".equals(localName))
+ {
+ portlet.setName(value);
+ }
+ else if ("remotable".equals(localName))
+ {
+ if ("true".equalsIgnoreCase(value))
+ {
+ portlet.setRemotable(Boolean.TRUE);
+ }
+ else if ("false".equalsIgnoreCase(value))
+ {
+ portlet.setRemotable(Boolean.FALSE);
+ }
+ else
+ {
+ throw new RuntimeException();
+ }
+ }
+ else if ("distributed".equals(localName))
+ {
+ if ("true".equalsIgnoreCase(value))
+ {
+ portlet.setDistributed(Boolean.TRUE);
+ }
+ else if ("false".equalsIgnoreCase(value))
+ {
+ portlet.setDistributed(Boolean.FALSE);
+ }
+ else
+ {
+ throw new RuntimeException();
+ }
+ }
+ else if ("ref-type".equals(localName))
+ {
+ if ("strong".equals(localName))
+ {
+ portlet.setCacheRefType(new Integer(ContainerCacheInfo.REF_STRONG));
+ }
+ else if ("soft".equals(localName))
+ {
+ portlet.setCacheRefType(new Integer(ContainerCacheInfo.REF_SOFT));
+ }
+ else
+ {
+ // log.warn("Unrecognized reference type " + refType);
+ }
+ }
+ else if ("trans-attribute".equals(localName))
+ {
+ if ("Required".equalsIgnoreCase(value))
+ {
+ portlet.setTxType(Transactions.TYPE_REQUIRED);
+ }
+ else if ("Mandatory".equals(value))
+ {
+ portlet.setTxType(Transactions.TYPE_MANDATORY);
+ }
+ else if ("Never".equals(value))
+ {
+ portlet.setTxType(Transactions.TYPE_NEVER);
+ }
+ else if ("Supports".equals(value))
+ {
+ portlet.setTxType(Transactions.TYPE_SUPPORTS);
+ }
+ else if ("NotSupported".equals(value))
+ {
+ portlet.setTxType(Transactions.TYPE_NOT_SUPPORTED);
+ }
+ else if ("RequiresNew".equals(value))
+ {
+ portlet.setTxType(Transactions.TYPE_REQUIRES_NEW);
+ }
+ else
+ {
+ throw new RuntimeException();
+ }
+ }
+ }
+ else if (object instanceof PolicyPermissionMetaData)
+ {
+ PolicyPermissionMetaData policyPermission = (PolicyPermissionMetaData)object;
+ if ("role-name".equals(localName))
+ {
+ policyPermission.setRoleName(value);
+ }
+ else if ("action-name".equals(localName))
+ {
+ policyPermission.getActions().add(value);
+ }
+ }
+ }
+
+ /** Can be subclasses to allow sub class. */
+ protected JBossPortletMetaData createJBossPortlet()
+ {
+ return new JBossPortletMetaData();
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/deployment/JBossApplicationMetaDataFactory.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/deployment/PortletApplicationMetaDataFactory.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/deployment/PortletApplicationMetaDataFactory.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/deployment/PortletApplicationMetaDataFactory.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,405 @@
+/******************************************************************************
+ * 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;
+
+import org.jboss.portal.Mode;
+import org.jboss.portal.common.i18n.LocaleFormat;
+import org.jboss.portal.common.util.Tools;
+import org.jboss.portal.common.util.ConversionException;
+import org.jboss.portal.portlet.TransportGuarantee;
+import org.jboss.portal.portlet.impl.jsr168.metadata.CacheConfigMetaData;
+import org.jboss.portal.portlet.impl.jsr168.metadata.ContentTypeMetaData;
+import org.jboss.portal.portlet.impl.jsr168.metadata.DescribableObjectMetaData;
+import org.jboss.portal.portlet.impl.jsr168.metadata.DescriptionMetaData;
+import org.jboss.portal.portlet.impl.jsr168.metadata.DisplayNameMetaData;
+import org.jboss.portal.portlet.impl.jsr168.metadata.LanguagesMetaData;
+import org.jboss.portal.portlet.impl.jsr168.metadata.LocalizedValueMetaData;
+import org.jboss.portal.portlet.impl.jsr168.metadata.ParameterMetaData;
+import org.jboss.portal.portlet.impl.jsr168.metadata.PortletApplicationMetaData;
+import org.jboss.portal.portlet.impl.jsr168.metadata.PortletMetaData;
+import org.jboss.portal.portlet.impl.jsr168.metadata.PreferenceMetaData;
+import org.jboss.portal.portlet.impl.jsr168.metadata.SecurityConstraintMetaData;
+import org.jboss.portal.portlet.impl.jsr168.metadata.SecurityRoleRefMetaData;
+import org.jboss.portal.portlet.impl.jsr168.metadata.TransportGuaranteesMetaData;
+import org.jboss.portal.portlet.impl.jsr168.metadata.UserAttributeMetaData;
+import org.jboss.xb.binding.GenericObjectModelFactory;
+import org.jboss.xb.binding.UnmarshallingContext;
+import org.xml.sax.Attributes;
+import org.apache.log4j.Logger;
+
+import java.util.Iterator;
+import java.util.List;
+import java.util.Locale;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 7200 $
+ */
+public class PortletApplicationMetaDataFactory implements GenericObjectModelFactory
+{
+
+ /** . */
+ private static final Logger log =
Logger.getLogger(PortletApplicationMetaDataFactory.class);
+
+ public Object newRoot(Object root, UnmarshallingContext nav, String nsURI, String
localName, Attributes attrs)
+ {
+ return new PortletApplicationMetaData();
+ }
+
+ public Object completeRoot(Object root, UnmarshallingContext ctx, String nsURI, String
name)
+ {
+ return root;
+ }
+
+ public Object newChild(Object object, UnmarshallingContext nav, String nsURI, String
localName, Attributes attrs)
+ {
+ if (object instanceof DescribableObjectMetaData)
+ {
+ if ("description".equals(localName))
+ {
+ String lang = attrs.getValue("xml:lang");
+ DescriptionMetaData value = new DescriptionMetaData();
+ if (lang != null)
+ {
+ try
+ {
+ Locale locale = LocaleFormat.DEFAULT.getLocale(lang);
+ value.setLocale(locale);
+ }
+ catch (ConversionException e)
+ {
+ log.error("Cannot obtain language value", e);
+ return null;
+ }
+ }
+ return value;
+ }
+ }
+ if (object instanceof PortletApplicationMetaData)
+ {
+ if ("portlet".equals(localName))
+ {
+ return new PortletMetaData();
+ }
+ else if ("user-attribute".equals(localName))
+ {
+ return new UserAttributeMetaData();
+ }
+ else if ("security-constraint".equals(localName))
+ {
+ return new SecurityConstraintMetaData();
+ }
+ }
+ if (object instanceof PortletMetaData)
+ {
+ if ("init-param".equals(localName))
+ {
+ return new ParameterMetaData();
+ }
+ else if ("supports".equals(localName))
+ {
+ return new ContentTypeMetaData();
+ }
+ else if ("portlet-info".equals(localName))
+ {
+ return new LanguagesMetaData.InfoMetaData();
+ }
+ else if ("security-role-ref".equals(localName))
+ {
+ return new SecurityRoleRefMetaData();
+ }
+ else if ("preference".equals(localName))
+ {
+ return new PreferenceMetaData();
+ }
+ else if ("display-name".equals(localName))
+ {
+ String lang = attrs.getValue("xml:lang");
+ DisplayNameMetaData value = new DisplayNameMetaData();
+ if (lang != null)
+ {
+ try
+ {
+ Locale locale = LocaleFormat.DEFAULT.getLocale(lang);
+ value.setLocale(locale);
+ }
+ catch (ConversionException e)
+ {
+ log.error("Cannot obtain language value", e);
+ return null;
+ }
+ }
+ return value;
+ }
+ }
+ return null;
+ }
+
+ public void addChild(Object parent, Object child, UnmarshallingContext nav, String
nsURI, String localName)
+ {
+ if (parent instanceof DescribableObjectMetaData)
+ {
+ DescribableObjectMetaData describable = (DescribableObjectMetaData)parent;
+ if (child instanceof DescriptionMetaData)
+ {
+ describable.getDescription().getValues().add(child);
+ }
+ }
+ if (parent instanceof PortletApplicationMetaData)
+ {
+ PortletApplicationMetaData pa = (PortletApplicationMetaData)parent;
+ if (child instanceof PortletMetaData)
+ {
+ pa.addPortlet((PortletMetaData)child);
+ }
+ else if (child instanceof UserAttributeMetaData)
+ {
+ UserAttributeMetaData userAttribute = (UserAttributeMetaData)child;
+ pa.getUserAttributes().put(userAttribute.getName(), userAttribute);
+ }
+ else if (child instanceof SecurityConstraintMetaData)
+ {
+ SecurityConstraintMetaData security = (SecurityConstraintMetaData)child;
+ for (Iterator i = security.getPortlets().iterator(); i.hasNext();)
+ {
+ String portletName = (String)i.next();
+ PortletMetaData portlet = pa.getPortlet(portletName);
+ if (portlet.getTransportGuarantees() == null)
+ {
+ portlet.setTransportGuarantees(new TransportGuaranteesMetaData());
+ }
+ portlet.getTransportGuarantees().add(security.getTransportGuarantee());
+ }
+
+ }
+ }
+ if (parent instanceof PortletMetaData)
+ {
+ PortletMetaData portlet = (PortletMetaData)parent;
+ if (child instanceof ParameterMetaData)
+ {
+ ParameterMetaData parameter = (ParameterMetaData)child;
+ portlet.getParameters().put(parameter.getName(), parameter);
+ }
+ else if (child instanceof ContentTypeMetaData)
+ {
+ portlet.getContentTypes().addContentType((ContentTypeMetaData)child);
+ }
+ else if (child instanceof LanguagesMetaData.InfoMetaData)
+ {
+
+ LanguagesMetaData.InfoMetaData info = (LanguagesMetaData.InfoMetaData)child;
+ if (info.getTitle() == null)
+ {
+ // JBossXB won't populate <title></title>
+ info.setTitle("");
+ }
+ portlet.getLanguages().setInfo(info);
+ }
+ else if (child instanceof SecurityRoleRefMetaData)
+ {
+ portlet.getSecurityRoleRefs().add(child);
+ }
+ else if (child instanceof DisplayNameMetaData)
+ {
+ portlet.getDisplayName().getValues().add(child);
+ }
+ }
+ if (parent instanceof PortletMetaData)
+ {
+ PortletMetaData preferences = (PortletMetaData)parent;
+ if (child instanceof PreferenceMetaData)
+ {
+ preferences.getPreferences().addPreference((PreferenceMetaData)child);
+ }
+ }
+ }
+
+ public void setValue(Object object, UnmarshallingContext nav, String nsURI, String
localName, String value)
+ {
+ if (object instanceof PortletApplicationMetaData)
+ {
+ PortletApplicationMetaData app = (PortletApplicationMetaData)object;
+ if ("version".equals(localName))
+ {
+ app.setVersion(value);
+ }
+ }
+ if (object instanceof LocalizedValueMetaData)
+ {
+ LocalizedValueMetaData localizedValue = (LocalizedValueMetaData)object;
+ if ("description".equals(localName))
+ {
+ localizedValue.setValue(value);
+ }
+ else if ("display-name".equals(localName))
+ {
+ localizedValue.setValue(value);
+ }
+ }
+ if (object instanceof PortletMetaData)
+ {
+ PortletMetaData portlet = (PortletMetaData)object;
+ if ("portlet-name".equals(localName))
+ {
+ portlet.setName(value);
+ }
+ else if ("portlet-class".equals(localName))
+ {
+ portlet.setClassName(value);
+ }
+ else if ("expiration-cache".equals(localName))
+ {
+ CacheConfigMetaData cacheConfig = portlet.getCacheConfig();
+ if (cacheConfig == null)
+ {
+ cacheConfig = new CacheConfigMetaData();
+ portlet.setCacheConfig(cacheConfig);
+ }
+ int timeMillis = Integer.parseInt(value);
+ cacheConfig.setExpirationTime(timeMillis);
+ }
+ else if ("resource-bundle".equals(localName))
+ {
+ portlet.getLanguages().setResourceBundle(value);
+ }
+ else if ("supported-locale".equals(localName))
+ {
+ try
+ {
+ Locale locale = LocaleFormat.DEFAULT.getLocale(value);
+ portlet.getLanguages().getSupportedLocales().add(locale);
+ }
+ catch (ConversionException e)
+ {
+ log.error("Cannot obtain language value", e);
+ }
+ }
+ else if ("preferences-validator".equals(localName))
+ {
+ portlet.getPreferences().setValidator(value);
+ }
+ }
+ if (object instanceof ParameterMetaData)
+ {
+ ParameterMetaData parameter = (ParameterMetaData)object;
+ if ("name".equals(localName))
+ {
+ parameter.setName(value);
+ }
+ else if ("value".equals(localName))
+ {
+ parameter.setValue(value);
+ }
+ }
+ if (object instanceof ContentTypeMetaData)
+ {
+ ContentTypeMetaData contentType = (ContentTypeMetaData)object;
+ if ("mime-type".equals(localName))
+ {
+ contentType.setContentType(value);
+ }
+ else if ("portlet-mode".equals(localName))
+ {
+ contentType.getModes().add(Mode.create(value));
+ }
+ }
+ if (object instanceof LanguagesMetaData.InfoMetaData)
+ {
+ LanguagesMetaData.InfoMetaData info = (LanguagesMetaData.InfoMetaData)object;
+ if ("title".equals(localName))
+ {
+ info.setTitle(value);
+ }
+ else if ("short-title".equals(localName))
+ {
+ info.setShortTitle(value);
+ }
+ else if ("keywords".equals(localName))
+ {
+ info.setKeywords(value);
+ }
+ }
+ if (object instanceof PreferenceMetaData)
+ {
+ PreferenceMetaData preference = (PreferenceMetaData)object;
+ if ("name".equals(localName))
+ {
+ preference.setName(value);
+ }
+ else if ("value".equals(localName))
+ {
+ List tmp = Tools.toList(preference.getValues());
+ tmp.add(value);
+ preference.setValues((String[])tmp.toArray(new String[tmp.size()]));
+ }
+ else if ("read-only".equals(localName))
+ {
+ if ("true".equalsIgnoreCase(value))
+ {
+ preference.setReadOnly(true);
+ }
+ else if ("false".equalsIgnoreCase(value))
+ {
+ preference.setReadOnly(false);
+ }
+ else
+ {
+ throw new RuntimeException("Unrecognized read only value" +
value);
+ }
+ }
+ }
+ if (object instanceof SecurityRoleRefMetaData)
+ {
+ SecurityRoleRefMetaData srr = (SecurityRoleRefMetaData)object;
+ if ("role-name".equals(localName))
+ {
+ srr.setRoleName(value);
+ }
+ else if ("role-link".equals(localName))
+ {
+ srr.setRoleLink(value);
+ }
+ }
+ if (object instanceof UserAttributeMetaData)
+ {
+ UserAttributeMetaData userAttribute = (UserAttributeMetaData)object;
+ if ("name".equals(localName))
+ {
+ userAttribute.setName(value);
+ }
+ }
+ else if (object instanceof SecurityConstraintMetaData)
+ {
+ SecurityConstraintMetaData security = (SecurityConstraintMetaData)object;
+ if ("portlet-name".equals(localName))
+ {
+ security.addPortlet(value);
+ }
+ if ("transport-guarantee".equals(localName))
+ {
+ security.setTransportGuarantee(TransportGuarantee.decode(value));
+ }
+ }
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/deployment/PortletApplicationMetaDataFactory.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/deployment/ValueTrimmingFilter.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/deployment/ValueTrimmingFilter.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/deployment/ValueTrimmingFilter.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,75 @@
+/******************************************************************************
+ * 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;
+
+import org.jboss.xb.binding.GenericObjectModelFactory;
+import org.jboss.xb.binding.UnmarshallingContext;
+import org.xml.sax.Attributes;
+
+/**
+ * Filter <code>setValue</code> method by doing a trimming before calling the
next model.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 6713 $
+ */
+public class ValueTrimmingFilter implements GenericObjectModelFactory
+{
+
+ private final GenericObjectModelFactory next;
+
+ public ValueTrimmingFilter(GenericObjectModelFactory next) throws
IllegalArgumentException
+ {
+ if (next == null)
+ {
+ throw new IllegalArgumentException("Cannot be null");
+ }
+ this.next = next;
+ }
+
+ public Object newChild(Object object, UnmarshallingContext nav, String nsURI, String
localName, Attributes attrs)
+ {
+ return next.newChild(object, nav, nsURI, localName, attrs);
+ }
+
+ public void addChild(Object parent, Object child, UnmarshallingContext nav, String
nsURI, String localName)
+ {
+ next.addChild(parent, child, nav, nsURI, localName);
+ }
+
+ public void setValue(Object object, UnmarshallingContext nav, String nsURI, String
localName, String value)
+ {
+ value = value.trim();
+ next.setValue(object, nav, nsURI, localName, value);
+ }
+
+ public Object newRoot(Object root, UnmarshallingContext nav, String nsURI, String
localName, Attributes attrs)
+ {
+ return next.newRoot(root, nav, nsURI, localName, attrs);
+ }
+
+ public Object completeRoot(Object root, UnmarshallingContext nav, String nsURI, String
localName)
+ {
+ return next.completeRoot(root, nav, nsURI, localName);
+ }
+
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/deployment/ValueTrimmingFilter.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/PortletRequestDecoder.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/PortletRequestDecoder.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/PortletRequestDecoder.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,324 @@
+/******************************************************************************
+ * 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;
+
+import org.jboss.portal.Mode;
+import org.jboss.portal.WindowState;
+import org.jboss.portal.portlet.StateString;
+import org.jboss.portal.portlet.PortletParameters;
+import org.jboss.portal.portlet.PortletParametersStateString;
+import org.jboss.portal.portlet.OpaqueStateString;
+
+import java.util.Iterator;
+import java.util.Map;
+
+/**
+ * This class is a possible implementation for the behavior of a request made to a
portlet. Which means that this
+ * implementation does not preclude other implementations.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 6549 $
+ */
+public class PortletRequestDecoder
+{
+
+ /** The mask for action. */
+ public static final int ACTION_MASK = 0x00000001;
+
+ /** The mask for render. */
+ public static final int RENDER_MASK = 0x00000002;
+
+ /** The mask for mode. */
+ public static final int MODE_MASK = 0x00000004;
+
+ /** The mask for window state. */
+ public static final int WINDOW_STATE_MASK = 0x00000008;
+
+ /** The mask for opacity. */
+ public static final int OPAQUE_MASK = 0x00000010;
+
+ /** The name of the URL parameter containing the mode. */
+ public static final String MODE_PARAMETER = "mode";
+
+ /** The name of the URL parameter containing the window state. */
+ public static final String WINDOW_STATE_PARAMETER = "windowstate";
+
+ /** The name of the URL parameter containing the interaction state. */
+ public static final String INTERACTION_STATE_PARAMETER = "is";
+
+ /** The name of the URL parameter containing the navigational state. */
+ public static final String NAVIGATIONAL_STATE_PARAMETER = "ns";
+
+ /** The name of the URL parameter containing the meta information. */
+ public static final String META_PARAMETER = "action";
+
+ /** . */
+ public static final int ACTION_TYPE = 0;
+
+ /** . */
+ public static final int RENDER_TYPE = 1;
+
+ /** . */
+ public static final int NAV_TYPE = 2;
+
+ /** . */
+ private Mode mode;
+
+ /** . */
+ private WindowState windowState;
+
+ /** . */
+ private StateString navigationalstate;
+
+ /** . */
+ private StateString interactionState;
+
+ /** . */
+ private PortletParameters form;
+
+ /** . */
+ private int type;
+
+ public void decode(Map queryParams, Map bodyParams) throws IllegalArgumentException
+ {
+ // The meta info from the URL
+ int meta = 0;
+ String[] metaParam = (String[])queryParams.get(META_PARAMETER);
+ if (metaParam != null)
+ {
+ try
+ {
+ meta = Integer.parseInt(metaParam[0], 16);
+ }
+ catch (NumberFormatException ignore)
+ {
+ // If mask is not present then we assume that it can only be a navigation URL
(NAV_TYPE)
+ }
+ }
+
+ //
+ if ((meta & (ACTION_MASK | RENDER_MASK)) != 0)
+ {
+ // Check validity
+ if ((meta & (ACTION_MASK | RENDER_MASK)) == (ACTION_MASK | RENDER_MASK))
+ {
+ throw new IllegalArgumentException("Cannot have both action and render
in the mask at the same time");
+ }
+
+ //
+ if ((meta & ACTION_MASK) != 0)
+ {
+ type = ACTION_TYPE;
+ }
+ else
+ {
+ type = RENDER_TYPE;
+ }
+
+ // Get the mode from the parameters if it exists
+ if ((meta & MODE_MASK) != 0)
+ {
+ String[] modeParam = (String[])queryParams.get(MODE_PARAMETER);
+ if (modeParam == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ mode = Mode.create(modeParam[0]);
+ }
+ else
+ {
+ mode = null;
+ }
+
+ // Get the window state from the parameters if it exists
+ if ((meta & WINDOW_STATE_MASK) != 0)
+ {
+ String[] windowStateParam =
(String[])queryParams.get(WINDOW_STATE_PARAMETER);
+ if (windowStateParam == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ windowState = WindowState.create(windowStateParam[0]);
+ }
+ else
+ {
+ windowState = null;
+ }
+
+ //
+ boolean opaque = (meta & OPAQUE_MASK) != 0;
+ if (!opaque)
+ {
+ // Compute the parameters skipping the portlet navigational state that may be
encoded as well
+ PortletParametersStateString query = new PortletParametersStateString();
+ for (Iterator i = queryParams.entrySet().iterator(); i.hasNext();)
+ {
+ Map.Entry entry = (Map.Entry)i.next();
+ int index = 0;
+ String name = (String)entry.getKey();
+ String[] queryValues = (String[])entry.getValue();
+
+ //
+ if (META_PARAMETER.equals(name))
+ {
+ index = 1;
+ }
+ else if ((meta & MODE_MASK) != 0 &&
MODE_PARAMETER.equals(name))
+ {
+ index = 1;
+ }
+ else if ((meta & WINDOW_STATE_MASK) != 0 &&
WINDOW_STATE_PARAMETER.equals(name))
+ {
+ index = 1;
+ }
+
+ // We have interaction param(s) in the query string
+ if (index < queryValues.length)
+ {
+ String[] values = new String[queryValues.length - index];
+ System.arraycopy(queryValues, index, values, 0, values.length);
+ query.setValues(name, values);
+ }
+ }
+
+ // Julien :
+ PortletParameters form = new PortletParameters();
+ if (bodyParams != null)
+ {
+ form.putAll(bodyParams);
+ }
+
+ //
+ if (type == ACTION_TYPE)
+ {
+ this.navigationalstate = null;
+ this.interactionState = query;
+ this.form = form;
+ }
+ else
+ {
+ this.navigationalstate = query;
+ this.interactionState = null;
+ this.form = null;
+ }
+ }
+ else
+ {
+ // Decode the navigational state
+ String[] ns = (String[])queryParams.get(NAVIGATIONAL_STATE_PARAMETER);
+ if (ns != null)
+ {
+ navigationalstate = new OpaqueStateString(ns[0]);
+ }
+ else
+ {
+ navigationalstate = null;
+ }
+
+ // Decode more if we have an action
+ if (type == ACTION_TYPE)
+ {
+ // Decode the interaction state
+ String[] is = (String[])queryParams.get(INTERACTION_STATE_PARAMETER);
+ if (is != null)
+ {
+ interactionState = new OpaqueStateString(is[0]);
+ }
+ else
+ {
+ interactionState = null;
+ }
+
+ //
+ form = new PortletParameters();
+ if (bodyParams != null)
+ {
+ form.putAll(bodyParams);
+ }
+ }
+ else
+ {
+ interactionState = null;
+ form = null;
+ }
+ }
+ }
+ else
+ {
+ // Set to nav type
+ type = NAV_TYPE;
+
+ // Get the mode from the parameters if it exists
+ String[] modeParam = (String[])queryParams.get(MODE_PARAMETER);
+ if (modeParam != null)
+ {
+ mode = Mode.create(modeParam[0]);
+ }
+ else
+ {
+ mode = null;
+ }
+
+ // Get the window state from the parameters if it exists
+ String[] windowStateParam = (String[])queryParams.get(WINDOW_STATE_PARAMETER);
+ if (windowStateParam != null)
+ {
+ windowState = WindowState.create(windowStateParam[0]);
+ }
+ else
+ {
+ windowState = null;
+ }
+ }
+ }
+
+ public Mode getMode()
+ {
+ return mode;
+ }
+
+ public WindowState getWindowState()
+ {
+ return windowState;
+ }
+
+ public StateString getNavigationalState()
+ {
+ return navigationalstate;
+ }
+
+ public StateString getInteractionState()
+ {
+ return interactionState;
+ }
+
+ public PortletParameters getForm()
+ {
+ return form;
+ }
+
+ public int getType()
+ {
+ return type;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/PortletRequestDecoder.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/PortletRequestEncoder.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/PortletRequestEncoder.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/PortletRequestEncoder.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,226 @@
+/******************************************************************************
+ * 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;
+
+import org.jboss.portal.Mode;
+import org.jboss.portal.WindowState;
+import org.jboss.portal.common.util.ParameterMap;
+import org.jboss.portal.portlet.StateString;
+import org.jboss.portal.portlet.PortletParametersStateString;
+import org.jboss.portal.portlet.PortletParameters;
+import org.jboss.portal.portlet.PortletURL;
+import org.jboss.portal.portlet.RenderURL;
+import org.jboss.portal.portlet.ActionURL;
+
+import java.util.Iterator;
+import java.util.Map;
+
+/**
+ * This class is designed to provide the encoding in the query string of a URL of the
following state :
+ * <ul>
+ * <li>A set of parameters</li>
+ * <li>A mode value</li>
+ * <li>A window state value</li>
+ * <li>A invocation type (action or render)</li>
+ * </ul>
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class PortletRequestEncoder
+{
+
+ /** . */
+ private ParameterMap queryParameters;
+
+ public PortletRequestEncoder(ParameterMap queryParameters)
+ {
+ if (queryParameters == null)
+ {
+ throw new IllegalArgumentException();
+ }
+
+ //
+ this.queryParameters = queryParameters;
+ }
+
+ public PortletRequestEncoder()
+ {
+ this(new PortletParameters());
+ }
+
+ public void encode(PortletURL portletURL) throws IllegalArgumentException
+ {
+ if (portletURL instanceof RenderURL)
+ {
+ RenderURL renderURL = (RenderURL)portletURL;
+ encodeRender(renderURL.getNavigationalState(), renderURL.getMode(),
renderURL.getWindowState());
+ }
+ else if (portletURL instanceof ActionURL)
+ {
+ ActionURL actionURL = (ActionURL)portletURL;
+ encodeAction(actionURL.getNavigationalState(), actionURL.getInteractionState(),
actionURL.getMode(), actionURL.getWindowState());
+ }
+ else
+ {
+ throw new IllegalArgumentException();
+ }
+ }
+
+ public void encodeAction(
+ StateString navigationalState,
+ StateString interactionState,
+ Mode mode,
+ WindowState windowState) throws IllegalArgumentException
+ {
+ queryParameters.clear();
+
+ //
+ int meta = PortletRequestDecoder.ACTION_MASK;
+
+ //
+ if (interactionState != null)
+ {
+ if (interactionState instanceof PortletParametersStateString)
+ {
+ if (navigationalState != null)
+ {
+ throw new IllegalArgumentException("Cannot handle case with both non
opaque interaction and navigational state");
+ }
+
+ // Add the parameters
+ PortletParameters parameters =
((PortletParametersStateString)interactionState).getParameters();
+ configure(parameters);
+ }
+ else
+ {
+ meta |= PortletRequestDecoder.OPAQUE_MASK;
+
+ // Set interaction state
+ queryParameters.setValue(PortletRequestDecoder.INTERACTION_STATE_PARAMETER,
interactionState.getStringValue());
+
+ // We may have navigational state
+ if (navigationalState != null)
+ {
+
queryParameters.setValue(PortletRequestDecoder.NAVIGATIONAL_STATE_PARAMETER,
navigationalState.getStringValue());
+ }
+ }
+ }
+
+ //
+ configure(meta, mode, windowState);
+ }
+
+ public void encodeRender(
+ StateString navigationalState,
+ Mode mode,
+ WindowState windowState)
+ {
+ queryParameters.clear();
+
+ //
+ if (navigationalState != null)
+ {
+ int meta = PortletRequestDecoder.RENDER_MASK;
+
+ //
+ if (navigationalState instanceof PortletParametersStateString)
+ {
+ // Add the parameters
+ PortletParameters parameters =
((PortletParametersStateString)navigationalState).getParameters();
+ configure(parameters);
+ }
+ else
+ {
+ meta |= PortletRequestDecoder.OPAQUE_MASK;
+
+ //
+ queryParameters.setValue(PortletRequestDecoder.NAVIGATIONAL_STATE_PARAMETER,
navigationalState.getStringValue());
+ }
+
+ //
+ configure(meta, mode, windowState);
+ }
+ else
+ {
+ if (mode != null)
+ {
+ queryParameters.setValue(PortletRequestDecoder.MODE_PARAMETER,
mode.toString());
+ }
+
+ //
+ if (windowState != null)
+ {
+ queryParameters.setValue(PortletRequestDecoder.WINDOW_STATE_PARAMETER,
windowState.toString());
+ }
+ }
+ }
+
+ public ParameterMap getQueryParameters()
+ {
+ return queryParameters;
+ }
+
+ private void configure(PortletParameters parameters)
+ {
+ 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();
+ queryParameters.setValues(name, values);
+ }
+ }
+
+ private void configure(int meta, Mode mode, WindowState windowState)
+ {
+ if (mode != null)
+ {
+ meta |= PortletRequestDecoder.MODE_MASK;
+ setMetaParameter(PortletRequestDecoder.MODE_PARAMETER, mode.toString());
+ }
+ if (windowState != null)
+ {
+ meta |= PortletRequestDecoder.WINDOW_STATE_MASK;
+ setMetaParameter(PortletRequestDecoder.WINDOW_STATE_PARAMETER,
windowState.toString());
+ }
+ setMetaParameter(PortletRequestDecoder.META_PARAMETER, Integer.toHexString(meta));
+ }
+
+ private void setMetaParameter(String name, String value)
+ {
+ String[] values = queryParameters.getValues(name);
+ if (values == null)
+ {
+ values = new String[]{value};
+ }
+ else
+ {
+ String[] tmp = new String[values.length + 1];
+ System.arraycopy(values, 0, tmp, 1, values.length);
+ tmp[0] = value;
+ values = tmp;
+ }
+ queryParameters.setValues(name, values);
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/RequestPropertiesAttributeResolver.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/RequestPropertiesAttributeResolver.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/RequestPropertiesAttributeResolver.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,30 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., 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;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class RequestPropertiesAttributeResolver
+{
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/container/PortletApplicationContextImpl.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/container/PortletApplicationContextImpl.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/container/PortletApplicationContextImpl.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,196 @@
+/******************************************************************************
+ * 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.container;
+
+import org.jboss.portal.portlet.container.PortletApplicationContext;
+import org.jboss.portal.portlet.container.PortletApplicationRegistrationContext;
+import org.jboss.portal.portlet.container.PortletApplicationRegistry;
+import org.jboss.portal.portlet.container.PortletContainer;
+import org.jboss.portal.portlet.impl.jsr168.PortletApplicationImpl;
+import org.jboss.portal.portlet.impl.jsr168.PortletContainerImpl;
+import org.jboss.portal.portlet.impl.jsr168.metadata.PortletApplicationMetaData;
+import org.jboss.portal.portlet.impl.jsr168.metadata.PortletMetaData;
+import org.jboss.portal.portlet.impl.jsr168.spi.PortletAPIFactory;
+import org.jboss.portal.portlet.impl.jsr168.spi.PortletInfoFactory;
+import org.jboss.portal.portlet.metadata.JBossApplicationMetaData;
+import org.jboss.portal.portlet.metadata.JBossPortletMetaData;
+
+import javax.servlet.ServletContext;
+import java.util.Iterator;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 6697 $
+ */
+public class PortletApplicationContextImpl implements PortletApplicationContext
+{
+
+ /** . */
+ private final PortletAPIFactory portletAPIFactory;
+
+ /** . */
+ private final PortletInfoFactory portletInfoFactory;
+
+ /** . */
+ private final PortletApplicationMetaData portletAppMD;
+
+ /** . */
+ private final JBossApplicationMetaData jbossAppMD;
+
+ /** . */
+ private final ServletContext servletContext;
+
+ /** . */
+ private final ClassLoader classLoader;
+
+ /** . */
+ private PortletApplicationImpl portletApp;
+
+ /** . */
+ private PortletApplicationRegistry registry;
+
+ /** . */
+ private PortletApplicationRegistrationContext registrationContext;
+
+ public PortletApplicationContextImpl(
+ PortletApplicationRegistry registry,
+ PortletAPIFactory portletAPIFactory,
+ PortletInfoFactory portletInfoFactory,
+ PortletApplicationMetaData portletAppMD,
+ JBossApplicationMetaData jbossAppMD,
+ ServletContext servletContext,
+ ClassLoader classLoader)
+ {
+ this.registry = registry;
+ this.portletAPIFactory = portletAPIFactory;
+ this.portletInfoFactory = portletInfoFactory;
+ this.portletAppMD = portletAppMD;
+ this.jbossAppMD = jbossAppMD;
+ this.servletContext = servletContext;
+ this.classLoader = classLoader;
+ }
+
+ public PortletApplicationImpl getPortletApplication()
+ {
+ return portletApp;
+ }
+
+ // PortletApplicationContext implementation
*************************************************************************
+
+ public void startPortletApplication() throws Exception
+ {
+ portletApp = new PortletApplicationImpl(portletAppMD, jbossAppMD, this,
portletAPIFactory, portletInfoFactory);
+ portletApp.start();
+
+ //
+ registrationContext = registry.registerPortletApplication(portletApp);
+
+ //
+ for (Iterator i = portletAppMD.getPortlets().iterator(); i.hasNext();)
+ {
+ PortletMetaData portletMD = (PortletMetaData)i.next();
+
+ //
+ JBossPortletMetaData jBossPortletMD = null;
+ if (jbossAppMD != null)
+ {
+ jBossPortletMD =
(JBossPortletMetaData)jbossAppMD.getPortlets().get(portletMD.getName());
+ }
+
+ //
+ PortletContainerImpl container = new PortletContainerImpl(portletMD,
jBossPortletMD);
+
+ //
+ container.setApplication(portletApp);
+ portletApp.addContainer(container);
+
+ //
+ try
+ {
+ container.start();
+ registrationContext.registerPortlet(container);
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ public void stopPortletApplication()
+ {
+ // if the portlet application wasn't properly started, we shouldn't be
trying to stop it
+ if (portletApp != null)
+ {
+ for (Iterator i = portletApp.getPortletContainers().iterator(); i.hasNext();)
+ {
+ PortletContainerImpl container = (PortletContainerImpl)i.next();
+ try
+ {
+ registrationContext.unregisterPortlet(container);
+ container.stop();
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+
+ //
+ portletApp.removeContainer(container);
+ container.setApplication(null);
+ }
+
+ //
+ registry.unregisterPortletApplication(portletApp);
+ portletApp.stop();
+
+ //
+ portletApp = null;
+ registrationContext = null;
+ }
+ }
+
+ public void startPortletContainer(String portletName) throws Exception
+ {
+ PortletContainer container = portletApp.getPortletContainer(portletName);
+ container.start();
+ registrationContext.registerPortlet(container);
+ }
+
+ public void stopPortletContainer(String portletName)
+ {
+ PortletContainer container = portletApp.getPortletContainer(portletName);
+ registrationContext.unregisterPortlet(container);
+ container.stop();
+ }
+
+ public ServletContext getServletContext()
+ {
+ return servletContext;
+ }
+
+ public ClassLoader getClassLoader()
+ {
+ return classLoader;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/container/PortletApplicationContextImpl.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/container/PortletApplicationRegistryImpl.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/container/PortletApplicationRegistryImpl.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/container/PortletApplicationRegistryImpl.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,255 @@
+/******************************************************************************
+ * 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.container;
+
+import org.jboss.portal.portlet.container.PortletApplicationRegistry;
+import org.jboss.portal.portlet.container.PortletApplicationRegistrationContext;
+import org.jboss.portal.portlet.container.PortletApplication;
+import org.jboss.portal.portlet.container.PortletApplicationRegistryListener;
+import org.jboss.portal.portlet.container.PortletContainer;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @version $Revision: 6720 $
+ */
+public class PortletApplicationRegistryImpl implements PortletApplicationRegistry
+{
+
+ /** . */
+ private Map portletApplications = new HashMap();
+
+ /** . */
+ private Map portletContainers = new HashMap();
+
+ /** . */
+ private List listeners = new ArrayList();
+
+ public PortletApplicationRegistrationContext
registerPortletApplication(PortletApplication portletApplication)
+ {
+ if (portletApplication == null)
+ {
+ throw new IllegalArgumentException("No null portlet app accepted");
+ }
+ synchronized (this)
+ {
+ String key = portletApplication.getId();
+ if (portletApplications.containsKey(key))
+ {
+ throw new IllegalArgumentException("This portlet app is already
registered: " + key);
+ }
+ PortletApplicationRegistrationContext ctx = new
PortletApplicationRegistrationContextImpl(portletApplication);
+ Map webAppsCopy = new HashMap(portletApplications);
+ webAppsCopy.put(key, portletApplication);
+ portletApplications = webAppsCopy;
+ return ctx;
+ }
+ }
+
+ public void unregisterPortletApplication(PortletApplication portletApplication)
+ {
+ if (portletApplication == null)
+ {
+ throw new IllegalArgumentException("No null portlet app accepted");
+ }
+ synchronized (this)
+ {
+ String key = portletApplication.getId();
+ if (!portletApplications.containsKey(key))
+ {
+ throw new IllegalArgumentException("This portlet app does not exist
here: " + key);
+ }
+ Map webAppsCopy = new HashMap(portletApplications);
+ webAppsCopy.remove(key);
+ portletApplications = webAppsCopy;
+ }
+ }
+
+ public Collection getPortletApplications()
+ {
+ return Collections.unmodifiableCollection(portletApplications.values());
+ }
+
+ public PortletApplication getPortletApplication(String id)
+ {
+ return (PortletApplication)portletApplications.get(id);
+ }
+
+ public void addListener(PortletApplicationRegistryListener listener)
+ {
+ if (listener == null)
+ {
+ throw new IllegalArgumentException("No null listener accepted");
+ }
+ else
+ {
+ synchronized (this)
+ {
+ listeners.add(listener);
+ }
+ }
+ }
+
+ public void removeListener(PortletApplicationRegistryListener listener)
+ {
+ if (listener == null)
+ {
+ throw new IllegalArgumentException("No null listener accepted");
+ }
+ else
+ {
+ synchronized (this)
+ {
+ listeners.remove(listener);
+ }
+ }
+ }
+
+ private void raiseRegisterPortletContainerEvent(PortletContainer portlet)
+ {
+ Iterator it = listeners.iterator();
+ while (it.hasNext())
+ {
+ PortletApplicationRegistryListener listener =
(PortletApplicationRegistryListener)it.next();
+ listener.portletContainerRegistered(portlet);
+ }
+ }
+
+ private void raiseUnregisterPortletContainerEvent(PortletContainer portlet)
+ {
+ Iterator it = listeners.iterator();
+ while (it.hasNext())
+ {
+ PortletApplicationRegistryListener listener =
(PortletApplicationRegistryListener)it.next();
+ listener.portletContainerUnregistered(portlet);
+ }
+ }
+
+ private static class ContainerKey
+ {
+ /** . */
+ private final String applicationId;
+
+ /** . */
+ private final String containerId;
+
+ public ContainerKey(PortletContainer container)
+ {
+ this.applicationId = container.getApplication().getId();
+ this.containerId = container.getId();
+ }
+
+ public boolean equals(Object obj)
+ {
+ if (obj == this)
+ {
+ return true;
+ }
+ if (obj instanceof ContainerKey)
+ {
+ ContainerKey that = (ContainerKey)obj;
+ return applicationId.equals(that.applicationId) &&
containerId.equals(containerId);
+ }
+ return false;
+ }
+
+ public int hashCode()
+ {
+ return applicationId.hashCode() & containerId.hashCode();
+ }
+ }
+
+ private class PortletApplicationRegistrationContextImpl implements
PortletApplicationRegistrationContext
+ {
+
+ /** . */
+ private PortletApplication portletApplication;
+
+ /** . */
+ private boolean active;
+
+ public PortletApplicationRegistrationContextImpl(PortletApplication
portletApplication)
+ {
+ this.portletApplication = portletApplication;
+ this.active = true;
+ }
+
+ public void registerPortlet(PortletContainer portletContainer)
+ {
+ if (portletContainer == null)
+ {
+ throw new IllegalArgumentException("No null portlet accepted");
+ }
+ if (portletContainer.getApplication() != portletApplication)
+ {
+ throw new IllegalArgumentException("The container does not belong to the
application owning the registration");
+ }
+ if (!active)
+ {
+ throw new IllegalStateException("Not anymore active");
+ }
+ synchronized (this)
+ {
+ Map componentsCopy = new HashMap(portletContainers);
+ componentsCopy.put(new ContainerKey(portletContainer), portletContainer);
+ portletContainers = componentsCopy;
+
+ //
+ raiseRegisterPortletContainerEvent(portletContainer);
+ }
+ }
+
+ public void unregisterPortlet(PortletContainer portletContainer)
+ {
+ if (portletContainer == null)
+ {
+ throw new IllegalArgumentException("No null portlet accepted");
+ }
+ if (portletContainer.getApplication() != portletApplication)
+ {
+ throw new IllegalArgumentException("The container does not belong to the
application owning the registration");
+ }
+ if (!active)
+ {
+ throw new IllegalStateException("Not anymore active");
+ }
+ synchronized (this)
+ {
+ Map componentsCopy = new HashMap(portletContainers);
+ componentsCopy.remove(portletContainer);
+ portletContainers = componentsCopy;
+ raiseUnregisterPortletContainerEvent(portletContainer);
+ }
+ }
+
+ }
+
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/container/PortletApplicationRegistryImpl.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/APIConstants.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/APIConstants.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/APIConstants.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,60 @@
+/******************************************************************************
+ * 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.jsr168;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public interface APIConstants
+{
+ /**
+ *
+ */
+ String JAVAX_PORTLET_TITLE = "javax.portlet.title";
+
+ /**
+ *
+ */
+ String JAVAX_PORTLET_SHORT_TITLE = "javax.portlet.short-title";
+
+ /**
+ *
+ */
+ String JAVAX_PORTLET_KEYWORDS = "javax.portlet.keywords";
+
+ /**
+ *
+ */
+ String JAVAX_PORTLET_CONFIG = "javax.portlet.config";
+
+ /**
+ *
+ */
+ String JAVAX_PORTLET_REQUEST = "javax.portlet.request";
+
+ /**
+ *
+ */
+ String JAVAX_PORTLET_RESPONSE = "javax.portlet.response";
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/APIConstants.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/DispatchedHttpServletRequest.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/DispatchedHttpServletRequest.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/DispatchedHttpServletRequest.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,482 @@
+/******************************************************************************
+ * 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.jsr168;
+
+import org.jboss.portal.common.http.QueryStringParser;
+import org.jboss.portal.common.util.Tools;
+import org.jboss.portal.portlet.PortletParameters;
+import org.jboss.portal.portlet.impl.jsr168.api.RenderRequestImpl;
+
+import javax.servlet.RequestDispatcher;
+import javax.servlet.ServletInputStream;
+import javax.servlet.http.Cookie;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpSession;
+import javax.servlet.http.HttpServletRequestWrapper;
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.security.Principal;
+import java.util.Enumeration;
+import java.util.Locale;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 6903 $
+ */
+public class DispatchedHttpServletRequest extends HttpServletRequestWrapper
+{
+
+ private static final String REQUEST_URI =
"javax.servlet.include.request_uri";
+ private static final String CONTEXT_PATH =
"javax.servlet.include.context_path";
+ private static final String SERVLET_PATH =
"javax.servlet.include.servlet_path";
+ private static final String PATH_INFO = "javax.servlet.include.path_info";
+ private static final String QUERY_STRING =
"javax.servlet.include.query_string";
+
+ private RenderRequestImpl rreq;
+ private HttpServletRequest dreq;
+
+ private final Map parameters;
+
+ public DispatchedHttpServletRequest(
+ RenderRequestImpl rreq,
+ HttpServletRequest dreq,
+ String path)
+ {
+ super(dreq);
+
+ //
+ this.rreq = rreq;
+ this.dreq = dreq;
+
+ //
+ if (path != null)
+ {
+ String queryString;
+
+ int endOfServletPath = path.indexOf('/', 1);
+ if (endOfServletPath == -1)
+ {
+ endOfServletPath = path.indexOf('?', 1);
+ if (endOfServletPath == -1)
+ {
+ queryString = "";
+ }
+ else
+ {
+ queryString = path.substring(endOfServletPath + 1);
+ }
+ }
+ else
+ {
+ int endOfPathInfo = path.indexOf('?', endOfServletPath + 1);
+ if (endOfPathInfo == -1)
+ {
+ queryString = "";
+ }
+ else
+ {
+ queryString = path.substring(endOfPathInfo + 1);
+ }
+ }
+
+ //
+ if (queryString.length() > 0)
+ {
+ this.parameters = new PortletParameters(rreq.getParameterMap());
+ this.parameters.putAll(QueryStringParser.parseQueryString(queryString));
+ }
+ else
+ {
+ this.parameters = rreq.getParameterMap();
+ }
+ }
+ else
+ {
+ this.parameters = rreq.getParameterMap();
+ }
+ }
+
+ // Must return null
+
+ public String getProtocol()
+ {
+ return null;
+ }
+
+ public String getRemoteAddr()
+ {
+ return null;
+ }
+
+ public String getRemoteHost()
+ {
+ return null;
+ }
+
+ public String getRealPath(String s)
+ {
+ return null;
+ }
+
+ public StringBuffer getRequestURL()
+ {
+ return null;
+ }
+
+ // Must return the path and query string information used to obtain the
PortletRequestDispatcher object
+
+ public String getPathInfo()
+ {
+ return (String)getAttribute(PATH_INFO);
+ }
+
+ public String getQueryString()
+ {
+ return (String)getAttribute(QUERY_STRING);
+ }
+
+ public String getServletPath()
+ {
+ return (String)getAttribute(SERVLET_PATH);
+ }
+
+ public String getRequestURI()
+ {
+ return (String)getAttribute(REQUEST_URI);
+ }
+
+ public String getPathTranslated()
+ {
+ return "PathTranslated"; // todo
+ }
+
+ // Must be equivalent to the method of the PortletRequest
+
+ public String getScheme()
+ {
+ return rreq.getScheme();
+ }
+
+ public String getServerName()
+ {
+ return rreq.getServerName();
+ }
+
+ public int getServerPort()
+ {
+ return rreq.getServerPort();
+ }
+
+ public Object getAttribute(String s)
+ {
+ // First try the special values
+// Object value = attrs.get(s);
+// if (value != null)
+// {
+// return value;
+// }
+
+ // Otherwise try the render request modified attributes
+ return rreq.getAttributes().getAttribute(s, (HttpServletRequest)getRequest());
+ }
+
+ public Enumeration getAttributeNames()
+ {
+ return
Tools.toEnumeration(rreq.getAttributes().getAttributeNames((HttpServletRequest)getRequest()));
+// return new Enumeration()
+// {
+// // The next element
+// Object next;
+//
+// {
+// next();
+// }
+//
+// public boolean hasMoreElements()
+// {
+// return next != null;
+// }
+//
+// public Object nextElement()
+// {
+// Object next = this.next;
+// next();
+// return next;
+// }
+//
+// private void next()
+// {
+// next = null;
+// while (true)
+// {
+// if (i.hasNext())
+// {
+// Object next = i.next();
+// if (attrs != null && !attrs.containsKey(next))
+// {
+// this.next = next;
+// break;
+// }
+// }
+// else
+// {
+// break;
+// }
+// }
+// }
+// };
+ }
+
+ public void setAttribute(String s, Object o)
+ {
+ rreq.getAttributes().setAttribute(s, o);
+ }
+
+ public void removeAttribute(String s)
+ {
+ rreq.getAttributes().removeAttribute(s);
+ }
+
+ public Locale getLocale()
+ {
+ return rreq.getLocale();
+ }
+
+ public Enumeration getLocales()
+ {
+ return rreq.getLocales();
+ }
+
+ public boolean isSecure()
+ {
+ return rreq.isSecure();
+ }
+
+ public String getAuthType()
+ {
+ return rreq.getAuthType();
+ }
+
+ public String getContextPath()
+ {
+ return (String)getAttribute(CONTEXT_PATH);
+ }
+
+ public String getRemoteUser()
+ {
+ return rreq.getRemoteUser();
+ }
+
+ public Principal getUserPrincipal()
+ {
+ return rreq.getUserPrincipal();
+ }
+
+ public String getRequestedSessionId()
+ {
+ return rreq.getRequestedSessionId();
+ }
+
+ public boolean isRequestedSessionIdValid()
+ {
+ return rreq.isRequestedSessionIdValid();
+ }
+
+ // Must be equivalent to the method of the PortletRequest with the provision defined
in PLT.16.1.1
+
+ public String getParameter(String name)
+ {
+ if (name == null)
+ {
+ throw new IllegalArgumentException("Parameter name must not be
null");
+ }
+
+ //
+ String[] values = (String[])parameters.get(name);
+ if (values != null)
+ {
+ return values[0];
+ }
+
+ //
+ return null;
+ }
+
+ public Enumeration getParameterNames()
+ {
+ return Tools.toEnumeration(parameters.keySet().iterator());
+ }
+
+ public String[] getParameterValues(String name)
+ {
+ if (name == null)
+ {
+ throw new IllegalArgumentException("Parameter name must not be
null");
+ }
+
+ //
+ String[] values = (String[])parameters.get(name);
+ if (values != null)
+ {
+ return (String[])values.clone();
+ }
+
+ //
+ return null;
+ }
+
+ public Map getParameterMap()
+ {
+ return parameters;
+ }
+
+ // Do not operate and return null or zero
+
+ public String getCharacterEncoding()
+ {
+ return null;
+ }
+
+ public void setCharacterEncoding(String s) throws UnsupportedEncodingException
+ {
+ }
+
+ public int getContentLength()
+ {
+ return 0;
+ }
+
+ public String getContentType()
+ {
+ return null;
+ }
+
+ public ServletInputStream getInputStream() throws IOException
+ {
+ return null;
+ }
+
+ public BufferedReader getReader() throws IOException
+ {
+ return null;
+ }
+
+ // Must be based on properties provided by the getProperties method of the
PortletRequest interface
+
+ public String getHeader(String s)
+ {
+ return rreq.getProperty(s);
+ }
+
+ public Enumeration getHeaders(String s)
+ {
+ return rreq.getProperties(s);
+ }
+
+ public Enumeration getHeaderNames()
+ {
+ return rreq.getPropertyNames();
+ }
+
+ public Cookie[] getCookies()
+ {
+ return new Cookie[0];
+ }
+
+ public long getDateHeader(String s)
+ {
+ return 0;
+ }
+
+ public int getIntHeader(String s)
+ {
+ return 0;
+ }
+
+ // Must provide the functionnalities provided by the servlet specification 2.3
+
+ public String getMethod()
+ {
+ // The getMethod method of the HttpServletRequest must always return
"GET"
+ return "GET";
+ }
+
+ public RequestDispatcher getRequestDispatcher(String s)
+ {
+ return dreq.getRequestDispatcher(s);
+ }
+
+ public boolean isUserInRole(String s)
+ {
+ return false;
+ }
+
+ public HttpSession getSession(boolean b)
+ {
+ return dreq.getSession(b);
+ }
+
+ public HttpSession getSession()
+ {
+ return dreq.getSession();
+ }
+
+ public boolean isRequestedSessionIdFromCookie()
+ {
+ return false;
+ }
+
+ public boolean isRequestedSessionIdFromURL()
+ {
+ return false;
+ }
+
+ public boolean isRequestedSessionIdFromUrl()
+ {
+ return false;
+ }
+
+ // Belongs to servlet 2.4 - not specified how it should behave yet
+
+ public int getRemotePort()
+ {
+ throw new UnsupportedOperationException("Not specified by spec");
+ }
+
+ public String getLocalName()
+ {
+ throw new UnsupportedOperationException("Not specified by spec");
+ }
+
+ public String getLocalAddr()
+ {
+ throw new UnsupportedOperationException("Not specified by spec");
+ }
+
+ public int getLocalPort()
+ {
+ throw new UnsupportedOperationException("Not specified by spec");
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/DispatchedHttpServletRequest.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/DispatchedHttpServletResponse.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/DispatchedHttpServletResponse.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/DispatchedHttpServletResponse.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,230 @@
+/******************************************************************************
+ * 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.jsr168;
+
+import javax.portlet.RenderResponse;
+import javax.servlet.ServletOutputStream;
+import javax.servlet.http.Cookie;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpServletResponseWrapper;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.PrintWriter;
+import java.util.Locale;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 6639 $
+ */
+public class DispatchedHttpServletResponse extends HttpServletResponseWrapper
+{
+
+ private RenderResponse rresp;
+ private ServletOutputStream sos;
+
+ public DispatchedHttpServletResponse(RenderResponse rresp, HttpServletResponse dresp)
+ {
+ super(dresp);
+ this.rresp = rresp;
+ this.sos = null;
+ }
+
+ // Must return null
+
+ public String encodeRedirectURL(String s)
+ {
+ return null;
+ }
+
+ public String encodeRedirectUrl(String s)
+ {
+ return null;
+ }
+
+ // Must be equivalent to the methods of the RenderResponse
+
+ public String getCharacterEncoding()
+ {
+ return rresp.getCharacterEncoding();
+ }
+
+ public void setBufferSize(int i)
+ {
+ rresp.setBufferSize(i);
+ }
+
+ public void flushBuffer() throws IOException
+ {
+ rresp.flushBuffer();
+ }
+
+ public void resetBuffer()
+ {
+ rresp.resetBuffer();
+ }
+
+ public void reset()
+ {
+ rresp.reset();
+ }
+
+ public int getBufferSize()
+ {
+ return rresp.getBufferSize();
+ }
+
+ public boolean isCommitted()
+ {
+ return rresp.isCommitted();
+ }
+
+ public ServletOutputStream getOutputStream() throws IOException
+ {
+ if (sos == null)
+ {
+ sos = new ServletOutputStream()
+ {
+ private OutputStream out = rresp.getPortletOutputStream();
+
+ public void write(byte b[], int off, int len) throws IOException
+ {
+ out.write(b, off, len);
+ }
+
+ public void write(byte b[]) throws IOException
+ {
+ out.write(b);
+ }
+
+ public void write(int b) throws IOException
+ {
+ out.write(b);
+ }
+ };
+ }
+ return sos;
+ }
+
+ public PrintWriter getWriter() throws IOException
+ {
+ return rresp.getWriter();
+ }
+
+ public String encodeURL(String s)
+ {
+ return rresp.encodeURL(s);
+ }
+
+ public String encodeUrl(String s)
+ {
+ return rresp.encodeURL(s);
+ }
+
+ // Must perform no operations
+
+ public void setContentType(String s)
+ {
+ }
+
+ public void setContentLength(int i)
+ {
+ }
+
+ public void setLocale(Locale locale)
+ {
+ }
+
+ public void addCookie(Cookie cookie)
+ {
+ }
+
+ public void sendError(int i) throws IOException
+ {
+ }
+
+ public void sendError(int i, String s) throws IOException
+ {
+ }
+
+ public void sendRedirect(String s) throws IOException
+ {
+ }
+
+ public void setDateHeader(String s, long l)
+ {
+ }
+
+ public void addDateHeader(String s, long l)
+ {
+ }
+
+ public void setHeader(String s, String s1)
+ {
+ }
+
+ public void addHeader(String s, String s1)
+ {
+ }
+
+ public void setIntHeader(String s, int i)
+ {
+ }
+
+ public void addIntHeader(String s, int i)
+ {
+ }
+
+ public void setStatus(int i)
+ {
+ }
+
+ public void setStatus(int i, String s)
+ {
+ }
+
+ public boolean containsHeader(String s)
+ {
+ // Must return false
+ return false;
+ }
+
+ // Must be based on the getLocale method of the RenderResponse
+
+ public Locale getLocale()
+ {
+ return rresp.getLocale();
+ }
+
+ // Belongs to servlet 2.4 - not specified how it should behave yet
+
+ public String getContentType()
+ {
+ throw new UnsupportedOperationException("Not specified by spec");
+ }
+
+ public void setCharacterEncoding(String s)
+ {
+ throw new UnsupportedOperationException("Not specified by spec");
+ }
+}
+
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/DispatchedHttpServletResponse.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletAPIFactoryImpl.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletAPIFactoryImpl.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletAPIFactoryImpl.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,58 @@
+/******************************************************************************
+ * 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.jsr168;
+
+import org.jboss.portal.portlet.invocation.ActionInvocation;
+import org.jboss.portal.portlet.invocation.RenderInvocation;
+import org.jboss.portal.portlet.impl.jsr168.api.ActionResponseImpl;
+import org.jboss.portal.portlet.impl.jsr168.api.ActionRequestImpl;
+import org.jboss.portal.portlet.impl.jsr168.api.RenderRequestImpl;
+import org.jboss.portal.portlet.impl.jsr168.api.RenderResponseImpl;
+import org.jboss.portal.portlet.impl.jsr168.spi.PortletAPIFactory;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 7226 $
+ */
+public class PortletAPIFactoryImpl implements PortletAPIFactory
+{
+ public ActionRequestImpl createActionRequest(ActionInvocation invocation)
+ {
+ return new ActionRequestImpl(invocation);
+ }
+
+ public ActionResponseImpl createActionResponse(ActionInvocation invocation,
ActionRequestImpl actionRequest)
+ {
+ return new ActionResponseImpl(invocation, actionRequest);
+ }
+
+ public RenderRequestImpl createRenderRequest(RenderInvocation invocation)
+ {
+ return new RenderRequestImpl(invocation);
+ }
+
+ public RenderResponseImpl createRenderResponse(RenderInvocation invocation,
RenderRequestImpl renderRequest)
+ {
+ return new RenderResponseImpl(invocation, renderRequest);
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletAPIFactoryImpl.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletApplicationImpl.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletApplicationImpl.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletApplicationImpl.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -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. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.impl.jsr168;
+
+import org.jboss.portal.portlet.impl.jsr168.api.PortletContextImpl;
+import org.jboss.portal.portlet.impl.jsr168.metadata.PortletApplicationMetaData;
+import org.jboss.portal.portlet.impl.jsr168.spi.PortletAPIFactory;
+import org.jboss.portal.portlet.impl.jsr168.spi.PortletInfoFactory;
+import org.jboss.portal.portlet.metadata.JBossApplicationMetaData;
+import org.jboss.portal.portlet.container.PortletApplication;
+import org.jboss.portal.portlet.container.PortletApplicationContext;
+import org.jboss.portal.portlet.container.PortletContainer;
+
+import javax.portlet.PortletContext;
+import java.util.HashSet;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 7226 $
+ */
+public class PortletApplicationImpl implements PortletApplication
+{
+
+ /** . */
+ protected final PortletApplicationMetaData metaData;
+
+ /** . */
+ protected final JBossApplicationMetaData jbossMetaData;
+
+ /** . */
+ protected final PortletApplicationContext context;
+
+ /** . */
+ protected final PortletAPIFactory portletAPIFactory;
+
+ /** . */
+ protected final PortletInfoFactory portletInfoFactory;
+
+ /** . */
+ protected LinkedHashMap portlets;
+
+ /** . */
+ protected PortletContext portletContext;
+
+ /** . */
+ protected String version;
+
+ /** . */
+ protected Map portletModes;
+
+ /** . */
+ protected Map windowStates;
+
+ public PortletApplicationImpl(
+ PortletApplicationMetaData metaData,
+ JBossApplicationMetaData jbossMetaData,
+ PortletApplicationContext context,
+ PortletAPIFactory portletAPIFactory,
+ PortletInfoFactory portletInfoFactory)
+ {
+ this.metaData = metaData;
+ this.jbossMetaData = jbossMetaData;
+ this.portletAPIFactory = portletAPIFactory;
+ this.portletInfoFactory = portletInfoFactory;
+ this.portlets = new LinkedHashMap();
+ this.context = context;
+ }
+
+ public String getId()
+ {
+ return metaData.getId();
+ }
+
+ public PortletAPIFactory getPortletAPIFactory()
+ {
+ return portletAPIFactory;
+ }
+
+ public PortletInfoFactory getPortletInfoFactory()
+ {
+ return portletInfoFactory;
+ }
+
+ public PortletApplicationMetaData getMetaData()
+ {
+ return metaData;
+ }
+
+ public JBossApplicationMetaData getJBossMetaData()
+ {
+ return jbossMetaData;
+ }
+
+ public void addContainer(PortletContainer container)
+ {
+ portlets.put(container.getId(), container);
+ }
+
+ public void removeContainer(PortletContainer container)
+ {
+ portlets.remove(container.getId());
+ }
+
+ //
+
+ public void start() throws Exception
+ {
+ version = metaData.getVersion();
+ portletModes = metaData.getPortletModes();
+ windowStates = metaData.getWindowStates();
+ portletContext = new PortletContextImpl(context.getServletContext());
+ }
+
+ public void stop()
+ {
+ version = null;
+ portletModes = null;
+ windowStates = null;
+ portletContext = null;
+ }
+
+ public String getVersion()
+ {
+ return version;
+ }
+
+ public PortletContext getPortletContext()
+ {
+ return portletContext;
+ }
+
+ public Map getPortletModes()
+ {
+ return portletModes;
+ }
+
+ public Map getWindowStates()
+ {
+ return windowStates;
+ }
+
+ // WebApp implementation
********************************************************************************************
+
+ public Set getPortletContainers()
+ {
+ return new HashSet(portlets.values());
+ }
+
+ public PortletContainer getPortletContainer(String name)
+ {
+ return (PortletContainer)portlets.get(name);
+ }
+
+ public PortletApplicationContext getContext()
+ {
+ return context;
+ }
+
+ // Container implementation
*****************************************************************************************
+
+ public String toString()
+ {
+ return "PortletWebApp[" + metaData.getId() + "]";
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletApplicationImpl.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletContainerImpl.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletContainerImpl.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletContainerImpl.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,494 @@
+/******************************************************************************
+ * 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.jsr168;
+
+import org.jboss.portal.common.concurrent.Valve;
+import org.jboss.portal.common.i18n.ResourceBundleManager;
+import org.jboss.portal.common.invocation.InvocationException;
+import org.jboss.portal.portlet.PortletInvokerException;
+import org.jboss.portal.portlet.aspects.portlet.ContextDispatcherInterceptor;
+import org.jboss.portal.portlet.container.PortletApplication;
+import org.jboss.portal.portlet.container.PortletContainer;
+import org.jboss.portal.portlet.container.PortletInitializationException;
+import org.jboss.portal.portlet.impl.jsr168.api.ActionRequestImpl;
+import org.jboss.portal.portlet.impl.jsr168.api.ActionResponseImpl;
+import org.jboss.portal.portlet.impl.jsr168.api.PortletConfigImpl;
+import org.jboss.portal.portlet.impl.jsr168.api.RenderRequestImpl;
+import org.jboss.portal.portlet.impl.jsr168.api.RenderResponseImpl;
+import org.jboss.portal.portlet.impl.jsr168.metadata.ParameterMetaData;
+import org.jboss.portal.portlet.impl.jsr168.metadata.PortletMetaData;
+import org.jboss.portal.portlet.impl.jsr168.metadata.PortletPreferencesMetaData;
+import org.jboss.portal.portlet.impl.jsr168.metadata.SecurityRoleRefMetaData;
+import org.jboss.portal.portlet.impl.jsr168.spi.PortletAPIFactory;
+import org.jboss.portal.portlet.info.PortletInfo;
+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.PortletInvocationResponse;
+import org.jboss.portal.portlet.invocation.response.SecurityErrorResponse;
+import org.jboss.portal.portlet.invocation.response.UnavailableResponse;
+import org.jboss.portal.portlet.metadata.JBossPortletMetaData;
+import org.apache.log4j.Logger;
+
+import javax.portlet.Portlet;
+import javax.portlet.PortletConfig;
+import javax.portlet.PortletException;
+import javax.portlet.PortletSecurityException;
+import javax.portlet.PreferencesValidator;
+import javax.portlet.UnavailableException;
+import javax.servlet.http.HttpServletRequest;
+import java.io.IOException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 6365 $
+ */
+public class PortletContainerImpl implements PortletContainer
+{
+
+ /** Logger. */
+ protected final Logger log;
+
+ /** . */
+ protected PortletApplicationImpl application;
+
+ /** . */
+ protected PortletMetaData metaData;
+
+ /** . */
+ protected JBossPortletMetaData jbossMetaData;
+
+ /** The portlet implementation class name. */
+ protected String className;
+
+ /** The portlet config. */
+ protected PortletConfig config;
+
+ /** The portlet instance. */
+ protected Portlet portlet;
+
+ /** The invocation valve. */
+ protected final Valve valve;
+
+ /** Give the correspondance between role name and role link. */
+ protected Map securityRoleRefsMap;
+
+ /** Are we started or not. */
+ protected boolean started;
+
+ /** User data constraint. */
+ protected Set userDataConstraints;
+
+ /** Return info. */
+ protected PortletInfo info;
+
+ /**
+ * The preference validator, this is not exposed as runtime meta data as it is only
used by the JSR 168 portlet
+ * container implementation.
+ */
+ protected PreferencesValidator preferencesValidator;
+
+ public PortletContainerImpl(PortletMetaData metaData, JBossPortletMetaData
jbossMetaData)
+ {
+ this.metaData = metaData;
+ this.jbossMetaData = jbossMetaData;
+ this.valve = new Valve();
+ this.log = Logger.getLogger("org.jboss.portal.portlet.container." +
metaData.getClassName().replace('.', '_'));
+ this.started = false;
+ }
+
+ public PortletInfo getInfo()
+ {
+ if (started)
+ {
+ return info;
+ }
+
+ //
+ throw new IllegalStateException("Portlet " + metaData.getName() + "
is not started");
+ }
+
+ public String getId()
+ {
+ return metaData.getName();
+ }
+
+ public PortletMetaData getMetaData()
+ {
+ return metaData;
+ }
+
+ public JBossPortletMetaData getJBossMetaData()
+ {
+ return jbossMetaData;
+ }
+
+ public boolean isStarted()
+ {
+ return valve.getState() == Valve.OPEN;
+ }
+
+ public void start() throws PortletInitializationException
+ {
+ // Set class name
+ this.className = metaData.getClassName();
+
+ //
+ PortletPreferencesMetaData preferences = metaData.getPreferences();
+ if (preferences != null)
+ {
+ String validatorClassName = preferences.getValidator();
+ if (validatorClassName != null)
+ {
+ try
+ {
+ ClassLoader loader = application.getContext().getClassLoader();
+
+ //
+ if (validatorClassName != null)
+ {
+ // Load the class
+ Class preferencesValidatorClass =
loader.loadClass(validatorClassName);
+ preferencesValidator =
(PreferencesValidator)preferencesValidatorClass.newInstance();
+ }
+ }
+ catch (ClassNotFoundException e)
+ {
+ log.error("Class for preference validator not found", e);
+ }
+ catch (InstantiationException e)
+ {
+ log.error("Cannot instantiate preference validator", e);
+ }
+ catch (IllegalAccessException e)
+ {
+ throw new Error();
+ }
+ }
+ }
+
+ // Security role ref
+ Map securityRoleRefsMap = new HashMap();
+ for (Iterator i = metaData.getSecurityRoleRefs().iterator(); i.hasNext();)
+ {
+ SecurityRoleRefMetaData securityRoleRefMD = (SecurityRoleRefMetaData)i.next();
+ securityRoleRefsMap.put(securityRoleRefMD.getRoleName(),
securityRoleRefMD.getRoleLink());
+ }
+
+ // Init parameters
+ Map initParameters = new HashMap();
+ for (Iterator i = metaData.getParameters().values().iterator(); i.hasNext();)
+ {
+ ParameterMetaData parameterMD = (ParameterMetaData)i.next();
+ initParameters.put(parameterMD.getName(), parameterMD.getValue());
+ }
+
+ // Resource bundle manager
+ ResourceBundleManager bundleMgr =
PortletResourceBundleFactory.createResourceBundleManager(application.getContext().getClassLoader(),
metaData.getLanguages());
+
+ // Portlet config object
+ PortletConfig config = new PortletConfigImpl(
+ metaData.getName(),
+ application.getPortletContext(),
+ initParameters,
+ bundleMgr);
+
+ // Create meta data
+ PortletInfo info = application.getPortletInfoFactory().createPortletInfo(metaData,
jbossMetaData, bundleMgr);
+
+ // Finally initialize the porlet instance
+ try
+ {
+ log.debug("Loading portlet class " + className);
+ Class portletClass =
application.getContext().getClassLoader().loadClass(className);
+ log.debug("Creating portlet object " + className);
+ Portlet portlet = (Portlet)portletClass.newInstance();
+ log.debug("Created portlet object " + className);
+ initPortlet(portlet, config);
+ log.debug("Initialized portlet object " + className);
+
+ // We are safe, update state
+ this.portlet = portlet;
+ this.config = config;
+ this.securityRoleRefsMap = Collections.unmodifiableMap(securityRoleRefsMap);
+ this.info = info;
+ this.started = true;
+
+ // Let invocation flow in
+ valve.open();
+ }
+ catch (IllegalAccessException e)
+ {
+ throw new PortletInitializationException("Portlet class not accessible
" + className, e);
+ }
+ catch (ClassNotFoundException e)
+ {
+ throw new PortletInitializationException("Portlet class not found " +
className, e);
+ }
+ catch (InstantiationException e)
+ {
+ throw new PortletInitializationException("Portlet class cannot be
instantiated " + className, e);
+ }
+ catch (PortletException e)
+ {
+ throw new PortletInitializationException("The portlet " + getId() +
" threw a portlet exception during init", e);
+ }
+ catch (RuntimeException e)
+ {
+ throw new PortletInitializationException("The portlet " + getId() +
" threw a runtime exception during init", e);
+ }
+ catch (Error e)
+ {
+ throw new PortletInitializationException("The portlet " + getId() +
" threw an error during init", e);
+ }
+ }
+
+ public void stop()
+ {
+ // if the portlet is not started, we shouldn't be trying to stop it...
+ if (started)
+ {
+ // Wait at most 60 seconds before all invocations are done
+ log.debug("Trying to close the valve");
+ boolean done = valve.closing(60000);
+ if (!done)
+ {
+ log.warn("The valve is still holding invocations, continue
anyway");
+ }
+
+ //
+ valve.closed();
+
+ //
+ started = false;
+
+ // Destroy the portlet object
+ destroyPortlet(portlet);
+
+ // Update state
+ preferencesValidator = null;
+ className = null;
+ portlet = null;
+ securityRoleRefsMap = null;
+ config = null;
+ userDataConstraints = null;
+ info = null;
+ }
+ }
+
+ public PortletConfig getConfig()
+ {
+ return config;
+ }
+
+ public Portlet getPortlet()
+ {
+ return portlet;
+ }
+
+ public Map getSecurityRoleRefsMap()
+ {
+ return securityRoleRefsMap;
+ }
+
+ public PortletApplication getApplication()
+ {
+ return application;
+ }
+
+ public void setApplication(PortletApplicationImpl application)
+ {
+ this.application = application;
+ }
+
+ public Valve getValve()
+ {
+ return valve;
+ }
+
+ public Set getUserDataConstraints()
+ {
+ return userDataConstraints;
+ }
+
+ public PreferencesValidator getPreferencesValidator()
+ {
+ return preferencesValidator;
+ }
+
+ public String toString()
+ {
+ return "PortletContainer[name=" + getId() + ",+application=" +
application.getId() + "]";
+ }
+
+ /** Initialize the portlet. */
+ private void initPortlet(Portlet portlet, PortletConfig config) throws
PortletException
+ {
+ ClassLoader oldLoader = Thread.currentThread().getContextClassLoader();
+ try
+ {
+ // Set the war loader for the request
+ ClassLoader newLoader = application.getContext().getClassLoader();
+ Thread.currentThread().setContextClassLoader(newLoader);
+ portlet.init(config);
+ }
+ finally
+ {
+ Thread.currentThread().setContextClassLoader(oldLoader);
+ }
+ }
+
+ /** Destroy the portlet. */
+ private void destroyPortlet(Portlet portlet)
+ {
+ ClassLoader oldLoader = Thread.currentThread().getContextClassLoader();
+ try
+ {
+ // Set the war loader for the request
+ ClassLoader newLoader = application.getContext().getClassLoader();
+ Thread.currentThread().setContextClassLoader(newLoader);
+ if (portlet != null)
+ {
+ portlet.destroy();
+ }
+ else
+ {
+ log.debug("Cannot call destroy, portlet was null");
+ }
+ }
+ catch (RuntimeException e)
+ {
+ log.error("The portlet threw a runtime exception", e);
+ }
+ finally
+ {
+ Thread.currentThread().setContextClassLoader(oldLoader);
+ }
+ }
+
+ public PortletInvocationResponse dispatch(PortletInvocation invocation) throws
PortletInvokerException, InvocationException
+ {
+ try
+ {
+ if (invocation instanceof ActionInvocation)
+ {
+ return invokeAction((ActionInvocation)invocation);
+ }
+ else if (invocation instanceof RenderInvocation)
+ {
+ return invokeRender((RenderInvocation)invocation);
+ }
+ else
+ {
+ throw new InvocationException("Unexpected invocation " +
invocation);
+ }
+ }
+ catch (NoClassDefFoundError e)
+ {
+ //
+ return new ErrorResponse(e);
+ }
+ catch (Exception e)
+ {
+ log.error("The portlet threw an exception", e);
+
+ //
+ if (e instanceof PortletSecurityException)
+ {
+ return new SecurityErrorResponse(e);
+ }
+ else if (e instanceof UnavailableException)
+ {
+ UnavailableException ue = (UnavailableException)e;
+ if (ue.isPermanent())
+ {
+ return new UnavailableResponse();
+ }
+ else
+ {
+ return new UnavailableResponse(ue.getUnavailableSeconds());
+ }
+ }
+ else
+ {
+ // The exception is either a PortletException, an IOException or a
RuntimeException
+ return new ErrorResponse(e);
+ }
+ }
+ }
+
+ protected PortletInvocationResponse invokeAction(ActionInvocation invocation) throws
IOException, PortletException
+ {
+ PortletAPIFactory factory = application.getPortletAPIFactory();
+ ActionRequestImpl areq = factory.createActionRequest(invocation);
+ ActionResponseImpl aresp = factory.createActionResponse(invocation, areq);
+ HttpServletRequest dreq = invocation.getDispatchedRequest();
+ try
+ {
+ dreq.setAttribute(APIConstants.JAVAX_PORTLET_CONFIG, config);
+ dreq.setAttribute(APIConstants.JAVAX_PORTLET_REQUEST, areq);
+ dreq.setAttribute(APIConstants.JAVAX_PORTLET_RESPONSE, aresp);
+ dreq.setAttribute(ContextDispatcherInterceptor.REQ_ATT_COMPONENT_INVOCATION,
invocation);
+ portlet.processAction(areq, aresp);
+ }
+ finally
+ {
+ dreq.removeAttribute(APIConstants.JAVAX_PORTLET_CONFIG);
+ dreq.removeAttribute(APIConstants.JAVAX_PORTLET_REQUEST);
+ dreq.removeAttribute(APIConstants.JAVAX_PORTLET_RESPONSE);
+
dreq.removeAttribute(ContextDispatcherInterceptor.REQ_ATT_COMPONENT_INVOCATION);
+ }
+
+ return aresp.getResult();
+ }
+
+ protected PortletInvocationResponse invokeRender(RenderInvocation invocation) throws
IOException, PortletException
+ {
+ PortletAPIFactory factory = application.getPortletAPIFactory();
+ RenderRequestImpl rreq = factory.createRenderRequest(invocation);
+ RenderResponseImpl rresp = factory.createRenderResponse(invocation, rreq);
+ HttpServletRequest dreq = invocation.getDispatchedRequest();
+ try
+ {
+ dreq.setAttribute(APIConstants.JAVAX_PORTLET_CONFIG, config);
+ dreq.setAttribute(APIConstants.JAVAX_PORTLET_REQUEST, rreq);
+ dreq.setAttribute(APIConstants.JAVAX_PORTLET_RESPONSE, rresp);
+ dreq.setAttribute(ContextDispatcherInterceptor.REQ_ATT_COMPONENT_INVOCATION,
invocation);
+ portlet.render(rreq, rresp);
+ }
+ finally
+ {
+ dreq.removeAttribute(APIConstants.JAVAX_PORTLET_CONFIG);
+ dreq.removeAttribute(APIConstants.JAVAX_PORTLET_REQUEST);
+ dreq.removeAttribute(APIConstants.JAVAX_PORTLET_RESPONSE);
+
dreq.removeAttribute(ContextDispatcherInterceptor.REQ_ATT_COMPONENT_INVOCATION);
+ }
+ return rresp.getResult();
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletInfoFactoryImpl.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletInfoFactoryImpl.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletInfoFactoryImpl.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,42 @@
+/******************************************************************************
+ * 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.jsr168;
+
+import org.jboss.portal.portlet.impl.jsr168.spi.PortletInfoFactory;
+import org.jboss.portal.portlet.impl.jsr168.metadata.PortletMetaData;
+import org.jboss.portal.portlet.impl.jsr168.info.ContainerPortletInfo;
+import org.jboss.portal.portlet.info.PortletInfo;
+import org.jboss.portal.portlet.metadata.JBossPortletMetaData;
+import org.jboss.portal.common.i18n.ResourceBundleManager;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class PortletInfoFactoryImpl implements PortletInfoFactory
+{
+ public PortletInfo createPortletInfo(PortletMetaData portletMD, JBossPortletMetaData
jbossPortletMD, ResourceBundleManager resourceBundleManager)
+ {
+ return new ContainerPortletInfo(portletMD, jbossPortletMD, resourceBundleManager);
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletRequestAttributes.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletRequestAttributes.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletRequestAttributes.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,190 @@
+/******************************************************************************
+ * 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.jsr168;
+
+import org.jboss.portal.common.util.Tools;
+import org.jboss.portal.portlet.impl.jsr168.metadata.PortletApplicationMetaData;
+import org.jboss.portal.portlet.spi.UserContext;
+import org.jboss.portal.portlet.container.PortletContainer;
+
+import javax.portlet.PortletRequest;
+import javax.servlet.http.HttpServletRequest;
+import java.util.Map;
+import java.util.Enumeration;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.HashMap;
+import java.util.Collections;
+
+/**
+ * Hold the portlet request attributes and holds only the modified state. That is the
reason motivating the
+ * presence of an <code>HttpServletRequest</code> on the methods returning
data reading the state. The object
+ * can be used either during the render request where the dispatched request will be
used. It can also be used
+ * during a request dispatch made from the portlet to a servlet, in that situation the
request provided will
+ * be the one valid during the dispatching operation.
+ *
+ * The other motivation of this class is to hold the state of the attributes that have
been modified by the
+ * request to the portlet container, so it will not write in the portal request
attributes.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class PortletRequestAttributes
+{
+
+ /** Constant object to mark that a request attribute is removed. */
+ protected static final Object REMOVED_ATTRIBUTE = new Object();
+
+ private PortletContainer container;
+
+ private UserContext userContext;
+
+ /** The lazy request attributes map added or removed during the request of the
portlet. */
+ private Map attributes;
+
+ public PortletRequestAttributes(PortletContainer container, UserContext userContext)
+ {
+ this.container = container;
+ this.userContext = userContext;
+ }
+
+ public Object getAttribute(String name, HttpServletRequest req)
+ {
+ if (name == null)
+ {
+ throw new IllegalArgumentException("name must not be null");
+ }
+ if (PortletRequest.USER_INFO.equals(name))
+ {
+ Map infos = userContext.getInformations();
+
+ //
+ if (infos != null)
+ {
+ // Get portlet application metadata
+ PortletApplicationImpl portletApp =
(PortletApplicationImpl)container.getApplication();
+ PortletApplicationMetaData pamd = portletApp.getMetaData();
+ Map uaMD = pamd.getUserAttributes();
+
+ // Clone the map
+ infos = new HashMap(infos);
+
+ // Keep only what is of interest with respect to what the portlet app
defines
+ infos.keySet().retainAll(uaMD.keySet());
+
+ // Make it immutable
+ infos = Collections.unmodifiableMap(infos);
+ }
+
+ //
+ return infos;
+ }
+ else
+ {
+ Object value = null;
+ if (attributes != null)
+ {
+ value = attributes.get(name);
+ }
+ if (value == null && req != null)
+ {
+ value = req.getAttribute(name);
+ }
+ else if (value == REMOVED_ATTRIBUTE)
+ {
+ value = null;
+ }
+ return value;
+ }
+ }
+
+ public Iterator getAttributeNames(HttpServletRequest req)
+ {
+ // Copy the attribute names to avoid ConcurrentModificationException
+ // one test in the TCK getPortalObjectContext the Enumeration then dispatch the
call to a
+ // servlet where it use the Enumeration and it throws a CME if we don't copy
+ Set names = new HashSet();
+
+ //
+ if (req != null)
+ {
+ for (Enumeration e = req.getAttributeNames();e.hasMoreElements();)
+ {
+ names.add(e.nextElement());
+ }
+ }
+
+ //
+ if (attributes != null)
+ {
+ for (Iterator i = attributes.entrySet().iterator(); i.hasNext();)
+ {
+ Map.Entry entry = (Map.Entry)i.next();
+ String name = (String)entry.getKey();
+ Object value = entry.getValue();
+ if (value == REMOVED_ATTRIBUTE)
+ {
+ names.remove(name);
+ }
+ else
+ {
+ names.add(name);
+ }
+ }
+ }
+ names.add(PortletRequest.USER_INFO);
+
+ //
+ return names.iterator();
+ }
+
+ public void setAttribute(String name, Object value)
+ {
+ if (name == null)
+ {
+ throw new IllegalArgumentException("name must not be null");
+ }
+ if (!PortletRequest.USER_INFO.equals(name))
+ {
+ if (value == null)
+ {
+ value = REMOVED_ATTRIBUTE;
+ }
+ if (attributes == null)
+ {
+ attributes = new HashMap();
+ }
+ attributes.put(name, value);
+ }
+ }
+
+ public void removeAttribute(String name)
+ {
+ if (name == null)
+ {
+ throw new IllegalArgumentException("name must not be null");
+ }
+ setAttribute(name, null);
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletResourceBundleFactory.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletResourceBundleFactory.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletResourceBundleFactory.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,145 @@
+/******************************************************************************
+ * 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.jsr168;
+
+import org.jboss.portal.common.util.EmptyResourceBundle;
+import org.jboss.portal.common.i18n.ParentChildResourceBundle;
+import org.jboss.portal.common.i18n.ResourceBundleManager;
+import org.jboss.portal.common.i18n.ResourceBundleFactory;
+import org.jboss.portal.portlet.impl.jsr168.metadata.LanguagesMetaData;
+import org.jboss.portal.portlet.impl.jsr168.info.InfoBundle;
+
+import java.util.Iterator;
+import java.util.Locale;
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+/**
+ * Manage resource bundles for a portlet.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @version $Revision: 6818 $
+ */
+public class PortletResourceBundleFactory implements ResourceBundleFactory
+{
+
+ public static ResourceBundleManager createResourceBundleManager(ClassLoader
classLoader, LanguagesMetaData metaData)
+ {
+ if (classLoader == null)
+ {
+ throw new IllegalArgumentException("Need a non null classloader");
+ }
+ if (metaData == null)
+ {
+ throw new IllegalArgumentException("Need non null meta data");
+ }
+
+ // Create factory
+ PortletResourceBundleFactory factory = new
PortletResourceBundleFactory(classLoader, metaData);
+
+ // Create manager
+ ResourceBundleManager manager = new
ResourceBundleManager(EmptyResourceBundle.INSTANCE, factory);
+
+ // Preload declared locales
+ for (Iterator i = metaData.getSupportedLocales().iterator();i.hasNext();)
+ {
+ Locale locale = (Locale)i.next();
+ manager.getResourceBundle(locale);
+ }
+
+ //
+ return manager;
+ }
+
+ /** The class loader to load resource bundle from. */
+ private final ClassLoader classLoader;
+
+ /** The base name of the resource bundle. */
+ private final String baseName;
+
+ /** */
+ private ResourceBundle infoBundle;
+
+ public PortletResourceBundleFactory(ClassLoader classLoader, LanguagesMetaData
metaData)
+ {
+ if (classLoader == null)
+ {
+ throw new IllegalArgumentException("Need a non null classloader");
+ }
+ if (metaData == null)
+ {
+ throw new IllegalArgumentException("Need non null meta data");
+ }
+ this.classLoader = classLoader;
+ this.baseName = metaData.getResourceBundle();
+
+ // Get the resource bundle containing the portlet info
+ LanguagesMetaData.InfoMetaData infoMD = metaData.getInfo();
+ if (infoMD != null)
+ {
+ infoBundle = new InfoBundle(infoMD);
+ }
+ else
+ {
+ infoBundle = EmptyResourceBundle.INSTANCE;
+ }
+ }
+
+ public ResourceBundle getBundle(Locale locale)
+ {
+ if (locale == null)
+ {
+ throw new IllegalArgumentException("Locale cannot be null");
+ }
+
+ //
+ ResourceBundle bundle;
+
+ //
+ if (baseName == null)
+ {
+ bundle = infoBundle;
+ }
+ else
+ {
+ try
+ {
+ bundle = ResourceBundle.getBundle(baseName, locale, classLoader);
+ if (infoBundle != null)
+ {
+ bundle = new ParentChildResourceBundle(infoBundle, bundle);
+ }
+ // log.debug("Created bundle " + baseName + " for locale
" + locale);
+ }
+ catch (MissingResourceException e)
+ {
+ // log.warn("Bundle " + baseName + " for locale " +
locale + " not found");
+ bundle = infoBundle;
+ }
+ }
+
+ //
+ return bundle;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletResourceBundleFactory.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletUtils.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletUtils.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletUtils.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,209 @@
+/******************************************************************************
+ * 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.jsr168;
+
+import org.jboss.portal.portlet.invocation.PortletInvocation;
+import org.jboss.portal.portlet.impl.jsr168.api.PortletURLImpl;
+
+import javax.portlet.PortletMode;
+import javax.portlet.PortletRequest;
+import javax.portlet.PortletURL;
+import javax.portlet.WindowState;
+import java.util.Iterator;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class PortletUtils
+{
+ public static final String PREFIX = "jbpns";
+ public static final String SUFFIX = "snpbj";
+
+ /**
+ * Check that provided map follow the constraints : <ul> <li>Not
null</li> <li>Keys are non null string</li>
+ * <li>Values are non null string arrays</li> </ul> If a constraint
is not respected then an IllegalArgumentException
+ * is thrown.
+ *
+ * @param map the map to check
+ * @throws IllegalArgumentException
+ */
+ public static void checkPortletParameterMapValidity(Map map) throws
IllegalArgumentException
+ {
+ if (map == null)
+ {
+ throw new IllegalArgumentException("Map cannot be null");
+ }
+ for (Iterator i = map.entrySet().iterator(); i.hasNext();)
+ {
+ Map.Entry entry = (Map.Entry)i.next();
+ Object key = entry.getKey();
+ Object value = entry.getValue();
+ if (key == null)
+ {
+ throw new IllegalArgumentException("Key cannot be null");
+ }
+ if (key instanceof String == false)
+ {
+ throw new IllegalArgumentException("Key must be a String and not "
+ key.getClass());
+ }
+ if (value == null)
+ {
+ throw new IllegalArgumentException("Value cannot be null");
+ }
+ if (value instanceof String[] == false)
+ {
+ throw new IllegalArgumentException("Value must be a String[] and not
" + value.getClass());
+ }
+ }
+ }
+
+ /**
+ * Check that the passed argument are non null otherwise throw an
IllegalArgumentException.
+ *
+ * @throws IllegalArgumentException
+ */
+ public static void checkPortletParameterValidity(String name, String value) throws
IllegalArgumentException
+ {
+ if (name == null)
+ {
+ throw new IllegalArgumentException("Name cannot be null");
+ }
+ if (value == null)
+ {
+ throw new IllegalArgumentException("Value cannot be null");
+ }
+ }
+
+ /**
+ * Check that the passed argument are non null otherwise throw an
IllegalArgumentException.
+ *
+ * @throws IllegalArgumentException
+ */
+ public static void checkPortletParameterValidity(String name, String[] values) throws
IllegalArgumentException
+ {
+ if (name == null)
+ {
+ throw new IllegalArgumentException("Name cannot be null");
+ }
+ if (values == null)
+ {
+ throw new IllegalArgumentException("Values cannot be null");
+ }
+ }
+
+ /** Creates an action URL. */
+ public static PortletURL createActionURL(PortletInvocation invocation, PortletRequest
preq)
+ {
+ return new PortletURLImpl(invocation, preq, new
PortletURLImpl.InternalActionURL());
+ }
+
+ /** Creates an render URL. */
+ public static PortletURL createRenderURL(PortletInvocation invocation, PortletRequest
preq)
+ {
+ return new PortletURLImpl(invocation, preq, new
PortletURLImpl.InternalRenderURL());
+ }
+
+ /**
+ * Creates a <code>WindowState</code> object based on the specified name.
+ *
+ * @param windowStateName the name of the window state
+ * @return one of the standard WindowStates if the specified name matches one of them
or a new WindowState.
+ * @see javax.portlet.WindowState
+ */
+ public static WindowState decodeWindowState(String windowStateName)
+ {
+ if (WindowState.NORMAL.toString().equalsIgnoreCase(windowStateName))
+ {
+ return WindowState.NORMAL;
+ }
+ else if (WindowState.MINIMIZED.toString().equalsIgnoreCase(windowStateName))
+ {
+ return WindowState.MINIMIZED;
+ }
+ else if (WindowState.MAXIMIZED.toString().equalsIgnoreCase(windowStateName))
+ {
+ return WindowState.MAXIMIZED;
+ }
+ else
+ {
+ return new WindowState(windowStateName);
+ }
+ }
+
+ /**
+ * Creates a <code>PortletMode</code> object based on the specified name.
+ *
+ * @param portletModeName the name of the portlet mode
+ * @return one of the standard PortletModes if the specified name matches one of them
or a new PortletMode.
+ * @see javax.portlet.PortletMode
+ */
+ public static PortletMode decodePortletMode(String portletModeName)
+ {
+ if (PortletMode.EDIT.toString().equalsIgnoreCase(portletModeName))
+ {
+ return PortletMode.EDIT;
+ }
+ else if (PortletMode.HELP.toString().equalsIgnoreCase(portletModeName))
+ {
+ return PortletMode.HELP;
+ }
+ else if (PortletMode.VIEW.toString().equalsIgnoreCase(portletModeName))
+ {
+ return PortletMode.VIEW;
+ }
+ else
+ {
+ return new PortletMode(portletModeName);
+ }
+ }
+
+ /**
+ * Generates a namespace suitable for Portlet prefixing of tokens that need to be
unique in an aggregated page.
+ *
+ * @param windowId
+ * @since 2.6
+ */
+ public static String generateNamespaceFrom(String windowId)
+ {
+ StringBuffer tmp = new StringBuffer(PREFIX.length() + windowId.length() * 2);
+ tmp.append(PREFIX);
+ for (int i = 0; i < windowId.length(); i++)
+ {
+ char c = windowId.charAt(i);
+ if (Character.isLetterOrDigit(c))
+ {
+ tmp.append(c);
+ }
+ else
+ {
+ tmp.append('_');
+ tmp.append(Character.forDigit((((int)c) & 0XF0) >> 4, 16));
+ tmp.append(Character.forDigit((((int)c) & 0X0F), 16));
+ }
+ }
+ tmp.append(SUFFIX);
+ return tmp.toString();
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/ActionRequestImpl.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/ActionRequestImpl.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/ActionRequestImpl.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,130 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.impl.jsr168.api;
+
+import org.jboss.portal.portlet.PortletParameters;
+import org.jboss.portal.portlet.PortletParametersStateString;
+import org.jboss.portal.portlet.StateString;
+import org.jboss.portal.portlet.invocation.ActionInvocation;
+import org.jboss.portal.portlet.spi.ActionContext;
+
+import javax.portlet.ActionRequest;
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.UnsupportedEncodingException;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 6697 $
+ */
+public class ActionRequestImpl extends PortletRequestImpl implements ActionRequest
+{
+
+ /** . */
+ protected final ActionContext actionContext;
+
+ public ActionRequestImpl(ActionInvocation invocation)
+ {
+ super(invocation);
+ this.actionContext = (ActionContext)invocation.getPortletContext();
+
+ // Get the possibly null interaction state
+ StateString interactionState = actionContext.getInteractionState();
+
+ // Take care of the interaction state if any
+ if (interactionState != null)
+ {
+ // Unserialize the interaction state if necessary
+ PortletParametersStateString parametersState = null;
+ if (interactionState instanceof PortletParametersStateString)
+ {
+ parametersState = (PortletParametersStateString)interactionState;
+ }
+ else
+ {
+ parametersState = new
PortletParametersStateString(interactionState.getStringValue());
+ }
+
+ //
+ parameters = parametersState.getParameters();
+ }
+
+ //
+ PortletParameters form = actionContext.getForm();
+ if (form != null)
+ {
+ if (parameters == null)
+ {
+ parameters = form;
+ }
+ else
+ {
+ parameters = new PortletParameters(parameters);
+ parameters.append(form);
+ }
+ }
+ }
+
+ //
+
+ public InputStream getPortletInputStream() throws IOException
+ {
+ if
("application/x-www-form-urlencoded".equals(actionContext.getContentType()))
+ {
+ throw new IllegalStateException();
+ }
+ return actionContext.getInputStream();
+ }
+
+ public void setCharacterEncoding(String s) throws UnsupportedEncodingException
+ {
+ // This method is frankly stupid
+ throw new IllegalStateException("called after the body has been read");
+ // req.setCharacterEncoding(s);
+ }
+
+ public BufferedReader getReader() throws UnsupportedEncodingException, IOException
+ {
+ if
("application/x-www-form-urlencoded".equals(actionContext.getContentType()))
+ {
+ throw new IllegalStateException();
+ }
+ return actionContext.getReader();
+ }
+
+ public String getCharacterEncoding()
+ {
+ return actionContext.getCharacterEncoding();
+ }
+
+ public String getContentType()
+ {
+ return actionContext.getContentType();
+ }
+
+ public int getContentLength()
+ {
+ return actionContext.getContentLength();
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/ActionRequestImpl.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/ActionResponseImpl.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/ActionResponseImpl.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/ActionResponseImpl.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,201 @@
+/******************************************************************************
+ * 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.jsr168.api;
+
+import org.apache.log4j.Logger;
+import org.jboss.portal.Mode;
+import org.jboss.portal.common.net.URLTools;
+import org.jboss.portal.portlet.PortletParametersStateString;
+import org.jboss.portal.portlet.impl.jsr168.PortletUtils;
+import org.jboss.portal.portlet.invocation.ActionInvocation;
+import org.jboss.portal.portlet.invocation.response.HTTPRedirectionResponse;
+import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
+import org.jboss.portal.portlet.invocation.response.RedirectionResponse;
+import org.jboss.portal.portlet.invocation.response.RenderResponse;
+
+import javax.portlet.ActionResponse;
+import javax.portlet.PortletMode;
+import javax.portlet.PortletModeException;
+import javax.portlet.WindowState;
+import javax.portlet.WindowStateException;
+import java.io.IOException;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 7379 $
+ */
+public class ActionResponseImpl extends PortletResponseImpl implements ActionResponse
+{
+
+ private static final Logger log = Logger.getLogger(ActionResponseImpl.class);
+
+ protected static final int WANT_NOTHING = 0;
+ protected static final int WANT_RENDER = 1;
+ protected static final int WANT_REDIRECT = 2;
+
+ protected PortletInvocationResponse response;
+ protected int decision;
+
+ public ActionResponseImpl(ActionInvocation invocation, PortletRequestImpl preq)
+ {
+ super(invocation, preq);
+
+ //
+ RenderResponse rr = new RenderResponse();
+ rr.setNavigationalState(new PortletParametersStateString());
+
+ //
+ this.response = rr;
+ this.decision = WANT_NOTHING;
+ }
+
+ public PortletInvocationResponse getResult()
+ {
+ return response;
+ }
+
+ public void setWindowState(WindowState windowState) throws WindowStateException
+ {
+ if (decision == WANT_NOTHING || decision == WANT_RENDER)
+ {
+ if (!preq.isWindowStateAllowed(windowState))
+ {
+ throw new WindowStateException("Not supported", windowState);
+ }
+
((RenderResponse)response).setWindowState(org.jboss.portal.WindowState.create(windowState.toString()));
+ decision = WANT_RENDER;
+ }
+ else
+ {
+ throw new IllegalStateException("Window state cannot be set after
redirect");
+ }
+ }
+
+ public void setPortletMode(PortletMode portletMode) throws PortletModeException
+ {
+ if (decision == WANT_NOTHING || decision == WANT_RENDER)
+ {
+ if (portletMode == null)
+ {
+ // The spec does not define that case
+ // we just issue a warn
+ log.warn("Set null portlet mode");
+ }
+ else
+ {
+ if (!preq.isPortletModeAllowed(portletMode))
+ {
+ throw new PortletModeException("Not supported", portletMode);
+ }
+ Mode mode = Mode.create(portletMode.toString());
+ ((RenderResponse)response).setMode(mode);
+ }
+ decision = WANT_RENDER;
+ }
+ else
+ {
+ throw new IllegalStateException("Portlet mode cannot be set after
redirect");
+ }
+ }
+
+ public void sendRedirect(String location) throws IOException
+ {
+ if (location == null)
+ {
+ // do something more clever than simply returning
+ return;
+ }
+ URLTools.enforceAbsoluteURL(location);
+ sendRedirect(new HTTPRedirectionResponse(location));
+ }
+
+ /**
+ * Generic send redirect.
+ *
+ * @param redirect
+ * @throws IllegalStateException implement jsr168 behavior if the portlet as already
commited stuff
+ */
+ protected final void sendRedirect(RedirectionResponse redirect) throws
IllegalStateException
+ {
+ if (decision == WANT_NOTHING || decision == WANT_REDIRECT)
+ {
+ response = redirect;
+ decision = WANT_REDIRECT;
+ }
+ else
+ {
+ throw new IllegalStateException("sendRedirect cannot be called after "
+
+ "setPortletMode/setWindowState/setRenderParameter/setRenderParameters
" +
+ "has been called previously");
+ }
+ }
+
+ public void setRenderParameters(Map map)
+ {
+ PortletUtils.checkPortletParameterMapValidity(map);
+
+ //
+ if (decision == WANT_NOTHING || decision == WANT_RENDER)
+ {
+
((PortletParametersStateString)((RenderResponse)response).getNavigationalState()).replace(map);
+ decision = WANT_RENDER;
+ }
+ else
+ {
+ throw new IllegalStateException("setRenderParameters cannot be called after
redirect");
+ }
+ }
+
+ public void setRenderParameter(String name, String value)
+ {
+ PortletUtils.checkPortletParameterValidity(name, value);
+
+ //
+ if (decision == WANT_NOTHING || decision == WANT_RENDER)
+ {
+
((PortletParametersStateString)((RenderResponse)response).getNavigationalState()).setValue(name,
value);
+ decision = WANT_RENDER;
+ }
+ else
+ {
+ throw new IllegalStateException("setRenderParameter cannot be called after
redirect");
+ }
+ }
+
+ public void setRenderParameter(String name, String[] values)
+ {
+ PortletUtils.checkPortletParameterValidity(name, values);
+
+ //
+ if (decision == WANT_NOTHING || decision == WANT_RENDER)
+ {
+
((PortletParametersStateString)((RenderResponse)response).getNavigationalState()).setValues(name,
values);
+ decision = WANT_RENDER;
+ }
+ else
+ {
+ throw new IllegalStateException("setRenderParameter cannot be called after
redirect");
+ }
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/ActionResponseImpl.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/PortalContextImpl.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/PortalContextImpl.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/PortalContextImpl.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,108 @@
+/******************************************************************************
+ * 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.jsr168.api;
+
+import org.jboss.portal.Mode;
+import org.jboss.portal.common.util.Tools;
+import org.jboss.portal.portlet.spi.PortalContext;
+import org.jboss.portal.portlet.impl.jsr168.PortletUtils;
+
+import java.util.Enumeration;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * todo : does not provide customizable values for portlet modes and window states.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 6720 $
+ */
+public class PortalContextImpl implements javax.portlet.PortalContext
+{
+
+ private PortalContext portal;
+ private Map properties;
+ private Set supportedPortletModes;
+ private Set supportedWindowStates;
+
+ public PortalContextImpl(PortalContext portal)
+ {
+ if (portal == null)
+ {
+ throw new IllegalArgumentException("Must provide a non-null
PortalContext!");
+ }
+ this.portal = portal;
+ this.properties = portal.getProperties();
+ }
+
+ public String getPortalInfo()
+ {
+ return portal.getInfo();
+ }
+
+ public String getProperty(String name)
+ {
+ if (name == null)
+ {
+ throw new IllegalArgumentException("Must provide a non-null property
name");
+ }
+ return (String)properties.get(name);
+ }
+
+ public Enumeration getPropertyNames()
+ {
+ return Tools.toEnumeration(properties.keySet().iterator());
+ }
+
+ public Enumeration getSupportedPortletModes()
+ {
+ if (supportedPortletModes == null)
+ {
+ Set tmp = portal.getModes();
+ supportedPortletModes = new HashSet(tmp.size());
+ for (Iterator i = tmp.iterator(); i.hasNext();)
+ {
+ Mode mode = (Mode)i.next();
+ supportedPortletModes.add(PortletUtils.decodePortletMode(mode.toString()));
+ }
+ }
+ return Tools.toEnumeration(supportedPortletModes.iterator());
+ }
+
+ public Enumeration getSupportedWindowStates()
+ {
+ if (supportedWindowStates == null)
+ {
+ Set tmp = portal.getWindowStates();
+ supportedWindowStates = new HashSet(tmp.size());
+ for (Iterator i = tmp.iterator(); i.hasNext();)
+ {
+ org.jboss.portal.WindowState windowState =
(org.jboss.portal.WindowState)i.next();
+
supportedWindowStates.add(PortletUtils.decodeWindowState(windowState.toString()));
+ }
+ }
+ return Tools.toEnumeration(supportedWindowStates.iterator());
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/PortalContextImpl.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/PortletConfigImpl.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/PortletConfigImpl.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/PortletConfigImpl.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,87 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.impl.jsr168.api;
+
+import org.jboss.portal.common.i18n.ResourceBundleManager;
+
+import javax.portlet.PortletConfig;
+import javax.portlet.PortletContext;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.Locale;
+import java.util.Map;
+import java.util.ResourceBundle;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 6817 $
+ */
+public class PortletConfigImpl implements PortletConfig
+{
+
+ private String portletName;
+ private PortletContext portletContext;
+ private Map initParameters;
+ private ResourceBundleManager bundleMgr;
+
+ public PortletConfigImpl(String portletName,
+ PortletContext portletContext,
+ Map initParameters,
+ ResourceBundleManager bundleMgr)
+ {
+ this.portletName = portletName;
+ this.portletContext = portletContext;
+ this.initParameters = initParameters;
+ this.bundleMgr = bundleMgr;
+ }
+
+ public String getPortletName()
+ {
+ return portletName;
+ }
+
+ public PortletContext getPortletContext()
+ {
+ return portletContext;
+ }
+
+ /** May return null ? the spec does not specify what happens when the bundle is not
found for the locale. */
+ public ResourceBundle getResourceBundle(Locale locale)
+ {
+ return bundleMgr.getResourceBundle(locale);
+ }
+
+ public String getInitParameter(String s)
+ {
+ if (s == null)
+ {
+ throw new IllegalArgumentException("name must not be null");
+ }
+ return (String)initParameters.get(s);
+ }
+
+ public Enumeration getInitParameterNames()
+ {
+ return Collections.enumeration(initParameters.keySet());
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/PortletConfigImpl.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/PortletContextImpl.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/PortletContextImpl.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/PortletContextImpl.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,184 @@
+/******************************************************************************
+ * 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.jsr168.api;
+
+import javax.portlet.PortletContext;
+import javax.portlet.PortletRequestDispatcher;
+import javax.servlet.RequestDispatcher;
+import javax.servlet.ServletContext;
+import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.Enumeration;
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 6713 $
+ */
+public class PortletContextImpl implements PortletContext
+{
+
+ private ServletContext servletContext;
+
+ public PortletContextImpl(ServletContext servletContext)
+ {
+ this.servletContext = servletContext;
+ }
+
+ public String getServerInfo()
+ {
+ return "JBossPortal/" + 1 + "." + 0;
+ }
+
+ public PortletRequestDispatcher getRequestDispatcher(String path)
+ {
+ if (path == null || !path.startsWith("/"))
+ {
+ return null;
+ }
+ RequestDispatcher rd = servletContext.getRequestDispatcher(path);
+ if (rd != null)
+ {
+ return new PortletRequestDispatcherImpl(rd, path);
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ public PortletRequestDispatcher getNamedDispatcher(String name)
+ {
+ if (name == null)
+ {
+ return null;
+ }
+ RequestDispatcher rd = servletContext.getNamedDispatcher(name);
+ if (rd != null)
+ {
+ return new PortletRequestDispatcherImpl(rd);
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ public InputStream getResourceAsStream(String s)
+ {
+ return servletContext.getResourceAsStream(s);
+ }
+
+ public int getMajorVersion()
+ {
+ return 1;
+ }
+
+ public int getMinorVersion()
+ {
+ return 0;
+ }
+
+ public String getMimeType(String s)
+ {
+ return servletContext.getMimeType(s);
+ }
+
+ public String getRealPath(String s)
+ {
+ return servletContext.getRealPath(s);
+ }
+
+ public Set getResourcePaths(String s)
+ {
+ return servletContext.getResourcePaths(s);
+ }
+
+ public URL getResource(String s) throws MalformedURLException
+ {
+ if (s == null || !s.startsWith("/"))
+ {
+ throw new MalformedURLException("invalid resource");
+ }
+ URL resource = servletContext.getResource(s);
+ return resource;
+ }
+
+ public Object getAttribute(String s)
+ {
+ if (s == null)
+ {
+ throw new IllegalArgumentException("attribute name must not be
null");
+ }
+ return servletContext.getAttribute(s);
+ }
+
+ public Enumeration getAttributeNames()
+ {
+ return servletContext.getAttributeNames();
+ }
+
+ public String getInitParameter(String s)
+ {
+ if (s == null)
+ {
+ throw new IllegalArgumentException("init parameter name must not be
null");
+ }
+ return servletContext.getInitParameter(s);
+ }
+
+ public Enumeration getInitParameterNames()
+ {
+ return servletContext.getInitParameterNames();
+ }
+
+ public void log(String s)
+ {
+ servletContext.log(s);
+ }
+
+ public void log(String s, Throwable throwable)
+ {
+ servletContext.log(s, throwable);
+ }
+
+ public void removeAttribute(String s)
+ {
+ if (s == null)
+ {
+ throw new IllegalArgumentException("attribute name must not be
null");
+ }
+ servletContext.removeAttribute(s);
+ }
+
+ public void setAttribute(String s, Object o)
+ {
+ servletContext.setAttribute(s, o);
+ }
+
+ public String getPortletContextName()
+ {
+ return servletContext.getServletContextName();
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/PortletContextImpl.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/PortletPreferencesImpl.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/PortletPreferencesImpl.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/PortletPreferencesImpl.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,417 @@
+/******************************************************************************
+ * 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.jsr168.api;
+
+import org.apache.log4j.Logger;
+import org.jboss.portal.common.value.StringValue;
+import org.jboss.portal.common.value.Value;
+import org.jboss.portal.portlet.state.PropertyChange;
+import org.jboss.portal.portlet.state.PropertyContext;
+import org.jboss.portal.portlet.impl.jsr168.info.ContainerPreferenceInfo;
+import org.jboss.portal.portlet.impl.jsr168.info.ContainerPreferencesInfo;
+import org.jboss.portal.portlet.info.PreferenceInfo;
+
+import javax.portlet.PortletPreferences;
+import javax.portlet.PreferencesValidator;
+import javax.portlet.ReadOnlyException;
+import javax.portlet.ValidatorException;
+import java.io.IOException;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 6757 $
+ */
+public class PortletPreferencesImpl implements PortletPreferences
+{
+
+ /** The logger. */
+ protected static final Logger log = Logger.getLogger(PortletPreferencesImpl.class);
+
+ /** Indicates the object is used during a action phase. */
+ public static final int ACTION = 1;
+
+ /** Indicates the object is used during a render phase. */
+ public static final int RENDER = 0;
+
+ /** . */
+ protected final PropertyContext prefs;
+
+ /** . */
+ protected final PreferencesValidator validator;
+
+ /** . */
+ protected final ContainerPreferencesInfo containerPrefs;
+
+ /** . */
+ protected final int mode;
+
+ /** Keep track of updates */
+ protected final Map updates;
+
+ public PortletPreferencesImpl(
+ PropertyContext prefs,
+ ContainerPreferencesInfo containerPrefs,
+ PreferencesValidator validator,
+ int mode)
+ {
+ this.prefs = prefs;
+ this.validator = validator;
+ this.containerPrefs = containerPrefs;
+ this.mode = mode;
+ this.updates = new HashMap();
+ }
+
+ public Map getMap()
+ {
+ return new PreferencesMap();
+ }
+
+ public Enumeration getNames()
+ {
+ // Clone the system names
+ Set names = new HashSet(containerPrefs.getKeys());
+
+ // Add the user
+ names.addAll(prefs.getKeys());
+
+ // Add the transient updates
+ for (Iterator i = updates.values().iterator(); i.hasNext();)
+ {
+ PropertyChange change = (PropertyChange)i.next();
+ if (change.getType() == PropertyChange.PREF_UPDATE)
+ {
+ names.add(change.getKey());
+ }
+ else
+ {
+ names.remove(change.getKey());
+ }
+ }
+
+ // Convert to enumeration
+ return Collections.enumeration(names);
+ }
+
+ private Value getValue(String key)
+ {
+ Value value = null;
+ PropertyChange change = (PropertyChange)updates.get(key);
+ if (change != null)
+ {
+ if (change.getType() == PropertyChange.PREF_UPDATE)
+ {
+ value = change.getValue();
+ }
+ else
+ {
+ ContainerPreferenceInfo containerPref =
containerPrefs.getContainerPreference(key);
+ if (containerPref != null)
+ {
+ value = containerPref.getDefaultValue();
+ }
+ }
+ }
+ else
+ {
+ // Get user
+ value = prefs.getValue(key);
+
+ // If does not exist or read only use what the default one
+ if (value == null || isDDReadOnly(key))
+ {
+ ContainerPreferenceInfo containerPref =
containerPrefs.getContainerPreference(key);
+ if (containerPref != null)
+ {
+ value = containerPref.getDefaultValue();
+ }
+ }
+ }
+ return value;
+ }
+
+ /**
+ * Return true if the preferences is marked as read only in the portlet.xml
deployment
+ * descriptor.
+ *
+ * @param key the preference key
+ * @return the read only value
+ */
+ private boolean isDDReadOnly(String key)
+ {
+ PreferenceInfo pref = containerPrefs.getPreference(key);
+ if (pref != null)
+ {
+ return Boolean.TRUE.equals(pref.isReadOnly());
+ }
+ return false;
+ }
+
+
+ public String getValue(String key, String def) throws IllegalArgumentException
+ {
+ if (key == null)
+ {
+ throw new IllegalArgumentException("key must not be null");
+ }
+ Value value = getValue(key);
+ if (value == null || value.isEmpty())
+ {
+ return def;
+ }
+ else
+ {
+ return value.asString();
+ }
+ }
+
+ public String[] getValues(String key, String[] def) throws IllegalArgumentException
+ {
+ if (key == null)
+ {
+ throw new IllegalArgumentException("key must not be null");
+ }
+ Value value = getValue(key);
+ if (value != null)
+ {
+ return value.asStringArray();
+ }
+ else
+ {
+ return def;
+ }
+ }
+
+ public boolean isReadOnly(String key) throws IllegalArgumentException,
IllegalArgumentException
+ {
+ if (key == null)
+ {
+ throw new IllegalArgumentException("key must not be null");
+ }
+ if (mode == ACTION)
+ {
+ // The accurate value is to combine what the portlet developer and the consumer
specifies
+ return prefs.isReadOnly() || isDDReadOnly(key);
+ }
+ else
+ {
+ // During render we cannot be aware of the consumer
+ // intent with respect to the access mode of the current state
+ return isDDReadOnly(key);
+ }
+ }
+
+ public void reset(String key) throws IllegalArgumentException, ReadOnlyException
+ {
+ if (key == null)
+ {
+ throw new IllegalArgumentException("key must not be null");
+ }
+ if (isReadOnly(key))
+ {
+ throw new ReadOnlyException("Key " + key + " cannot be
written");
+ }
+ updates.put(key, PropertyChange.newReset(key));
+ }
+
+ public void setValue(String key, String value) throws IllegalArgumentException,
ReadOnlyException
+ {
+ if (key == null)
+ {
+ throw new IllegalArgumentException("key must not be null");
+ }
+ if (isReadOnly(key))
+ {
+ throw new ReadOnlyException("Key " + key + " cannot be
written");
+ }
+ Value value_ = new StringValue(value);
+ updates.put(key, PropertyChange.newUpdate(key, value_));
+ }
+
+ public void setValues(String key, String[] values) throws IllegalArgumentException,
ReadOnlyException
+ {
+ if (key == null)
+ {
+ throw new IllegalArgumentException("key must not be null");
+ }
+ if (isReadOnly(key))
+ {
+ throw new ReadOnlyException("Key " + key + " cannot be
written");
+ }
+ if (values == null)
+ {
+ values = new String[1];
+ }
+ Value value_ = new StringValue(values);
+ updates.put(key, PropertyChange.newUpdate(key, value_));
+ }
+
+ public void store() throws IOException, ValidatorException
+ {
+ // Check we are in the right mode
+ if (mode != ACTION)
+ {
+ throw new IllegalStateException("Store must be called within the scope of
an action request");
+ }
+
+ // Copy the transient set to the persistent set if the consumer allows it
+ if (prefs.isReadOnly())
+ {
+ throw new IOException("Should not happen");
+ }
+
+ // If the optional validator is present validate
+ if (validator != null)
+ {
+ validator.validate(this);
+ }
+
+ //
+ PropertyChange[] changes = (PropertyChange[])updates.values().toArray(new
PropertyChange[updates.size()]);
+ prefs.update(changes);
+
+ // Clear the updates
+ updates.clear();
+ }
+
+ private class PreferencesMap extends HashMap
+ {
+
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 6969583304804836926L;
+
+ public PreferencesMap()
+ {
+ super(10);
+
+ //
+ for (Iterator i = containerPrefs.getKeys().iterator(); i.hasNext();)
+ {
+ String key = (String)i.next();
+ String[] value =
containerPrefs.getContainerPreference(key).getDefaultValue().asStringArray();
+ String[] clone = new String[value.length];
+ System.arraycopy(value, 0, clone, 0, value.length);
+ super.put(key, clone);
+ }
+
+ //
+ for (Iterator i = prefs.getKeys().iterator(); i.hasNext();)
+ {
+ String key = (String)i.next();
+ String[] value = prefs.getValue(key).asStringArray();
+ String[] clone = new String[value.length];
+ System.arraycopy(value, 0, clone, 0, value.length);
+ super.put(key, clone);
+ }
+
+ //
+ for (Iterator i = updates.values().iterator(); i.hasNext();)
+ {
+ PropertyChange change = (PropertyChange)i.next();
+ String key = change.getKey();
+
+ if (change.getType() == PropertyChange.PREF_RESET)
+ {
+ super.remove(key);
+ }
+ else
+ {
+ String[] value = change.getValue().asStringArray();
+ String[] clone = new String[value.length];
+ System.arraycopy(value, 0, clone, 0, value.length);
+ super.put(key, clone);
+ }
+ }
+ }
+
+ public boolean containsValue(Object value)
+ {
+ if (value instanceof String[])
+ {
+ String[] strings = (String[])value;
+ for (Iterator i = super.values().iterator(); i.hasNext();)
+ {
+ String[] other = (String[])i.next();
+ if (Arrays.equals(strings, other))
+ {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ public Object get(Object key)
+ {
+ return (String[])super.get(key); // Should be cloned here to ensure
immutability
+ }
+
+ public Collection values()
+ {
+ return super.values(); // String[] should be cloned here to ensure immutability
+ }
+
+ public Set entrySet()
+ {
+ return super.entrySet();
+ }
+
+ /**
+ * Do not change state.
+ *
+ * @return null
+ */
+ public Object put(Object key, Object value)
+ {
+ return null;
+ }
+
+ /**
+ * Do not change state.
+ *
+ * @return null
+ */
+ public Object remove(Object key)
+ {
+ return null;
+ }
+
+ /** Do not change state. */
+ public void putAll(Map t)
+ {
+ }
+
+ /** Do not change state. */
+ public void clear()
+ {
+ }
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/PortletPreferencesImpl.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/PortletRequestDispatcherImpl.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/PortletRequestDispatcherImpl.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/PortletRequestDispatcherImpl.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,94 @@
+/******************************************************************************
+ * 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.jsr168.api;
+
+import org.jboss.portal.portlet.aspects.portlet.ContextDispatcherInterceptor;
+import org.jboss.portal.portlet.invocation.PortletInvocation;
+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 javax.portlet.PortletException;
+import javax.portlet.PortletRequestDispatcher;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.servlet.RequestDispatcher;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 6854 $
+ */
+public class PortletRequestDispatcherImpl
+ implements PortletRequestDispatcher
+{
+
+ /** The servlet request dispatcher. */
+ private final RequestDispatcher dispatcher;
+
+ /** . */
+ private final String path;
+
+ PortletRequestDispatcherImpl(RequestDispatcher dispatcher)
+ {
+ this(dispatcher, null);
+ }
+
+ PortletRequestDispatcherImpl(RequestDispatcher dispatcher, String path)
+ {
+ this.dispatcher = dispatcher;
+ this.path = path;
+ }
+
+ public void include(RenderRequest req, RenderResponse resp) throws PortletException,
IOException
+ {
+ try
+ {
+ // Get the invocation that is still in the request
+ PortletInvocation invocation =
(PortletInvocation)req.getAttribute(ContextDispatcherInterceptor.REQ_ATT_COMPONENT_INVOCATION);
+
+ //
+ HttpServletRequest dreq = invocation.getDispatchedRequest();
+ HttpServletResponse dresp = invocation.getDispatchedResponse();
+
+ // It was set by the PortletContainerInvoker before diving into the portlet, so
let's just reuse them
+ RenderRequest rreq =
(RenderRequest)req.getAttribute(APIConstants.JAVAX_PORTLET_REQUEST);
+ RenderResponse rresp =
(RenderResponse)req.getAttribute(APIConstants.JAVAX_PORTLET_RESPONSE);
+
+ //
+ DispatchedHttpServletRequest direq = new
DispatchedHttpServletRequest((RenderRequestImpl)rreq, dreq, path);
+ DispatchedHttpServletResponse diresp = new DispatchedHttpServletResponse(rresp,
dresp);
+
+ //
+ dispatcher.include(direq, diresp);
+ }
+ catch (ServletException e)
+ {
+ // We must translate the servlet exception into a portlet exception for the
calling portlet
+ throw new PortletException(e);
+ }
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/PortletRequestDispatcherImpl.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/PortletRequestImpl.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/PortletRequestImpl.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/PortletRequestImpl.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,470 @@
+/******************************************************************************
+ * 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.jsr168.api;
+
+import org.apache.log4j.Logger;
+import org.jboss.portal.common.util.Tools;
+import org.jboss.portal.portlet.PortletParameters;
+import org.jboss.portal.portlet.container.PortletContainerInvoker;
+import org.jboss.portal.portlet.impl.jsr168.PortletApplicationImpl;
+import org.jboss.portal.portlet.impl.jsr168.PortletContainerImpl;
+import org.jboss.portal.portlet.impl.jsr168.PortletUtils;
+import org.jboss.portal.portlet.impl.jsr168.PortletRequestAttributes;
+import org.jboss.portal.portlet.impl.jsr168.info.ContainerPreferencesInfo;
+import org.jboss.portal.portlet.invocation.PortletInvocation;
+import org.jboss.portal.portlet.spi.InstanceContext;
+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.state.PropertyContext;
+
+import javax.portlet.PortalContext;
+import javax.portlet.PortletMode;
+import javax.portlet.PortletPreferences;
+import javax.portlet.PortletRequest;
+import javax.portlet.PortletSession;
+import javax.portlet.PreferencesValidator;
+import javax.portlet.RenderRequest;
+import javax.portlet.WindowState;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpSession;
+import java.security.Principal;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Locale;
+import java.util.Map;
+import java.util.Set;
+import java.util.Vector;
+import java.util.Collection;
+
+/**
+ * PortletRequest implemention. The parameter implementation is left to subclasses that
can implement it differently.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 7226 $
+ */
+public abstract class PortletRequestImpl implements PortletRequest
+{
+
+ protected static final Logger log = Logger.getLogger(PortletRequestImpl.class);
+
+ protected PortletInvocation invocation;
+ protected UserContext userContext;
+ protected SecurityContext securityContext;
+ protected RequestContext requestContext;
+ protected InstanceContext instanceContext;
+ protected PortletPreferences preferences;
+ protected PortletContainerImpl container;
+ protected HttpServletRequest dreq;
+ protected PortalContext portalContext;
+ protected PortletSessionImpl psession;
+ protected int sessionStatus;
+
+ /** . */
+ protected PortletParameters parameters;
+
+ /** . */
+ protected final PortletRequestAttributes attributes;
+
+ public PortletRequestImpl(PortletInvocation invocation)
+ {
+ //
+ this.invocation = invocation;
+ this.userContext = invocation.getUserContext();
+ this.securityContext = invocation.getSecurityContext();
+ this.requestContext = invocation.getRequestContext();
+ this.instanceContext = invocation.getInstanceContext();
+ this.container =
(PortletContainerImpl)invocation.getAttribute(PortletInvocation.INVOCATION_SCOPE,
PortletContainerInvoker.PORTLET_CONTAINER);
+ this.dreq = invocation.getDispatchedRequest();
+ this.portalContext = new PortalContextImpl(invocation.getPortalContext());
+ this.parameters = null;
+ this.attributes = new PortletRequestAttributes(container, userContext);
+
+ //
+ int mode = this instanceof RenderRequest ? PortletPreferencesImpl.RENDER :
PortletPreferencesImpl.ACTION;
+ PropertyContext prefs =
(PropertyContext)invocation.getAttribute(PortletInvocation.INVOCATION_SCOPE,
PropertyContext.PREFERENCES_ATTRIBUTE);
+ PreferencesValidator validator = container.getPreferencesValidator();
+ ContainerPreferencesInfo containerPrefs =
(ContainerPreferencesInfo)container.getInfo().getPreferences();
+ this.preferences = new PortletPreferencesImpl(prefs, containerPrefs, validator,
mode);
+ }
+
+ // PLT.11.1.1
+
+ public String getParameter(String name)
+ {
+ if (name == null)
+ {
+ throw new IllegalArgumentException("name must not be null");
+ }
+ if (parameters != null)
+ {
+ return parameters.getValue(name);
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ public Enumeration getParameterNames()
+ {
+ if (parameters != null)
+ {
+ return Collections.enumeration(parameters.keySet());
+ }
+ else
+ {
+ return Tools.EMPTY_ENUMERATION;
+ }
+ }
+
+ public String[] getParameterValues(String name)
+ {
+ if (name == null)
+ {
+ throw new IllegalArgumentException("name must not be null");
+ }
+ if (parameters != null)
+ {
+ return parameters.getValues(name);
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ public Map getParameterMap()
+ {
+ if (parameters != null)
+ {
+ return Collections.unmodifiableMap(parameters);
+ }
+ else
+ {
+ return Collections.EMPTY_MAP;
+ }
+ }
+
+ public WindowState getWindowState()
+ {
+ String s = invocation.getPortletContext().getWindowState().toString();
+ return PortletUtils.decodeWindowState(s);
+ }
+
+ public PortletMode getPortletMode()
+ {
+ String s = invocation.getPortletContext().getMode().toString();
+ return PortletUtils.decodePortletMode(s);
+ }
+
+ // PLT.11.1.3
+
+
+ public Object getAttribute(String name) throws IllegalArgumentException
+ {
+ return attributes.getAttribute(name, dreq);
+ }
+
+ public Enumeration getAttributeNames()
+ {
+ return Tools.toEnumeration(attributes.getAttributeNames(dreq));
+ }
+
+ public void setAttribute(String name, Object value)
+ {
+ attributes.setAttribute(name, value);
+ }
+
+ public void removeAttribute(String name)
+ {
+ attributes.removeAttribute(name);
+ }
+
+ // PLT.11.1.4
+
+ public String getProperty(String name)
+ {
+ if (name == null)
+ {
+ throw new IllegalArgumentException("name must not be null");
+ }
+
+ //
+ Object prop = invocation.getAttribute(PortletInvocation.REQUEST_PROPERTIES_SCOPE,
name);
+ if (prop instanceof Collection)
+ {
+ Iterator iterator = ((Collection)prop).iterator();
+ if (iterator.hasNext())
+ {
+ prop = iterator.next();
+ }
+ }
+
+ //
+ if (prop == null)
+ {
+ // Otherwise the request header
+ prop = dreq.getHeader(name);
+ }
+
+ return (String)prop;
+ }
+
+ public Enumeration getProperties(String name)
+ {
+ if (name == null)
+ {
+ throw new IllegalArgumentException("name must not be null");
+ }
+
+ //
+ Object prop = invocation.getAttribute(PortletInvocation.REQUEST_PROPERTIES_SCOPE,
name);
+ if (prop == null)
+ {
+ // Otherwise the request headers
+ return dreq.getHeaders(name);
+ }
+ else if (prop instanceof Collection)
+ {
+ return Collections.enumeration(((Collection)prop));
+ }
+ else
+ {
+ return Tools.toEnumeration(prop);
+ }
+ }
+
+ public Enumeration getPropertyNames()
+ {
+ // First the properties
+ Set names = new
HashSet(invocation.getContext().getAttributeResolver(PortletInvocation.REQUEST_PROPERTIES_SCOPE).getKeys());
+
+ // Then put the headers
+ for (Enumeration e = dreq.getHeaderNames();e.hasMoreElements();)
+ {
+ String name = (String)e.nextElement();
+ names.add(name);
+ }
+
+ //
+ return Collections.enumeration(names);
+ }
+
+ // PLT.11.1.5
+
+ public String getContextPath()
+ {
+ return (String)dreq.getAttribute("javax.servlet.include.context_path");
+ }
+
+ // PLT.11.1.6
+
+ public String getAuthType()
+ {
+ return securityContext.getAuthType();
+ }
+
+ public String getRemoteUser()
+ {
+ return securityContext.getRemoteUser();
+ }
+
+ public Principal getUserPrincipal()
+ {
+ return securityContext.getUserPrincipal();
+ }
+
+ public boolean isUserInRole(String roleName)
+ {
+ // Get the map role name to role link
+ Map securityRoleRefsMap = container.getSecurityRoleRefsMap();
+
+ // Process the role link
+ String roleLink = (String)securityRoleRefsMap.get(roleName);
+ if (roleLink == null)
+ {
+ if (securityRoleRefsMap.containsKey(roleName))
+ {
+ // The role name exist without a role link value
+ return securityContext.isUserInRole(roleName);
+ }
+ else
+ {
+ // No role name is defined
+ return false;
+ }
+ }
+ else
+ {
+ // We have the role link value
+ return securityContext.isUserInRole(roleLink);
+ }
+ }
+
+ public boolean isSecure()
+ {
+ return securityContext.isSecure();
+ }
+
+ // PLT.11.1.7
+
+ public String getResponseContentType()
+ {
+ return invocation.getPortletContext().getMarkupInfo().getContentType().toString();
+ }
+
+ public Enumeration getResponseContentTypes()
+ {
+ Vector v = new Vector();
+ v.add(getResponseContentType());
+ return v.elements();
+ }
+
+ // PLT.11.1.8
+
+ public Locale getLocale()
+ {
+ return userContext.getLocale();
+ }
+
+ // PLT.11.1.9
+
+ public boolean isPortletModeAllowed(PortletMode portletMode)
+ {
+ if (portletMode == null)
+ {
+ // The spec does not give way to handle that case properly
+ log.warn("Try to test a null portlet mode");
+ return false;
+ }
+ else
+ {
+ return
invocation.getSupportedModes().contains(org.jboss.portal.Mode.create(portletMode.toString()));
+ }
+ }
+
+ // PLT.11.1.10
+
+ public boolean isWindowStateAllowed(WindowState windowState)
+ {
+ return
invocation.getSupportedWindowStates().contains(org.jboss.portal.WindowState.create(windowState.toString()));
+ }
+
+ //
+
+ public PortletSession getPortletSession()
+ {
+ return getPortletSession(true);
+ }
+
+ public PortletSession getPortletSession(boolean create)
+ {
+ //
+ if (create)
+ {
+ // Create the session with the dispatched request
+ HttpSession hsession = dreq.getSession(true);
+
+ // Create portlet session
+ PortletApplicationImpl portletApp =
(PortletApplicationImpl)container.getApplication();
+ psession = new PortletSessionImpl(
+ hsession,
+ instanceContext.getId(),
+ portletApp.getPortletContext());
+ }
+ else if (psession == null)
+ {
+ HttpSession hsession = dreq.getSession(false);
+
+ //
+ if (hsession != null)
+ {
+ // Create portlet session
+ PortletApplicationImpl portletApp =
(PortletApplicationImpl)container.getApplication();
+ psession = new PortletSessionImpl(
+ hsession,
+ instanceContext.getId(),
+ portletApp.getPortletContext());
+ }
+ }
+ else if (!psession.isValid())
+ {
+ // If we don't create and the underlying http session is not valid we return
null
+ psession = null;
+ }
+
+ //
+ return psession;
+ }
+
+ public PortalContext getPortalContext()
+ {
+ return portalContext;
+ }
+
+ public String getRequestedSessionId()
+ {
+ return dreq.getRequestedSessionId();
+ }
+
+ public boolean isRequestedSessionIdValid()
+ {
+ return dreq.isRequestedSessionIdValid();
+ }
+
+ public Enumeration getLocales()
+ {
+ return Collections.enumeration(userContext.getLocales());
+ }
+
+ public String getScheme()
+ {
+ return requestContext.getScheme();
+ }
+
+ public String getServerName()
+ {
+ return requestContext.getServerName();
+ }
+
+ public int getServerPort()
+ {
+ return requestContext.getServerPort();
+ }
+
+ public PortletPreferences getPreferences()
+ {
+ return preferences;
+ }
+
+ //
+
+ public PortletRequestAttributes getAttributes()
+ {
+ return attributes;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/PortletRequestImpl.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/PortletResponseImpl.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/PortletResponseImpl.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/PortletResponseImpl.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,105 @@
+/******************************************************************************
+ * 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.jsr168.api;
+
+import org.jboss.portal.portlet.invocation.PortletInvocation;
+import org.jboss.portal.common.invocation.AttributeResolver;
+
+import javax.portlet.PortletResponse;
+import java.util.Collection;
+import java.util.ArrayList;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 6697 $
+ */
+public abstract class PortletResponseImpl implements PortletResponse
+{
+
+ /** . */
+ protected final PortletInvocation invocation;
+
+ /** . */
+ protected final PortletRequestImpl preq;
+
+ protected PortletResponseImpl(PortletInvocation invocation, PortletRequestImpl preq)
+ {
+ this.invocation = invocation;
+ this.preq = preq;
+ }
+
+ public String encodeURL(String url)
+ {
+ if (url == null)
+ {
+ throw new IllegalArgumentException("URL must not be null");
+ }
+ return invocation.getPortletContext().encodeResourceURL(url);
+ }
+
+ public void addProperty(String key, String value) throws IllegalArgumentException
+ {
+ if (key == null)
+ {
+ throw new IllegalArgumentException("Name cannot be null");
+ }
+ if (value == null)
+ {
+ throw new IllegalArgumentException("Value cannot be null");
+ }
+
+ //
+ AttributeResolver resolver =
invocation.getContext().getAttributeResolver(PortletInvocation.RESPONSE_PROPERTIES_SCOPE);
+ Object prop = resolver.getAttribute(key);
+ if (prop == null)
+ {
+ resolver.setAttribute(key, prop);
+ }
+ else if (prop instanceof Collection)
+ {
+ ((Collection)prop).add(value);
+ }
+ else
+ {
+ Collection c = new ArrayList();
+ c.add(prop);
+ c.add(value);
+ resolver.setAttribute(key, c);
+ }
+ }
+
+ public void setProperty(String key, String value) throws IllegalArgumentException
+ {
+ if (key == null)
+ {
+ throw new IllegalArgumentException("Name cannot be null");
+ }
+ if (value == null)
+ {
+ throw new IllegalArgumentException("Value cannot be null");
+ }
+
+ //
+ invocation.setAttribute(PortletInvocation.RESPONSE_PROPERTIES_SCOPE, key, value);
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/PortletResponseImpl.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/PortletSessionImpl.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/PortletSessionImpl.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/PortletSessionImpl.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,218 @@
+/******************************************************************************
+ * 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.jsr168.api;
+
+import javax.portlet.PortletContext;
+import javax.portlet.PortletSession;
+import javax.servlet.http.HttpSession;
+import java.util.Enumeration;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 6697 $
+ */
+public class PortletSessionImpl implements PortletSession
+{
+
+ private HttpSession session;
+ private String prefix;
+ private PortletContext context;
+
+ public PortletSessionImpl(HttpSession session, String id, PortletContext context)
+ {
+ this.session = session;
+ this.prefix = "javax.portlet.p." + id + "?";
+ this.context = context;
+ }
+
+ public Object getAttribute(String s)
+ {
+ return getAttribute(s, PORTLET_SCOPE);
+ }
+
+ public Object getAttribute(String s, int i)
+ {
+ if (s == null)
+ {
+ throw new IllegalArgumentException("Name must not be null");
+ }
+ if (i == PORTLET_SCOPE)
+ {
+ s = prefix + s;
+ }
+ return session.getAttribute(s);
+ }
+
+ public Enumeration getAttributeNames()
+ {
+ return getAttributeNames(PORTLET_SCOPE);
+ }
+
+ public Enumeration getAttributeNames(int scope)
+ {
+ final boolean app = scope == APPLICATION_SCOPE;
+ return new Enumeration()
+ {
+ private Enumeration e;
+ private String next;
+
+ {
+ e = session.getAttributeNames();
+ next = null;
+ next();
+ }
+
+ public boolean hasMoreElements()
+ {
+ return next != null;
+ }
+
+ public Object nextElement()
+ {
+ String result = next;
+ next = null;
+ next();
+ return result;
+ }
+
+ private void next()
+ {
+ while (e.hasMoreElements())
+ {
+ String attribute = (String)e.nextElement();
+ if (app && !attribute.startsWith("javax.portlet."))
+ {
+ next = attribute;
+ break;
+ }
+ else if (!app && attribute.startsWith(prefix))
+ {
+ next = attribute.substring(prefix.length());
+ break;
+ }
+ }
+ }
+ };
+ }
+
+ public long getCreationTime()
+ {
+ return session.getCreationTime();
+ }
+
+ public String getId()
+ {
+ return session.getId();
+ }
+
+ public long getLastAccessedTime()
+ {
+ return session.getLastAccessedTime();
+ }
+
+ public int getMaxInactiveInterval()
+ {
+ return session.getMaxInactiveInterval();
+ }
+
+ public void invalidate()
+ {
+ // Invalidate the underlying HTTP session
+ session.invalidate();
+
+ // Mark the session as invalid
+ // valid = false;
+ }
+
+ public boolean isNew()
+ {
+ return session.isNew();
+ }
+
+ public void removeAttribute(String s)
+ {
+ removeAttribute(s, PORTLET_SCOPE);
+ }
+
+ public void removeAttribute(String s, int i)
+ {
+ if (s == null)
+ {
+ throw new IllegalArgumentException("Name must not be null");
+ }
+ if (i == PORTLET_SCOPE)
+ {
+ s = prefix + s;
+ }
+ session.removeAttribute(s);
+ }
+
+ public void setAttribute(String s, Object o)
+ {
+ setAttribute(s, o, PORTLET_SCOPE);
+ }
+
+ public void setAttribute(String s, Object o, int i)
+ {
+ if (s == null)
+ {
+ throw new IllegalArgumentException("Name must not be null");
+ }
+ if (i == PORTLET_SCOPE)
+ {
+ s = prefix + s;
+ }
+ session.setAttribute(s, o);
+ }
+
+ public void setMaxInactiveInterval(int i)
+ {
+ session.setMaxInactiveInterval(i);
+ }
+
+ public PortletContext getPortletContext()
+ {
+ return context;
+ }
+
+ /** Return the underlying session. */
+ HttpSession getHttpSession()
+ {
+ return session;
+ }
+
+ /** Detect validity of the session based on the underlying session. */
+ boolean isValid()
+ {
+ try
+ {
+ session.isNew();
+ return true;
+ }
+ catch (IllegalStateException e)
+ {
+ return false;
+ }
+ }
+
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/PortletSessionImpl.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/PortletURLImpl.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/PortletURLImpl.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/PortletURLImpl.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,200 @@
+/******************************************************************************
+ * 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.jsr168.api;
+
+import org.jboss.portal.Mode;
+import org.jboss.portal.portlet.ActionURL;
+import org.jboss.portal.portlet.PortletParameters;
+import org.jboss.portal.portlet.PortletParametersStateString;
+import org.jboss.portal.portlet.RenderURL;
+import org.jboss.portal.portlet.StateString;
+import org.jboss.portal.portlet.impl.jsr168.PortletUtils;
+import org.jboss.portal.portlet.invocation.PortletInvocation;
+import org.jboss.portal.portlet.spi.PortletInvocationContext;
+
+import javax.portlet.PortletMode;
+import javax.portlet.PortletModeException;
+import javax.portlet.PortletRequest;
+import javax.portlet.PortletSecurityException;
+import javax.portlet.PortletURL;
+import javax.portlet.WindowState;
+import javax.portlet.WindowStateException;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 6697 $
+ */
+public class PortletURLImpl implements PortletURL
+{
+
+ private PortletInvocation inv;
+ private PortletRequest preq;
+
+ //
+ private Boolean secure;
+ private InternalPortletURL url;
+
+ public PortletURLImpl(PortletInvocation invocation, PortletRequest preq,
InternalPortletURL url)
+ {
+ this.inv = invocation;
+ this.preq = preq;
+ this.url = url;
+ }
+
+ public void setWindowState(WindowState windowState) throws WindowStateException
+ {
+ if (!preq.isWindowStateAllowed(windowState))
+ {
+ throw new WindowStateException("Not supported", windowState);
+ }
+ url.windowState = windowState;
+ }
+
+ public void setPortletMode(PortletMode portletMode) throws PortletModeException
+ {
+ if (portletMode == null)
+ {
+ // The spec does not say the behaviour with null argument
+ // we suppose it clear the current mode
+ url.portletMode = null;
+ }
+ else
+ {
+ // Check possible
+ if (!preq.isPortletModeAllowed(portletMode))
+ {
+ throw new PortletModeException("Not supported", portletMode);
+ }
+
+ // Set mode
+ url.portletMode = portletMode;
+ }
+ }
+
+ /** @throws IllegalArgumentException if the name is null */
+ public void setParameter(String name, String value)
+ {
+ PortletUtils.checkPortletParameterValidity(name, value);
+
+ //
+ url.getInternalParameters().setValue(name, value);
+ }
+
+ public void setParameter(String name, String[] values)
+ {
+ PortletUtils.checkPortletParameterValidity(name, values);
+
+ //
+ url.getInternalParameters().setValues(name, values);
+ }
+
+ public void setParameters(Map parameters)
+ {
+ PortletUtils.checkPortletParameterMapValidity(parameters);
+
+ //
+ url.getInternalParameters().replace(parameters);
+ }
+
+ public void setSecure(boolean secure) throws PortletSecurityException
+ {
+ this.secure = Boolean.valueOf(secure);
+ }
+
+ public String toString()
+ {
+ PortletInvocationContext responseContext = inv.getPortletContext();
+ return responseContext.renderURL(url, secure, null, true);
+ }
+
+ public static abstract class InternalPortletURL implements
org.jboss.portal.portlet.PortletURL
+ {
+
+ /** . */
+ private WindowState windowState;
+
+ /** . */
+ private PortletMode portletMode;
+
+ public Mode getMode()
+ {
+ if (portletMode != null)
+ {
+ return Mode.create(portletMode.toString());
+ }
+ return null;
+ }
+
+ public org.jboss.portal.WindowState getWindowState()
+ {
+ if (windowState != null)
+ {
+ return org.jboss.portal.WindowState.create(windowState.toString());
+ }
+ return null;
+ }
+
+ protected abstract PortletParameters getInternalParameters();
+ }
+
+ public static class InternalActionURL extends InternalPortletURL implements ActionURL
+ {
+
+ /** . */
+ private PortletParametersStateString parameters = new
PortletParametersStateString();
+
+ protected PortletParameters getInternalParameters()
+ {
+ return parameters.getParameters();
+ }
+
+ public StateString getInteractionState()
+ {
+ return parameters;
+ }
+
+ /** The portlet container does not need to have the navigational state provided.
*/
+ public StateString getNavigationalState()
+ {
+ return null;
+ }
+ }
+
+ public static class InternalRenderURL extends InternalPortletURL implements RenderURL
+ {
+
+ /** . */
+ private PortletParametersStateString navigationalState = new
PortletParametersStateString();
+
+ protected PortletParameters getInternalParameters()
+ {
+ return navigationalState.getParameters();
+ }
+
+ public StateString getNavigationalState()
+ {
+ return navigationalState;
+ }
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/PortletURLImpl.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/RenderRequestImpl.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/RenderRequestImpl.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/RenderRequestImpl.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -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.portlet.impl.jsr168.api;
+
+import org.jboss.portal.portlet.PortletParametersStateString;
+import org.jboss.portal.portlet.StateString;
+import org.jboss.portal.portlet.invocation.RenderInvocation;
+import org.jboss.portal.portlet.spi.RenderContext;
+
+import javax.portlet.RenderRequest;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 6697 $
+ */
+public class RenderRequestImpl extends PortletRequestImpl implements RenderRequest
+{
+
+ /** . */
+ protected RenderContext renderContext;
+
+ public RenderRequestImpl(RenderInvocation invocation)
+ {
+ super(invocation);
+
+ // Get the render context
+ renderContext = (RenderContext)invocation.getPortletContext();
+
+ // Get the possibly null navigational state
+ StateString navigationalState = renderContext.getNavigationalState();
+
+ //
+ if (navigationalState == null)
+ {
+
+ }
+ else if (navigationalState instanceof PortletParametersStateString)
+ {
+ parameters = ((PortletParametersStateString)navigationalState).getParameters();
+ }
+ else
+ {
+ PortletParametersStateString parametersState = new
PortletParametersStateString(navigationalState.getStringValue());
+ parameters = parametersState.getParameters();
+ }
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/RenderRequestImpl.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/RenderResponseImpl.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/RenderResponseImpl.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/RenderResponseImpl.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,193 @@
+/******************************************************************************
+ * 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.jsr168.api;
+
+import org.jboss.portal.common.util.MediaType;
+import org.jboss.portal.common.util.ContentInfo;
+import org.jboss.portal.portlet.invocation.PortletInvocation;
+import org.jboss.portal.portlet.invocation.RenderInvocation;
+import org.jboss.portal.portlet.invocation.response.FragmentResponse;
+import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
+import org.jboss.portal.portlet.impl.jsr168.PortletUtils;
+
+import javax.activation.MimeTypeParseException;
+import javax.portlet.PortletURL;
+import javax.portlet.RenderResponse;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.PrintWriter;
+import java.util.Locale;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 6704 $
+ */
+public class RenderResponseImpl extends PortletResponseImpl implements RenderResponse
+{
+
+ /** The fragment result. */
+ protected FragmentResponse result;
+
+ /** The namespace. */
+ protected String namespace;
+
+ /** Not really used but we need it to memorize what the client set optionally. */
+ protected int bufferSize;
+
+ public RenderResponseImpl(RenderInvocation invocation, PortletRequestImpl preq)
+ {
+ super(invocation, preq);
+
+ // 0 means no buffering - we say no buffering
+ this.bufferSize = 0;
+ this.result = new FragmentResponse();
+ }
+
+ public PortletInvocationResponse getResult()
+ {
+ return result;
+ }
+
+ public void setTitle(String s)
+ {
+ result.setTitle(s);
+ }
+
+ public String getContentType()
+ {
+ return result.getContentType();
+ }
+
+ public void setContentType(String contentType)
+ {
+ try
+ {
+ // Remove the unused appended charset first
+ int index = contentType.indexOf(';');
+ if (index != -1)
+ {
+ contentType = contentType.substring(0, index);
+ }
+
+ // Find the content type among the media type we know
+ MediaType requestedMediaType = MediaType.parseMimeType(contentType);
+
+ // Get the response media type
+ ContentInfo info = invocation.getPortletContext().getMarkupInfo();
+ MediaType responseMediaType = info.getContentType();
+
+ // Check if the requested media type is allowed as a subtype of the main
response
+ if (!responseMediaType.isAllowedSubType(requestedMediaType))
+ {
+ throw new IllegalArgumentException("Content type not accepted");
+ }
+
+ // Set the content type
+ result.setContentType(contentType);
+ }
+ catch (MimeTypeParseException e)
+ {
+ IllegalArgumentException ex = new IllegalArgumentException("Content type
not accepted");
+ ex.initCause(e);
+ throw ex;
+ }
+ }
+
+ public PrintWriter getWriter() throws IOException
+ {
+ return result.getWriter();
+ }
+
+ public OutputStream getPortletOutputStream() throws IOException
+ {
+ return result.getOutputStream();
+ }
+
+ public PortletURL createRenderURL()
+ {
+ return PortletUtils.createRenderURL(invocation, preq);
+ }
+
+ public PortletURL createActionURL()
+ {
+ return PortletUtils.createActionURL(invocation, preq);
+ }
+
+ public String getNamespace()
+ {
+ if (namespace == null)
+ {
+ String windowId = invocation.getWindowContext().getId();
+ namespace = PortletUtils.generateNamespaceFrom(windowId);
+ }
+ return namespace;
+ }
+
+ public String getCharacterEncoding()
+ {
+ return invocation.getPortletContext().getMarkupInfo().getCharset();
+ }
+
+ public Locale getLocale()
+ {
+ return invocation.getUserContext().getLocale();
+ }
+
+ public void setBufferSize(int bufferSize)
+ {
+ if (bufferSize > -0)
+ {
+ this.bufferSize = bufferSize;
+ }
+ }
+
+ public int getBufferSize()
+ {
+ return bufferSize;
+ }
+
+ public void flushBuffer() throws IOException
+ {
+ }
+
+ public void resetBuffer()
+ {
+ // Clear the buffer
+ result.resetBuffer();
+ }
+
+ public void reset()
+ {
+ // Clear the buffer
+ resetBuffer();
+
+ // And properties
+
invocation.getContext().getAttributeResolver(PortletInvocation.RESPONSE_PROPERTIES_SCOPE).getKeys().clear();
+ }
+
+ public boolean isCommitted()
+ {
+ // Never afterCommit
+ return false;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/RenderResponseImpl.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContainerCacheInfo.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContainerCacheInfo.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContainerCacheInfo.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,86 @@
+/******************************************************************************
+ * 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.jsr168.info;
+
+import org.apache.log4j.Logger;
+import org.jboss.portal.portlet.impl.jsr168.metadata.CacheConfigMetaData;
+import org.jboss.portal.portlet.impl.jsr168.metadata.PortletMetaData;
+import org.jboss.portal.portlet.info.CacheInfo;
+import org.jboss.portal.portlet.metadata.JBossPortletMetaData;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 6697 $
+ */
+public class ContainerCacheInfo implements CacheInfo
+{
+
+ /** Cache uses strong references. */
+ public static int REF_STRONG = 0;
+
+ /** Cache uses soft references. */
+ public static int REF_SOFT = 1;
+
+ /** . */
+ private static Logger log = Logger.getLogger(ContainerCacheInfo.class);
+
+ /** . */
+ private int expirationTimeSecs;
+
+ /** . */
+ private int referenceType;
+
+ public ContainerCacheInfo(PortletMetaData portletMD, JBossPortletMetaData
jbossPortletMD)
+ {
+ CacheConfigMetaData cacheConfigMD = portletMD.getCacheConfig();
+ if (cacheConfigMD != null)
+ {
+ expirationTimeSecs = cacheConfigMD.getExpirationTime();
+ if (expirationTimeSecs < 0 && expirationTimeSecs != -1)
+ {
+ log.warn("Seen bad caching expiration value " + expirationTimeSecs
+ " disable caching instead");
+ expirationTimeSecs = 0;
+ }
+ }
+ else
+ {
+ expirationTimeSecs = 0;
+ }
+
+ referenceType = REF_STRONG;
+ if (jbossPortletMD != null)
+ {
+ referenceType = jbossPortletMD.getCacheRefType() == null ? REF_STRONG :
jbossPortletMD.getCacheRefType().intValue();
+ }
+ }
+
+ public int getExpirationSecs()
+ {
+ return expirationTimeSecs;
+ }
+
+ public int getReferenceType()
+ {
+ return referenceType;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContainerCacheInfo.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContainerCapabilities.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContainerCapabilities.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContainerCapabilities.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,127 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.impl.jsr168.info;
+
+import org.jboss.portal.Mode;
+import org.jboss.portal.WindowState;
+import org.jboss.portal.portlet.info.CapabilitiesInfo;
+import org.jboss.portal.portlet.impl.jsr168.metadata.PortletMetaData;
+
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Set;
+import java.util.Locale;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
+ * @version $Revision: 7226 $
+ */
+public class ContainerCapabilities implements CapabilitiesInfo
+{
+ private static Set WINDOW_STATES = new HashSet(3);
+
+ static
+ {
+ WINDOW_STATES.add(new ContainerWindowStateInfo(WindowState.MAXIMIZED));
+ WINDOW_STATES.add(new ContainerWindowStateInfo(WindowState.MINIMIZED));
+ WINDOW_STATES.add(new ContainerWindowStateInfo(WindowState.NORMAL));
+ WINDOW_STATES = Collections.unmodifiableSet(WINDOW_STATES);
+ }
+
+ /** . */
+ private Set supportedLocales;
+
+ /** . */
+ private ContentTypes contentTypes;
+
+ public ContainerCapabilities(PortletMetaData portletMD)
+ {
+ ContentTypes contentTypes = new ContentTypes();
+ contentTypes.setMetadata(portletMD.getContentTypes());
+ contentTypes.start();
+
+ // Add Locale.ENGLISH to supported locales if no locales was provided
+ // todo: should we always include it (i.e. even when other locales are present)?
+ HashSet supportedLocales = new
HashSet(portletMD.getLanguages().getSupportedLocales());
+ if (supportedLocales.isEmpty())
+ {
+ supportedLocales.add(Locale.ENGLISH);
+ }
+
+ //
+ this.supportedLocales = supportedLocales;
+ this.contentTypes = contentTypes;
+ }
+
+ public Set getMimeTypes()
+ {
+ return new HashSet(contentTypes.getAllContentTypes());
+ }
+
+ public Set getAllModes()
+ {
+ Set infos = new HashSet();
+ for (Iterator i = contentTypes.getAllModes().iterator(); i.hasNext();)
+ {
+ infos.add(new ContainerModeInfo((Mode)i.next()));
+ }
+ return infos;
+ }
+
+ public Set getModes(String mimeType)
+ {
+ Set infos = new HashSet();
+ for (Iterator i = contentTypes.getSupportedModes(mimeType).iterator();
i.hasNext();)
+ {
+ infos.add(new ContainerModeInfo((Mode)i.next()));
+ }
+ return infos;
+ }
+
+ public Set getAllWindowStates()
+ {
+ return WINDOW_STATES;
+ }
+
+ public Set getWindowStates(String mimeType)
+ {
+ if (contentTypes.isContentTypeSupported(mimeType))
+ {
+ return getAllWindowStates();
+ }
+ return Collections.EMPTY_SET;
+ }
+
+ public Set getAllLocales()
+ {
+ return supportedLocales;
+ }
+
+ public Set getLocales(String mimeType)
+ {
+ return getAllLocales();
+ }
+
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContainerCapabilities.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContainerMetaInfo.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContainerMetaInfo.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContainerMetaInfo.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,94 @@
+/******************************************************************************
+ * 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.jsr168.info;
+
+import org.jboss.portal.common.i18n.LocalizedString;
+import org.jboss.portal.common.i18n.ResourceBundleManager;
+import org.jboss.portal.portlet.impl.jsr168.metadata.PortletMetaData;
+import org.jboss.portal.portlet.info.MetaInfo;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
+ * @version $Revision: 6818 $
+ */
+public class ContainerMetaInfo implements MetaInfo
+{
+
+ private Map values;
+ private static final String JAVAX_PORTLET = "javax.portlet.";
+ private static final String[] KEYS = {TITLE, SHORT_TITLE, KEYWORDS};
+ private static final String[] BUNDLE_KEYS = {JAVAX_PORTLET + TITLE, JAVAX_PORTLET +
SHORT_TITLE, JAVAX_PORTLET + KEYWORDS};
+
+ public ContainerMetaInfo(PortletMetaData metadata, ResourceBundleManager rb)
+ {
+ this.values = new HashMap();
+
+ // Construct info from resource bundle manager
+ if (rb != null)
+ {
+ for (int i = 0; i < KEYS.length; i++)
+ {
+ String key = KEYS[i];
+ Map tmp = new HashMap();
+ List locales = metadata.getLanguages().getSupportedLocales();
+
+ // Add english locale
+ locales.add(Locale.ENGLISH);
+
+ for (Iterator j = locales.iterator(); j.hasNext();)
+ {
+ Locale locale = (Locale)j.next();
+ ResourceBundle bundle = rb.getResourceBundle(locale);
+ try
+ {
+ String value = bundle.getString(BUNDLE_KEYS[i]);
+ tmp.put(locale, value);
+ }
+ catch (MissingResourceException ignore)
+ {
+ }
+ }
+ LocalizedString ls = new LocalizedString(tmp, Locale.ENGLISH);
+ values.put(key, ls);
+ }
+ }
+
+ // Add stuff coming from meta data
+ values.put(DESCRIPTION, Utils.getLocalizedDescription(metadata.getDescription()));
+ values.put(DISPLAY_NAME,
Utils.getLocalizedDescription(metadata.getDisplayName()));
+ }
+
+ public LocalizedString getMetaValue(String key)
+ {
+ return (LocalizedString)values.get(key);
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContainerMetaInfo.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContainerModeInfo.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContainerModeInfo.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContainerModeInfo.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,83 @@
+/******************************************************************************
+ * 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.jsr168.info;
+
+import org.jboss.portal.Mode;
+import org.jboss.portal.common.i18n.LocalizedString;
+import org.jboss.portal.portlet.info.ModeInfo;
+
+import java.util.Locale;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
+ * @version $Revision: 6818 $
+ * @since 2.4
+ */
+class ContainerModeInfo implements ModeInfo
+{
+ private final Mode mode;
+ private static final LocalizedString DEFAULT_DESCRIPTION = new
LocalizedString("Default Portlet mode description.", Locale.ENGLISH);
+
+ public ContainerModeInfo(Mode mode)
+ {
+ this.mode = mode;
+ }
+
+ public LocalizedString getDescription()
+ {
+ return DEFAULT_DESCRIPTION; // fix-me
+ }
+
+ public Mode getMode()
+ {
+ return mode;
+ }
+
+ public String getModeName()
+ {
+ return mode.toString();
+ }
+
+ public boolean equals(Object o)
+ {
+ if (this == o)
+ {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass())
+ {
+ return false;
+ }
+
+ final ContainerModeInfo modeInfo = (ContainerModeInfo)o;
+
+ return mode.equals(modeInfo.mode);
+
+ }
+
+ public int hashCode()
+ {
+ return mode.hashCode();
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContainerModeInfo.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContainerPortletInfo.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContainerPortletInfo.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContainerPortletInfo.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,107 @@
+/******************************************************************************
+ * 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.jsr168.info;
+
+import org.jboss.portal.common.i18n.ResourceBundleManager;
+import org.jboss.portal.portlet.impl.jsr168.metadata.PortletMetaData;
+import org.jboss.portal.portlet.info.CacheInfo;
+import org.jboss.portal.portlet.info.CapabilitiesInfo;
+import org.jboss.portal.portlet.info.MetaInfo;
+import org.jboss.portal.portlet.info.PortletInfo;
+import org.jboss.portal.portlet.info.PreferencesInfo;
+import org.jboss.portal.portlet.info.SecurityInfo;
+import org.jboss.portal.portlet.info.SessionInfo;
+import org.jboss.portal.portlet.metadata.JBossPortletMetaData;
+
+/**
+ * For now implementation that use the portlet container directly.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
+ * @version $Revision: 7242 $
+ */
+public class ContainerPortletInfo implements PortletInfo
+{
+
+ private ContainerCapabilities capabilities;
+ private ContainerPreferencesInfo preferences;
+ private ContainerMetaInfo meta;
+ private ContainerSecurityInfo security;
+ private ContainerCacheInfo cache;
+ private ContainerSessionInfo session;
+ private Boolean remotable;
+
+ public ContainerPortletInfo(
+ PortletMetaData portletMD,
+ JBossPortletMetaData jbossPortletMD,
+ ResourceBundleManager bundleMgr)
+ {
+ this.capabilities = new ContainerCapabilities(portletMD);
+ this.preferences = portletMD.getPreferences() != null ? new
ContainerPreferencesInfo(portletMD, bundleMgr) : new ContainerPreferencesInfo();
+ this.meta = new ContainerMetaInfo(portletMD, bundleMgr);
+ this.security = new ContainerSecurityInfo(portletMD);
+ this.cache = new ContainerCacheInfo(portletMD, jbossPortletMD);
+ this.session = new ContainerSessionInfo(jbossPortletMD);
+ // if there is no JBoss specific metadata, remotable status should be indetermined
(i.e., null)
+ if (jbossPortletMD != null)
+ {
+ this.remotable = jbossPortletMD.getRemotable();
+ }
+
+ }
+
+ public CapabilitiesInfo getCapabilities()
+ {
+ return capabilities;
+ }
+
+ public PreferencesInfo getPreferences()
+ {
+ return preferences;
+ }
+
+ public MetaInfo getMeta()
+ {
+ return meta;
+ }
+
+ public SecurityInfo getSecurity()
+ {
+ return security;
+ }
+
+ public CacheInfo getCache()
+ {
+ return cache;
+ }
+
+ public SessionInfo getSession()
+ {
+ return session;
+ }
+
+ public Boolean isRemotable()
+ {
+ return remotable;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContainerPortletInfo.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContainerPreferenceInfo.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContainerPreferenceInfo.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContainerPreferenceInfo.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,80 @@
+/******************************************************************************
+ * 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.jsr168.info;
+
+import org.jboss.portal.common.i18n.LocalizedString;
+import org.jboss.portal.common.value.Value;
+import org.jboss.portal.portlet.info.PreferenceInfo;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 6818 $
+ */
+public class ContainerPreferenceInfo implements PreferenceInfo
+{
+
+ private String key;
+ private LocalizedString displayName;
+ private LocalizedString description;
+ private Boolean readOnly;
+ private Value value;
+
+ public ContainerPreferenceInfo(String key, LocalizedString displayName,
LocalizedString description, boolean readOnly, Value value)
+ {
+ this.key = key;
+ this.displayName = displayName;
+ this.description = description;
+ this.readOnly = Boolean.valueOf(readOnly);
+ this.value = value;
+ }
+
+ public String getKey()
+ {
+ return key;
+ }
+
+ public LocalizedString getDisplayName()
+ {
+ return displayName;
+ }
+
+ public LocalizedString getDescription()
+ {
+ return description;
+ }
+
+ public Boolean isReadOnly()
+ {
+ return readOnly;
+ }
+
+ /**
+ * Return the value provided by the portlet.xml deployment descriptor.
+ *
+ * @return the preference value associated with this preference meta data
+ */
+ public Value getDefaultValue()
+ {
+ return value;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContainerPreferenceInfo.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContainerPreferencesInfo.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContainerPreferencesInfo.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContainerPreferencesInfo.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -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.impl.jsr168.info;
+
+import org.jboss.portal.common.i18n.LocalizedString;
+import org.jboss.portal.common.value.StringValue;
+import org.jboss.portal.common.value.Value;
+import org.jboss.portal.common.i18n.ResourceBundleManager;
+import org.jboss.portal.portlet.impl.jsr168.metadata.PortletMetaData;
+import org.jboss.portal.portlet.impl.jsr168.metadata.PreferenceMetaData;
+import org.jboss.portal.portlet.info.PreferenceInfo;
+import org.jboss.portal.portlet.info.PreferencesInfo;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
+ * @version $Revision: 6818 $
+ */
+public class ContainerPreferencesInfo implements PreferencesInfo
+{
+
+ /** The cached container preference info. */
+ private Map content;
+
+ public ContainerPreferencesInfo()
+ {
+ content = new HashMap();
+ }
+
+ public ContainerPreferencesInfo(PortletMetaData portletMD, ResourceBundleManager
bundleMgr)
+ {
+ content = new HashMap();
+
+ for (Iterator i = portletMD.getPreferences().iterator(); i.hasNext();)
+ {
+ PreferenceMetaData prefMD = (PreferenceMetaData)i.next();
+ Value value = new StringValue(prefMD.getValues());
+ LocalizedString displayName =
bundleMgr.getLocalizedValue("javax.portlet.preference.name." + prefMD.getName(),
prefMD.getName());
+ LocalizedString description =
bundleMgr.getLocalizedValue("javax.portlet.preference.description." +
prefMD.getName(), prefMD.getName());
+ ContainerPreferenceInfo pref = new ContainerPreferenceInfo(prefMD.getName(),
displayName, description, prefMD.isReadOnly(), value);
+ content.put(pref.getKey(), pref);
+ }
+ }
+
+ public ContainerPreferenceInfo getContainerPreference(String key)
+ {
+ if (key == null)
+ {
+ throw new IllegalArgumentException("Preference key must not be
null");
+ }
+ return (ContainerPreferenceInfo)content.get(key);
+ }
+
+ public Set getKeys()
+ {
+ return Collections.unmodifiableSet(content.keySet());
+ }
+
+ public PreferenceInfo getPreference(String key)
+ {
+ return getContainerPreference(key);
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContainerPreferencesInfo.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContainerSecurityInfo.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContainerSecurityInfo.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContainerSecurityInfo.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,75 @@
+/******************************************************************************
+ * 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.jsr168.info;
+
+import org.jboss.portal.portlet.TransportGuarantee;
+import org.jboss.portal.portlet.impl.jsr168.metadata.PortletMetaData;
+import org.jboss.portal.portlet.impl.jsr168.metadata.TransportGuaranteesMetaData;
+import org.jboss.portal.portlet.info.SecurityInfo;
+
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 6697 $
+ */
+public class ContainerSecurityInfo implements SecurityInfo
+{
+
+ /** . */
+ private Set tgs;
+
+ public ContainerSecurityInfo(PortletMetaData portletMD)
+ {
+ tgs = new HashSet();
+ tgs.add(TransportGuarantee.NONE);
+
+ //
+ TransportGuaranteesMetaData tgMD = portletMD.getTransportGuarantees();
+ if (tgMD != null)
+ {
+ for (Iterator i = tgMD.iterator(); i.hasNext();)
+ {
+ TransportGuarantee tg = (TransportGuarantee)i.next();
+ tgs.add(tg);
+ }
+ }
+
+ //
+ tgs = Collections.unmodifiableSet(tgs);
+ }
+
+
+ public boolean containsTransportGuarantee(TransportGuarantee transportGuarantee)
+ {
+ return tgs.contains(transportGuarantee);
+ }
+
+ public Set getTransportGuarantees()
+ {
+ return tgs;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContainerSecurityInfo.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContainerSessionInfo.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContainerSessionInfo.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContainerSessionInfo.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,54 @@
+/******************************************************************************
+ * 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.jsr168.info;
+
+import org.jboss.portal.portlet.container.PortletContainer;
+import org.jboss.portal.portlet.info.SessionInfo;
+import org.jboss.portal.portlet.metadata.JBossPortletMetaData;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 7226 $
+ */
+public class ContainerSessionInfo implements SessionInfo
+{
+
+ private Boolean distributed;
+
+ ContainerSessionInfo(JBossPortletMetaData md)
+ {
+ if (md != null)
+ {
+ distributed = md.getDistributed();
+ }
+ if (distributed == null)
+ {
+ distributed = Boolean.FALSE;
+ }
+ }
+
+ public Boolean getDistributed()
+ {
+ return distributed;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContainerSessionInfo.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContainerWindowStateInfo.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContainerWindowStateInfo.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContainerWindowStateInfo.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,83 @@
+/******************************************************************************
+ * 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.jsr168.info;
+
+import org.jboss.portal.WindowState;
+import org.jboss.portal.common.i18n.LocalizedString;
+import org.jboss.portal.portlet.info.WindowStateInfo;
+
+import java.util.Locale;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
+ * @version $Revision: 6818 $
+ * @since 2.4
+ */
+class ContainerWindowStateInfo implements WindowStateInfo
+{
+ private final WindowState windowState;
+ private static final LocalizedString DEFAULT_DESCRIPTION = new
LocalizedString("Default window state description.", Locale.ENGLISH);
+
+ public ContainerWindowStateInfo(WindowState windowState)
+ {
+ this.windowState = windowState;
+ }
+
+ public LocalizedString getDescription()
+ {
+ return DEFAULT_DESCRIPTION; //fix-me
+ }
+
+ public WindowState getWindowState()
+ {
+ return windowState;
+ }
+
+ public String getWindowStateName()
+ {
+ return windowState.toString();
+ }
+
+ public boolean equals(Object o)
+ {
+ if (this == o)
+ {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass())
+ {
+ return false;
+ }
+
+ final ContainerWindowStateInfo that = (ContainerWindowStateInfo)o;
+
+ return windowState.equals(that.windowState);
+
+ }
+
+ public int hashCode()
+ {
+ return windowState.hashCode();
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContainerWindowStateInfo.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContentTypes.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContentTypes.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContentTypes.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,351 @@
+/******************************************************************************
+ * 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.jsr168.info;
+
+import org.jboss.portal.Mode;
+import org.jboss.portal.portlet.impl.jsr168.metadata.ContentTypeMetaData;
+import org.jboss.portal.portlet.impl.jsr168.metadata.ContentTypesMetaData;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * This object holds the content type and mode capabilities.
+ * <p/>
+ * Todo : use the media type object ?
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
+ * @version $Revision: 6700 $
+ */
+public class ContentTypes
+{
+ /** Maps MIME Type (String) -> Modes (Set), excluding multiple MIME Types
("*", "* / *", "type / *"). */
+ protected final Map singleTypeToPortletModes;
+ /** Maps MIME Type (String) -> Modes (Set), including multiple MIME Types
("*", "* / *", "type / *"). */
+ protected final Map allTypeToPortletModes;
+
+ protected final Set allModes;
+
+ protected ContentTypesMetaData metadata;
+ protected boolean isStarted = false;
+
+ private static final String ALL = "*";
+ private static final String ALL_ALL = "*/*";
+ private static final char SLASH = '/';
+
+ // case-insensitive
+ // CONTENT TYPE = TYPE / SUBTYPE
+ // SUBTYPE = any char except a TSPECIALS or SPACE or CTLS (??)
+ // TSPECIALS ( ) < > @ , ; : \ " / [ ] ? . =
+
+ public ContentTypes()
+ {
+ singleTypeToPortletModes = new HashMap();
+ allTypeToPortletModes = new HashMap(); // Including *
+ allModes = new HashSet();
+ metadata = null;
+ }
+
+ public ContentTypesMetaData getMetadata()
+ {
+ return metadata;
+ }
+
+ public void setMetadata(ContentTypesMetaData metadata)
+ {
+ isStarted = false;
+ initFromMetadata(metadata);
+ this.metadata = metadata;
+ }
+
+ public void start()
+ {
+ initFromMetadata(metadata);
+ }
+
+ /**
+ * Process all the supported content types.
+ *
+ * @param metadata
+ */
+ private void initFromMetadata(ContentTypesMetaData metadata)
+ {
+ if (!isStarted)
+ {
+ if (metadata == null)
+ {
+ throw new IllegalArgumentException("Must pass non-null
metadata.");
+ }
+
+ // Reset the collections
+ singleTypeToPortletModes.clear();
+ allTypeToPortletModes.clear();
+ allModes.clear();
+
+ // Build info from metadata
+ for (Iterator i = metadata.iterator(); i.hasNext();)
+ {
+ ContentTypeMetaData contentTypeMD = (ContentTypeMetaData)i.next();
+
+ // Get the content type
+ String contentType = contentTypeMD.getContentType().toLowerCase();
+
+ // Add the content type to the view mode
+ // because each content type must handle this view
+ add(contentType, Mode.VIEW);
+
+ // Then process each mode
+ Set modes = contentTypeMD.getModes();
+ for (Iterator j = modes.iterator(); j.hasNext();)
+ {
+ Mode mode = (Mode)j.next();
+ add(contentType, mode);
+ }
+ }
+ isStarted = true;
+ }
+ }
+
+ public void stop()
+ {
+
+ }
+
+ private void add(String contentType, Mode mode)
+ {
+ // Determines which map and key to store the mode under
+ String key;
+ if (ALL.equals(contentType) || ALL_ALL.equals(contentType))
+ {
+ key = ALL;
+ }
+ else
+ {
+ int index = contentType.indexOf(SLASH);
+ if (index == -1)
+ {
+ System.out.println("'" + contentType + "' is not a
valid MIME type: ignoring!");
+ return;
+ }
+
+ String type = contentType.substring(0, index);
+ String subtype = contentType.substring(index + 1);
+
+ if (ALL.equals(subtype))
+ {
+ key = type;
+ }
+ else
+ {
+ key = contentType;
+ // This is a single content type so we need to add it to the single mappings
in addition to all
+ addMode(singleTypeToPortletModes, key, mode);
+ }
+ }
+
+ // Store the mode in the complete mapping
+ addMode(allTypeToPortletModes, key, mode);
+
+ // Add the mode to the known modes
+ allModes.add(mode);
+ }
+
+ private void addMode(Map map, String key, Mode mode)
+ {
+ Set modes = (Set)map.get(key);
+ if (modes == null)
+ {
+ modes = new HashSet();
+ map.put(key, modes);
+ }
+ modes.add(mode);
+ }
+
+ /** Return all modes. */
+ public Collection getAllModes()
+ {
+ return Collections.unmodifiableCollection(allModes);
+ }
+
+ /** Return all content types. */
+ public Collection getAllContentTypes()
+ {
+ return Collections.unmodifiableCollection(allTypeToPortletModes.keySet());
+ }
+
+ /**
+ * Return true if the mode is supported
+ *
+ * @throws IllegalArgumentException if the mode is null
+ */
+ public boolean isModeSupported(Mode mode)
+ {
+ if (mode == null)
+ {
+ throw new IllegalArgumentException("Mode must not be null");
+ }
+ return allModes.contains(mode);
+ }
+
+ /**
+ * Return all the supported modes for this content type.
+ *
+ * @throws IllegalArgumentException if the content type is null
+ */
+ public Set getSupportedModes(String contentType)
+ {
+ if (contentType == null)
+ {
+ throw new IllegalArgumentException("Content type must not be null");
+ }
+
+ int index = contentType.indexOf(SLASH);
+ if (index == -1)
+ {
+ // Not valid content type so return empty set
+ return Collections.EMPTY_SET;
+ }
+
+ //
+ Set set = new HashSet();
+
+ //
+ Set contentTypeModes =
(Set)singleTypeToPortletModes.get(contentType.toLowerCase());
+ if (contentTypeModes != null)
+ {
+ set.addAll(contentTypeModes);
+ }
+
+ //
+ Set typeModes = (Set)allTypeToPortletModes.get(contentType.substring(0,
index).toLowerCase());
+ if (typeModes != null)
+ {
+ set.addAll(typeModes);
+ }
+
+ Set wildcardModes = (Set)allTypeToPortletModes.get(ALL);
+ if (wildcardModes != null)
+ {
+ set.addAll(wildcardModes);
+ }
+
+ return set;
+ }
+
+ /**
+ * Return true if the content type is supported.
+ *
+ * @throws IllegalArgumentException if the content type is null
+ */
+ public boolean isContentTypeSupported(String contentType)
+ {
+ Collection allContentTypes = getAllContentTypes();
+ if (contentType == null)
+ {
+ throw new IllegalArgumentException("Content type must not be null");
+ }
+
+ int index = contentType.indexOf(SLASH);
+ if (index == -1)
+ {
+ // Not valid content type so return false
+ return false;
+ }
+
+ // Try the content type, * or */*
+ if (allContentTypes.contains(contentType) |
+ allContentTypes.contains(contentType.toLowerCase()) |
+ allContentTypes.contains(ALL) |
+ allContentTypes.contains(ALL_ALL))
+ {
+ return true;
+ }
+
+ // Try xxx/*
+ String wildcard = contentType.substring(0, index) + "/*";
+ return allContentTypes.contains(wildcard) |
allContentTypes.contains(wildcard.toLowerCase());
+ }
+
+ /**
+ * Return true if the given content type is supported for the given mode.
+ *
+ * @throws IllegalArgumentException if the content type or the mode is null
+ */
+ public boolean isSupported(Mode mode, String contentType)
+ {
+ if (mode == null)
+ {
+ throw new IllegalArgumentException("Mode must not be null");
+ }
+ if (contentType == null)
+ {
+ throw new IllegalArgumentException("Content type must not be null");
+ }
+
+ int index = contentType.indexOf(SLASH);
+ if (index == -1)
+ {
+ // Not valid content type so return false
+ return false;
+ }
+
+ // Try full name matching
+ Set contentTypeModes = (Set)singleTypeToPortletModes.get(contentType);
+ if (contentTypeModes != null && contentTypeModes.contains(mode))
+ {
+ return true;
+ }
+
+ // Try full name lowercase matching
+ Set lowercaseContentTypeModes =
(Set)singleTypeToPortletModes.get(contentType.toLowerCase());
+ if (lowercaseContentTypeModes != null &&
lowercaseContentTypeModes.contains(mode))
+ {
+ return true;
+ }
+
+ // Try type matching
+ String type = contentType.substring(0, index);
+ Set typeMode = (Set)allTypeToPortletModes.get(type);
+ if (typeMode != null && typeMode.contains(mode))
+ {
+ return true;
+ }
+
+ // Try type matching
+ Set lowercaseTypeMode = (Set)allTypeToPortletModes.get(type.toLowerCase());
+ if (lowercaseTypeMode != null && lowercaseTypeMode.contains(mode))
+ {
+ return true;
+ }
+
+ // Try wildcard matching
+ Set wildcardMode = (Set)allTypeToPortletModes.get(ALL);
+ return wildcardMode != null && wildcardMode.contains(mode);
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContentTypes.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/InfoBundle.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/InfoBundle.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/InfoBundle.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,93 @@
+/******************************************************************************
+ * 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.jsr168.info;
+
+import org.apache.log4j.Logger;
+import org.jboss.portal.portlet.impl.jsr168.APIConstants;
+import org.jboss.portal.portlet.impl.jsr168.metadata.LanguagesMetaData;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.ListResourceBundle;
+import java.util.Locale;
+
+/**
+ * A resource bundle that contains the inline information defined by the portlet
specification.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 6697 $
+ */
+public class InfoBundle extends ListResourceBundle
+{
+
+ private static final Logger log = Logger.getLogger(InfoBundle.class);
+
+ /** . */
+ private final Object[][] content;
+
+ public InfoBundle(LanguagesMetaData.InfoMetaData metaData)
+ {
+ log.debug("Creates the parent bundle");
+
+ //
+ List list = new ArrayList(3);
+
+ //
+ String title = metaData.getTitle();
+ if (title == null)
+ {
+ throw new IllegalArgumentException("Title must be provided");
+ }
+ list.add(new Object[]{APIConstants.JAVAX_PORTLET_TITLE, title});
+
+ //
+ if (metaData.getShortTitle() != null)
+ {
+ list.add(new Object[]{APIConstants.JAVAX_PORTLET_SHORT_TITLE,
metaData.getShortTitle()});
+ }
+
+ //
+ if (metaData.getKeywords() != null)
+ {
+ list.add(new Object[]{APIConstants.JAVAX_PORTLET_KEYWORDS,
metaData.getKeywords()});
+ }
+
+ //
+ content = (Object[][])list.toArray(new Object[list.size()][]);
+ }
+
+ protected Object[][] getContents()
+ {
+ return content;
+ }
+
+ /**
+ * This is the english locale.
+ *
+ * @return the english locale
+ */
+ public Locale getLocale()
+ {
+ return Locale.ENGLISH;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/InfoBundle.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/Utils.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/Utils.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/Utils.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -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.portlet.impl.jsr168.info;
+
+import org.jboss.portal.common.i18n.LocalizedString;
+import org.jboss.portal.portlet.impl.jsr168.metadata.LocalizedStringMetaData;
+import org.jboss.portal.portlet.impl.jsr168.metadata.LocalizedValueMetaData;
+
+import java.util.HashMap;
+import java.util.Locale;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 6818 $
+ */
+public class Utils
+{
+
+ private static final Locale DEFAULT_LOCALE = Locale.ENGLISH;
+
+ public static LocalizedString getLocalizedDescription(LocalizedStringMetaData
describable)
+ {
+ Map m = new HashMap();
+ for (int i = 0; i < describable.getValues().size(); i++)
+ {
+ LocalizedValueMetaData descriptionMD =
(LocalizedValueMetaData)describable.getValues().get(i);
+ Locale locale = descriptionMD.getLocale();
+ if (locale == null)
+ {
+ locale = DEFAULT_LOCALE;
+ }
+ m.put(locale, descriptionMD.getValue());
+ }
+ return new LocalizedString(m, DEFAULT_LOCALE);
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/Utils.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/CacheConfigMetaData.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/CacheConfigMetaData.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/CacheConfigMetaData.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -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.impl.jsr168.metadata;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public class CacheConfigMetaData
+{
+
+ /** . */
+ private int expirationTime;
+
+ public CacheConfigMetaData()
+ {
+ }
+
+ public int getExpirationTime()
+ {
+ return expirationTime;
+ }
+
+ public void setExpirationTime(int expirationTime)
+ {
+ this.expirationTime = expirationTime;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/CacheConfigMetaData.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/ContentTypeMetaData.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/ContentTypeMetaData.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/ContentTypeMetaData.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -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.portlet.impl.jsr168.metadata;
+
+import org.jboss.portal.Mode;
+import org.jboss.portal.common.util.Tools;
+
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public class ContentTypeMetaData
+{
+
+ private String contentType;
+ private Set modes;
+
+ public ContentTypeMetaData()
+ {
+ modes = new HashSet();
+ }
+
+ /**
+ * @param contentType
+ * @param modes
+ * @since 2.4
+ */
+ public ContentTypeMetaData(String contentType, Mode[] modes)
+ {
+ this.contentType = contentType;
+ this.modes = Tools.toSet(modes);
+ }
+
+ public String getContentType()
+ {
+ return contentType;
+ }
+
+ public void setContentType(String contentType)
+ {
+ this.contentType = contentType;
+ }
+
+ public Set getModes()
+ {
+ return modes;
+ }
+
+ public void setModes(Set modes)
+ {
+ this.modes = modes;
+ }
+
+ public int hashCode()
+ {
+ return contentType.hashCode();
+ }
+
+ public boolean equals(Object obj)
+ {
+ if (obj == this)
+ {
+ return true;
+ }
+ if (obj instanceof ContentTypeMetaData)
+ {
+ ContentTypeMetaData other = (ContentTypeMetaData)obj;
+ return other.contentType.equals(contentType);
+ }
+ return false;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/ContentTypeMetaData.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/ContentTypesMetaData.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/ContentTypesMetaData.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/ContentTypesMetaData.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,52 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.impl.jsr168.metadata;
+
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public class ContentTypesMetaData
+{
+
+ private Set set;
+
+ public ContentTypesMetaData()
+ {
+ set = new HashSet();
+ }
+
+ public void addContentType(ContentTypeMetaData contentType)
+ {
+ set.add(contentType);
+ }
+
+ public Iterator iterator()
+ {
+ return set.iterator();
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/ContentTypesMetaData.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/DescribableObjectMetaData.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/DescribableObjectMetaData.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/DescribableObjectMetaData.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,43 @@
+/******************************************************************************
+ * 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.jsr168.metadata;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public class DescribableObjectMetaData
+{
+
+ private LocalizedStringMetaData description;
+
+ public DescribableObjectMetaData()
+ {
+ description = new LocalizedStringMetaData();
+ }
+
+ public LocalizedStringMetaData getDescription()
+ {
+ return description;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/DescribableObjectMetaData.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/DescriptionMetaData.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/DescriptionMetaData.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/DescriptionMetaData.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,31 @@
+/******************************************************************************
+ * 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.jsr168.metadata;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public class DescriptionMetaData extends LocalizedValueMetaData
+{
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/DescriptionMetaData.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/DisplayNameMetaData.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/DisplayNameMetaData.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/DisplayNameMetaData.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,31 @@
+/******************************************************************************
+ * 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.jsr168.metadata;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public class DisplayNameMetaData extends LocalizedValueMetaData
+{
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/DisplayNameMetaData.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/LanguagesMetaData.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/LanguagesMetaData.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/LanguagesMetaData.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,123 @@
+/******************************************************************************
+ * 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.jsr168.metadata;
+
+import java.util.LinkedList;
+import java.util.List;
+
+/**
+ * Contains locale specific values.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public class LanguagesMetaData
+{
+
+ /** The unmodifiable list of the locales supported by the portlet. */
+ private List supportedLocales;
+
+ /** The path of the resource bundle or null if no is defined. */
+ private String resourceBundle;
+
+ /** The inline info or null if not defined */
+ private InfoMetaData info;
+
+ public LanguagesMetaData()
+ {
+ this.supportedLocales = new LinkedList();
+ }
+
+ /**
+ * A list of all supported locales.
+ *
+ * @return a List of String representation of supported locales.
+ */
+ public List getSupportedLocales()
+ {
+ return supportedLocales;
+ }
+
+ public String getResourceBundle()
+ {
+ return resourceBundle;
+ }
+
+ public void setResourceBundle(String resourceBundle)
+ {
+ this.resourceBundle = resourceBundle;
+ }
+
+ public InfoMetaData getInfo()
+ {
+ return info;
+ }
+
+ public void setInfo(InfoMetaData info)
+ {
+ this.info = info;
+ }
+
+ public static class InfoMetaData
+ {
+
+ /** The portlet title, cannot be null. */
+ private String title;
+
+ /** The portlet short title, can be null if not defined. */
+ private String shortTitle;
+
+ /** The unparsed keywords, can be null if not defined. */
+ private String keywords;
+
+ public String getTitle()
+ {
+ return title;
+ }
+
+ public void setTitle(String title)
+ {
+ this.title = title;
+ }
+
+ public String getShortTitle()
+ {
+ return shortTitle;
+ }
+
+ public void setShortTitle(String shortTitle)
+ {
+ this.shortTitle = shortTitle;
+ }
+
+ public String getKeywords()
+ {
+ return keywords;
+ }
+
+ public void setKeywords(String keywords)
+ {
+ this.keywords = keywords;
+ }
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/LanguagesMetaData.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/LocalizedStringMetaData.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/LocalizedStringMetaData.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/LocalizedStringMetaData.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,47 @@
+/******************************************************************************
+ * 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.jsr168.metadata;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public class LocalizedStringMetaData
+{
+
+ /** . */
+ private List values;
+
+ public LocalizedStringMetaData()
+ {
+ values = new ArrayList();
+ }
+
+ public List getValues()
+ {
+ return values;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/LocalizedStringMetaData.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/LocalizedValueMetaData.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/LocalizedValueMetaData.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/LocalizedValueMetaData.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,59 @@
+/******************************************************************************
+ * 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.jsr168.metadata;
+
+import java.util.Locale;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public class LocalizedValueMetaData
+{
+
+ /** . */
+ private Locale locale;
+
+ /** . */
+ private String value;
+
+ public Locale getLocale()
+ {
+ return locale;
+ }
+
+ public void setLocale(Locale locale)
+ {
+ this.locale = locale;
+ }
+
+ public String getValue()
+ {
+ return value;
+ }
+
+ public void setValue(String value)
+ {
+ this.value = value;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/LocalizedValueMetaData.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/ModesMetaData.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/ModesMetaData.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/ModesMetaData.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,53 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.impl.jsr168.metadata;
+
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 6165 $
+ */
+public class ModesMetaData
+{
+
+ /** The modes as strings. */
+ private Set modes;
+
+ public ModesMetaData()
+ {
+ modes = new HashSet();
+ }
+
+ public Iterator getAll()
+ {
+ return modes.iterator();
+ }
+
+ public void add(String mode)
+ {
+ modes.add(mode);
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/ModesMetaData.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/ParameterMetaData.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/ParameterMetaData.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/ParameterMetaData.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,54 @@
+/******************************************************************************
+ * 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.jsr168.metadata;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public class ParameterMetaData extends DescribableObjectMetaData
+{
+
+ private String name;
+ private String value;
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+ public String getValue()
+ {
+ return value;
+ }
+
+ public void setValue(String value)
+ {
+ this.value = value;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/ParameterMetaData.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/PortletApplicationMetaData.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/PortletApplicationMetaData.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/PortletApplicationMetaData.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,112 @@
+/******************************************************************************
+ * 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.jsr168.metadata;
+
+import java.util.Collection;
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public class PortletApplicationMetaData
+{
+
+ /** . */
+ private String id;
+
+ /** . */
+ private String version;
+
+ /** . */
+ private Map portletModes;
+
+ /** . */
+ private Map windowStates;
+
+ /** . */
+ private Map userAttributes;
+
+ /** . */
+ private Map portlets;
+
+ public PortletApplicationMetaData()
+ {
+ this.portletModes = new LinkedHashMap();
+ this.windowStates = new LinkedHashMap();
+ this.userAttributes = new LinkedHashMap();
+ this.portlets = new LinkedHashMap();
+ }
+
+ public String getId()
+ {
+ return id;
+ }
+
+ public void setId(String id)
+ {
+ this.id = id;
+ }
+
+ public String getVersion()
+ {
+ return version;
+ }
+
+ public void setVersion(String version)
+ {
+ this.version = version;
+ }
+
+ public Map getPortletModes()
+ {
+ return portletModes;
+ }
+
+ public Map getWindowStates()
+ {
+ return windowStates;
+ }
+
+ public Map getUserAttributes()
+ {
+ return userAttributes;
+ }
+
+ public void addPortlet(PortletMetaData portlet)
+ {
+ portlets.put(portlet.getName(), portlet);
+ }
+
+ public PortletMetaData getPortlet(String id)
+ {
+ return (PortletMetaData)portlets.get(id);
+ }
+
+ public Collection getPortlets()
+ {
+ return portlets.values();
+ }
+
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/PortletApplicationMetaData.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/PortletMetaData.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/PortletMetaData.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/PortletMetaData.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -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.portlet.impl.jsr168.metadata;
+
+import org.jboss.portal.portlet.metadata.SessionConfigMetaData;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public class PortletMetaData extends DescribableObjectMetaData
+{
+
+ private String name;
+ private String className;
+ private Map parameters;
+ private List securityRoleRefs;
+ private ContentTypesMetaData contentTypes;
+ private LanguagesMetaData languages;
+ private CacheConfigMetaData cacheConfig;
+ private TransportGuaranteesMetaData transportGuarantees;
+ private SessionConfigMetaData sessionConfig;
+ private PortletPreferencesMetaData preferences;
+ private LocalizedStringMetaData displayName;
+
+ public PortletMetaData()
+ {
+ this.parameters = new HashMap();
+ this.securityRoleRefs = new ArrayList();
+ this.contentTypes = new ContentTypesMetaData();
+ this.languages = new LanguagesMetaData();
+ this.preferences = new PortletPreferencesMetaData();
+ this.displayName = new LocalizedStringMetaData();
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+ public String getClassName()
+ {
+ return className;
+ }
+
+ public void setClassName(String className)
+ {
+ this.className = className;
+ }
+
+ public ContentTypesMetaData getContentTypes()
+ {
+ return contentTypes;
+ }
+
+ public void setContentTypes(ContentTypesMetaData contentTypes)
+ {
+ this.contentTypes = contentTypes;
+ }
+
+ public LanguagesMetaData getLanguages()
+ {
+ return languages;
+ }
+
+ public void setLanguages(LanguagesMetaData languages)
+ {
+ this.languages = languages;
+ }
+
+ public Map getParameters()
+ {
+ return parameters;
+ }
+
+ public LocalizedStringMetaData getDisplayName()
+ {
+ return displayName;
+ }
+
+ public List getSecurityRoleRefs()
+ {
+ return securityRoleRefs;
+ }
+
+ public CacheConfigMetaData getCacheConfig()
+ {
+ return cacheConfig;
+ }
+
+ public void setCacheConfig(CacheConfigMetaData cacheConfig)
+ {
+ this.cacheConfig = cacheConfig;
+ }
+
+ public TransportGuaranteesMetaData getTransportGuarantees()
+ {
+ return transportGuarantees;
+ }
+
+ public void setTransportGuarantees(TransportGuaranteesMetaData transportGuarantees)
+ {
+ this.transportGuarantees = transportGuarantees;
+ }
+
+ public SessionConfigMetaData getSessionConfig()
+ {
+ return sessionConfig;
+ }
+
+ public void setSessionConfig(SessionConfigMetaData sessionConfig)
+ {
+ this.sessionConfig = sessionConfig;
+ }
+
+ public PortletPreferencesMetaData getPreferences()
+ {
+ return preferences;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/PortletMetaData.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/PortletModeMetaData.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/PortletModeMetaData.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/PortletModeMetaData.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,45 @@
+/******************************************************************************
+ * 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.jsr168.metadata;
+
+import javax.portlet.PortletMode;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public class PortletModeMetaData extends DescribableObjectMetaData
+{
+
+ private PortletMode portletMode;
+
+ public PortletMode getPortletMode()
+ {
+ return portletMode;
+ }
+
+ public void setPortletMode(PortletMode portletMode)
+ {
+ this.portletMode = portletMode;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/PortletModeMetaData.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/PortletPreferencesMetaData.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/PortletPreferencesMetaData.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/PortletPreferencesMetaData.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,71 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.impl.jsr168.metadata;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public class PortletPreferencesMetaData
+{
+
+ /** . */
+ private Map map = new HashMap();
+
+ /** . */
+ private String validator;
+
+ public void addPreference(PreferenceMetaData preference)
+ {
+ map.put(preference.getName(), preference);
+ }
+
+ public Iterator iterator()
+ {
+ return map.values().iterator();
+ }
+
+ public int size()
+ {
+ return map.size();
+ }
+
+ public PreferenceMetaData getPreference(String key)
+ {
+ return (PreferenceMetaData)map.get(key);
+ }
+
+ public String getValidator()
+ {
+ return validator;
+ }
+
+ public void setValidator(String validator)
+ {
+ this.validator = validator;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/PortletPreferencesMetaData.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/PreferenceMetaData.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/PreferenceMetaData.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/PreferenceMetaData.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,85 @@
+/******************************************************************************
+ * 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.jsr168.metadata;
+
+public class PreferenceMetaData
+{
+
+ private String name;
+ private String[] values;
+ private boolean readOnly;
+
+ public PreferenceMetaData()
+ {
+ values = new String[0];
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+ public String[] getValues()
+ {
+ return values;
+ }
+
+ public void setValues(String[] values)
+ {
+ this.values = values;
+ }
+
+ public boolean isReadOnly()
+ {
+ return readOnly;
+ }
+
+ public void setReadOnly(boolean readOnly)
+ {
+ this.readOnly = readOnly;
+ }
+
+ public int hashCode()
+ {
+ return name.hashCode();
+ }
+
+ public boolean equals(Object obj)
+ {
+ if (obj == this)
+ {
+ return true;
+ }
+ if (obj instanceof PreferenceMetaData)
+ {
+ PreferenceMetaData other = (PreferenceMetaData)obj;
+ return other.name.equals(name);
+ }
+ return false;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/PreferenceMetaData.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/SecurityConstraintMetaData.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/SecurityConstraintMetaData.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/SecurityConstraintMetaData.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,60 @@
+/******************************************************************************
+ * 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.jsr168.metadata;
+
+import org.jboss.portal.portlet.TransportGuarantee;
+
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 5448 $
+ */
+public class SecurityConstraintMetaData
+{
+ private Set portlets = new HashSet();
+ private TransportGuarantee transportGuarantee;
+
+ public Set getPortlets()
+ {
+ return portlets;
+ }
+
+ public void addPortlet(String name)
+ {
+ portlets.add(name);
+ }
+
+ public void setTransportGuarantee(TransportGuarantee guarantee)
+ {
+ transportGuarantee = guarantee;
+ }
+
+ public TransportGuarantee getTransportGuarantee()
+ {
+ return transportGuarantee;
+ }
+
+
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/SecurityConstraintMetaData.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/SecurityRoleRefMetaData.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/SecurityRoleRefMetaData.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/SecurityRoleRefMetaData.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,67 @@
+/******************************************************************************
+ * 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.jsr168.metadata;
+
+import org.jboss.portal.common.i18n.LocalizedString;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 6818 $
+ */
+public class SecurityRoleRefMetaData
+{
+
+ private String roleName;
+ private String roleLink;
+ private LocalizedString description;
+
+ public String getRoleName()
+ {
+ return roleName;
+ }
+
+ public void setRoleName(String roleName)
+ {
+ this.roleName = roleName;
+ }
+
+ public String getRoleLink()
+ {
+ return roleLink;
+ }
+
+ public void setRoleLink(String roleLink)
+ {
+ this.roleLink = roleLink;
+ }
+
+ public LocalizedString getDescription()
+ {
+ return description;
+ }
+
+ public void setDescription(LocalizedString description)
+ {
+ this.description = description;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/SecurityRoleRefMetaData.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/TransportGuaranteesMetaData.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/TransportGuaranteesMetaData.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/TransportGuaranteesMetaData.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,63 @@
+/******************************************************************************
+ * 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.jsr168.metadata;
+
+import org.jboss.portal.portlet.TransportGuarantee;
+
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public class TransportGuaranteesMetaData
+{
+
+ private Set guarantees;
+
+ public TransportGuaranteesMetaData()
+ {
+ guarantees = new HashSet();
+ }
+
+ public void add(TransportGuarantee transportGuarantee)
+ {
+ if (transportGuarantee == null)
+ {
+ throw new IllegalArgumentException("No null allowed");
+ }
+ guarantees.add(transportGuarantee);
+ }
+
+ public boolean contains(TransportGuarantee transportGuarantee)
+ {
+ return guarantees.contains(transportGuarantee);
+ }
+
+ public Iterator iterator()
+ {
+ return guarantees.iterator();
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/TransportGuaranteesMetaData.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/UserAttributeMetaData.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/UserAttributeMetaData.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/UserAttributeMetaData.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,43 @@
+/******************************************************************************
+ * 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.jsr168.metadata;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public class UserAttributeMetaData extends DescribableObjectMetaData
+{
+
+ private String name;
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/UserAttributeMetaData.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/WindowStateMetaData.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/WindowStateMetaData.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/WindowStateMetaData.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,45 @@
+/******************************************************************************
+ * 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.jsr168.metadata;
+
+import javax.portlet.WindowState;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public class WindowStateMetaData extends DescribableObjectMetaData
+{
+
+ private WindowState windowState;
+
+ public WindowState getWindowState()
+ {
+ return windowState;
+ }
+
+ public void setWindowState(WindowState windowState)
+ {
+ this.windowState = windowState;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/WindowStateMetaData.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/WindowStatesMetaData.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/WindowStatesMetaData.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/WindowStatesMetaData.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,53 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.impl.jsr168.metadata;
+
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 6165 $
+ */
+public class WindowStatesMetaData
+{
+
+ /** The modes as strings. */
+ private Set windowStates;
+
+ public WindowStatesMetaData()
+ {
+ windowStates = new HashSet();
+ }
+
+ public Iterator getAll()
+ {
+ return windowStates.iterator();
+ }
+
+ public void add(String windowState)
+ {
+ windowStates.add(windowState);
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/metadata/WindowStatesMetaData.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/spi/PortletAPIFactory.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/spi/PortletAPIFactory.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/spi/PortletAPIFactory.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,55 @@
+/******************************************************************************
+ * 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.jsr168.spi;
+
+import org.jboss.portal.portlet.invocation.ActionInvocation;
+import org.jboss.portal.portlet.invocation.RenderInvocation;
+import org.jboss.portal.portlet.impl.jsr168.api.RenderRequestImpl;
+import org.jboss.portal.portlet.impl.jsr168.api.ActionRequestImpl;
+import org.jboss.portal.portlet.impl.jsr168.api.ActionResponseImpl;
+import org.jboss.portal.portlet.impl.jsr168.api.RenderResponseImpl;
+
+/**
+ * Factory for portlet API implementation.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 7226 $
+ */
+public interface PortletAPIFactory
+{
+ /**
+ */
+ ActionRequestImpl createActionRequest(ActionInvocation invocation);
+
+ /**
+ */
+ ActionResponseImpl createActionResponse(ActionInvocation invocation, ActionRequestImpl
actionRequest);
+
+ /**
+ */
+ RenderRequestImpl createRenderRequest(RenderInvocation invocation);
+
+ /**
+ */
+ RenderResponseImpl createRenderResponse(RenderInvocation invocation, RenderRequestImpl
renderRequest);
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/spi/PortletAPIFactory.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/spi/PortletInfoFactory.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/spi/PortletInfoFactory.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/spi/PortletInfoFactory.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,51 @@
+/******************************************************************************
+ * 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.jsr168.spi;
+
+import org.jboss.portal.portlet.info.PortletInfo;
+import org.jboss.portal.portlet.impl.jsr168.metadata.PortletMetaData;
+import org.jboss.portal.portlet.metadata.JBossPortletMetaData;
+import org.jboss.portal.portlet.metadata.JBossApplicationMetaData;
+import org.jboss.portal.common.i18n.ResourceBundleManager;
+
+/**
+ * Enables the creation of custom portlet info implementations.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public interface PortletInfoFactory
+{
+ /**
+ * Create a new portlet info from the provided meta data.
+ *
+ * @param portletMD the portlet meta data
+ * @param jbossPortletMD
+ * @param resourceBundleManager the resource bundle manager
+ * @return the runtime portlet meta data
+ */
+ PortletInfo createPortletInfo(
+ PortletMetaData portletMD,
+ JBossPortletMetaData jbossPortletMD,
+ ResourceBundleManager resourceBundleManager);
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/taglib/ActionURLTag.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/taglib/ActionURLTag.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/taglib/ActionURLTag.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -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.impl.jsr168.taglib;
+
+/**
+ * The actionURL tag for the JSR 168 Portlet specification.
+ * <p/>
+ * Creates a URL that must point to the current portlet and must trigger an action
request with the supplied
+ * parameters.
+ *
+ * @author <a href="mailto:sgwood@ix.netcom.com">Sherman Wood</a>
+ * @version $Revision: 5448 $
+ * @jsp.tag name="actionURL" body-content="JSP"
tei-class="org.jboss.portal.portlet.impl.jsr168.taglib.GenerateURLTagTEI"
+ */
+public class ActionURLTag extends GenerateURLTag
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 7474331828863555492L;
+ public static String typeParameter = "action";
+
+ /* (non-Javadoc)
+ * @see org.jboss.portal.portlet.taglib.GenerateURLTag#addTypeParameter()
+ */
+ protected String getTypeValue()
+ {
+ return typeParameter;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/taglib/ActionURLTag.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/taglib/DefineObjectsTag.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/taglib/DefineObjectsTag.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/taglib/DefineObjectsTag.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,58 @@
+/******************************************************************************
+ * 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.jsr168.taglib;
+
+import javax.portlet.PortletConfig;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.servlet.jsp.JspException;
+
+/**
+ * The defineObjects tag for the JSR 168 Portlet specification.
+ *
+ * @author <a href="mailto:sgwood@ix.netcom.com">Sherman Wood</a>
+ * @version $Revision: 5448 $
+ * @jsp.tag name="defineObjects" body-content="empty"
tei-class="org.jboss.portal.portlet.impl.jsr168.taglib.DefineObjectsTagTEI"
+ */
+public class DefineObjectsTag extends PortletTag
+{
+
+ /** The serialVersionUID */
+ private static final long serialVersionUID = -8640865649772583292L;
+
+ public int doStartTag() throws JspException
+ {
+ return SKIP_BODY;
+ }
+
+ public int doEndTag() throws JspException
+ {
+ RenderRequest rreq = getRequest();
+ RenderResponse rresp = getResponse();
+ PortletConfig portletConfig = getConfig();
+ pageContext.setAttribute(DefineObjectsTagTEI.renderRequestVariableName, rreq);
+ pageContext.setAttribute(DefineObjectsTagTEI.renderResponseVariableName, rresp);
+ pageContext.setAttribute(DefineObjectsTagTEI.portletConfigVariableName,
portletConfig);
+ return EVAL_PAGE;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/taglib/DefineObjectsTag.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/taglib/DefineObjectsTagTEI.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/taglib/DefineObjectsTagTEI.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/taglib/DefineObjectsTagTEI.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,55 @@
+/******************************************************************************
+ * 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.jsr168.taglib;
+
+import javax.portlet.PortletConfig;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.servlet.jsp.tagext.TagData;
+import javax.servlet.jsp.tagext.TagExtraInfo;
+import javax.servlet.jsp.tagext.VariableInfo;
+
+/**
+ * The additional variable definitions for the defineObjects tag for the JSR 168 Portlet
specification.
+ *
+ * @author <a href="mailto:sgwood@ix.netcom.com">Sherman Wood</a>
+ * @version $Revision: 5448 $
+ */
+public class DefineObjectsTagTEI extends TagExtraInfo
+{
+ public static final String portletConfigVariableName = "portletConfig";
+ public static final String renderRequestVariableName = "renderRequest";
+ public static final String renderResponseVariableName = "renderResponse";
+
+ public VariableInfo[] getVariableInfo(TagData data)
+ {
+ VariableInfo info1 = new VariableInfo(portletConfigVariableName,
+ PortletConfig.class.getName(), true, VariableInfo.AT_END);
+ VariableInfo info2 = new VariableInfo(renderRequestVariableName,
+ RenderRequest.class.getName(), true, VariableInfo.AT_END);
+ VariableInfo info3 = new VariableInfo(renderResponseVariableName,
+ RenderResponse.class.getName(), true, VariableInfo.AT_END);
+ VariableInfo[] info = {info1, info2, info3};
+ return info;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/taglib/DefineObjectsTagTEI.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/taglib/GenerateURLTag.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/taglib/GenerateURLTag.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/taglib/GenerateURLTag.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,321 @@
+/******************************************************************************
+ * 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.jsr168.taglib;
+
+import org.jboss.portal.portlet.impl.jsr168.PortletUtils;
+
+import javax.portlet.PortletMode;
+import javax.portlet.PortletModeException;
+import javax.portlet.PortletSecurityException;
+import javax.portlet.PortletURL;
+import javax.portlet.RenderRequest;
+import javax.portlet.WindowState;
+import javax.portlet.WindowStateException;
+import javax.servlet.jsp.JspException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Superclass of the actionURL and renderURL tags for the JSR 168 Portlet specification.
+ * <p/>
+ * Creates a URL that must point to the current portlet and must trigger a render or
action request with the supplied
+ * parameters.
+ *
+ * @author <a href="mailto:sgwood@ix.netcom.com">Sherman Wood</a>
+ * @version $Revision: 5448 $
+ */
+abstract class GenerateURLTag extends PortletTag
+{
+ private String windowState;
+ private String portletMode;
+ private String var;
+ private String secure;
+ private Map parameters = new HashMap(5);
+
+ /**
+ * Indicates the portlet mode that the portlet must have when this link is executed.
+ * <p/>
+ * Predefined states: edit, view, help
+ * <p/>
+ * Optional. Defaults to same as the portlet mode for the current request, by not
being included as a parameter in
+ * the URL.
+ *
+ * @return Returns the portletMode.
+ * @jsp.attribute rtexprvalue="true"
+ */
+ public String getPortletMode()
+ {
+ return portletMode;
+ }
+
+ /** @param portletMode The portletMode to set. */
+ public void setPortletMode(String portletMode)
+ {
+ this.portletMode = portletMode;
+ }
+
+ /**
+ * Indicates whether the resulting URL should be a secure or insecure connection.
+ * <p/>
+ * "true" or "false"
+ * <p/>
+ * Optional. Defaults to security setting for the current request, by not being
included as a parameter in the URL.
+ *
+ * @return Returns the secure connection value.
+ * @jsp.attribute rtexprvalue="true"
+ */
+ public String getSecure()
+ {
+ return secure;
+ }
+
+ /** @param secure The secure connection value to set. */
+ public void setSecure(String secure)
+ {
+ this.secure = secure;
+ }
+
+ /**
+ * @return Returns the var - name of the exported scope variable.
+ * @jsp.attribute rtexprvalue="true"
+ */
+ public String getVar()
+ {
+ return var;
+ }
+
+ /** @param var The var to set. */
+ public void setVar(String var)
+ {
+ this.var = var;
+ }
+
+ /**
+ * Indicates the window state that the portlet should have when this link is
executed.
+ * <p/>
+ * Predefined states: minimized, maximized, normal
+ * <p/>
+ * Optional. Defaults to same as the window state for the current request, by not
being included as a parameter in
+ * the URL.
+ *
+ * @return Returns the windowState.
+ * @jsp.attribute rtexprvalue="true"
+ */
+ public String getWindowState()
+ {
+ return windowState;
+ }
+
+ /** @param windowState The windowState to set. */
+ public void setWindowState(String windowState)
+ {
+ this.windowState = windowState;
+ }
+
+ /**
+ * Convert working parameters to what is needed by PortletURL - a map with String[]
values.
+ *
+ * @return Returns the parameters.
+ */
+ private Map getURLParameters()
+ {
+ Map urlParameters = new HashMap(parameters.size());
+
+ Iterator it = parameters.entrySet().iterator();
+ while (it.hasNext())
+ {
+ Map.Entry entry = (Map.Entry)it.next();
+ ArrayList l = (ArrayList)entry.getValue();
+ urlParameters.put(entry.getKey(), l.toArray(new String[l.size()]));
+ }
+ return urlParameters;
+ }
+
+ /**
+ * Add a named parameter. Cater for multiple parameters with the same name by storing
them in a list.
+ *
+ * @param name
+ * @param value
+ */
+ public void addParameter(String name, String value)
+ {
+ List l;
+
+ Object o = parameters.get(name);
+ if (o == null)
+ {
+ l = new ArrayList(5);
+ parameters.put(name, l);
+
+ }
+ else
+ {
+ l = (List)o;
+ }
+ l.add(value);
+ }
+
+ /**
+ * Set up the environment for generating the PortletURL and get the base PortletURL to
decorate. Includes setting the
+ * "type" parameter from the implementing subclass.
+ *
+ * @return The PortelURL to decorate
+ */
+ private PortletURL getBasePortletEnvironmentAndURL()
+ {
+ RenderRequest preq = getRequest();
+
+ // Create the URL
+ if ("action".equals(getTypeValue()))
+ {
+ return PortletUtils.createActionURL(getInvocation(), preq);
+ }
+ else if ("render".equals(getTypeValue()))
+ {
+ return PortletUtils.createRenderURL(getInvocation(), preq);
+ }
+ else
+ {
+ throw new Error("Impossible - it's a bug");
+ }
+ }
+
+ /**
+ * Set the window state for the URL to be what was given in the tag. If not given,
default to what was there
+ * previously
+ *
+ * @param portletURL
+ * @throws WindowStateException
+ */
+ private void setWindowState(PortletURL portletURL) throws WindowStateException
+ {
+ if (getWindowState() != null && getWindowState().trim().length() > 0)
+ {
+ portletURL.setWindowState(new WindowState(getWindowState().trim()));
+ }
+ }
+
+ /**
+ * Set the portlet mode for the URL to be what was given in the tag. If not given,
default to what was there
+ * previously
+ *
+ * @param portletURL
+ * @throws PortletModeException
+ */
+ private void setPortletMode(PortletURL portletURL) throws PortletModeException
+ {
+ if (getPortletMode() != null && getPortletMode().trim().length() > 0)
+ {
+ portletURL.setPortletMode(new PortletMode(getPortletMode().trim()));
+ }
+ }
+
+ /**
+ * Set the secure/unsecure state for the URL to be what was given in the tag. If not
given, default to what was there
+ * previously
+ *
+ * @param portletURL
+ * @throws PortletSecurityException
+ */
+ private void setSecure(PortletURL portletURL) throws PortletSecurityException
+ {
+ if (getSecure() != null && getSecure().trim().length() > 0)
+ {
+ portletURL.setSecure(Boolean.valueOf(getSecure().trim()).booleanValue());
+ }
+ else
+ {
+ // Maybe we don't need to set this again
+ portletURL.setSecure(getInvocation().getSecurityContext().isSecure());
+ }
+ }
+
+ private void clearPreviousTag()
+ {
+ parameters = new HashMap(5);
+ // windowCtx = null;
+ // preq = null;
+ }
+
+ /**
+ * Get the type - action or render - from the implementing subclass
+ *
+ * @return the value for the "type" portal parameter
+ */
+ protected abstract String getTypeValue();
+
+ /** Process the body, which may contain portlet:param tags */
+ public int doStartTag() throws JspException
+ {
+ clearPreviousTag();
+ return EVAL_BODY_INCLUDE;
+ }
+
+ /** Generate the URL */
+ public int doEndTag() throws JspException
+ {
+ String resultingURL = null;
+ try
+ {
+
+ PortletURL newPortletURL = getBasePortletEnvironmentAndURL();
+
+ setWindowState(newPortletURL);
+
+ setPortletMode(newPortletURL);
+
+ setSecure(newPortletURL);
+
+ // Include parameters as part of the tag request.
+
+ if (!parameters.isEmpty())
+ {
+ newPortletURL.setParameters(getURLParameters());
+ }
+
+ resultingURL = newPortletURL.toString();
+
+ // If a variable was given in the tag to be set in the pageContext,
+ // do that. Otherwise, just write out the URL to the page.
+
+ if (getVar() != null)
+ {
+ pageContext.setAttribute(getVar(), resultingURL);
+ }
+ else
+ {
+ pageContext.getOut().print(resultingURL);
+ }
+
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ throw new JspException(e);
+ }
+ return EVAL_PAGE;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/taglib/GenerateURLTag.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/taglib/GenerateURLTagTEI.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/taglib/GenerateURLTagTEI.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/taglib/GenerateURLTagTEI.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,93 @@
+/******************************************************************************
+ * 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.jsr168.taglib;
+
+import javax.servlet.jsp.tagext.TagData;
+import javax.servlet.jsp.tagext.TagExtraInfo;
+import javax.servlet.jsp.tagext.VariableInfo;
+
+/**
+ * The additional variable definitions for the actionURL tag for the JSR 168 Portlet
specification.
+ *
+ * @author <a href="mailto:sgwood@ix.netcom.com">Sherman Wood</a>
+ * @version $Revision: 5448 $
+ */
+public class GenerateURLTagTEI extends TagExtraInfo
+{
+
+ public boolean isValid(TagData data)
+ {
+ return isWindowStateValid(data) &&
+ isPortletModeValid(data) &&
+ isSecureValid(data);
+ }
+
+ public boolean isWindowStateValid(TagData data)
+ {
+ return true;
+ }
+
+ public boolean isPortletModeValid(TagData data)
+ {
+ return true;
+ }
+
+ public boolean isSecureValid(TagData data)
+ {
+ Object o = data.getAttribute("secure");
+ if (o != null && o != TagData.REQUEST_TIME_VALUE)
+ {
+ String s = (String)o;
+ if (s.toLowerCase().equals("true") ||
+ s.toLowerCase().equals("false"))
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+ else
+ {
+ return true;
+ }
+ }
+
+ public VariableInfo[] getVariableInfo(TagData data)
+ {
+ String varName = data.getAttributeString("var");
+ if (varName == null)
+ {
+ return null;
+ }
+
+ VariableInfo info1
+ = new VariableInfo(varName,
+ "String",
+ true,
+ VariableInfo.AT_END);
+ VariableInfo[] info = {info1};
+ return info;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/taglib/GenerateURLTagTEI.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/taglib/NamespaceTag.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/taglib/NamespaceTag.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/taglib/NamespaceTag.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,66 @@
+/******************************************************************************
+ * 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.jsr168.taglib;
+
+import javax.portlet.RenderResponse;
+import javax.servlet.jsp.JspException;
+import java.io.IOException;
+
+/**
+ * The namespace tag for the JSR 168 Portlet specification.
+ * <p/>
+ * This tag produces a unique value for the current portlet.
+ * <p/>
+ * This tag should be used for named elements in the portlet output (such as Javascript
functions and variables). The
+ * namespacing ensures that the given name is uniquely associated with this portlet and
avoids name conflicts with other
+ * elements on the portal page or with other portlets on the page.
+ *
+ * @author <a href="mailto:sgwood@ix.netcom.com">Sherman Wood</a>
+ * @version $Revision: 5448 $
+ * @jsp.tag name="namespace" body-content="empty"
+ */
+public class NamespaceTag extends PortletTag
+{
+
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 4865294291730910307L;
+
+ public int doStartTag() throws JspException
+ {
+ return SKIP_BODY;
+ }
+
+ public int doEndTag() throws JspException
+ {
+ try
+ {
+ RenderResponse resp = getResponse();
+ String namespace = resp.getNamespace();
+ pageContext.getOut().print(namespace);
+ }
+ catch (IOException e)
+ {
+ }
+ return EVAL_PAGE;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/taglib/NamespaceTag.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/taglib/PortletTag.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/taglib/PortletTag.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/taglib/PortletTag.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,84 @@
+/******************************************************************************
+ * 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.jsr168.taglib;
+
+import org.jboss.portal.portlet.aspects.portlet.ContextDispatcherInterceptor;
+import org.jboss.portal.portlet.invocation.PortletInvocation;
+
+import javax.portlet.PortletConfig;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.servlet.ServletRequest;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.jsp.tagext.TagSupport;
+
+/**
+ * Superclass of the portlet tags for the JSR 168 Portlet specification.
+ * <p/>
+ * Provides hooks into the portlet environment
+ *
+ * @author <a href="mailto:sgwood@ix.netcom.com">Sherman Wood</a>
+ * @version $Revision: 5448 $
+ */
+public class PortletTag extends TagSupport
+{
+
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 8522925340258546845L;
+
+ protected HttpServletRequest getDispatchedRequest()
+ {
+ PortletInvocation invocation = getInvocation();
+ return invocation.getDispatchedRequest();
+ }
+
+ protected RenderRequest getRequest()
+ {
+ HttpServletRequest dreq = getDispatchedRequest();
+ return (RenderRequest)dreq.getAttribute("javax.portlet.request");
+ }
+
+ protected RenderResponse getResponse()
+ {
+ HttpServletRequest dreq = getDispatchedRequest();
+ return (RenderResponse)dreq.getAttribute("javax.portlet.response");
+ }
+
+ protected PortletConfig getConfig()
+ {
+ HttpServletRequest dreq = getDispatchedRequest();
+ return (PortletConfig)dreq.getAttribute("javax.portlet.config");
+ }
+
+ /**
+ * Set up the environment for accessing the portlat environment
+ *
+ * @return The invocation that called the superclasses of this tag
+ */
+ protected PortletInvocation getInvocation()
+ {
+ // Get the invocation
+ ServletRequest req = pageContext.getRequest();
+ return
(PortletInvocation)req.getAttribute(ContextDispatcherInterceptor.REQ_ATT_COMPONENT_INVOCATION);
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/taglib/PortletTag.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/taglib/RenderURLTag.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/taglib/RenderURLTag.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/taglib/RenderURLTag.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -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.impl.jsr168.taglib;
+
+/**
+ * The renderURL tag for the JSR 168 Portlet specification.
+ * <p/>
+ * Creates a URL that must point to the current portlet and must trigger an render
request with the supplied
+ * parameters.
+ *
+ * @author <a href="mailto:sgwood@ix.netcom.com">Sherman Wood</a>
+ * @version $Revision: 5448 $
+ * @jsp.tag name="renderURL" body-content="JSP"
tei-class="org.jboss.portal.portlet.impl.jsr168.taglib.GenerateURLTagTEI"
+ */
+public class RenderURLTag extends GenerateURLTag
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = -4138261559430217557L;
+ public static String typeParameter = "render";
+
+ /* (non-Javadoc)
+ * @see org.jboss.portal.portlet.taglib.GenerateURLTag#addTypeParameter()
+ */
+ protected String getTypeValue()
+ {
+ return typeParameter;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/taglib/RenderURLTag.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/taglib/URLParameterTag.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/taglib/URLParameterTag.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/taglib/URLParameterTag.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,155 @@
+/******************************************************************************
+ * 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.jsr168.taglib;
+
+import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.tagext.TagSupport;
+
+/**
+ * The additional parameters definitions for the actionURL and renderURL tags for the JSR
168 Portlet specification.
+ *
+ * @author <a href="mailto:sgwood@ix.netcom.com">Sherman Wood</a>
+ * @version $Revision: 5448 $
+ * @jsp.tag name="param" body-content="empty"
+ */
+public class URLParameterTag extends TagSupport
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 143146800706348087L;
+ private String name;
+ private String value;
+
+ /**
+ * The name of the parameter to add to the URL.
+ * <p/>
+ * If null or empty, no action is performed.
+ *
+ * @return Returns the name.
+ * @jsp.attribute required="true" rtexprvalue="true"
+ */
+ public String getName()
+ {
+ return name;
+ }
+
+ /** @param name The name to set. */
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+ /**
+ * The value of the parameter to add to the URL.
+ * <p/>
+ * If null, it is processed as an empty value.
+ *
+ * @return Returns the value.
+ * @jsp.attribute required="true" rtexprvalue="true"
+ */
+ public String getValue()
+ {
+ return value;
+ }
+
+ /** @param value The value to set. */
+ public void setValue(String value)
+ {
+ this.value = value;
+ }
+
+ /**
+ * No body to process
+ *
+ * @see javax.servlet.jsp.tagext.Tag#doStartTag()
+ */
+ public int doStartTag() throws JspException
+ {
+ return SKIP_BODY;
+ }
+
+ /**
+ * Include the parameter in the surround tag parameters
+ *
+ * @see javax.servlet.jsp.tagext.Tag#doEndTag()
+ */
+ public int doEndTag() throws JspException
+ {
+ try
+ {
+ GenerateURLTag ancestorTag =
+ (GenerateURLTag)findAncestorWithClass(this, GenerateURLTag.class);
+
+ Parameter p = new Parameter(getName(), getValue());
+
+ if (p.isValid())
+ {
+ ancestorTag.addParameter(p.getName(), p.getValue());
+ }
+ else
+ {
+ // Should throw a JspException?
+ // Not according to the JSR 168 spec. Ignore it
+ }
+
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ throw new JspException(e);
+ }
+ return EVAL_PAGE;
+ }
+
+ public class Parameter
+ {
+ private String name;
+ private String value;
+
+ /** @return Returns the name. */
+ public String getName()
+ {
+ return name;
+ }
+
+ /**
+ * Per JSR 168 spec, if null, return an empty value
+ *
+ * @return Returns the value.
+ */
+ public String getValue()
+ {
+ return value;
+ }
+
+ public Parameter(String name, String value)
+ {
+ this.name = name;
+ this.value = value;
+ }
+
+ public boolean isValid()
+ {
+ return name != null && name.length() > 0;
+ }
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/taglib/URLParameterTag.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/spi/AbstractActionContext.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/spi/AbstractActionContext.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/spi/AbstractActionContext.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,97 @@
+/******************************************************************************
+ * 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.spi;
+
+import org.jboss.portal.portlet.spi.ActionContext;
+import org.jboss.portal.portlet.StateString;
+import org.jboss.portal.portlet.PortletParameters;
+import org.jboss.portal.Mode;
+import org.jboss.portal.WindowState;
+import org.jboss.portal.common.util.MarkupInfo;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public abstract class AbstractActionContext extends AbstractPortletInvocationContext
implements ActionContext
+{
+
+ /** . */
+ protected StateString interactionState;
+
+ /** . */
+ protected PortletParameters form;
+
+
+ protected AbstractActionContext(
+ Mode mode,
+ WindowState windowState,
+ StateString navigationalState,
+ MarkupInfo markupInfo,
+ StateString interactionState,
+ PortletParameters form)
+ {
+ super(mode, windowState, navigationalState, markupInfo);
+ this.interactionState = interactionState;
+ this.form = form;
+ }
+
+ public String getCharacterEncoding()
+ {
+ return getClientRequest().getCharacterEncoding();
+ }
+
+ public BufferedReader getReader() throws IOException
+ {
+ return getClientRequest().getReader();
+ }
+
+ public InputStream getInputStream() throws IOException
+ {
+ return getClientRequest().getInputStream();
+ }
+
+ public int getContentLength()
+ {
+ return getClientRequest().getContentLength();
+ }
+
+ public String getContentType()
+ {
+ return getClientRequest().getContentType();
+ }
+
+ public StateString getInteractionState()
+ {
+ return interactionState;
+ }
+
+ public PortletParameters getForm()
+ {
+ return form;
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/spi/AbstractPortletInvocationContext.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/spi/AbstractPortletInvocationContext.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/spi/AbstractPortletInvocationContext.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,113 @@
+/******************************************************************************
+ * 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.spi;
+
+import org.jboss.portal.common.invocation.AbstractInvocationContext;
+import org.jboss.portal.common.net.URLTools;
+import org.jboss.portal.common.util.MarkupInfo;
+import org.jboss.portal.portlet.spi.PortletInvocationContext;
+import org.jboss.portal.portlet.StateString;
+import org.jboss.portal.Mode;
+import org.jboss.portal.WindowState;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * An abstract implementation that relies on the a request and response provided by the
client (i.e the portal).
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5064 $
+ */
+public abstract class AbstractPortletInvocationContext extends AbstractInvocationContext
implements PortletInvocationContext
+{
+
+ /** . */
+ protected MarkupInfo markupInfo;
+
+ /** . */
+ protected Mode mode;
+
+ /** . */
+ protected WindowState windowState;
+
+ /** . */
+ protected StateString navigationalState;
+
+ protected AbstractPortletInvocationContext(Mode mode, WindowState windowState,
StateString navigationalState, MarkupInfo markupInfo)
+ {
+ this.mode = mode;
+ this.windowState = windowState;
+ this.navigationalState = navigationalState;
+ this.markupInfo = markupInfo;
+ }
+
+ /**
+ * Return the client request.
+ *
+ * @return the client request
+ * @throws IllegalStateException if the client response is not available
+ */
+ public abstract HttpServletRequest getClientRequest() throws IllegalStateException;
+
+ /**
+ * Return the client response.
+ *
+ * @return the client response
+ * @throws IllegalStateException if the client response is not available
+ */
+ public abstract HttpServletResponse getClientResponse() throws IllegalStateException;
+
+ /**
+ * Validate the url and then delegate the encoding of the url to the client response.
+ *
+ * @return the encoded url
+ */
+ public String encodeResourceURL(String url) throws IllegalArgumentException
+ {
+ URLTools.enforceAbsoluteURL(url);
+
+ //
+ return getClientResponse().encodeURL(url);
+ }
+
+ public Mode getMode()
+ {
+ return mode;
+ }
+
+ public WindowState getWindowState()
+ {
+ return windowState;
+ }
+
+ public StateString getNavigationalState()
+ {
+ return navigationalState;
+ }
+
+ public MarkupInfo getMarkupInfo()
+ {
+ return markupInfo;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/spi/AbstractPortletInvocationContext.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/spi/AbstractRenderContext.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/spi/AbstractRenderContext.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/spi/AbstractRenderContext.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -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.portlet.impl.spi;
+
+import org.jboss.portal.portlet.spi.RenderContext;
+import org.jboss.portal.portlet.StateString;
+import org.jboss.portal.Mode;
+import org.jboss.portal.WindowState;
+import org.jboss.portal.common.util.ContentInfo;
+import org.jboss.portal.common.util.MarkupInfo;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public abstract class AbstractRenderContext extends AbstractPortletInvocationContext
implements RenderContext
+{
+ protected AbstractRenderContext(
+ Mode mode,
+ WindowState windowState,
+ StateString navigationalState,
+ MarkupInfo markupInfo)
+ {
+ super(mode, windowState, navigationalState, markupInfo);
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/spi/AbstractRequestContext.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/spi/AbstractRequestContext.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/spi/AbstractRequestContext.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,83 @@
+/******************************************************************************
+ * 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.spi;
+
+import org.jboss.portal.portlet.spi.RequestContext;
+import org.jboss.portal.web.spi.ServletContainerContext;
+import org.jboss.portal.web.RequestDispatchCallback;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.ServletContext;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 6929 $
+ */
+public class AbstractRequestContext implements RequestContext
+{
+
+ /** . */
+ private HttpServletRequest req;
+
+ /** . */
+ private HttpServletResponse resp;
+
+ /** . */
+ private String scheme;
+
+ /** . */
+ private String serverName;
+
+ /** . */
+ private int serverPort;
+
+ public AbstractRequestContext(HttpServletRequest req, HttpServletResponse resp)
+ {
+ this.req = req;
+ this.resp = resp;
+ this.scheme = req.getScheme();
+ this.serverName = req.getServerName();
+ this.serverPort = req.getServerPort();
+ }
+
+ public String getScheme()
+ {
+ return scheme;
+ }
+
+ public String getServerName()
+ {
+ return serverName;
+ }
+
+ public int getServerPort()
+ {
+ return serverPort;
+ }
+
+ public Object dispatch(ServletContainerContext scc, ServletContext targetCtx,
RequestDispatchCallback callback, Object handback) throws Exception
+ {
+ return scc.include(targetCtx, req, resp, callback, handback);
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/spi/AbstractRequestContext.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/spi/AbstractSecurityContext.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/spi/AbstractSecurityContext.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/spi/AbstractSecurityContext.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -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.impl.spi;
+
+import org.jboss.portal.portlet.spi.SecurityContext;
+
+import javax.servlet.http.HttpServletRequest;
+import java.security.Principal;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public class AbstractSecurityContext implements SecurityContext
+{
+
+ private HttpServletRequest req;
+
+ public AbstractSecurityContext(HttpServletRequest req)
+ {
+ this.req = req;
+ }
+
+ public boolean isSecure()
+ {
+ return req.isSecure();
+ }
+
+ public String getAuthType()
+ {
+ return req.getAuthType();
+ }
+
+ public String getRemoteUser()
+ {
+ return req.getRemoteUser();
+ }
+
+ public Principal getUserPrincipal()
+ {
+ return req.getUserPrincipal();
+ }
+
+ public boolean isUserInRole(String roleName)
+ {
+ return req.isUserInRole(roleName);
+ }
+
+ public boolean isAuthenticated()
+ {
+ return req.getUserPrincipal() != null;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/spi/AbstractSecurityContext.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/state/StateConverterV0.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/state/StateConverterV0.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/state/StateConverterV0.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,155 @@
+/******************************************************************************
+ * 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.state;
+
+import org.jboss.portal.common.value.StringValue;
+import org.jboss.portal.portlet.state.PropertyMap;
+import org.jboss.portal.portlet.state.SimplePropertyMap;
+import org.jboss.portal.portlet.state.StateConversionException;
+import org.jboss.portal.portlet.state.StateConverter;
+import org.jboss.portal.portlet.state.producer.PortletState;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.DataInputStream;
+import java.io.DataOutputStream;
+import java.io.IOException;
+import java.util.Iterator;
+import java.util.Map;
+
+/**
+ * <p>An implementation that relies on the <code>DataInputStream</code>
and <code>DataOutputStream</code> to marshall
+ * and unmarshall the producer state. The marshalled value starts with a magic value and
a version id to ensure future
+ * backward compatibility.</p>
+ * <p/>
+ * <p>It is an important matter because a migrated producer will probably have to
take care of consumers that hold a
+ * previous version of the producer state.</p>
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class StateConverterV0 implements StateConverter
+{
+
+ /** . */
+ private static final int MAGIC_VALUE = 0xBE57A515;
+
+ /** . */
+ private static final byte VERSION_ID = 0;
+
+ public byte[] marshall(PortletState state) throws StateConversionException
+ {
+ if (state == null)
+ {
+ throw new IllegalArgumentException("No null state");
+ }
+ try
+ {
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ DataOutputStream dos = new DataOutputStream(baos);
+
+ //
+ dos.writeInt(MAGIC_VALUE);
+ dos.write(VERSION_ID);
+ dos.writeUTF(state.getPortletId());
+ PropertyMap map = state.getProperties();
+ dos.writeInt(map.size());
+ for (Iterator i = map.entrySet().iterator(); i.hasNext();)
+ {
+ Map.Entry entry = (Map.Entry)i.next();
+ String key = (String)entry.getKey();
+ StringValue value = (StringValue)entry.getValue();
+ String[] strings = (String[])value.asObjectArray();
+ dos.writeUTF(key);
+ dos.writeInt(strings.length);
+ for (int j = 0; j < strings.length; j++)
+ {
+ String string = strings[j];
+ if (string == null)
+ {
+ dos.writeBoolean(true);
+ }
+ else
+ {
+ dos.writeBoolean(false);
+ dos.writeUTF(string);
+ }
+ }
+ }
+ dos.close();
+ return baos.toByteArray();
+ }
+ catch (IOException e)
+ {
+ throw new StateConversionException(e);
+ }
+ }
+
+ public PortletState unmarshall(byte[] marshalledState) throws
StateConversionException
+ {
+ if (marshalledState == null)
+ {
+ throw new IllegalArgumentException("No null bytes");
+ }
+ try
+ {
+ ByteArrayInputStream bais = new ByteArrayInputStream(marshalledState);
+ DataInputStream dis = new DataInputStream(bais);
+ int magicValue = dis.readInt();
+ if (magicValue != MAGIC_VALUE)
+ {
+ throw new StateConversionException("Bad magic value " +
Integer.toHexString(magicValue));
+ }
+ byte versionId = dis.readByte();
+ if (versionId > 0)
+ {
+ throw new StateConversionException("Bad version id " + versionId);
+ }
+ String portletId = dis.readUTF();
+ int size = dis.readInt();
+ PropertyMap properties = new SimplePropertyMap(size);
+ while (size-- > 0)
+ {
+ String key = dis.readUTF();
+ int length = dis.readInt();
+ String[] strings = new String[length];
+ for (int i = 0; i < strings.length; i++)
+ {
+ boolean isNull = dis.readBoolean();
+ if (isNull == false)
+ {
+ String string = dis.readUTF();
+ strings[i] = string;
+ }
+ }
+ StringValue value = new StringValue(strings);
+ properties.setProperty(key, value);
+ }
+ return new PortletState(portletId, properties);
+ }
+ catch (IOException e)
+ {
+ throw new StateConversionException(e);
+ }
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/state/StateManagementPolicyService.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/state/StateManagementPolicyService.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/state/StateManagementPolicyService.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,51 @@
+/******************************************************************************
+ * 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.state;
+
+import org.jboss.portal.portlet.state.StateManagementPolicy;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class StateManagementPolicyService implements StateManagementPolicy
+{
+
+ /** . */
+ private boolean persistLocally;
+
+ public boolean getPersistLocally()
+ {
+ return persistLocally;
+ }
+
+ public void setPersistLocally(boolean persistLocally)
+ {
+ this.persistLocally = persistLocally;
+ }
+
+ public boolean persistLocally()
+ {
+ return persistLocally;
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/state/consumer/ConsumerPersistenceManagerService.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/state/consumer/ConsumerPersistenceManagerService.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/state/consumer/ConsumerPersistenceManagerService.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,111 @@
+/******************************************************************************
+ * 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.state.consumer;
+
+import org.jboss.portal.portlet.state.InvalidStateIdException;
+import org.jboss.portal.portlet.state.NoSuchStateException;
+import org.jboss.portal.portlet.state.consumer.ConsumerPersistenceManager;
+import org.jboss.portal.portlet.state.consumer.ConsumerState;
+import org.jboss.portal.portlet.state.consumer.ConsumerStateContext;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class ConsumerPersistenceManagerService implements ConsumerPersistenceManager
+{
+
+ /** . */
+ private Map store = new HashMap();
+
+ /** . */
+ private int counter = 0;
+
+ public synchronized ConsumerStateContext loadState(String stateId) throws
IllegalArgumentException, NoSuchStateException, InvalidStateIdException
+ {
+ checkId(stateId);
+ ConsumerStateContext state = (ConsumerStateContext)store.get(stateId);
+ if (state == null)
+ {
+ throw new NoSuchStateException(stateId);
+ }
+ return state;
+ }
+
+ public synchronized String createState(ConsumerState state) throws
IllegalArgumentException
+ {
+ if (state == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ ConsumerStateContext ctx = new ConsumerStateContext(Integer.toString(counter++),
state.getPortletId(), state.getBytes());
+ store.put(ctx.getId(), ctx);
+ return ctx.getId();
+ }
+
+ public synchronized void updateState(String stateId, ConsumerState state) throws
IllegalArgumentException, NoSuchStateException, InvalidStateIdException
+ {
+ checkId(stateId);
+ if (state == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ if (store.put(stateId, new ConsumerStateContext(stateId, state.getPortletId(),
state.getBytes())) == null)
+ {
+ throw new NoSuchStateException(stateId);
+ }
+ }
+
+ public synchronized void destroyState(String stateId) throws IllegalArgumentException,
NoSuchStateException, InvalidStateIdException
+ {
+ checkId(stateId);
+ if (store.remove(stateId) == null)
+ {
+ throw new NoSuchStateException(stateId);
+ }
+ }
+
+ public synchronized int getSize()
+ {
+ return store.size();
+ }
+
+ private void checkId(String stateId) throws IllegalArgumentException,
InvalidStateIdException
+ {
+ if (stateId == null)
+ {
+ throw new IllegalArgumentException("No null state id accepted");
+ }
+ try
+ {
+ Integer.parseInt(stateId);
+ }
+ catch (NumberFormatException e)
+ {
+ throw new InvalidStateIdException(e, stateId);
+ }
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/state/producer/PortletStateContextImpl.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/state/producer/PortletStateContextImpl.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/state/producer/PortletStateContextImpl.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -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.portlet.impl.state.producer;
+
+import org.jboss.portal.portlet.state.producer.PortletStateContext;
+import org.jboss.portal.portlet.state.producer.PortletState;
+import org.jboss.portal.portlet.state.PropertyMap;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class PortletStateContextImpl implements PortletStateContext
+{
+
+ /** . */
+ private final String id;
+
+ /** . */
+ private PortletState state;
+
+ public PortletStateContextImpl(String id, String portletId, PropertyMap propertyMap)
+ {
+ this.id = id;
+ this.state = new PortletState(portletId, propertyMap);
+ }
+
+ public String getId()
+ {
+ return id;
+ }
+
+ public PortletState getState()
+ {
+ return state;
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/state/producer/PortletStatePersistenceManagerService.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/state/producer/PortletStatePersistenceManagerService.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/state/producer/PortletStatePersistenceManagerService.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,146 @@
+/******************************************************************************
+ * 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.state.producer;
+
+import org.jboss.portal.portlet.state.InvalidStateIdException;
+import org.jboss.portal.portlet.state.NoSuchStateException;
+import org.jboss.portal.portlet.state.PropertyMap;
+import org.jboss.portal.portlet.state.SimplePropertyMap;
+import org.jboss.portal.portlet.state.producer.PortletStatePersistenceManager;
+import org.jboss.portal.portlet.state.producer.PortletStateContext;
+import org.jboss.portal.portlet.state.producer.PortletState;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * An in memory implementation of the producer state persistence manager.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 7215 $
+ */
+public class PortletStatePersistenceManagerService implements
PortletStatePersistenceManager
+{
+
+ /** . */
+ private Map store = new HashMap();
+
+ /** . */
+ private int counter = 0;
+
+ public synchronized PortletStateContext loadState(String stateId) throws
IllegalArgumentException, NoSuchStateException, InvalidStateIdException
+ {
+ if (stateId == null)
+ {
+ throw new IllegalArgumentException("No null state id accepted");
+ }
+ try
+ {
+ Integer.parseInt(stateId);
+ }
+ catch (NumberFormatException e)
+ {
+ throw new InvalidStateIdException(e, stateId);
+ }
+ PortletStateContext context = (PortletStateContext)store.get(stateId);
+ if (context == null)
+ {
+ throw new NoSuchStateException(stateId);
+ }
+ return context;
+ }
+
+ private synchronized PortletState getState(String stateId) throws
NoSuchStateException, InvalidStateIdException
+ {
+ PortletStateContext context = loadState(stateId);
+ return context.getState();
+ }
+
+ public synchronized String createState(String portletId, PropertyMap propertyMap)
+ {
+ if (portletId == null)
+ {
+ throw new IllegalArgumentException("No null portlet id accepted");
+ }
+ if (propertyMap == null)
+ {
+ throw new IllegalArgumentException("No null value map accepted");
+ }
+ String id = Integer.toString(counter++);
+ PortletStateContext state = new PortletStateContextImpl(id, portletId, new
SimplePropertyMap(propertyMap));
+ store.put(id, state);
+ return id;
+ }
+
+ public synchronized String cloneState(String stateId, PropertyMap propertyMap) throws
NoSuchStateException, InvalidStateIdException
+ {
+ if (propertyMap == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ PortletState stateContext = getState(stateId);
+ return createState(stateContext.getPortletId(), propertyMap);
+ }
+
+ public String cloneState(String stateId) throws IllegalArgumentException,
NoSuchStateException, InvalidStateIdException
+ {
+ PortletState state = getState(stateId);
+ return createState(state.getPortletId(), new
SimplePropertyMap(state.getProperties()));
+ }
+
+ public synchronized void updateState(String stateId, PropertyMap propertyMap) throws
NoSuchStateException, InvalidStateIdException
+ {
+ if (propertyMap == null)
+ {
+ throw new IllegalArgumentException("No null value map");
+ }
+ PortletState ctx = getState(stateId);
+ ctx.getProperties().clear();
+ ctx.getProperties().putAll(propertyMap);
+ }
+
+ public synchronized void destroyState(String stateId) throws InvalidStateIdException,
NoSuchStateException
+ {
+ if (stateId == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ try
+ {
+ Integer.parseInt(stateId);
+ }
+ catch (NumberFormatException e)
+ {
+ throw new InvalidStateIdException(e, stateId);
+ }
+ if (store.remove(stateId) == null)
+ {
+ throw new NoSuchStateException(stateId);
+ }
+ }
+
+ public synchronized int getSize()
+ {
+ return store.size();
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/impl/state/producer/PortletStatePersistenceManagerService.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/info/CacheInfo.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/info/CacheInfo.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/info/CacheInfo.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,34 @@
+/******************************************************************************
+ * 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.info;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public interface CacheInfo
+{
+
+ /** The expiration in seconds. */
+ int getExpirationSecs();
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/info/CacheInfo.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/info/CapabilitiesInfo.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/info/CapabilitiesInfo.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/info/CapabilitiesInfo.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,84 @@
+/******************************************************************************
+ * 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.info;
+
+import java.util.Set;
+
+/**
+ * Gathers capability information (portlet modes, window states, supported MIME types and
locales) regarding a portlet.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ * @since 2.4
+ */
+public interface CapabilitiesInfo
+{
+ /**
+ * Retrieves all the MIME types supported by the associated Portlet.
+ *
+ * @return a Set of String representation of supported MIME types
+ */
+ Set getMimeTypes();
+
+ /**
+ * Retrieves all the portlet modes supported by the associated Portlet.
+ *
+ * @return a Set of {@link ModeInfo} reprensenting the supported portlet modes
+ */
+ Set getAllModes();
+
+ /**
+ * Retrieves the portlet modes supported by the associated Portlet for the specified
MIME type.
+ *
+ * @return a Set of {@link ModeInfo} reprensenting the supported portlet modes for the
specified MIME type
+ */
+ Set getModes(String mimeType);
+
+ /**
+ * Retrieves all the window states supported by the associated Portlet.
+ *
+ * @return a Set of {@link WindowStateInfo} reprensenting the supported window states
+ */
+ Set getAllWindowStates();
+
+ /**
+ * Retrieves the window states supported by the associated Portlet for the specified
MIME type.
+ *
+ * @return a Set of {@link ModeInfo} reprensenting the supported window states for the
specified MIME type
+ */
+ Set getWindowStates(String mimeType);
+
+ /**
+ * Retrieves all the locales supported by the associated Portlet.
+ *
+ * @return the Set of supported {@link java.util.Locale}s
+ */
+ Set getAllLocales();
+
+ /**
+ * Retrieves the locales supported by the associated Portlet for the specified MIME
type.
+ *
+ * @return a Set of supported {@link java.util.Locale}s for the specified MIME type
+ */
+ Set getLocales(String mimeType);
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/info/CapabilitiesInfo.java
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/info/MetaInfo.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/info/MetaInfo.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/info/MetaInfo.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,58 @@
+/******************************************************************************
+ * 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.info;
+
+import org.jboss.portal.common.i18n.LocalizedString;
+
+/**
+ * Portlet metadata (display-name, title, short title, keywords).
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 6818 $
+ * @since 2.4
+ */
+public interface MetaInfo
+{
+
+ /** Key for display name. */
+ String DISPLAY_NAME = "display-name";
+
+ /** Key for title. */
+ String TITLE = "title";
+
+ /** Key for short title. */
+ String SHORT_TITLE = "short-title";
+
+ /** Key for locale specific keywords associated with this portlet. The keywords are
separated by commas. */
+ String KEYWORDS = "keywords";
+
+ /** Key for description. */
+ String DESCRIPTION = "description";
+
+ /**
+ * Return the meta value of the portlet for a specific key.
+ *
+ * @return an internationalized value
+ */
+ LocalizedString getMetaValue(String key);
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/info/MetaInfo.java
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/info/ModeInfo.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/info/ModeInfo.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/info/ModeInfo.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,47 @@
+/******************************************************************************
+ * 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.info;
+
+import org.jboss.portal.Mode;
+import org.jboss.portal.common.i18n.LocalizedString;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 6818 $
+ * @since 2.4
+ */
+public interface ModeInfo
+{
+ /** The mode description. */
+ LocalizedString getDescription();
+
+ /** The mode value. */
+ Mode getMode();
+
+ /**
+ * Retrieves the associated Mode name.
+ *
+ * @return the associated Mode name.
+ */
+ String getModeName();
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/info/ModeInfo.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/info/PortletInfo.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/info/PortletInfo.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/info/PortletInfo.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,88 @@
+/******************************************************************************
+ * 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.info;
+
+/**
+ * Runtime meta data for a portlet.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ * @since 2.4
+ */
+public interface PortletInfo
+{
+ /**
+ * Retrieves the capabilities of supported by the described portlet.
+ *
+ * @return the capabilities of the portlet
+ */
+ CapabilitiesInfo getCapabilities();
+
+ /**
+ * Retrieves information about the preferences supported by the described portlet, it
must return null if the portlet
+ * cannot be personalized.
+ *
+ * @return the preferences meta data of the portlet
+ */
+ PreferencesInfo getPreferences();
+
+ /**
+ * Retrieves the portlet description (title, keywords, etc).
+ *
+ * @return the portlet description
+ */
+ MetaInfo getMeta();
+
+ /**
+ * Retrieves the security information for the described portlet.
+ *
+ * @return the security information
+ */
+ SecurityInfo getSecurity();
+
+ /**
+ * Retrieves caching-related information for the described portlet.
+ *
+ * @return the caching related information
+ */
+ CacheInfo getCache();
+
+ /**
+ * Retrieves session-related information for the described portlet. If no information
is available then it returns
+ * the null value.
+ *
+ * @return the session related information
+ */
+ SessionInfo getSession();
+
+ /**
+ * Determines whether the described portlet can be accessed remotely (such as via
WSRP) or not. Clients of this
+ * method should be prepare to handle a <code>null</code> return value
expressing the fact that the remotable status
+ * hasn't been explicitely set.
+ *
+ * @return <code>Boolean.TRUE</code> if the described portlet can be
accessed remotely, <code>Boolean.FALSE</code> if
+ * the described portlet cannot be accessed remotely,
<code>null</code> if the value hasn't been specified
+ * explicitely for the associated portlet.
+ */
+ Boolean isRemotable();
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/info/PortletInfo.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/info/PreferenceInfo.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/info/PreferenceInfo.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/info/PreferenceInfo.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,72 @@
+/******************************************************************************
+ * 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.info;
+
+import org.jboss.portal.common.i18n.LocalizedString;
+
+/**
+ * Describes a Portlet preference.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 6818 $
+ * @since 2.4
+ */
+public interface PreferenceInfo
+{
+ /**
+ * Retrieves the key associated to the described preference.
+ *
+ * @return the key associated to the described preference.
+ */
+ String getKey();
+
+ /**
+ * Retrieves the localized display name of the described preference.
+ *
+ * @return the localized display name of the described preference.
+ * @see LocalizedString
+ */
+ LocalizedString getDisplayName();
+
+ /**
+ * Retrieves the localized description of the described preference.
+ *
+ * @return the localized description of the described preference.
+ * @see LocalizedString
+ */
+ LocalizedString getDescription();
+
+ /**
+ * Return true if the preference is read-only, false otherwise or null if it cannot be
determined.
+ *
+ * @return <code>true</code> if the described preference is read-only,
<code>false</code> otherwise.
+ */
+ Boolean isReadOnly();
+
+ /**
+ * Return the default value or null if it cannot be determined.
+ *
+ * @return the default value
+ */
+// Value getDefaultValue();
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/info/PreferenceInfo.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/info/PreferencesInfo.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/info/PreferencesInfo.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/info/PreferencesInfo.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,44 @@
+/******************************************************************************
+ * 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.info;
+
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ * @since 2.4
+ */
+public interface PreferencesInfo
+{
+ /** Return the immutable set of keys. */
+ Set getKeys();
+
+ /**
+ * A preference specified by its key.
+ *
+ * @return the preference info or null if it does not exist
+ * @throws IllegalArgumentException if the key is null
+ */
+ PreferenceInfo getPreference(String key) throws IllegalArgumentException;
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/info/PreferencesInfo.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/info/SecurityInfo.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/info/SecurityInfo.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/info/SecurityInfo.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,44 @@
+/******************************************************************************
+ * 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.info;
+
+import org.jboss.portal.portlet.TransportGuarantee;
+
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public interface SecurityInfo
+{
+ /**
+ *
+ */
+ boolean containsTransportGuarantee(TransportGuarantee transportGuarantee);
+
+ /**
+ *
+ */
+ Set getTransportGuarantees();
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/info/SecurityInfo.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/info/SessionInfo.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/info/SessionInfo.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/info/SessionInfo.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -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.info;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public interface SessionInfo
+{
+ /**
+ *
+ */
+ Boolean getDistributed();
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/info/SessionInfo.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/info/WindowStateInfo.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/info/WindowStateInfo.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/info/WindowStateInfo.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,47 @@
+/******************************************************************************
+ * 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.info;
+
+import org.jboss.portal.WindowState;
+import org.jboss.portal.common.i18n.LocalizedString;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 6818 $
+ * @since 2.4
+ */
+public interface WindowStateInfo
+{
+ /** The window state description. */
+ LocalizedString getDescription();
+
+ /** The window state value. */
+ WindowState getWindowState();
+
+ /**
+ * Retrieves the associated window state name.
+ *
+ * @return the associated window state name.
+ */
+ String getWindowStateName();
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/info/WindowStateInfo.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/ActionInvocation.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/ActionInvocation.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/ActionInvocation.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -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.invocation;
+
+import org.jboss.portal.portlet.spi.ActionContext;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public class ActionInvocation extends PortletInvocation
+{
+ public ActionInvocation(ActionContext ctx)
+ {
+ super(ctx);
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/ActionInvocation.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/PortletInterceptor.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/PortletInterceptor.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/PortletInterceptor.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,42 @@
+/******************************************************************************
+ * 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.invocation;
+
+import org.jboss.portal.common.invocation.Invocation;
+import org.jboss.portal.common.invocation.InvocationException;
+import org.jboss.portal.common.invocation.Interceptor;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 6712 $
+ */
+public abstract class PortletInterceptor implements Interceptor
+{
+
+ public Object invoke(Invocation invocation) throws Exception, InvocationException
+ {
+ return invoke((PortletInvocation)invocation);
+ }
+
+ protected abstract Object invoke(PortletInvocation invocation) throws Exception,
InvocationException;
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/PortletInterceptor.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/PortletInvocation.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/PortletInvocation.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/PortletInvocation.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,239 @@
+/******************************************************************************
+ * 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.invocation;
+
+import org.jboss.portal.common.invocation.Invocation;
+import org.jboss.portal.common.invocation.InvocationContext;
+import org.jboss.portal.common.invocation.Scope;
+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.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.PortletContext;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 6765 $
+ * @since 2.4
+ */
+public abstract class PortletInvocation extends Invocation
+{
+
+ /** The portal principal scope. */
+ public static final Scope PRINCIPAL_SCOPE = Scope.PRINCIPAL_SCOPE;
+
+ /** The request scope. */
+ public static final Scope REQUEST_SCOPE = Scope.REQUEST_SCOPE;
+
+ /** The request scope. */
+ public static final Scope INVOCATION_SCOPE = Scope.INVOCATION_SCOPE;
+
+ /** The request properties . */
+ public static final Scope REQUEST_PROPERTIES_SCOPE = new
Scope("request_properties");
+
+ /** The response properties. */
+ public static final Scope RESPONSE_PROPERTIES_SCOPE = new
Scope("response_properties");
+
+ /** The target portlet. */
+ protected PortletContext target;
+
+ /** The portal context. */
+ protected PortalContext portalContext;
+
+ /** The request context. */
+ protected RequestContext requestContext;
+
+ /** The security context. */
+ protected SecurityContext securityContext;
+
+ /** The user context. */
+ protected UserContext userContext;
+
+ /** The instance context. */
+ protected InstanceContext instanceContext;
+
+ /** The window context. */
+ protected WindowContext windowContext;
+
+ /** The window states this portlet can accept. */
+ protected Set supportedWindowStates;
+
+ /** The modes this portlet can accept. */
+ protected Set supportedModes;
+
+ /** The dispatched request. */
+ protected HttpServletRequest dreq;
+
+ /** The dispatched response. */
+ protected HttpServletResponse dresp;
+
+ /** The invocation context. */
+ protected PortletInvocationContext ctx;
+
+ /**
+ * Create an invocation to a portlet.
+ *
+ * @param ctx the portlet invocation context
+ */
+ protected PortletInvocation(PortletInvocationContext ctx) throws
IllegalArgumentException
+ {
+ if (ctx == null)
+ {
+ throw new IllegalArgumentException();
+ }
+
+ //
+ this.ctx = ctx;
+ }
+
+ public InvocationContext getContext()
+ {
+ return ctx;
+ }
+
+ public PortletInvocationContext getPortletContext()
+ {
+ return ctx;
+ }
+
+ public PortletContext getTarget()
+ {
+ return target;
+ }
+
+ public void setTarget(PortletContext target)
+ {
+ this.target = target;
+ }
+
+ public Set getSupportedWindowStates()
+ {
+ return supportedWindowStates;
+ }
+
+ public void setSupportedWindowStates(Set supportedWindowStates)
+ {
+ this.supportedWindowStates = supportedWindowStates;
+ }
+
+ public Set getSupportedModes()
+ {
+ return supportedModes;
+ }
+
+ public void setSupportedModes(Set supportedModes)
+ {
+ this.supportedModes = supportedModes;
+ }
+
+ /** Return the dispatched http servlet request. */
+ public HttpServletResponse getDispatchedResponse()
+ {
+ return dresp;
+ }
+
+ /** Set the dispatched http servlet request. */
+ public void setDispatchedResponse(HttpServletResponse dresp)
+ {
+ this.dresp = dresp;
+ }
+
+ /** Return the dispatched http servlet request. */
+ public HttpServletRequest getDispatchedRequest()
+ {
+ return dreq;
+ }
+
+ /** Set the dispatched http servlet request. */
+ public void setDispatchedRequest(HttpServletRequest dreq)
+ {
+ this.dreq = dreq;
+ }
+
+ public PortalContext getPortalContext()
+ {
+ return portalContext;
+ }
+
+ public void setPortalContext(PortalContext portalContext)
+ {
+ this.portalContext = portalContext;
+ }
+
+ public RequestContext getRequestContext()
+ {
+ return requestContext;
+ }
+
+ public void setRequestContext(RequestContext requestContext)
+ {
+ this.requestContext = requestContext;
+ }
+
+ public SecurityContext getSecurityContext()
+ {
+ return securityContext;
+ }
+
+ public void setSecurityContext(SecurityContext securityContext)
+ {
+ this.securityContext = securityContext;
+ }
+
+ public UserContext getUserContext()
+ {
+ return userContext;
+ }
+
+ public void setUserContext(UserContext userContext)
+ {
+ this.userContext = userContext;
+ }
+
+ public InstanceContext getInstanceContext()
+ {
+ return instanceContext;
+ }
+
+ public void setInstanceContext(InstanceContext instanceContext)
+ {
+ this.instanceContext = instanceContext;
+ }
+
+ public WindowContext getWindowContext()
+ {
+ return windowContext;
+ }
+
+ public void setWindowContext(WindowContext windowContext)
+ {
+ this.windowContext = windowContext;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/PortletInvocation.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/RenderInvocation.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/RenderInvocation.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/RenderInvocation.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -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.invocation;
+
+import org.jboss.portal.portlet.spi.RenderContext;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public class RenderInvocation extends PortletInvocation
+{
+ public RenderInvocation(RenderContext ctx)
+ {
+ super(ctx);
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/RenderInvocation.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/ErrorResponse.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/ErrorResponse.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/ErrorResponse.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,116 @@
+/******************************************************************************
+ * 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.invocation.response;
+
+import org.jboss.portal.common.util.Exceptions;
+import org.apache.log4j.Logger;
+
+/**
+ * Application level error.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 7395 $
+ */
+public class ErrorResponse extends PortletInvocationResponse
+{
+ /** The logged throwable if any. */
+ private final Throwable cause;
+
+ /** There must be one error message. */
+ private final String message;
+
+ public ErrorResponse(Throwable cause)
+ {
+ if (cause == null)
+ {
+ throw new IllegalArgumentException("There must be a cause");
+ }
+ this.cause = cause;
+ this.message = cause.getMessage();
+ }
+
+ public ErrorResponse(String message)
+ {
+ if (message == null)
+ {
+ throw new IllegalArgumentException("Message cannot be null.");
+ }
+ this.message = message;
+ this.cause = null;
+ }
+
+ /** The throwable. Can be a null object. */
+ public Throwable getCause()
+ {
+ return cause;
+ }
+
+ /** The logged message. */
+ public String getMessage()
+ {
+ if (message == null)
+ {
+ return cause.getClass().getName();
+ }
+
+ return message;
+ }
+
+ /**
+ * Logs an error message to the specified logger, using either the message or this
ErrorResult's Throwable if
+ * available.
+ *
+ * @param log
+ * @param logMessage
+ */
+ public void logErrorTo(Logger log, String logMessage)
+ {
+ if (cause != null)
+ {
+ log.error(logMessage, cause);
+ }
+ else
+ {
+ log.error(logMessage + "\n" + message);
+ }
+ }
+
+ /**
+ * Provides an HTML description of the error, using either the message or the
encapsulated Throwable.
+ *
+ * @return
+ */
+ public String toHTML()
+ {
+ if (cause != null)
+ {
+ return Exceptions.toHTML(cause);
+ }
+ else
+ {
+ StringBuffer sb = new StringBuffer(255);
+
sb.append("<div><code>").append(message).append("</code></div>");
+ return sb.toString();
+ }
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/ErrorResponse.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/FragmentResponse.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/FragmentResponse.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/FragmentResponse.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,402 @@
+/******************************************************************************
+ * 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.invocation.response;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.io.Writer;
+
+/**
+ * Data produced.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5602 $
+ */
+public class FragmentResponse extends PortletInvocationResponse
+{
+
+ public static final int TYPE_EMPTY = 0;
+ public static final int TYPE_CHARS = 1;
+ public static final int TYPE_BYTES = 2;
+
+ /** Any content that should appear in the header. */
+ private String header;
+
+ /** The output as a bytes if any. */
+ private ClosableOutputStream bytes;
+
+ /** The output as chars if any. */
+ private ClosableWriter chars;
+
+ /** The writer that will produce the chars output if any. */
+ private PrintWriter writer;
+
+ /** The result content type if any. */
+ private String contentType;
+
+ /** The title if any. */
+ private String title;
+
+ /** Number of seconds this result remains valid, a value of -1 indicates that it never
expires. */
+ protected int expirationSecs;
+
+ public FragmentResponse()
+ {
+ this.header = null;
+ this.bytes = null;
+ this.chars = null;
+ this.writer = null;
+ this.contentType = null;
+ this.title = null;
+ this.expirationSecs = 0;
+ }
+
+ public String getHeader()
+ {
+ return header;
+ }
+
+ public void setHeader(String header)
+ {
+ this.header = header;
+ }
+
+ public int getType()
+ {
+ if (bytes == null)
+ {
+ if (chars == null)
+ {
+ return TYPE_EMPTY;
+ }
+ else
+ {
+ return TYPE_CHARS;
+ }
+ }
+ else
+ {
+ return TYPE_BYTES;
+ }
+ }
+
+ /**
+ * Return the bytes of the content held by the fragment.
+ *
+ * @return the bytes
+ * @throws IllegalArgumentException if the type is not bytes
+ */
+ public ByteArrayOutputStream getBytes() throws IllegalArgumentException
+ {
+ if (bytes == null)
+ {
+ throw new IllegalStateException("Bytes not used");
+ }
+ return (ByteArrayOutputStream)bytes.out;
+ }
+
+ /**
+ * Return the chars of the content held by the fragment.
+ *
+ * @return the chars
+ * @throws IllegalArgumentException if the type is not chars
+ */
+ public StringWriter getChars() throws IllegalArgumentException
+ {
+ if (chars == null)
+ {
+ throw new IllegalStateException("Chars not used");
+ }
+ return (StringWriter)chars.writer;
+ }
+
+ /**
+ * Return the fragment title.
+ *
+ * @return the title.
+ */
+ public String getTitle()
+ {
+ return title;
+ }
+
+ /**
+ * Set the fragment title.
+ *
+ * @param title the new title
+ */
+ public void setTitle(String title)
+ {
+ this.title = title;
+ }
+
+ /**
+ * Return the content type of the generated fragment.
+ *
+ * @return the content type
+ */
+ public String getContentType()
+ {
+ return contentType;
+ }
+
+ /**
+ * Set the fragment of the content type.
+ *
+ * @param contentType the content type
+ */
+ public void setContentType(String contentType)
+ {
+ this.contentType = contentType;
+ }
+
+ /** @throws IllegalStateException if the output stream is already used or if no
content type is defined */
+ public PrintWriter getWriter() throws IllegalStateException
+ {
+ if (bytes != null)
+ {
+ throw new IllegalStateException("The window output stream is already
used");
+ }
+ if (contentType == null)
+ {
+ throw new IllegalStateException("No content type defined");
+ }
+ if (chars == null)
+ {
+ chars = new ClosableWriter(new StringWriter());
+ writer = new PrintWriter(chars);
+ }
+ return writer;
+ }
+
+ /**
+ * @throws IOException
+ * @throws IllegalStateException if the window writer is already used or if no content
type is defined
+ */
+ public OutputStream getOutputStream() throws IOException, IllegalStateException
+ {
+ if (chars != null)
+ {
+ throw new IllegalStateException("The window writer is already used");
+ }
+ if (contentType == null)
+ {
+ throw new IllegalStateException("No content type defined");
+ }
+ if (bytes == null)
+ {
+ bytes = new ClosableOutputStream(new ByteArrayOutputStream());
+ }
+ return bytes;
+ }
+
+ public void resetBuffer()
+ {
+ if (bytes != null)
+ {
+ if (bytes.closed)
+ {
+ throw new IllegalStateException("Cannot reset a closed stream");
+ }
+ ((ByteArrayOutputStream)bytes.out).reset();
+ }
+ else if (chars != null)
+ {
+ if (chars.closed)
+ {
+ throw new IllegalStateException("Cannot reset a closed writer");
+ }
+ StringWriter sw = (StringWriter)chars.writer;
+ sw.flush();
+ sw.getBuffer().setLength(0);
+ }
+ }
+
+ public int getExpirationSecs()
+ {
+ return expirationSecs;
+ }
+
+ public void setExpirationSecs(int expirationSecs)
+ {
+ this.expirationSecs = expirationSecs;
+ }
+
+ private class ClosableOutputStream extends OutputStream
+ {
+
+ /** . */
+ boolean closed = false;
+
+ /** . */
+ final OutputStream out;
+
+ public ClosableOutputStream(OutputStream out)
+ {
+ this.out = out;
+ }
+
+
+ public void write(byte b[]) throws IOException
+ {
+ if (closed)
+ {
+ throw new IOException("Cannot write to a closed stream");
+ }
+
+ //
+ out.write(b);
+ }
+
+ public void write(byte b[], int off, int len) throws IOException
+ {
+ if (closed)
+ {
+ throw new IOException("Cannot write to a closed stream");
+ }
+
+ //
+ out.write(b);
+ }
+
+ public void write(int b) throws IOException
+ {
+ if (closed)
+ {
+ throw new IOException("Cannot write to a closed stream");
+ }
+
+ //
+ out.write(b);
+ }
+
+ public void flush() throws IOException
+ {
+ if (closed)
+ {
+ throw new IOException("Cannot flush a closed stream");
+ }
+
+ //
+ out.flush();
+ }
+
+ public void close() throws IOException
+ {
+ super.close();
+
+ //
+ closed = true;
+ }
+ }
+
+ /**
+ * Adds behavior to a writer that complies with JSR-168 notion of writer.
+ */
+ private class ClosableWriter extends Writer
+ {
+
+ /** . */
+ boolean closed = false;
+
+ /** . */
+ final Writer writer;
+
+ public ClosableWriter(Writer writer)
+ {
+ this.writer = writer;
+ }
+
+ public void write(int c) throws IOException
+ {
+ if (closed)
+ {
+ throw new IOException("Cannot write to a closed writer");
+ }
+
+ //
+ writer.write(c);
+ }
+
+
+ public void write(char cbuf[], int off, int len) throws IOException
+ {
+ if (closed)
+ {
+ throw new IOException("Cannot write to a closed writer");
+ }
+
+ //
+ writer.write(cbuf, off, len);
+ }
+
+
+ public void write(String str) throws IOException
+ {
+ if (closed)
+ {
+ throw new IOException("Cannot write to a closed writer");
+ }
+
+ //
+ writer.write(str);
+ }
+
+ public void flush() throws IOException
+ {
+ if (closed)
+ {
+ throw new IOException("Cannot flush closed writer");
+ }
+
+ //
+ writer.flush();
+ }
+
+ public void close() throws IOException
+ {
+ writer.close();
+
+ //
+ closed = true;
+ }
+ }
+
+ /**
+ * Return the content as a string.
+ */
+ public String getContent()
+ {
+ switch (getType())
+ {
+ case FragmentResponse.TYPE_CHARS:
+ return getChars().toString();
+ case FragmentResponse.TYPE_BYTES:
+ return getBytes().toString();
+ }
+ return "";
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/FragmentResponse.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/HTTPRedirectionResponse.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/HTTPRedirectionResponse.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/HTTPRedirectionResponse.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,45 @@
+/******************************************************************************
+ * 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.invocation.response;
+
+/**
+ * Redirection to an HTTP location.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public class HTTPRedirectionResponse extends RedirectionResponse
+{
+
+ protected String location;
+
+ public HTTPRedirectionResponse(String location)
+ {
+ this.location = location;
+ }
+
+ public String getLocation()
+ {
+ return location;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/HTTPRedirectionResponse.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/InsufficientPrivilegesResponse.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/InsufficientPrivilegesResponse.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/InsufficientPrivilegesResponse.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,31 @@
+/******************************************************************************
+ * 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.invocation.response;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5602 $
+ */
+public class InsufficientPrivilegesResponse extends SecurityResponse
+{
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/InsufficientPrivilegesResponse.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/InsufficientTransportGuaranteeResponse.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/InsufficientTransportGuaranteeResponse.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/InsufficientTransportGuaranteeResponse.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,31 @@
+/******************************************************************************
+ * 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.invocation.response;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5602 $
+ */
+public class InsufficientTransportGuaranteeResponse extends SecurityResponse
+{
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/InsufficientTransportGuaranteeResponse.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/PortletInvocationResponse.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/PortletInvocationResponse.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/PortletInvocationResponse.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,33 @@
+/******************************************************************************
+ * 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.invocation.response;
+
+/**
+ * The base interface for all result objects.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public class PortletInvocationResponse
+{
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/PortletInvocationResponse.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/RedirectionResponse.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/RedirectionResponse.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/RedirectionResponse.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,33 @@
+/******************************************************************************
+ * 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.invocation.response;
+
+/**
+ * Redirection to something.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public class RedirectionResponse extends PortletInvocationResponse
+{
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/RedirectionResponse.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/RenderResponse.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/RenderResponse.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/RenderResponse.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,83 @@
+/******************************************************************************
+ * 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.invocation.response;
+
+import org.jboss.portal.Mode;
+import org.jboss.portal.WindowState;
+import org.jboss.portal.portlet.StateString;
+
+/**
+ * Want to be rendered.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5477 $
+ */
+public class RenderResponse extends PortletInvocationResponse
+{
+
+ /** The navigational state returned. */
+ protected StateString state;
+
+ /** The new window state requested. */
+ protected WindowState windowState;
+
+ /** The new mode requested. */
+ protected Mode mode;
+
+ public RenderResponse()
+ {
+ state = null;
+ windowState = null;
+ mode = null;
+ }
+
+ public Mode getMode()
+ {
+ return mode;
+ }
+
+ public void setMode(Mode mode)
+ {
+ this.mode = mode;
+ }
+
+ public WindowState getWindowState()
+ {
+ return windowState;
+ }
+
+ public void setWindowState(WindowState windowState)
+ {
+ this.windowState = windowState;
+ }
+
+ public StateString getNavigationalState()
+ {
+ return state;
+ }
+
+ public void setNavigationalState(StateString state)
+ {
+ this.state = state;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/RenderResponse.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/SecurityErrorResponse.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/SecurityErrorResponse.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/SecurityErrorResponse.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -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.invocation.response;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5602 $
+ */
+public class SecurityErrorResponse extends SecurityResponse
+{
+
+ /** . */
+ private Throwable throwable;
+
+ public SecurityErrorResponse(Throwable throwable)
+ {
+ if (throwable == null)
+ {
+ throw new IllegalArgumentException("There must be a throwable");
+ }
+ this.throwable = throwable;
+ }
+
+ public Throwable getThrowable()
+ {
+ return throwable;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/SecurityErrorResponse.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/SecurityResponse.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/SecurityResponse.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/SecurityResponse.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,31 @@
+/******************************************************************************
+ * 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.invocation.response;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class SecurityResponse extends PortletInvocationResponse
+{
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/StreamResponse.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/StreamResponse.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/StreamResponse.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,60 @@
+/******************************************************************************
+ * 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.invocation.response;
+
+/**
+ * Stream a result to the client directly.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public class StreamResponse extends PortletInvocationResponse
+{
+
+ private String contentType;
+ private byte[] bytes;
+
+ public StreamResponse(String contentType, byte[] bytes)
+ {
+ if (contentType == null)
+ {
+ throw new IllegalArgumentException("Content type cannot be null");
+ }
+ if (bytes == null)
+ {
+ throw new IllegalArgumentException("Bytes cannot be null");
+ }
+ this.contentType = contentType;
+ this.bytes = bytes;
+ }
+
+ public String getContentType()
+ {
+ return contentType;
+ }
+
+ public byte[] getBytes()
+ {
+ return bytes;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/StreamResponse.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/UnavailableResponse.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/UnavailableResponse.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/UnavailableResponse.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,58 @@
+/******************************************************************************
+ * 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.invocation.response;
+
+/**
+ * Portlet exists but cannot be used.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public class UnavailableResponse extends PortletInvocationResponse
+{
+
+ private boolean permanent;
+ private int seconds;
+
+ public UnavailableResponse()
+ {
+ this.seconds = 0;
+ this.permanent = true;
+ }
+
+ public UnavailableResponse(int seconds)
+ {
+ this.seconds = seconds;
+ this.permanent = false;
+ }
+
+ public int getUnavailableSeconds()
+ {
+ return seconds;
+ }
+
+ public boolean isPermanent()
+ {
+ return permanent;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/UnavailableResponse.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/cache/SoftTimedContent.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/cache/SoftTimedContent.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/cache/SoftTimedContent.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,59 @@
+/******************************************************************************
+ * 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.invocation.response.cache;
+
+import org.jboss.portal.portlet.invocation.response.FragmentResponse;
+
+import java.lang.ref.WeakReference;
+
+/**
+ * Use soft reference.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision:5417 $
+ */
+public class SoftTimedContent extends TimedContent
+{
+
+ /** The serialVersionUID */
+ private static final long serialVersionUID = -8166044526732362286L;
+
+ /** The content. */
+ private transient WeakReference content;
+
+ /** @throws IllegalArgumentException if the content is null */
+ public SoftTimedContent(FragmentResponse content, long expirationTimeMillis) throws
IllegalArgumentException
+ {
+ super(expirationTimeMillis);
+ if (content == null)
+ {
+ throw new IllegalArgumentException("Content must not be null");
+ }
+ this.content = new WeakReference(content);
+ }
+
+ public FragmentResponse getContent()
+ {
+ return (FragmentResponse)content.get();
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/cache/SoftTimedContent.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/cache/StrongTimedContent.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/cache/StrongTimedContent.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/cache/StrongTimedContent.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,56 @@
+/******************************************************************************
+ * 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.invocation.response.cache;
+
+import org.jboss.portal.portlet.invocation.response.FragmentResponse;
+
+/**
+ * Use strong references.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public class StrongTimedContent extends TimedContent
+{
+
+ /** The serialVersionUID */
+ private static final long serialVersionUID = -8194245397756941208L;
+ /** The content. */
+ private transient FragmentResponse content;
+
+ /** @throws IllegalArgumentException if the content is null */
+ public StrongTimedContent(FragmentResponse content, long expirationTimeMillis) throws
IllegalArgumentException
+ {
+ super(expirationTimeMillis);
+ if (content == null)
+ {
+ throw new IllegalArgumentException("Content must not be null");
+ }
+ this.content = content;
+ }
+
+ public FragmentResponse getContent()
+ {
+ return content;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/cache/StrongTimedContent.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/cache/TimedContent.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/cache/TimedContent.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/cache/TimedContent.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,56 @@
+/******************************************************************************
+ * 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.invocation.response.cache;
+
+import org.jboss.portal.portlet.invocation.response.FragmentResponse;
+
+import java.io.Serializable;
+
+/**
+ * A fragment result + its expiration date.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public abstract class TimedContent implements Serializable
+{
+
+ /** Expiration date. */
+ private final long expirationTimeMillis;
+
+ public TimedContent(long expirationTimeMillis)
+ {
+ this.expirationTimeMillis = expirationTimeMillis;
+ }
+
+ /** Return the content, possibly null. */
+ public abstract FragmentResponse getContent();
+
+ /**
+ *
+ */
+ public long getExpirationTimeMillis()
+ {
+ return expirationTimeMillis;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/cache/TimedContent.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/management/LocalPortletManagement.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/management/LocalPortletManagement.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/management/LocalPortletManagement.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,88 @@
+/******************************************************************************
+ * 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.management;
+
+import org.jboss.portal.portlet.Portlet;
+import org.jboss.portal.portlet.container.PortletContainer;
+
+/**
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @version $Revision$
+ */
+public class LocalPortletManagement implements LocalPortletManagementMBean
+{
+ private Portlet portlet;
+
+ private PortletContainerManagementInterceptor interceptor;
+
+ public LocalPortletManagement(Portlet portlet, PortletContainerManagementInterceptor
interceptor)
+ {
+ this.portlet = portlet;
+ this.interceptor = interceptor;
+ }
+
+ public String getId()
+ {
+ return portlet.getContext().getId();
+ }
+
+ public float getAverageRenderTime()
+ {
+ return interceptor.getPortletInfo(getId()).getAverageRenderTime();
+ }
+
+ public float getAverageActionTime()
+ {
+ return interceptor.getPortletInfo(getId()).getAverageActionTime();
+ }
+
+ public long getMaxRenderTime()
+ {
+ return interceptor.getPortletInfo(getId()).getMaxRenderTime();
+ }
+
+ public long getMaxActionTime()
+ {
+ return interceptor.getPortletInfo(getId()).getMaxActionTime();
+ }
+
+ public long getRenderRequestCount()
+ {
+ return interceptor.getPortletInfo(getId()).getRenderRequestCount();
+ }
+
+ public long getActionRequestCount()
+ {
+ return interceptor.getPortletInfo(getId()).getActionRequestCount();
+ }
+
+ public long getActionErrorCount()
+ {
+ return interceptor.getPortletInfo(getId()).getActionErrorCount();
+ }
+
+ public long getRenderErrorCount()
+ {
+ return interceptor.getPortletInfo(getId()).getRenderErrorCount();
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/management/LocalPortletManagementMBean.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/management/LocalPortletManagementMBean.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/management/LocalPortletManagementMBean.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -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.portlet.management;
+
+/**
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @version $Revision$
+ */
+public interface LocalPortletManagementMBean
+{
+ public float getAverageRenderTime();
+
+ public float getAverageActionTime();
+
+ public long getMaxRenderTime();
+
+ public long getMaxActionTime();
+
+ public long getRenderRequestCount();
+
+ public long getActionRequestCount();
+
+ public long getActionErrorCount();
+
+ public long getRenderErrorCount();
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/management/PortletContainerManagementInterceptor.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/management/PortletContainerManagementInterceptor.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/management/PortletContainerManagementInterceptor.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,32 @@
+/******************************************************************************
+ * 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.management;
+
+/**
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @version $Revision$
+ */
+public interface PortletContainerManagementInterceptor
+{
+ public PortletInfo getPortletInfo(String portletName);
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/management/PortletContainerManagementInterceptorImpl.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/management/PortletContainerManagementInterceptorImpl.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/management/PortletContainerManagementInterceptorImpl.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,97 @@
+/******************************************************************************
+ * 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.management;
+
+import java.util.Map;
+
+import org.jboss.portal.common.invocation.InvocationException;
+import org.jboss.portal.portlet.PortletContext;
+import org.jboss.portal.portlet.invocation.ActionInvocation;
+import org.jboss.portal.portlet.invocation.PortletInterceptor;
+import org.jboss.portal.portlet.invocation.PortletInvocation;
+import org.jboss.portal.portlet.invocation.RenderInvocation;
+
+import EDU.oswego.cs.dl.util.concurrent.ConcurrentHashMap;
+
+/**
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @version $Revision$
+ */
+public class PortletContainerManagementInterceptorImpl extends PortletInterceptor
implements PortletContainerManagementInterceptor
+{
+
+ private Map map = new ConcurrentHashMap();
+
+
+ // Correctness is not insured.
+ protected Object invoke(PortletInvocation invocation) throws Exception,
InvocationException
+ {
+ PortletContext portlet = invocation.getTarget();
+ String portletName = portlet.getId();
+
+ boolean error = false;
+
+ long delta = - System.currentTimeMillis();
+ Object object;
+ try
+ {
+ object = invocation.invokeNext();
+ }
+ catch (InvocationException e)
+ {
+ error = true;
+ throw e;
+ }
+ catch (Exception e)
+ {
+ error = true;
+ throw e;
+ }
+
+ delta += System.currentTimeMillis();
+
+ if (invocation instanceof RenderInvocation)
+ {
+ PortletInfo info = getPortletInfo(portletName);
+ info.newRenderCall(delta, error);
+ }
+ else if (invocation instanceof ActionInvocation)
+ {
+ PortletInfo info = getPortletInfo(portletName);
+ info.newActionCall(delta, error);
+ }
+ return object;
+ }
+
+ public synchronized PortletInfo getPortletInfo(String key)
+ {
+ PortletInfo info = (PortletInfo)map.get(key);
+ if (info == null)
+ {
+ info = new PortletInfo();
+ map.put(key, info);
+ }
+ return info;
+ }
+
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/management/PortletInfo.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/management/PortletInfo.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/management/PortletInfo.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,144 @@
+/******************************************************************************
+ * 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.management;
+
+/**
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @version $Revision$
+ */
+public class PortletInfo
+{
+
+ private long renderRequestProcessingTime;
+
+ private long actionRequestProcessingTime;
+
+ private long maxActionTime;
+
+ private long maxRenderTime;
+
+ private String maxRenderRequestUri;
+
+ private String maxActionRequestUri;
+
+ private int actionRequestCount;
+
+ private int renderRequestCount;
+
+ private int renderErrorCount;
+
+ private int actionErrorCount;
+
+ public long getRenderRequestProcessingTime()
+ {
+ return renderRequestProcessingTime;
+ }
+
+ public long getActionRequestProcessingTime()
+ {
+ return actionRequestProcessingTime;
+ }
+
+ public long getMaxRenderTime()
+ {
+ return maxRenderTime;
+ }
+
+ public long getMaxActionTime()
+ {
+ return maxActionTime;
+ }
+
+ public String getMaxRenderRequestUri()
+ {
+ return maxRenderRequestUri;
+ }
+
+ public String getMaxActionRequestUri()
+ {
+ return maxActionRequestUri;
+ }
+
+ public synchronized float getAverageRenderTime()
+ {
+ return (float)renderRequestProcessingTime/renderRequestCount;
+ }
+
+ public synchronized float getAverageActionTime()
+ {
+ return (float)actionRequestProcessingTime/actionRequestCount;
+ }
+
+ public int getRenderRequestCount()
+ {
+ return renderRequestCount;
+ }
+
+ public int getActionRequestCount()
+ {
+ return actionRequestCount;
+ }
+
+ public int getRenderErrorCount()
+ {
+ return renderErrorCount;
+ }
+
+ public int getActionErrorCount()
+ {
+ return actionErrorCount;
+ }
+
+ public synchronized void newRenderCall(long time, boolean error)
+ {
+ renderRequestProcessingTime += time;
+ if (time > maxRenderTime)
+ {
+ maxRenderTime = time;
+ }
+ renderRequestCount++;
+ if (error)
+ {
+ renderErrorCount++;
+ }
+ }
+
+ public synchronized void newActionCall(long time, boolean error)
+ {
+ actionRequestProcessingTime += time;
+ if (time > maxActionTime)
+ {
+ maxActionTime = time;
+ }
+ actionRequestCount++;
+ if (error)
+ {
+ actionErrorCount++;
+ }
+ }
+
+ public boolean isUsed()
+ {
+ return getActionRequestCount() + getRenderRequestCount() > 0;
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/metadata/JBossApplicationMetaData.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/metadata/JBossApplicationMetaData.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/metadata/JBossApplicationMetaData.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,60 @@
+/******************************************************************************
+ * 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.metadata;
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public class JBossApplicationMetaData
+{
+
+ /** . */
+ protected Boolean remotable;
+
+ /** . */
+ protected Map portlets;
+
+ public JBossApplicationMetaData()
+ {
+ portlets = new LinkedHashMap();
+ }
+
+ public Map getPortlets()
+ {
+ return portlets;
+ }
+
+ public Boolean getRemotable()
+ {
+ return remotable;
+ }
+
+ public void setRemotable(Boolean remotable)
+ {
+ this.remotable = remotable;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/metadata/JBossApplicationMetaData.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/metadata/JBossPortletMetaData.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/metadata/JBossPortletMetaData.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/metadata/JBossPortletMetaData.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,163 @@
+/******************************************************************************
+ * 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.metadata;
+
+import org.jboss.portal.common.transaction.Transactions;
+
+/**
+ * Specific metadata specified to jboss portlet container.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 7226 $
+ */
+public class JBossPortletMetaData implements Cloneable
+{
+
+ /** . */
+ private String name;
+
+ /** . */
+ private Boolean remotable;
+
+ /** . */
+ private SecurityConstraintMetaData securityConstraint;
+
+ /** . */
+ private Integer cacheRefType;
+
+ /** . */
+ private Transactions.Type txType;
+
+ /** . */
+ private Boolean distributed;
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+ public Boolean getRemotable()
+ {
+ return remotable;
+ }
+
+ public void setRemotable(Boolean remotable)
+ {
+ this.remotable = remotable;
+ }
+
+ public Boolean getDistributed()
+ {
+ return distributed;
+ }
+
+ public void setDistributed(Boolean distributed)
+ {
+ this.distributed = distributed;
+ }
+
+ public SecurityConstraintMetaData getSecurityConstraint()
+ {
+ return securityConstraint;
+ }
+
+ public void setSecurityConstraint(SecurityConstraintMetaData securityConstraint)
+ {
+ this.securityConstraint = securityConstraint;
+ }
+
+ public Integer getCacheRefType()
+ {
+ return cacheRefType;
+ }
+
+ public void setCacheRefType(Integer cacheRefType)
+ {
+ this.cacheRefType = cacheRefType;
+ }
+
+ public Transactions.Type getTxType()
+ {
+ return txType;
+ }
+
+ public void setTxType(Transactions.Type txType)
+ {
+ this.txType = txType;
+ }
+
+ /**
+ * Merge the current meta data with portlet application.
+ */
+ public void merge(JBossApplicationMetaData application)
+ {
+ if (remotable == null)
+ {
+ remotable = application.getRemotable();
+ }
+ }
+
+ /**
+ * Merge the current meta data with a specified one.
+ */
+ public void merge(JBossPortletMetaData portlet)
+ {
+ if (remotable == null)
+ {
+ remotable = portlet.getRemotable();
+ }
+ if (txType == null)
+ {
+ txType = portlet.getTxType();
+ }
+ if (cacheRefType == null)
+ {
+ cacheRefType = portlet.getCacheRefType();
+ }
+ if (securityConstraint == null)
+ {
+ securityConstraint = portlet.getSecurityConstraint();
+ }
+ if (distributed == null)
+ {
+ distributed = portlet.getDistributed();
+ }
+ }
+
+ public Object clone()
+ {
+ try
+ {
+ return super.clone();
+ }
+ catch (CloneNotSupportedException e)
+ {
+ throw new Error(e);
+ }
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/metadata/JBossPortletMetaData.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/metadata/PolicyPermissionMetaData.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/metadata/PolicyPermissionMetaData.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/metadata/PolicyPermissionMetaData.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,62 @@
+/******************************************************************************
+ * 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.metadata;
+
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public class PolicyPermissionMetaData
+{
+
+ private String roleName;
+ private Set actions;
+
+ public PolicyPermissionMetaData()
+ {
+ actions = new HashSet();
+ }
+
+ public String getRoleName()
+ {
+ return roleName;
+ }
+
+ public void setRoleName(String roleName)
+ {
+ this.roleName = roleName;
+ }
+
+ public Set getActions()
+ {
+ return actions;
+ }
+
+ public void setActions(Set actions)
+ {
+ this.actions = actions;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/metadata/PolicyPermissionMetaData.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/metadata/SecurityConstraintMetaData.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/metadata/SecurityConstraintMetaData.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/metadata/SecurityConstraintMetaData.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,51 @@
+/******************************************************************************
+ * 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.metadata;
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public class SecurityConstraintMetaData
+{
+
+ private Map policyPermissions;
+
+ public SecurityConstraintMetaData()
+ {
+ policyPermissions = new LinkedHashMap();
+ }
+
+ public Map getPolicyPermissions()
+ {
+ return policyPermissions;
+ }
+
+ public void setPolicyPermissions(Map policyPermissions)
+ {
+ this.policyPermissions = policyPermissions;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/metadata/SecurityConstraintMetaData.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/metadata/SessionConfigMetaData.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/metadata/SessionConfigMetaData.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/metadata/SessionConfigMetaData.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,47 @@
+/******************************************************************************
+ * 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.metadata;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public class SessionConfigMetaData
+{
+
+ private boolean distributed;
+
+ public SessionConfigMetaData()
+ {
+ }
+
+ public boolean isDistributed()
+ {
+ return distributed;
+ }
+
+ public void setDistributed(boolean distributed)
+ {
+ this.distributed = distributed;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/metadata/SessionConfigMetaData.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/spi/ActionContext.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/spi/ActionContext.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/spi/ActionContext.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,113 @@
+/******************************************************************************
+ * 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.spi;
+
+import org.jboss.portal.portlet.PortletParameters;
+import org.jboss.portal.portlet.StateString;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+
+/**
+ * Extends the generic invocation context to provide action invocation specific
input/services.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5976 $
+ */
+public interface ActionContext extends PortletInvocationContext
+{
+
+ /**
+ * Returns the name of the character encoding used in the body of this request. This
method returns <code>null</code>
+ * if the request does not specify a character encoding.
+ *
+ * @return a <code>String</code> containing the name of the chararacter
encoding, or <code>null</code> if the
+ * request does not specify a character encoding.
+ */
+ String getCharacterEncoding();
+
+ /**
+ * Returns the length, in bytes, of the request body which is made available by the
input stream, or -1 if the length
+ * is not known.
+ *
+ * @return an integer containing the length of the request body or -1 if the length is
not known
+ */
+ int getContentLength();
+
+ /**
+ * Retrieves the body of the HTTP request from the client to the portal as character
data using a
+ * <code>BufferedReader</code>. The reader translates the character data
according to the character encoding used on
+ * the body. Either this method or {@link #getInputStream} may be called to read the
body, not both.
+ * <p/>
+ * For HTTP POST data of type application/x-www-form-urlencoded this method throws an
+ * <code>IllegalStateException</code> as this data has been already
processed by the portal/portlet-container and is
+ * available as request parameters.
+ *
+ * @throws java.io.UnsupportedEncodingException if the character set encoding used is
not supported and
+ * the text cannot be decoded
+ * @throws java.lang.IllegalStateException if {@link #getInputStream} method has been
called on this request,
+ * it is a HTTP POST data of type application/x-www-form-urlencoded.
+ * @throws java.io.IOException if an input or output exception occurred
+ * @return a <code>BufferedReader</code> containing the body of the
request
+ * @see #getInputStream
+ */
+ BufferedReader getReader() throws IOException;
+
+ /**
+ * Retrieves the body of the HTTP request from client to portal as binary data using
an <CODE>InputStream</CODE>.
+ * Either this method or {@link #getReader} may be called to read the body, but not
both.
+ * <p/>
+ * For HTTP POST data of type application/x-www-form-urlencoded this method throws an
+ * <code>IllegalStateException</code> as this data has been already
processed by the portal/portlet-container and is
+ * available as request parameters.
+ *
+ * @return an input stream containing the body of the request
+ * @throws java.lang.IllegalStateException if getReader was already called, or it is a
HTTP POST data of type
+ * application/x-www-form-urlencoded
+ * @throws java.io.IOException if an input or output exception occurred
+ */
+ InputStream getInputStream() throws IOException, IllegalStateException;
+
+ /**
+ * Returns the MIME type of the body of the request, or null if the type is not
known.
+ *
+ * @return a <code>String</code> containing the name of the MIME type of
the request, or null if the type is not
+ * known.
+ */
+ String getContentType();
+
+ /**
+ * Returns the interaction state of the request.
+ *
+ * @return the interaction state
+ */
+ StateString getInteractionState();
+
+ /**
+ * Returns the form parameters of the request or null if no form could be decoded by
the caller.
+ *
+ * @return the request form
+ */
+ PortletParameters getForm();
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/spi/ActionContext.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/spi/InstanceContext.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/spi/InstanceContext.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/spi/InstanceContext.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,54 @@
+/******************************************************************************
+ * 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.spi;
+
+import org.jboss.portal.portlet.StateEvent;
+import org.jboss.portal.portlet.state.AccessMode;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public interface InstanceContext
+{
+ /**
+ * Return an id that can differenciate instances.
+ *
+ * @return the instance id
+ */
+ String getId();
+
+ /**
+ * Return the access mode to this portlet instance.
+ *
+ * @return the access mode
+ */
+ AccessMode getAccessMode();
+
+ /**
+ * A state event occured.
+ *
+ * @param event the event
+ */
+ void onStateEvent(StateEvent event);
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/spi/InstanceContext.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/spi/PortalContext.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/spi/PortalContext.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/spi/PortalContext.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,51 @@
+/******************************************************************************
+ * 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.spi;
+
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * Represent the context of the portal that performs the invocation.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 6720 $
+ */
+public interface PortalContext
+{
+ /**
+ * Return info about the portal.
+ *
+ * @return portal infos
+ */
+ String getInfo();
+
+ /** Return the window states accepted by this portal context. */
+ Set getWindowStates();
+
+ /** Return the modes accepted by this portal context. */
+ Set getModes();
+
+ /** Return the set of properties of this portal context. */
+ Map getProperties();
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/spi/PortalContext.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/spi/PortletInvocationContext.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/spi/PortletInvocationContext.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/spi/PortletInvocationContext.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -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.portlet.spi;
+
+import org.jboss.portal.Mode;
+import org.jboss.portal.WindowState;
+import org.jboss.portal.common.invocation.InvocationContext;
+import org.jboss.portal.common.util.MarkupInfo;
+import org.jboss.portal.portlet.PortletURL;
+import org.jboss.portal.portlet.StateString;
+
+/**
+ * Contract that defines what input/services the caller of a portlet container must
provide.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5064 $
+ */
+public interface PortletInvocationContext extends InvocationContext
+{
+ /**
+ * Returns the navigational state for this invocation.
+ *
+ * @return the navigational state
+ */
+ StateString getNavigationalState();
+
+ /**
+ * Returns the mode for this invocation.
+ *
+ * @return the mode
+ */
+ Mode getMode();
+
+ /**
+ * Returns the window state for this invocation.
+ *
+ * @return the window state
+ */
+ WindowState getWindowState();
+
+ /**
+ * Return information about the underlying http wire this invocation is performed.
+ *
+ * @return the stream info
+ */
+ MarkupInfo getMarkupInfo();
+
+ /**
+ * <p>Encodes the specified URL by including the session ID in it, or, if
encoding is not needed, returns the URL
+ * unchanged. The implementation of this method includes the logic to determine
whether the session ID needs to be
+ * encoded in the URL. For example, if the browser supports cookies, or session
tracking is turned off, URL encoding
+ * is unnecessary.</p>
+ * <p/>
+ * <p>For robust session tracking, all URLs emitted by a servlet should be run
through this method. Otherwise, URL
+ * rewriting cannot be used with browsers which do not support cookies.</p>
+ *
+ * @param url the url to be encoded
+ * @return the encoded URL if encoding is needed, the unchanged URL otherwise
+ * @throws IllegalArgumentException if the url is not valid or null
+ */
+ String encodeResourceURL(String url) throws IllegalArgumentException;
+
+ /**
+ * @param portletURL the portlet url
+ * @param wantSecure
+ * @param wantAuthenticated
+ * @param relative
+ * @return the url
+ */
+ String renderURL(
+ PortletURL portletURL,
+ Boolean wantSecure,
+ Boolean wantAuthenticated,
+ boolean relative);
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/spi/PortletInvocationContext.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/spi/RenderContext.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/spi/RenderContext.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/spi/RenderContext.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,33 @@
+/******************************************************************************
+ * 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.spi;
+
+/**
+ * Extends the generic invocation context to provide render invocation specific
input/services.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5976 $
+ */
+public interface RenderContext extends PortletInvocationContext
+{
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/spi/RenderContext.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/spi/RequestContext.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/spi/RequestContext.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/spi/RequestContext.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,66 @@
+/******************************************************************************
+ * 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.spi;
+
+import org.jboss.portal.web.spi.ServletContainerContext;
+import org.jboss.portal.web.RequestDispatchCallback;
+
+import javax.servlet.ServletContext;
+
+/**
+ * Defines the request context contract. It's usage is related to the Servlet
Container operational
+ * environment.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 6929 $
+ */
+public interface RequestContext
+{
+ /**
+ * Return the scheme value.
+ */
+ String getScheme();
+
+ /**
+ * Return the server name value.
+ */
+ String getServerName();
+
+ /**
+ * Return the server port value.
+ */
+ int getServerPort();
+
+ /**
+ * Delegate to the request context the dispatching to the target servlet context using
the specified spi elements.
+ *
+ * @param servletContainerContext the servlet container spi
+ * @param targetServletContext the target servlet context
+ * @param callback the call back to be done after dispatch
+ * @param handback the hand back object to provide after dispatch to the call back
+ * @return the call back returned object
+ * @throws Exception any exception
+ */
+ Object dispatch(ServletContainerContext servletContainerContext, ServletContext
targetServletContext, RequestDispatchCallback callback, Object handback) throws
Exception;
+
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/spi/RequestContext.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/spi/SecurityContext.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/spi/SecurityContext.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/spi/SecurityContext.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,62 @@
+/******************************************************************************
+ * 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.spi;
+
+import java.security.Principal;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public interface SecurityContext
+{
+ /**
+ *
+ */
+ boolean isSecure();
+
+ /**
+ *
+ */
+ boolean isAuthenticated();
+
+ /**
+ *
+ */
+ String getAuthType();
+
+ /**
+ *
+ */
+ String getRemoteUser();
+
+ /**
+ *
+ */
+ Principal getUserPrincipal();
+
+ /**
+ *
+ */
+ boolean isUserInRole(String roleName);
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/spi/SecurityContext.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/spi/UserContext.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/spi/UserContext.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/spi/UserContext.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,66 @@
+/******************************************************************************
+ * 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.spi;
+
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+
+/**
+ * The user context valid during the scope of a single request.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public interface UserContext
+{
+
+ /**
+ * Retrieves the user id or null if it is not known.
+ *
+ * @return the user id
+ */
+ String getId();
+
+ /**
+ * The user profile information keyed by P3PConstants
+ *
+ * @return a map containing user profile informaton
+ * @see org.jboss.portal.common.p3p.P3PConstants
+ */
+ Map getInformations();
+
+ /**
+ * Return the user locale.
+ *
+ * @return the user locale.
+ */
+ Locale getLocale();
+
+ /**
+ * Retrieves the locales that the user is willing to receive information in.
+ *
+ * @return the locales ordered according to user preference (preferred first).
+ */
+ List getLocales();
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/spi/UserContext.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/spi/WindowContext.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/spi/WindowContext.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/spi/WindowContext.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -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.spi;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public interface WindowContext
+{
+ /**
+ * Return an id that can differenciate windows.
+ *
+ * @return the window id
+ */
+ String getId();
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/spi/WindowContext.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/AbstractPropertyContext.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/AbstractPropertyContext.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/AbstractPropertyContext.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,146 @@
+/******************************************************************************
+ * 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.state;
+
+import org.jboss.portal.common.value.Value;
+
+import java.util.Collections;
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 6757 $
+ */
+public class AbstractPropertyContext implements PropertyContext
+{
+
+ /** No change have been done or attempted. */
+ public static final int NO_CHANGE = 0;
+
+ /** Attempts to update the state that failed has been performed. */
+ public static final int UPDATE_FAILED = 1;
+
+ /** The state has been succesfully updated. */
+ public static final int UPDATE_SUCCESSFUL = 2;
+
+ /** True if render phase. */
+ private final boolean render;
+
+ /** The user prefs. */
+ private PropertyMap prefs;
+
+ /** The access mode. */
+ private final AccessMode access;
+
+ /** State change status. */
+ private int status;
+
+ /**
+ * Create a new object.
+ *
+ * @param prefs the user prefs
+ * @throws IllegalArgumentException if the portletPrefs are null
+ */
+ public AbstractPropertyContext(
+ AccessMode access,
+ PropertyMap prefs,
+ boolean render) throws IllegalArgumentException
+ {
+ if (access == null)
+ {
+ throw new IllegalArgumentException("No access mode provided");
+ }
+ this.access = access;
+ this.prefs = prefs;
+ this.status = NO_CHANGE;
+ this.render = render;
+ }
+
+ public void update(PropertyChange[] changes) throws IllegalStateException
+ {
+ if (access == AccessMode.READ_ONLY)
+ {
+ status = UPDATE_FAILED;
+ throw new IllegalStateException("Cannot update when read only");
+ }
+ if (changes.length > 0)
+ {
+ if (status == NO_CHANGE)
+ {
+ if (prefs == null)
+ {
+ prefs = new SimplePropertyMap();
+ }
+ else
+ {
+ prefs = new SimplePropertyMap(prefs);
+ }
+ }
+
+ //
+ for (int i = 0; i < changes.length; i++)
+ {
+ PropertyChange change = changes[i];
+ prefs.setProperty(change.getKey(), change.getValue());
+ }
+ status = UPDATE_SUCCESSFUL;
+ }
+ }
+
+ public Set getKeys()
+ {
+ if (prefs == null)
+ {
+ return Collections.EMPTY_SET;
+ }
+ return prefs.keySet();
+ }
+
+ public Value getValue(String key) throws IllegalArgumentException
+ {
+ if (prefs == null)
+ {
+ return null;
+ }
+ return prefs.getProperty(key);
+ }
+
+ public boolean isReadOnly()
+ {
+ if (render)
+ {
+ throw new IllegalStateException("Not authorized to call this method during
the render phase");
+ }
+ return access == AccessMode.READ_ONLY;
+ }
+
+ public PropertyMap getPrefs()
+ {
+ return prefs;
+ }
+
+ public int getStatus()
+ {
+ return status;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/AbstractPropertyContext.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/AbstractPropertyMap.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/AbstractPropertyMap.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/AbstractPropertyMap.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,110 @@
+/******************************************************************************
+ * 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.state;
+
+import org.jboss.portal.common.util.TypedMap;
+import org.jboss.portal.common.util.MapAccessor;
+import org.jboss.portal.common.value.Value;
+
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 6643 $
+ */
+public abstract class AbstractPropertyMap extends TypedMap implements PropertyMap
+{
+
+ protected AbstractPropertyMap(MapAccessor accessor)
+ {
+ super(accessor);
+ }
+
+ protected AbstractPropertyMap(Map delegate)
+ {
+ super(delegate);
+ }
+
+ /**
+ * Only accept non null string objects.
+ *
+ * @throws ClassCastException if the value is not an instance of string
+ */
+ protected void assertKeyValidity(Object value)
+ {
+ if (value instanceof String == false)
+ {
+ throw new ClassCastException("Key must be a String");
+ }
+ }
+
+ /**
+ * Only check are made to the value. The only valid values accepted are non null
instance of
+ * <code>org.jboss.portal.common.value.Value</code>.
+ *
+ * @throws NullPointerException if the value is null
+ * @throws ClassCastException if the value type is not an instance of
<code>org.jboss.portal.common.value.Value</code>
+ */
+ protected Object getInternalValue(Object value)
+ {
+ if (value == null)
+ {
+ throw new NullPointerException("Value must not be null");
+ }
+ if (value instanceof Value == false)
+ {
+ throw new ClassCastException("Value must be a Value");
+ }
+ return value;
+ }
+
+ protected Object getExternalValue(Object value)
+ {
+ return value;
+ }
+
+ public Value getProperty(String key) throws IllegalArgumentException
+ {
+ if (key == null)
+ {
+ throw new IllegalArgumentException("No null key accepted");
+ }
+ return (Value)get(key);
+ }
+
+ public void setProperty(String key, Value value) throws IllegalArgumentException
+ {
+ if (key == null)
+ {
+ throw new IllegalArgumentException("No null key accepted");
+ }
+ if (value != null)
+ {
+ put(key, value);
+ }
+ else
+ {
+ remove(key);
+ }
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/AbstractPropertyMap.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/AccessMode.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/AccessMode.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/AccessMode.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,55 @@
+/******************************************************************************
+ * 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.state;
+
+/**
+ * Type safe enumeration for the access mode to a portlet.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5776 $
+ */
+public class AccessMode
+{
+
+ /** Read only access mode. */
+ public static final AccessMode READ_ONLY = new AccessMode("READ_ONLY");
+
+ /** Read write access mode. */
+ public static final AccessMode READ_WRITE = new AccessMode("READ_WRITE");
+
+ /** Clone before write access mode. */
+ public static final AccessMode CLONE_BEFORE_WRITE = new
AccessMode("CLONE_BEFORE_WRITE");
+
+ /** The type as a string. */
+ private final String name;
+
+ private AccessMode(String name)
+ {
+ this.name = name;
+ }
+
+ public String toString()
+ {
+ return name;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/AccessMode.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/DestroyCloneFailure.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/DestroyCloneFailure.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/DestroyCloneFailure.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,86 @@
+/******************************************************************************
+ * 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.state;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5893 $
+ */
+public class DestroyCloneFailure
+{
+
+ /** The clone id. */
+ private final String portletId;
+
+ /** . */
+ private final String message;
+
+ public DestroyCloneFailure(String portletId, String message)
+ {
+ if (portletId == null)
+ {
+ throw new IllegalArgumentException("Must provide a portlet id");
+ }
+ this.portletId = portletId;
+ this.message = message;
+ }
+
+ public DestroyCloneFailure(String portletId)
+ {
+ this(portletId, null);
+ }
+
+ public String getPortletId()
+ {
+ return portletId;
+ }
+
+ public String getMessage()
+ {
+ return message;
+ }
+
+ public String toString()
+ {
+ return "DestroyCloneFailure[" + portletId + "," + message +
"]";
+ }
+
+ public int hashCode()
+ {
+ return portletId.hashCode();
+ }
+
+ public boolean equals(Object obj)
+ {
+ if (obj == this)
+ {
+ return true;
+ }
+ if (obj instanceof DestroyCloneFailure)
+ {
+ DestroyCloneFailure that = (DestroyCloneFailure)obj;
+ return portletId.equals(that.portletId);
+ }
+ return false;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/DestroyCloneFailure.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/InvalidStateIdException.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/InvalidStateIdException.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/InvalidStateIdException.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,62 @@
+/******************************************************************************
+ * 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.state;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5776 $
+ */
+public class InvalidStateIdException extends Exception
+{
+
+ private String stateId;
+
+ public InvalidStateIdException(String stateId)
+ {
+ super("No such state " + stateId);
+ this.stateId = stateId;
+ }
+
+ public InvalidStateIdException(String message, String portletId)
+ {
+ super(message);
+ this.stateId = portletId;
+ }
+
+ public InvalidStateIdException(Throwable cause, String portletId)
+ {
+ super(cause);
+ this.stateId = portletId;
+ }
+
+ public InvalidStateIdException(String message, Throwable cause, String portletId)
+ {
+ super(message, cause);
+ this.stateId = portletId;
+ }
+
+ public String getStateId()
+ {
+ return stateId;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/InvalidStateIdException.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/NoSuchStateException.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/NoSuchStateException.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/NoSuchStateException.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,62 @@
+/******************************************************************************
+ * 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.state;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5776 $
+ */
+public class NoSuchStateException extends Exception
+{
+
+ private String stateId;
+
+ public NoSuchStateException(String stateId)
+ {
+ super("No such state " + stateId);
+ this.stateId = stateId;
+ }
+
+ public NoSuchStateException(String message, String portletId)
+ {
+ super(message);
+ this.stateId = portletId;
+ }
+
+ public NoSuchStateException(Throwable cause, String portletId)
+ {
+ super(cause);
+ this.stateId = portletId;
+ }
+
+ public NoSuchStateException(String message, Throwable cause, String portletId)
+ {
+ super(message, cause);
+ this.stateId = portletId;
+ }
+
+ public String getStateId()
+ {
+ return stateId;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/NoSuchStateException.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/Property.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/Property.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/Property.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,55 @@
+/******************************************************************************
+ * 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.state;
+
+import org.jboss.portal.common.value.Value;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5950 $
+ */
+public class Property
+{
+
+ /** The property name. */
+ protected String name;
+
+ /** The property value. */
+ protected Value value;
+
+ public Property(String name, Value value)
+ {
+ this.name = name;
+ this.value = value;
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public Value getValue()
+ {
+ return value;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/Property.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/PropertyChange.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/PropertyChange.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/PropertyChange.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,114 @@
+/******************************************************************************
+ * 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.state;
+
+import org.jboss.portal.common.value.Value;
+
+/**
+ * A property change. The class is immutable
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5776 $
+ */
+public class PropertyChange
+{
+
+ /** The change is an update of the property value. */
+ public static final int PREF_UPDATE = 0;
+
+ /** The change is a reset of the property value. */
+ public static final int PREF_RESET = 1;
+
+ /** The key. */
+ private final String key;
+
+ /** The value. */
+ private final Value value;
+
+ /**
+ * Create a new property update.
+ *
+ * @param key the property key
+ * @param value the property value
+ * @return an instance representing a property update
+ */
+ public static PropertyChange newUpdate(String key, Value value)
+ {
+ if (value == null)
+ {
+ throw new IllegalArgumentException("No value provided");
+ }
+ return new PropertyChange(key, value);
+ }
+
+ /**
+ * Create a new property reset.
+ *
+ * @param key the property key
+ * @return an instance representing a property reset
+ */
+ public static PropertyChange newReset(String key)
+ {
+ return new PropertyChange(key, null);
+ }
+
+ private PropertyChange(String key, Value value)
+ {
+ if (key == null)
+ {
+ throw new IllegalArgumentException("No key provided");
+ }
+ this.key = key;
+ this.value = value;
+ }
+
+ /**
+ * Return the property change type.
+ *
+ * @return the proeprty change type
+ */
+ public int getType()
+ {
+ return value == null ? PREF_RESET : PREF_UPDATE;
+ }
+
+ /**
+ * Return the property key
+ *
+ * @return the property key
+ */
+ public String getKey()
+ {
+ return key;
+ }
+
+ /**
+ * Return the new value or null in case of a property reset.
+ *
+ * @return the property value
+ */
+ public Value getValue()
+ {
+ return value;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/PropertyChange.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/PropertyContext.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/PropertyContext.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/PropertyContext.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -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.state;
+
+import org.jboss.portal.common.value.Value;
+
+import java.util.Set;
+
+/**
+ * Exposes to the portlet the interface to deal with the personalization state.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 6757 $
+ */
+public interface PropertyContext
+{
+ /** The attribute name under which the preferences can be accessed. */
+ String PREFERENCES_ATTRIBUTE = "preferences";
+
+ /**
+ * Return the key set.
+ *
+ * @return the set of keys
+ */
+ Set getKeys();
+
+ /**
+ * Return for a specified key its value or null if the value does not exist.
+ *
+ * @param key the lookup key
+ * @return the key value or null if it does not exist
+ * @throws IllegalArgumentException if the key is null
+ */
+ Value getValue(String key) throws IllegalArgumentException;
+
+ /**
+ * Return true if the preferences are globally read only. The value returned by
+ * this method is valid only during the action request. Any call to this method
+ * during the render request will produce a non accurate value.
+ *
+ * @return true if the preferences are read only
+ * @throws IllegalStateException if this is called during render phase
+ */
+ boolean isReadOnly() throws IllegalStateException;
+
+ /**
+ * Update the preferences.
+ *
+ * @throws IllegalStateException if the preferences is not writable
+ * @throws IllegalArgumentException if any change is not valid
+ */
+ void update(PropertyChange[] changes) throws IllegalStateException;
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/PropertyContext.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/PropertyMap.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/PropertyMap.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/PropertyMap.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,54 @@
+/******************************************************************************
+ * 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.state;
+
+import org.jboss.portal.common.value.Value;
+
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 6643 $
+ */
+public interface PropertyMap extends Map
+{
+ /**
+ * Return the value for the given key or null if it does not exist.
+ *
+ * @param key the requested key
+ * @return the requested value or null if it does not exist
+ * @throws IllegalArgumentException if the key is null
+ */
+ Value getProperty(String key) throws IllegalArgumentException;
+
+ /**
+ * Update the value of the given key. If the value object is null it means that the
entry must be removed.
+ * Implementation can throw an unsupported operation exception when it is abnormal to
perform an update.
+ *
+ * @param key the key to update
+ * @param value the new value
+ * @throws UnsupportedOperationException if the operation is not supported
+ * @throws IllegalArgumentException if the key is null
+ */
+ void setProperty(String key, Value value) throws IllegalArgumentException,
UnsupportedOperationException;
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/SimplePropertyMap.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/SimplePropertyMap.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/SimplePropertyMap.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,64 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.state;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.io.Serializable;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 6643 $
+ */
+public class SimplePropertyMap extends AbstractPropertyMap
+{
+
+ public SimplePropertyMap()
+ {
+ this(new HashMap());
+ }
+
+ public SimplePropertyMap(int size)
+ {
+ this(new HashMap(size));
+ }
+
+ public SimplePropertyMap(PropertyMap that)
+ {
+ this(new HashMap());
+
+ //
+ if (that == null)
+ {
+ throw new IllegalArgumentException();
+ }
+
+ //
+ putAll(that);
+ }
+
+ public SimplePropertyMap(Map map)
+ {
+ super(map);
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/StateConversionException.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/StateConversionException.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/StateConversionException.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,49 @@
+/******************************************************************************
+ * 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.state;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5776 $
+ */
+public class StateConversionException extends Exception
+{
+ public StateConversionException()
+ {
+ }
+
+ public StateConversionException(String message)
+ {
+ super(message);
+ }
+
+ public StateConversionException(String message, Throwable cause)
+ {
+ super(message, cause);
+ }
+
+ public StateConversionException(Throwable cause)
+ {
+ super(cause);
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/StateConverter.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/StateConverter.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/StateConverter.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,52 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.state;
+
+import org.jboss.portal.portlet.state.producer.PortletState;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5873 $
+ */
+public interface StateConverter
+{
+ /**
+ * Marshall the producer state as a byte array.
+ *
+ * @param state the producer state
+ * @return the marshalled state
+ * @throws StateConversionException if marshalling cannot be performed
+ * @throws IllegalArgumentException if the state is null
+ */
+ byte[] marshall(PortletState state) throws StateConversionException,
IllegalArgumentException;
+
+ /**
+ * Unmarshall the producer state from a byte array.
+ *
+ * @param marshalledState the marshalled state
+ * @return the producer state
+ * @throws StateConversionException if unmarshalling cannot be performed
+ * @throws IllegalArgumentException if the argument is null
+ */
+ PortletState unmarshall(byte[] marshalledState) throws StateConversionException,
IllegalArgumentException;
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/StateManagementPolicy.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/StateManagementPolicy.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/StateManagementPolicy.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -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.state;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5776 $
+ */
+public interface StateManagementPolicy
+{
+ /**
+ * Returns true if the state must be persisted locally.
+ *
+ * @return true if state must be persisted locally
+ */
+ boolean persistLocally();
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/consumer/ConsumerPersistenceManager.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/consumer/ConsumerPersistenceManager.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/consumer/ConsumerPersistenceManager.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -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.state.consumer;
+
+import org.jboss.portal.portlet.state.InvalidStateIdException;
+import org.jboss.portal.portlet.state.NoSuchStateException;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5776 $
+ */
+public interface ConsumerPersistenceManager
+{
+ /**
+ * Load the state.
+ *
+ * @param stateId the state id
+ * @return the value map or null if it does not exist
+ * @throws IllegalArgumentException if the state id is null
+ * @throws NoSuchStateException is the specified state does not exist
+ * @throws InvalidStateIdException if the state id is not valid
+ */
+ ConsumerStateContext loadState(String stateId) throws IllegalArgumentException,
NoSuchStateException, InvalidStateIdException;
+
+ /**
+ * Create the initial state.
+ *
+ * @return the id of the state created
+ * @throws IllegalArgumentException if the portlet id is null
+ */
+ String createState(ConsumerState state) throws IllegalArgumentException;
+
+ /**
+ * Update the state.
+ *
+ * @param stateId
+ * @param propertyMap the updated state
+ * @throws IllegalArgumentException if the state id is null or the values are null
+ * @throws NoSuchStateException is the specified state does not exist
+ * @throws InvalidStateIdException if the state id is not valid
+ */
+ void updateState(String stateId, ConsumerState propertyMap) throws
IllegalArgumentException, NoSuchStateException, InvalidStateIdException;
+
+ /**
+ * Destroy the state.
+ *
+ * @param stateId
+ * @throws IllegalArgumentException if the state id is null
+ * @throws NoSuchStateException is the specified state does not exist
+ * @throws InvalidStateIdException if the state id is not valid
+ */
+ void destroyState(String stateId) throws IllegalArgumentException,
NoSuchStateException, InvalidStateIdException;
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/consumer/ConsumerPortlet.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/consumer/ConsumerPortlet.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/consumer/ConsumerPortlet.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,62 @@
+/******************************************************************************
+ * 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.state.consumer;
+
+import org.jboss.portal.portlet.Portlet;
+import org.jboss.portal.portlet.PortletContext;
+import org.jboss.portal.portlet.info.PortletInfo;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class ConsumerPortlet implements Portlet
+{
+
+ /** . */
+ private final PortletContext context;
+
+ /** . */
+ private final Portlet delegate;
+
+ public ConsumerPortlet(PortletContext context, Portlet delegate)
+ {
+ this.context = context;
+ this.delegate = delegate;
+ }
+
+ public PortletContext getContext()
+ {
+ return context;
+ }
+
+ public PortletInfo getInfo()
+ {
+ return delegate.getInfo();
+ }
+
+ public boolean isRemote()
+ {
+ return delegate.isRemote();
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/consumer/ConsumerPortletInvoker.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/consumer/ConsumerPortletInvoker.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/consumer/ConsumerPortletInvoker.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,422 @@
+/******************************************************************************
+ * 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.state.consumer;
+
+import org.jboss.portal.common.NotYetImplemented;
+import org.jboss.portal.portlet.InvalidPortletIdException;
+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.StateEvent;
+import org.jboss.portal.portlet.invocation.PortletInvocation;
+import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
+import org.jboss.portal.portlet.spi.InstanceContext;
+import org.jboss.portal.portlet.state.AccessMode;
+import org.jboss.portal.portlet.state.InvalidStateIdException;
+import org.jboss.portal.portlet.state.NoSuchStateException;
+import org.jboss.portal.portlet.state.PropertyChange;
+import org.jboss.portal.portlet.state.PropertyMap;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 6765 $
+ */
+public class ConsumerPortletInvoker implements PortletInvoker
+{
+
+ /** . */
+ private static final String CLONE_ID_PREFIX = "@";
+
+ /** . */
+ private PortletInvoker producer;
+
+ /** . */
+ private ConsumerPersistenceManager persistenceManager;
+
+ public PortletContext unwrapCCP(String wrappedCCP) throws InvalidPortletIdException
+ {
+ if (wrappedCCP == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ if (!wrappedCCP.startsWith(CLONE_ID_PREFIX))
+ {
+ throw new InvalidPortletIdException(wrappedCCP);
+ }
+ return
PortletContext.createPortletContext(wrappedCCP.substring(CLONE_ID_PREFIX.length()));
+ }
+
+ public PortletContext unwrapPOP(String wrappedPOPId) throws InvalidPortletIdException
+ {
+ if (wrappedPOPId == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ return PortletContext.createPortletContext(wrappedPOPId);
+ }
+
+ public String wrapCCP(PortletContext ccpCtx) throws InvalidPortletIdException
+ {
+ if (ccpCtx == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ return CLONE_ID_PREFIX + ccpCtx.getId();
+ }
+
+ public String wrapPOP(PortletContext popCtx) throws InvalidPortletIdException
+ {
+ if (popCtx == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ if (popCtx.getId().startsWith(CLONE_ID_PREFIX))
+ {
+ throw new IllegalArgumentException("Must not start with " +
CLONE_ID_PREFIX);
+ }
+ return popCtx.getId();
+ }
+
+ public PortletInvoker getProducer()
+ {
+ return producer;
+ }
+
+ public void setProducer(PortletInvoker producer)
+ {
+ this.producer = producer;
+ }
+
+ public void setPersistenceManager(ConsumerPersistenceManager persistenceManager)
+ {
+ this.persistenceManager = persistenceManager;
+ }
+
+ public Set getPortlets() throws PortletInvokerException
+ {
+ return producer.getPortlets();
+ }
+
+ public Portlet getPortlet(PortletContext portletContext) throws
IllegalArgumentException, PortletInvokerException
+ {
+ ConsumerContext cpc = getConsumerContext(portletContext);
+ Portlet delegate = producer.getPortlet(cpc.portletContext);
+ return new ConsumerPortlet(portletContext, delegate);
+ }
+
+ public PortletInvocationResponse invoke(PortletInvocation invocation) throws
IllegalArgumentException, PortletInvokerException
+ {
+ PortletContext portletContext = invocation.getTarget();
+ if (portletContext == null)
+ {
+ throw new IllegalArgumentException();
+ }
+
+ //
+ ConsumerContext consumerContext = getConsumerContext(portletContext);
+
+ //
+ InstanceContext cictx = invocation.getInstanceContext();
+ StatefulInstanceContextImpl pictx = new StatefulInstanceContextImpl(cictx);
+
+ try
+ {
+ invocation.setTarget(consumerContext.portletContext);
+ invocation.setInstanceContext(pictx);
+
+ //
+ PortletInvocationResponse response = producer.invoke(invocation);
+
+ //
+ PortletContext clonedContext = pictx.clonedContext;
+ if (clonedContext != null)
+ {
+ byte[] state = clonedContext.getState();
+ if (state != null)
+ {
+ // Save the clone state
+ ConsumerState consumerState = new ConsumerState(clonedContext.getId(),
state);
+ String stateId = persistenceManager.createState(consumerState);
+ String clonedId = CLONE_ID_PREFIX + stateId;
+ StateEvent event = new
StateEvent(PortletContext.createPortletContext(clonedId),
StateEvent.PORTLET_CLONED_EVENT);
+ cictx.onStateEvent(event);
+ }
+ else
+ {
+ StateEvent event = new
StateEvent(PortletContext.createPortletContext(clonedContext.getId()),
StateEvent.PORTLET_CLONED_EVENT);
+ cictx.onStateEvent(event);
+ }
+ }
+ else
+ {
+ PortletContext modifiedContext = pictx.modifiedContext;
+ if (modifiedContext != null)
+ {
+ byte[] state = modifiedContext.getState();
+ // update state if needed
+ if (state != null)
+ {
+ try
+ {
+ ConsumerState consumerState = new
ConsumerState(modifiedContext.getId(), state);
+ persistenceManager.updateState(consumerContext.stateId,
consumerState);
+ }
+ catch (NoSuchStateException e)
+ {
+ e.printStackTrace();
+ }
+ catch (InvalidStateIdException e)
+ {
+ e.printStackTrace();
+ }
+ }
+ }
+ }
+
+ //
+ return response;
+ }
+ finally
+ {
+ invocation.setTarget(portletContext);
+ invocation.setInstanceContext(cictx);
+ }
+ }
+
+ public PortletContext createClone(PortletContext portletContext) throws
IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
+ {
+ ConsumerContext consumerContext = getConsumerContext(portletContext);
+
+ //
+ PortletContext clonedContext =
producer.createClone(consumerContext.portletContext);
+
+ byte[] state = clonedContext.getState();
+ if (state != null)
+ {
+ ConsumerState consumerState = new ConsumerState(clonedContext.getId(), state);
+ String id = persistenceManager.createState(consumerState);
+ return PortletContext.createPortletContext(CLONE_ID_PREFIX + id);
+ }
+ else
+ {
+ return clonedContext;
+ }
+ }
+
+ public List destroyClones(List portletContexts) throws IllegalArgumentException,
PortletInvokerException, UnsupportedOperationException
+ {
+ if (portletContexts == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ portletContexts = new ArrayList(portletContexts);
+ for (int i = 0; i < portletContexts.size(); i++)
+ {
+ PortletContext portletContext = (PortletContext)portletContexts.get(i);
+ ConsumerContext consumerContext = getConsumerContext(portletContext);
+ portletContexts.set(i, consumerContext.portletContext);
+ if (consumerContext.stateId != null)
+ {
+ try
+ {
+ persistenceManager.destroyState(consumerContext.stateId);
+ }
+ catch (NoSuchStateException e)
+ {
+ //
+ }
+ catch (InvalidStateIdException e)
+ {
+ //
+ }
+ }
+ }
+
+ //
+ List failures = producer.destroyClones(portletContexts);
+
+// for (Iterator i = failures.iterator(); i.hasNext();)
+// {
+// DestroyCloneFailure failure = (DestroyCloneFailure)i.next();
+// //
+// }
+
+ //
+ return failures;
+ }
+
+ public PropertyMap getProperties(PortletContext portletContext, Set keys) throws
IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
+ {
+ ConsumerContext consumerContext = getConsumerContext(portletContext);
+ return producer.getProperties(consumerContext.portletContext, keys);
+ }
+
+ public PropertyMap getProperties(PortletContext portletContext) throws
IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
+ {
+ ConsumerContext consumerContext = getConsumerContext(portletContext);
+ return producer.getProperties(consumerContext.portletContext);
+ }
+
+ public PortletContext setProperties(PortletContext portletContext, PropertyChange[]
changes) throws IllegalArgumentException, PortletInvokerException,
UnsupportedOperationException
+ {
+ ConsumerContext consumerContext = getConsumerContext(portletContext);
+
+ //
+ PortletContext updatedPortletContext =
producer.setProperties(consumerContext.portletContext, changes);
+
+ byte[] state = updatedPortletContext.getState();
+ if (state != null)
+ {
+ if (consumerContext.stateId == null)
+ {
+ throw new NotYetImplemented();
+ }
+
+ //
+ ConsumerState consumerState = new ConsumerState(updatedPortletContext.getId(),
state);
+ try
+ {
+ persistenceManager.updateState(consumerContext.stateId, consumerState);
+ }
+ catch (NoSuchStateException e)
+ {
+ // What to do ?
+ }
+ catch (InvalidStateIdException e)
+ {
+ // What to do ?
+ }
+ }
+ else
+ {
+ if (consumerContext.stateId != null)
+ {
+ throw new NotYetImplemented();
+ }
+ }
+
+ // As the point is to make it constant we can simply return it
+ return portletContext;
+ }
+
+ private static class StatefulInstanceContextImpl implements InstanceContext
+ {
+
+ /** . */
+ private InstanceContext cictx;
+
+ /** . */
+ private PortletContext clonedContext;
+
+ /** . */
+ private PortletContext modifiedContext;
+
+ public StatefulInstanceContextImpl(InstanceContext cictx)
+ {
+ this.cictx = cictx;
+ }
+
+ public String getId()
+ {
+ return cictx.getId();
+ }
+
+ public AccessMode getAccessMode()
+ {
+ return cictx.getAccessMode();
+ }
+
+ public void onStateEvent(StateEvent event)
+ {
+ StateEvent.StateEventType type = event.getType();
+ if (StateEvent.PORTLET_CLONED_EVENT.equals(type))
+ {
+ clonedContext = event.getPortletContext();
+ }
+ else if (StateEvent.PORTLET_MODIFIED_EVENT.equals(type))
+ {
+ modifiedContext = event.getPortletContext();
+ }
+ }
+ }
+
+ private ConsumerContext getConsumerContext(PortletContext portletContext) throws
IllegalArgumentException, NoSuchPortletException, InvalidPortletIdException
+ {
+ if (portletContext == null)
+ {
+ throw new IllegalArgumentException();
+ }
+
+ //
+ String portletId = portletContext.getId();
+
+ //
+ if (portletId.startsWith(CLONE_ID_PREFIX))
+ {
+ String stateId = portletId.substring(CLONE_ID_PREFIX.length());
+ try
+ {
+ ConsumerStateContext stateCtx = persistenceManager.loadState(stateId);
+ return new ConsumerContext(stateId, stateCtx.getPortletId(),
stateCtx.getBytes());
+ }
+ catch (NoSuchStateException e)
+ {
+ throw new NoSuchPortletException(portletId);
+ }
+ catch (InvalidStateIdException e)
+ {
+ throw new InvalidPortletIdException(portletId);
+ }
+ }
+ else
+ {
+ return new ConsumerContext(portletContext, null);
+ }
+ }
+
+ private class ConsumerContext
+ {
+
+ private final PortletContext portletContext;
+
+ /** . */
+ private final String stateId;
+
+ public ConsumerContext(PortletContext portletContext, String stateId)
+ {
+ this.portletContext = portletContext;
+ this.stateId = stateId;
+ }
+
+ public ConsumerContext(String stateId, String id, byte[] state)
+ {
+ this(PortletContext.createStatefulPortletContext(id, state), stateId);
+ }
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/consumer/ConsumerState.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/consumer/ConsumerState.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/consumer/ConsumerState.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,82 @@
+/******************************************************************************
+ * 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.state.consumer;
+
+import java.util.Date;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5776 $
+ */
+public class ConsumerState
+{
+
+ /** . */
+ private String portletId;
+
+ /** . */
+ private byte[] bytes;
+
+ /** . */
+ private Date terminationTime;
+
+ public ConsumerState(String porteltId, byte[] bytes)
+ {
+ if (porteltId == null)
+ {
+ throw new IllegalArgumentException("No portlet id provided");
+ }
+ if (bytes == null)
+ {
+ throw new IllegalArgumentException("No bytes provided");
+ }
+ this.portletId = porteltId;
+ this.bytes = bytes;
+ }
+
+ /**
+ *
+ */
+ public String getPortletId()
+ {
+ return portletId;
+ }
+
+ /**
+ *
+ */
+ public byte[] getBytes()
+ {
+ return bytes;
+ }
+
+ /**
+ * The scheduled termination time.
+ *
+ * @return the termination time
+ */
+ public Date getTerminationTime()
+ {
+ return terminationTime;
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/consumer/ConsumerStateContext.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/consumer/ConsumerStateContext.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/consumer/ConsumerStateContext.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,53 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.state.consumer;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5776 $
+ */
+public class ConsumerStateContext extends ConsumerState
+{
+
+ /** . */
+ private final String id;
+
+ public ConsumerStateContext(String id, String portletId, byte[] bytes)
+ {
+ super(portletId, bytes);
+
+ //
+ if (id == null)
+ {
+ throw new IllegalArgumentException();
+ }
+
+ //
+ this.id = id;
+ }
+
+ public String getId()
+ {
+ return id;
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/producer/PortletState.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/producer/PortletState.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/producer/PortletState.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,86 @@
+/******************************************************************************
+ * 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.state.producer;
+
+import org.jboss.portal.portlet.state.PropertyMap;
+import org.jboss.portal.portlet.state.SimplePropertyMap;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5873 $
+ */
+public class PortletState implements Serializable
+{
+
+ /** . */
+ private String portletId;
+
+ /** . */
+ private PropertyMap properties;
+
+ /** . */
+ private Date terminationTime;
+
+ public PortletState(String portletId)
+ {
+ this(portletId, new SimplePropertyMap());
+ }
+
+ public PortletState(String portletId, PropertyMap properties)
+ {
+ if (portletId == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ if (properties == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ this.portletId = portletId;
+ this.properties = properties;
+ this.terminationTime = null;
+ }
+
+ public String getPortletId()
+ {
+ return portletId;
+ }
+
+ public PropertyMap getProperties()
+ {
+ return properties;
+ }
+
+ public Date getTerminationTime()
+ {
+ return terminationTime;
+ }
+
+ public void setTerminationTime(Date terminationTime)
+ {
+ this.terminationTime = terminationTime;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/producer/PortletState.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/producer/PortletStateChangeRequiredException.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/producer/PortletStateChangeRequiredException.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/producer/PortletStateChangeRequiredException.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,39 @@
+/******************************************************************************
+ * 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.state.producer;
+
+import org.jboss.portal.common.invocation.InvocationException;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
+ * @version $Revision: 5776 $
+ * @since 2.6
+ */
+public class PortletStateChangeRequiredException extends InvocationException
+{
+ public PortletStateChangeRequiredException(String message)
+ {
+ super(message);
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/producer/PortletStateContext.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/producer/PortletStateContext.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/producer/PortletStateContext.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,44 @@
+/******************************************************************************
+ * 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.state.producer;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5873 $
+ */
+public interface PortletStateContext
+{
+
+ /**
+ *
+ * @return
+ */
+ String getId();
+
+ /**
+ *
+ * @return
+ */
+ PortletState getState();
+
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/producer/PortletStatePersistenceManager.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/producer/PortletStatePersistenceManager.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/producer/PortletStatePersistenceManager.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,101 @@
+/******************************************************************************
+ * 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.state.producer;
+
+import org.jboss.portal.portlet.state.InvalidStateIdException;
+import org.jboss.portal.portlet.state.NoSuchStateException;
+import org.jboss.portal.portlet.state.PropertyMap;
+
+/**
+ * An abstraction for enabling state management on the producer side.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5873 $
+ */
+public interface PortletStatePersistenceManager
+{
+ /**
+ * Load the state.
+ *
+ * @param stateId the state id
+ * @return the value map or null if it does not exist
+ * @throws IllegalArgumentException if the state id is null
+ * @throws NoSuchStateException is the specified state does not exist
+ * @throws InvalidStateIdException if the state id is not valid
+ */
+ PortletStateContext loadState(String stateId) throws IllegalArgumentException,
NoSuchStateException, InvalidStateIdException;
+
+ /**
+ * Create the initial state.
+ *
+ * @param portletId the id that this state refers to
+ * @return the id of the state created
+ * @throws IllegalArgumentException if the portlet id is null
+ */
+ String createState(String portletId, PropertyMap propertyMap) throws
IllegalArgumentException;
+
+ /**
+ * Clone an existing state.
+ *
+ * @param stateId the id that this state refers to
+ * @return the state id
+ * @throws IllegalArgumentException if the state id is null
+ * @throws NoSuchStateException is the specified state does not exist
+ * @throws InvalidStateIdException if the state id is not valid
+ */
+ String cloneState(String stateId) throws IllegalArgumentException,
NoSuchStateException, InvalidStateIdException;
+
+ /**
+ * Clone an existing state.
+ *
+ * @param stateId the id that this state refers to
+ * @param propertyMap the values of the cloned state
+ * @return the state id
+ * @throws IllegalArgumentException if the state id is null or the value is nul
+ * @throws NoSuchStateException is the specified state does not exist
+ * @throws InvalidStateIdException if the state id is not valid
+ */
+ String cloneState(String stateId, PropertyMap propertyMap) throws
IllegalArgumentException, NoSuchStateException, InvalidStateIdException;
+
+ /**
+ * Update the state.
+ *
+ * @param stateId
+ * @param propertyMap the updated state
+ * @throws IllegalArgumentException if the state id is null or the values are null
+ * @throws NoSuchStateException is the specified state does not exist
+ * @throws org.jboss.portal.portlet.state.InvalidStateIdException
+ * if the state id is not valid
+ */
+ void updateState(String stateId, PropertyMap propertyMap) throws
IllegalArgumentException, NoSuchStateException, InvalidStateIdException;
+
+ /**
+ * Destroy the state.
+ *
+ * @param stateId
+ * @throws IllegalArgumentException if the state id is null
+ * @throws NoSuchStateException is the specified state does not exist
+ * @throws InvalidStateIdException if the state id is not valid
+ */
+ void destroyState(String stateId) throws IllegalArgumentException,
NoSuchStateException, InvalidStateIdException;
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/producer/PortletStatePersistenceManager.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/producer/ProducerPortlet.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/producer/ProducerPortlet.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/producer/ProducerPortlet.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,67 @@
+/******************************************************************************
+ * 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.state.producer;
+
+import org.jboss.portal.portlet.Portlet;
+import org.jboss.portal.portlet.PortletContext;
+import org.jboss.portal.portlet.info.PortletInfo;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class ProducerPortlet implements Portlet
+{
+
+ /** . */
+ private final PortletContext context;
+
+ /** . */
+ private final Portlet delegate;
+
+ public ProducerPortlet(PortletContext context, Portlet delegate)
+ {
+ this.context = context;
+ this.delegate = delegate;
+ }
+
+ public PortletContext getContext()
+ {
+ return context;
+ }
+
+ public PortletInfo getInfo()
+ {
+ return delegate.getInfo();
+ }
+
+ public boolean isRemote()
+ {
+ return delegate.isRemote();
+ }
+
+ public String toString()
+ {
+ return "ProducerPortlet[" + context + ",delegate=" + delegate +
"]";
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/producer/ProducerPortletInvoker.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/producer/ProducerPortletInvoker.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/producer/ProducerPortletInvoker.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,841 @@
+/******************************************************************************
+ * 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.state.producer;
+
+import org.jboss.portal.common.invocation.InvocationException;
+import org.jboss.portal.common.value.Value;
+import org.jboss.portal.portlet.InvalidPortletIdException;
+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.StateEvent;
+import org.jboss.portal.portlet.StatefulPortletContext;
+import org.jboss.portal.portlet.info.PortletInfo;
+import org.jboss.portal.portlet.info.PreferenceInfo;
+import org.jboss.portal.portlet.info.PreferencesInfo;
+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.PortletInvocationResponse;
+import org.jboss.portal.portlet.spi.InstanceContext;
+import org.jboss.portal.portlet.state.AbstractPropertyContext;
+import org.jboss.portal.portlet.state.AccessMode;
+import org.jboss.portal.portlet.state.DestroyCloneFailure;
+import org.jboss.portal.portlet.state.InvalidStateIdException;
+import org.jboss.portal.portlet.state.NoSuchStateException;
+import org.jboss.portal.portlet.state.PropertyChange;
+import org.jboss.portal.portlet.state.PropertyMap;
+import org.jboss.portal.portlet.state.SimplePropertyMap;
+import org.jboss.portal.portlet.state.StateConversionException;
+import org.jboss.portal.portlet.state.StateConverter;
+import org.jboss.portal.portlet.state.StateManagementPolicy;
+import org.jboss.portal.portlet.state.PropertyContext;
+import org.apache.log4j.Logger;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 6765 $
+ */
+public class ProducerPortletInvoker implements PortletInvoker
+{
+
+ /** . */
+ private static final String PRODUCER_CLONE_ID_PREFIX = "_";
+
+ /** . */
+ private static final String CONSUMER_CLONE_ID = "_dumbvalue";
+
+ /** . */
+ private PortletInvoker portletInvoker;
+
+ /** . */
+ private PortletStatePersistenceManager persistenceManager;
+
+ /** . */
+ private StateManagementPolicy stateManagementPolicy;
+
+ /** . */
+ private StateConverter stateConverter;
+
+ /** . */
+ private Logger log = Logger.getLogger(ProducerPortletInvoker.class);
+
+ public PortletInvoker getPortletInvoker()
+ {
+ return portletInvoker;
+ }
+
+ public void setPortletInvoker(PortletInvoker portletInvoker)
+ {
+ this.portletInvoker = portletInvoker;
+ }
+
+ public PortletStatePersistenceManager getPersistenceManager()
+ {
+ return persistenceManager;
+ }
+
+ public void setPersistenceManager(PortletStatePersistenceManager ppm)
+ {
+ this.persistenceManager = ppm;
+ }
+
+ public StateManagementPolicy getStateManagementPolicy()
+ {
+ return stateManagementPolicy;
+ }
+
+ public void setStateManagementPolicy(StateManagementPolicy stateManagementPolicy)
+ {
+ this.stateManagementPolicy = stateManagementPolicy;
+ }
+
+ public StateConverter getStateConverter()
+ {
+ return stateConverter;
+ }
+
+ public void setStateConverter(StateConverter stateConverter)
+ {
+ this.stateConverter = stateConverter;
+ }
+
+ public Set getPortlets() throws PortletInvokerException
+ {
+ return portletInvoker.getPortlets();
+ }
+
+ public Portlet getPortlet(PortletContext portletContext) throws
IllegalArgumentException, PortletInvokerException
+ {
+ if (portletContext == null)
+ {
+ throw new IllegalArgumentException("No null portlet id accepted");
+ }
+ String portletId = portletContext.getId();
+ if (CONSUMER_CLONE_ID.equals(portletId))
+ {
+ byte[] state = portletContext.getState();
+ if (state != null)
+ {
+ try
+ {
+ PortletState portletState = stateConverter.unmarshall(state);
+ Portlet delegate =
portletInvoker.getPortlet(PortletContext.createPortletContext(portletState.getPortletId()));
+ return new ProducerPortlet(portletContext, delegate);
+ }
+ catch (StateConversionException e)
+ {
+ throw new PortletInvokerException(e);
+ }
+ }
+ else
+ {
+ throw new InvalidPortletIdException("", portletId);
+ }
+ }
+ else if (portletId.startsWith(PRODUCER_CLONE_ID_PREFIX))
+ {
+ try
+ {
+ String stateId = portletId.substring(PRODUCER_CLONE_ID_PREFIX.length());
+ PortletStateContext stateContext = persistenceManager.loadState(stateId);
+ PortletState state = stateContext.getState();
+ Portlet delegate =
portletInvoker.getPortlet(PortletContext.createPortletContext(state.getPortletId()));
+ return new ProducerPortlet(portletContext, delegate);
+ }
+ catch (NoSuchStateException e)
+ {
+ throw new NoSuchPortletException(e, portletId);
+ }
+ catch (InvalidStateIdException e)
+ {
+ throw new InvalidPortletIdException(e, portletId);
+ }
+ }
+ else
+ {
+ return portletInvoker.getPortlet(portletContext);
+ }
+ }
+
+ public PortletInvocationResponse invoke(PortletInvocation invocation) throws
PortletInvokerException, InvocationException
+ {
+ // Get the context of the portlet that the client want to use
+ final PortletContext portletContext = invocation.getTarget();
+ if (portletContext == null)
+ {
+ throw new InvocationException("No portlet context provided");
+ }
+
+ // Get the access mode
+ InstanceContext instanceCtx = invocation.getInstanceContext();
+ AccessMode access = instanceCtx.getAccessMode();
+
+ // Get a state contxt for the portlet context
+ InternalContext context = getStateContext(portletContext);
+
+ // If it is a producer offered portlet we consider read-write as read-only
+ if (context.isStateful() == false && access == AccessMode.READ_WRITE)
+ {
+ access = AccessMode.READ_ONLY;
+ }
+
+ // Get the portlet container and set it on invocation
+ Portlet portlet = portletInvoker.getPortlet(context.getPortletContext());
+ if (portlet == null)
+ {
+ throw new NoSuchPortletException("Portlet " +
context.getPortletContext() + " not found", context.getPortletId());
+ }
+
+ // Create prefs
+ AbstractPropertyContext prefs = new AbstractPropertyContext(
+ access,
+ context.isStateful() ? ((StatefulContext)context).getProperties() : null,
+ invocation instanceof RenderInvocation);
+
+ //
+ PortletInvocationResponse response;
+ try
+ {
+ invocation.setTarget(context.getPortletContext());
+ invocation.setAttribute(PortletInvocation.INVOCATION_SCOPE,
PropertyContext.PREFERENCES_ATTRIBUTE, prefs);
+
+ // Invoke
+ response = portletInvoker.invoke(invocation);
+ }
+ finally
+ {
+ invocation.setTarget(portletContext);
+ invocation.removeAttribute(PortletInvocation.INVOCATION_SCOPE,
PropertyContext.PREFERENCES_ATTRIBUTE);
+ }
+
+ //
+ int status = prefs.getStatus();
+
+ // Producer state management if the invocation was succesful
+ if (invocation instanceof ActionInvocation && status ==
AbstractPropertyContext.UPDATE_SUCCESSFUL)
+ {
+ // Get the potentially updated prefs
+ PropertyMap newPrefs = prefs.getPrefs();
+
+ //
+ if (access == AccessMode.CLONE_BEFORE_WRITE)
+ {
+ // Create the state
+ if (context.isStateful())
+ {
+ StatefulContext statefulContext = (StatefulContext)context;
+ boolean persist = stateManagementPolicy.persistLocally();
+ if (persist)
+ {
+ try
+ {
+ // The state id should be ok as it was used before to load the
state
+ LocalContext localContext = (LocalContext)statefulContext;
+ String portletStateId = localContext.getStateId();
+ String cloneStateId = persistenceManager.cloneState(portletStateId,
newPrefs);
+
+ // Return the clone context
+ String cloneId = PRODUCER_CLONE_ID_PREFIX + cloneStateId;
+ PortletContext clonedCtx =
PortletContext.createPortletContext(cloneId);
+ StateEvent event = new StateEvent(clonedCtx,
StateEvent.PORTLET_CLONED_EVENT);
+ instanceCtx.onStateEvent(event);
+ }
+ catch (NoSuchStateException e)
+ {
+ throw new PortletInvokerException("Unexpected exception",
e);
+ }
+ catch (InvalidStateIdException e)
+ {
+ throw new PortletInvokerException("Unexpected exception",
e);
+ }
+ }
+ else
+ {
+ PortletContext clonedCtx = marshall(context.getPortletId(), newPrefs);
+ StateEvent event = new StateEvent(clonedCtx,
StateEvent.PORTLET_CLONED_EVENT);
+ instanceCtx.onStateEvent(event);
+ }
+ }
+ else
+ {
+ // Add the missing mutable portlet state
+ getPropertiesFromMetaData(portlet.getContext(), newPrefs);
+
+ // Create the new state
+ String cloneStateId =
persistenceManager.createState(context.getPortletId(), newPrefs);
+
+ // Return the clone context
+ String cloneId = PRODUCER_CLONE_ID_PREFIX + cloneStateId;
+ PortletContext clonedCtx = PortletContext.createPortletContext(cloneId);
+ StateEvent event = new StateEvent(clonedCtx,
StateEvent.PORTLET_CLONED_EVENT);
+ instanceCtx.onStateEvent(event);
+ }
+ }
+ else if (access == AccessMode.READ_WRITE)
+ {
+ StatefulContext statefulContext = (StatefulContext)context;
+ if (statefulContext.isLocal())
+ {
+ // Update the state
+ try
+ {
+ LocalContext localContext = (LocalContext)statefulContext;
+ String stateId = localContext.getStateId();
+ persistenceManager.updateState(stateId, newPrefs);
+ }
+ catch (NoSuchStateException e)
+ {
+ throw new PortletInvokerException("Unexpected exception",
e);
+ }
+ catch (InvalidStateIdException e)
+ {
+ throw new PortletInvokerException("Unexpected exception",
e);
+ }
+ }
+ else
+ {
+ PortletContext modifiedCtx = marshall(context.getPortletId(), newPrefs);
+ StateEvent event = new StateEvent(modifiedCtx,
StateEvent.PORTLET_MODIFIED_EVENT);
+ instanceCtx.onStateEvent(event);
+ }
+ }
+ else if (access == AccessMode.READ_ONLY)
+ {
+ throw new PortletStateChangeRequiredException("Modification was
requested for portlet with id '"
+ + context.getPortletId() + "' but access mode was READ
ONLY.");
+ }
+ }
+
+ //
+ return response;
+ }
+
+ public PortletContext createClone(PortletContext portletContext) throws
IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
+ {
+ if (portletContext == null)
+ {
+ throw new IllegalArgumentException("No null portlet context
accepted");
+ }
+
+ //
+ String portletId = portletContext.getId();
+ InternalContext context = getStateContext(portletContext);
+ boolean useStore = stateManagementPolicy.persistLocally();
+
+ //
+ if (context.isStateful())
+ {
+ StatefulContext statefulContext = (StatefulContext)context;
+ if (useStore)
+ {
+ try
+ {
+ String stateId = portletId.substring(PRODUCER_CLONE_ID_PREFIX.length());
+ String cloneId = PRODUCER_CLONE_ID_PREFIX +
persistenceManager.cloneState(stateId);
+ return PortletContext.createPortletContext(cloneId);
+ }
+ catch (NoSuchStateException e)
+ {
+ throw new NoSuchPortletException(e, portletId);
+ }
+ catch (InvalidStateIdException e)
+ {
+ throw new InvalidPortletIdException(e, portletId);
+ }
+ }
+ else
+ {
+ return marshall(statefulContext.getPortletId(),
statefulContext.getProperties());
+ }
+ }
+ else
+ {
+ PropertyMap newState = new SimplePropertyMap();
+ getPropertiesFromMetaData(portletContext, newState);
+ if (useStore)
+ {
+ String cloneId = persistenceManager.createState(portletId, newState);
+ return PortletContext.createPortletContext(PRODUCER_CLONE_ID_PREFIX +
cloneId);
+ }
+ else
+ {
+ return marshall(portletId, newState);
+ }
+ }
+ }
+
+ public List destroyClones(List portletContexts) throws IllegalArgumentException,
PortletInvokerException, UnsupportedOperationException
+ {
+ if (portletContexts == null)
+ {
+ throw new IllegalArgumentException("No portlet contexts provided");
+ }
+
+ //
+ List result = new ArrayList();
+ for (Iterator i = portletContexts.iterator(); i.hasNext();)
+ {
+ PortletContext portletContext = (PortletContext)i.next();
+
+ // We only take care of producer hosted state
+ if (!(portletContext instanceof StatefulPortletContext))
+ {
+ String portletId = portletContext.getId();
+ if (!portletId.startsWith(PRODUCER_CLONE_ID_PREFIX))
+ {
+ log.debug("Attempt to destroy a producer offered portlet " +
portletId);
+ DestroyCloneFailure failure = new DestroyCloneFailure(portletId,
"Cannot destroy POP");
+ result.add(failure);
+ }
+ else
+ {
+ try
+ {
+
persistenceManager.destroyState(portletId.substring(PRODUCER_CLONE_ID_PREFIX.length()));
+ }
+ catch (NoSuchStateException e)
+ {
+ log.debug("Attempt to destroy a non existing portlet " +
portletId);
+ DestroyCloneFailure failure = new DestroyCloneFailure(portletId,
"Not found");
+ result.add(failure);
+ }
+ catch (InvalidStateIdException e)
+ {
+ log.debug("Attempt to destroy a non valid portlet " +
portletId);
+ DestroyCloneFailure failure = new DestroyCloneFailure(portletId,
"Invalid portlet id");
+ result.add(failure);
+ }
+ }
+ }
+ }
+ return result;
+ }
+
+ public PropertyMap getProperties(PortletContext portletContext, Set keys) throws
IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
+ {
+ if (keys == null)
+ {
+ throw new IllegalArgumentException("No keys provided");
+ }
+ PropertyMap props = getProperties(portletContext);
+ props.keySet().retainAll(keys);
+ return props;
+ }
+
+ public PropertyMap getProperties(PortletContext portletContext) throws
IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
+ {
+ if (portletContext == null)
+ {
+ throw new IllegalArgumentException("No null portlet id is accepted");
+ }
+
+ //
+ String portletId = portletContext.getId();
+ InternalContext context = getStateContext(portletContext);
+
+ //
+ if (context.isStateful())
+ {
+ StatefulContext statefulContext = (StatefulContext)context;
+
+ // Get the content
+ PropertyMap props = new SimplePropertyMap(statefulContext.getProperties());
+
+ // Dereference the portlet
+ PortletContext refPortletContext = context.getPortletContext();
+
+ // Get the referenced portlet
+ Portlet refPortlet = portletInvoker.getPortlet(refPortletContext);
+
+ // We need the referenced portlet
+ if (refPortlet == null)
+ {
+ throw new PortletInvokerException("The portlet " +
refPortletContext + " referenced by this clone " + portletId + " is not
available");
+ }
+
+ //
+ getPropertiesFromMetaData(refPortletContext, props);
+
+ //
+ return props;
+ }
+ else
+ {
+ // Get the container
+ PropertyMap props = new SimplePropertyMap();
+ getPropertiesFromMetaData(context.getPortletContext(), props);
+ return props;
+ }
+ }
+
+ public PortletContext setProperties(PortletContext portletContext, PropertyChange[]
changes) throws IllegalArgumentException, PortletInvokerException,
UnsupportedOperationException
+ {
+ if (portletContext == null)
+ {
+ throw new IllegalArgumentException("No null portlet id accepted");
+ }
+ if (changes == null)
+ {
+ throw new IllegalArgumentException("No null changes accepted");
+ }
+ for (int i = 0; i < changes.length; i++)
+ {
+ PropertyChange change = changes[i];
+ if (change == null)
+ {
+ throw new IllegalArgumentException("No null change accepted");
+ }
+ }
+
+ //
+ String portletId = portletContext.getId();
+ InternalContext context = getStateContext(portletContext);
+
+ //
+ if (context.isStateful() == false)
+ {
+ throw new InvalidPortletIdException("Cannot configure producer offered
portlets", portletId);
+ }
+ StatefulContext statefulContext = (StatefulContext)context;
+
+ // Get the container
+ Portlet referencedPortlet =
portletInvoker.getPortlet(context.getPortletContext());
+
+ // We need the referenced portlet
+ if (referencedPortlet == null)
+ {
+ throw new PortletInvokerException("The portlet " +
context.getPortletContext() + " referenced by this clone " + portletId + "
is not available");
+ }
+
+ // Get the portlet info
+ PortletInfo referencedPortletInfo = referencedPortlet.getInfo();
+
+ //
+ PreferencesInfo prefs = referencedPortletInfo.getPreferences();
+
+ // Clone the current state
+ PropertyMap properties = new SimplePropertyMap(statefulContext.getProperties());
+
+ // Clone argument
+ for (int i = 0; i < changes.length; i++)
+ {
+ PropertyChange change = changes[i];
+ String key = change.getKey();
+ int type = change.getType();
+
+ // If the original value exist and is read only we perform a reset instead
+ PreferenceInfo pref = prefs.getPreference(key);
+ if (pref != null)
+ {
+ if (Boolean.TRUE.equals(pref.isReadOnly()))
+ {
+ type = PropertyChange.PREF_RESET;
+ }
+ }
+
+ //
+ if (type == PropertyChange.PREF_UPDATE)
+ {
+ properties.setProperty(key, change.getValue());
+ }
+ else
+ {
+ properties.remove(key);
+ }
+ }
+
+ //
+ if (statefulContext.isLocal())
+ {
+ LocalContext localContext = (LocalContext)statefulContext;
+ String stateId = localContext.getStateId();
+ try
+ {
+ persistenceManager.updateState(stateId, properties);
+ }
+ catch (NoSuchStateException e)
+ {
+ throw new NoSuchPortletException(e, portletId);
+ }
+ catch (InvalidStateIdException e)
+ {
+ throw new InvalidPortletIdException(e, portletId);
+ }
+ return PortletContext.createPortletContext(portletId);
+ }
+ else
+ {
+ return marshall(context.getPortletId(), properties);
+ }
+ }
+
+ private PortletContext marshall(String portletId, PropertyMap props) throws
PortletInvokerException
+ {
+ try
+ {
+ PortletState sstate = new PortletState(portletId, props);
+ byte[] marshalledState = stateConverter.marshall(sstate);
+ return PortletContext.createStatefulPortletContext(CONSUMER_CLONE_ID,
marshalledState);
+ }
+ catch (StateConversionException e)
+ {
+ throw new PortletInvokerException(e);
+ }
+ }
+
+ /**
+ * Retrieve the properties from the portlet meta data.
+ *
+ * @param portletContext the portlet context
+ * @return the properties
+ * @throws PortletInvokerException
+ */
+ private void getPropertiesFromMetaData(PortletContext portletContext, PropertyMap
props) throws PortletInvokerException
+ {
+ //
+ Portlet portlet = portletInvoker.getPortlet(portletContext);
+
+ // The prefs info
+ PreferencesInfo prefs = portlet.getInfo().getPreferences();
+
+ // Collect missing or read only properties from the referenced portlet
+ Set keys = new HashSet();
+ for (Iterator i = prefs.getKeys().iterator(); i.hasNext();)
+ {
+ String key = (String)i.next();
+ PreferenceInfo pref = prefs.getPreference(key);
+ if (Boolean.TRUE.equals(pref.isReadOnly()) ||
!props.keySet().contains(pref.getKey()))
+ {
+ keys.add(key);
+ }
+ }
+
+ // Get the missing or read only properties from the referenced portlet properties
+ // and add them to the actual state
+ PropertyMap refPreferencesInfo = portletInvoker.getProperties(portletContext,
keys);
+ for (Iterator i = refPreferencesInfo.entrySet().iterator();i.hasNext();)
+ {
+ Map.Entry entry = (Map.Entry)i.next();
+ String key = (String)entry.getKey();
+ Value value = (Value)entry.getValue();
+ props.setProperty(key, (Value)value.clone());
+ }
+ }
+
+ /**
+ * Return an internal portlet context from the specified portlet context.
+ *
+ * @param portletContext the portlet context
+ * @return the state that the portlet context carries
+ * @throws NoSuchPortletException if the underlying state does not exist
+ * @throws InvalidPortletIdException if the state id is not valid
+ */
+ private InternalContext getStateContext(final PortletContext portletContext) throws
NoSuchPortletException, InvalidPortletIdException
+ {
+ byte[] bytes = portletContext.getState();
+ if (bytes == null)
+ {
+ String portletId = portletContext.getId();
+ if (portletContext.getId().startsWith(PRODUCER_CLONE_ID_PREFIX))
+ {
+ String stateId = portletId.substring(PRODUCER_CLONE_ID_PREFIX.length());
+ try
+ {
+ PortletStateContext stateContext = persistenceManager.loadState(stateId);
+ return new LocalContext(stateContext.getState().getPortletId(),
stateContext.getState().getProperties(), stateContext.getId());
+ }
+ catch (NoSuchStateException e)
+ {
+ throw new NoSuchPortletException(e, portletId);
+ }
+ catch (InvalidStateIdException e)
+ {
+ throw new InvalidPortletIdException(e, portletId);
+ }
+ }
+ else
+ {
+ return new StatelessContext(portletContext.getId());
+ }
+ }
+ else
+ {
+ try
+ {
+ final PortletState state = stateConverter.unmarshall(bytes);
+ return new RemoteContext(state.getPortletId(), state.getProperties());
+ }
+ catch (StateConversionException e)
+ {
+ throw new InvalidPortletIdException(e, portletContext.getId());
+ }
+ }
+ }
+
+ /**
+ * An internal portlet context that describe how the portlet was obtained.
+ */
+ private abstract static class InternalContext
+ {
+
+ /** . */
+ private final String portletId;
+
+ /** . */
+ private final PortletContext portletContext;
+
+ /**
+ * @return true if the context represent a cloned portlet
+ */
+ public abstract boolean isStateful();
+
+ public InternalContext(String portletId)
+ {
+ if (portletId == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ this.portletId = portletId;
+ this.portletContext = PortletContext.createPortletContext(portletId);
+ }
+
+ /**
+ * @return the portlet id in the context of the delegate
+ */
+ public String getPortletId()
+ {
+ return portletId;
+ }
+
+ public PortletContext getPortletContext()
+ {
+ return portletContext;
+ }
+ }
+
+ /**
+ * Describe delegate portlets.
+ */
+ private static class StatelessContext extends InternalContext
+ {
+ public StatelessContext(String portletId)
+ {
+ super(portletId);
+ }
+
+ public boolean isStateful()
+ {
+ return false;
+ }
+ }
+
+ /**
+ * A cloned portlet that points to a delegate portlet.
+ */
+ private abstract static class StatefulContext extends InternalContext
+ {
+
+ /** . */
+ private final PropertyMap properties;
+
+ protected StatefulContext(String portletId, PropertyMap properties)
+ {
+ super(portletId);
+
+ //
+ if (properties == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ this.properties = properties;
+ }
+
+ /**
+ * @return true if the portlet is local
+ */
+ public abstract boolean isLocal();
+
+ public PropertyMap getProperties()
+ {
+ return properties;
+ }
+
+ public boolean isStateful()
+ {
+ return true;
+ }
+ }
+
+ private static class LocalContext extends StatefulContext
+ {
+
+ /** . */
+ private String stateId;
+
+ public LocalContext(String portletId, PropertyMap state, String stateId)
+ {
+ super(portletId, state);
+
+ //
+ if (stateId == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ this.stateId = stateId;
+ }
+
+ public String getStateId()
+ {
+ return stateId;
+ }
+
+ public boolean isLocal()
+ {
+ return true;
+ }
+ }
+
+ private static class RemoteContext extends StatefulContext
+ {
+
+ public RemoteContext(String portletId, PropertyMap state)
+ {
+ super(portletId, state);
+ }
+
+ public boolean isLocal()
+ {
+ return false;
+ }
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/state/producer/ProducerPortletInvoker.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/support/info/CacheInfoSupport.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/support/info/CacheInfoSupport.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/support/info/CacheInfoSupport.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,71 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.support.info;
+
+import org.jboss.portal.portlet.impl.jsr168.info.ContainerCacheInfo;
+import org.jboss.portal.portlet.info.CacheInfo;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public class CacheInfoSupport implements CacheInfo
+{
+
+ /** . */
+ private int expirationTimeMillis;
+
+ /** . */
+ private int referenceType;
+
+ public CacheInfoSupport(int expirationTimeMillis, int referenceType)
+ {
+ this.expirationTimeMillis = expirationTimeMillis;
+ this.referenceType = referenceType;
+ }
+
+ public CacheInfoSupport()
+ {
+ this(0, ContainerCacheInfo.REF_STRONG);
+ }
+
+ public int getExpirationSecs()
+ {
+ return expirationTimeMillis;
+ }
+
+ public void setExpirationTimeMillis(int expirationTimeMillis)
+ {
+ this.expirationTimeMillis = expirationTimeMillis;
+ }
+
+ public int getReferenceType()
+ {
+ return referenceType;
+ }
+
+ public void setReferenceType(int referenceType)
+ {
+ this.referenceType = referenceType;
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/support/info/CapabilitiesInfoSupport.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/support/info/CapabilitiesInfoSupport.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/support/info/CapabilitiesInfoSupport.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,121 @@
+/******************************************************************************
+ * 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.support.info;
+
+import org.jboss.portal.portlet.info.CapabilitiesInfo;
+import org.jboss.portal.Mode;
+import org.jboss.portal.WindowState;
+
+import java.util.Set;
+import java.util.HashSet;
+import java.util.Locale;
+import java.util.Collections;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class CapabilitiesInfoSupport implements CapabilitiesInfo
+{
+
+ /** . */
+ private Set mimeTypes;
+
+ /** . */
+ private Set modes;
+
+ /** . */
+ private Set windowStates;
+
+ /** . */
+ private Set locales;
+
+ public CapabilitiesInfoSupport()
+ {
+ mimeTypes = new HashSet();
+ mimeTypes.add("text/html");
+
+ //
+ modes = new HashSet();
+ modes.add(new ModeInfoSupport(Mode.VIEW));
+ modes.add(new ModeInfoSupport(Mode.EDIT));
+ modes.add(new ModeInfoSupport(Mode.HELP));
+
+ //
+ windowStates = new HashSet();
+ windowStates.add(new WindowStateInfoSupport(WindowState.NORMAL));
+ windowStates.add(new WindowStateInfoSupport(WindowState.MAXIMIZED));
+ windowStates.add(new WindowStateInfoSupport(WindowState.MINIMIZED));
+
+ //
+ locales = new HashSet();
+ locales.add(Locale.ENGLISH);
+ }
+
+ public Set getMimeTypes()
+ {
+ return mimeTypes;
+ }
+
+ public Set getAllModes()
+ {
+ return modes;
+ }
+
+ public Set getModes(String mimeType)
+ {
+ if (mimeTypes.contains(mimeType))
+ {
+ return modes;
+ }
+ return Collections.EMPTY_SET;
+ }
+
+ public Set getAllWindowStates()
+ {
+ return windowStates;
+ }
+
+ public Set getWindowStates(String mimeType)
+ {
+ if (mimeTypes.contains(mimeType))
+ {
+ return windowStates;
+ }
+ return Collections.EMPTY_SET;
+ }
+
+ public Set getAllLocales()
+ {
+ return locales;
+ }
+
+ public Set getLocales(String mimeType)
+ {
+ if (mimeTypes.contains(mimeType))
+ {
+ return locales;
+ }
+ return Collections.EMPTY_SET;
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/support/info/MetaInfoSupport.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/support/info/MetaInfoSupport.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/support/info/MetaInfoSupport.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,98 @@
+/******************************************************************************
+ * 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.support.info;
+
+import org.jboss.portal.common.i18n.LocalizedString;
+import org.jboss.portal.portlet.info.MetaInfo;
+
+import java.util.HashMap;
+import java.util.Locale;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class MetaInfoSupport implements MetaInfo
+{
+
+ /** . */
+ private Map values = new HashMap();
+
+ public LocalizedString getMetaValue(String key)
+ {
+ if (key == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ return (LocalizedString)values.get(key);
+ }
+
+ public void addValue(String key, Locale locale, String value)
+ {
+ if (key == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ LocalizedString string = new LocalizedString(value, locale);
+ if (values.put(key, string) != null)
+ {
+ throw new IllegalStateException("Already existing");
+ }
+ }
+
+ public void setTitle(String name)
+ {
+ addValue(MetaInfo.TITLE, Locale.ENGLISH, name);
+ }
+
+ public void setShortTitle(String name)
+ {
+ addValue(MetaInfo.SHORT_TITLE, Locale.ENGLISH, name);
+ }
+
+ public void setKeywords(String name)
+ {
+ addValue(MetaInfo.KEYWORDS, Locale.ENGLISH, name);
+ }
+
+ public void setDisplayName(String name)
+ {
+ addValue(MetaInfo.DISPLAY_NAME, Locale.ENGLISH, name);
+ }
+
+ public void setDescription(String name)
+ {
+ addValue(MetaInfo.DESCRIPTION, Locale.ENGLISH, name);
+ }
+
+ public String getDisplayName()
+ {
+ LocalizedString string = getMetaValue(MetaInfo.DISPLAY_NAME);
+ if (string == null)
+ {
+ throw new IllegalStateException();
+ }
+ return string.getString(Locale.ENGLISH, true);
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/support/info/ModeInfoSupport.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/support/info/ModeInfoSupport.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/support/info/ModeInfoSupport.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,64 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.support.info;
+
+import org.jboss.portal.Mode;
+import org.jboss.portal.common.i18n.LocalizedString;
+import org.jboss.portal.portlet.info.ModeInfo;
+
+import java.util.Locale;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public class ModeInfoSupport implements ModeInfo
+{
+
+ /** . */
+ private final LocalizedString description;
+
+ /** . */
+ private final Mode mode;
+
+ public ModeInfoSupport(Mode mode)
+ {
+ this.description = new LocalizedString(mode + " mode", Locale.ENGLISH);
+ this.mode = mode;
+ }
+
+ public LocalizedString getDescription()
+ {
+ return description;
+ }
+
+ public Mode getMode()
+ {
+ return mode;
+ }
+
+ public String getModeName()
+ {
+ return mode.toString();
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/support/info/PortletInfoSupport.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/support/info/PortletInfoSupport.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/support/info/PortletInfoSupport.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,111 @@
+/******************************************************************************
+ * 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.support.info;
+
+import org.jboss.portal.portlet.info.CacheInfo;
+import org.jboss.portal.portlet.info.CapabilitiesInfo;
+import org.jboss.portal.portlet.info.MetaInfo;
+import org.jboss.portal.portlet.info.PortletInfo;
+import org.jboss.portal.portlet.info.PreferencesInfo;
+import org.jboss.portal.portlet.info.SecurityInfo;
+import org.jboss.portal.portlet.info.SessionInfo;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public class PortletInfoSupport implements PortletInfo
+{
+
+ private Boolean remotable;
+ private PreferencesInfoSupport preferencesSupport = new PreferencesInfoSupport();
+ private SecurityInfoSupport securitySupport = new SecurityInfoSupport();
+ private CacheInfoSupport cacheSupport = new CacheInfoSupport();
+ private SessionInfoSupport sessionSupport = new SessionInfoSupport();
+ private MetaInfoSupport metaSupport = new MetaInfoSupport();
+
+ public CapabilitiesInfo getCapabilities()
+ {
+ throw new UnsupportedOperationException("Implement me");
+ }
+
+ public PreferencesInfo getPreferences()
+ {
+ return preferencesSupport;
+ }
+
+ public PreferencesInfoSupport getPreferencesSupport()
+ {
+ return preferencesSupport;
+ }
+
+ public MetaInfo getMeta()
+ {
+ return metaSupport;
+ }
+
+ public MetaInfoSupport getMetaSupport()
+ {
+ return metaSupport;
+ }
+
+ public SecurityInfo getSecurity()
+ {
+ return securitySupport;
+ }
+
+ public SecurityInfoSupport getSecuritySupport()
+ {
+ return securitySupport;
+ }
+
+ public CacheInfo getCache()
+ {
+ return cacheSupport;
+ }
+
+ public CacheInfoSupport getCacheSupport()
+ {
+ return cacheSupport;
+ }
+
+ public SessionInfo getSession()
+ {
+ return sessionSupport;
+ }
+
+ public SessionInfoSupport getSessionSupport()
+ {
+ return sessionSupport;
+ }
+
+ public Boolean isRemotable()
+ {
+ return remotable;
+ }
+
+ public void setRemotable(Boolean remotable)
+ {
+ this.remotable = remotable;
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/support/info/PreferenceInfoSupport.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/support/info/PreferenceInfoSupport.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/support/info/PreferenceInfoSupport.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,99 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.support.info;
+
+import org.jboss.portal.common.i18n.LocalizedString;
+import org.jboss.portal.portlet.info.PreferenceInfo;
+
+import java.util.Locale;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public class PreferenceInfoSupport implements PreferenceInfo
+{
+
+ /** . */
+ private final String key;
+
+ /** . */
+ private LocalizedString displayName;
+
+ /** . */
+ private LocalizedString description;
+
+ /** . */
+ private Boolean readOnly;
+
+ public PreferenceInfoSupport(String key)
+ {
+ this.key = key;
+ this.displayName = new LocalizedString("Display name of " + key,
Locale.ENGLISH);
+ this.description = new LocalizedString("Description of " + key,
Locale.ENGLISH);
+ this.readOnly = null;
+ }
+
+ public PreferenceInfoSupport(String key, Boolean readOnly)
+ {
+ this.key = key;
+ this.displayName = new LocalizedString("Display name of " + key,
Locale.ENGLISH);
+ this.description = new LocalizedString("Description of " + key,
Locale.ENGLISH);
+ this.readOnly = readOnly;
+ }
+
+ public String getKey()
+ {
+ return key;
+ }
+
+ public LocalizedString getDisplayName()
+ {
+ return displayName;
+ }
+
+ public LocalizedString getDescription()
+ {
+ return description;
+ }
+
+ public Boolean isReadOnly()
+ {
+ return readOnly;
+ }
+
+ public void setReadOnly(Boolean readOnly)
+ {
+ this.readOnly = readOnly;
+ }
+
+ public void setDisplayName(LocalizedString displayName)
+ {
+ this.displayName = displayName;
+ }
+
+ public void setDescription(LocalizedString description)
+ {
+ this.description = description;
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/support/info/PreferencesInfoSupport.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/support/info/PreferencesInfoSupport.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/support/info/PreferencesInfoSupport.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,76 @@
+/******************************************************************************
+ * 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.support.info;
+
+import org.jboss.portal.common.value.Value;
+import org.jboss.portal.portlet.info.PreferenceInfo;
+import org.jboss.portal.portlet.info.PreferencesInfo;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public class PreferencesInfoSupport implements PreferencesInfo
+{
+
+ private final Map preferences;
+
+ public PreferencesInfoSupport(Map preferences)
+ {
+ this.preferences = preferences;
+ }
+
+ public PreferencesInfoSupport()
+ {
+ this(new HashMap());
+ }
+
+ public Set getKeys()
+ {
+ return preferences.keySet();
+ }
+
+ public PreferenceInfo getPreference(String key) throws IllegalArgumentException
+ {
+ return (PreferenceInfo)preferences.get(key);
+ }
+
+ public void addPreference(PreferenceInfoSupport preference)
+ {
+ preferences.put(preference.getKey(), preference);
+ }
+
+ public void addPreference(String key)
+ {
+ preferences.put(key, new PreferenceInfoSupport(key));
+ }
+
+ public void addPreference(String key, Boolean readOnly)
+ {
+ preferences.put(key, new PreferenceInfoSupport(key, readOnly));
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/support/info/SecurityInfoSupport.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/support/info/SecurityInfoSupport.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/support/info/SecurityInfoSupport.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,60 @@
+/******************************************************************************
+ * 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.support.info;
+
+import org.jboss.portal.common.util.CollectionBuilder;
+import org.jboss.portal.portlet.TransportGuarantee;
+import org.jboss.portal.portlet.info.SecurityInfo;
+
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public class SecurityInfoSupport implements SecurityInfo
+{
+
+ /** . */
+ private final Set transportGuarantees;
+
+ public SecurityInfoSupport(Set transportGuarantees)
+ {
+ this.transportGuarantees = transportGuarantees;
+ }
+
+ public SecurityInfoSupport()
+ {
+ this(new CollectionBuilder().add(TransportGuarantee.NONE).toHashSet());
+ }
+
+ public boolean containsTransportGuarantee(TransportGuarantee transportGuarantee)
+ {
+ return transportGuarantees.contains(transportGuarantee);
+ }
+
+ public Set getTransportGuarantees()
+ {
+ return transportGuarantees;
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/support/info/SessionInfoSupport.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/support/info/SessionInfoSupport.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/support/info/SessionInfoSupport.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,56 @@
+/******************************************************************************
+ * 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.support.info;
+
+import org.jboss.portal.portlet.info.SessionInfo;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public class SessionInfoSupport implements SessionInfo
+{
+
+ /** . */
+ private Boolean distributed;
+
+ public SessionInfoSupport(Boolean distributed)
+ {
+ this.distributed = distributed;
+ }
+
+ public SessionInfoSupport()
+ {
+ this(null);
+ }
+
+ public Boolean getDistributed()
+ {
+ return distributed;
+ }
+
+ public void setDistributed(Boolean distributed)
+ {
+ this.distributed = distributed;
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/support/info/WindowStateInfoSupport.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/support/info/WindowStateInfoSupport.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/support/info/WindowStateInfoSupport.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,64 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.support.info;
+
+import org.jboss.portal.WindowState;
+import org.jboss.portal.common.i18n.LocalizedString;
+import org.jboss.portal.portlet.info.WindowStateInfo;
+
+import java.util.Locale;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public class WindowStateInfoSupport implements WindowStateInfo
+{
+
+ /** . */
+ private final LocalizedString description;
+
+ /** . */
+ private final WindowState windowState;
+
+ public WindowStateInfoSupport(WindowState mode)
+ {
+ this.description = new LocalizedString(mode + " window state",
Locale.ENGLISH);
+ this.windowState = mode;
+ }
+
+ public LocalizedString getDescription()
+ {
+ return description;
+ }
+
+ public WindowState getWindowState()
+ {
+ return windowState;
+ }
+
+ public String getWindowStateName()
+ {
+ return windowState.toString();
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/support/spi/ActionContextSupport.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/support/spi/ActionContextSupport.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/support/spi/ActionContextSupport.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,74 @@
+/******************************************************************************
+ * 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.support.spi;
+
+import org.jboss.portal.portlet.PortletParameters;
+import org.jboss.portal.portlet.StateString;
+import org.jboss.portal.portlet.spi.ActionContext;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5976 $
+ */
+public class ActionContextSupport extends PortletInvocationContextSupport implements
ActionContext
+{
+
+ public String getCharacterEncoding()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public int getContentLength()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public BufferedReader getReader() throws IOException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public InputStream getInputStream() throws IOException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public String getContentType()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public StateString getInteractionState()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public PortletParameters getForm()
+ {
+ throw new UnsupportedOperationException();
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/support/spi/ActionContextSupport.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/support/spi/InstanceContextSupport.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/support/spi/InstanceContextSupport.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/support/spi/InstanceContextSupport.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,49 @@
+/******************************************************************************
+ * 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.support.spi;
+
+import org.jboss.portal.portlet.StateEvent;
+import org.jboss.portal.portlet.spi.InstanceContext;
+import org.jboss.portal.portlet.state.AccessMode;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public class InstanceContextSupport implements InstanceContext
+{
+ public String getId()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public AccessMode getAccessMode()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public void onStateEvent(StateEvent event)
+ {
+ throw new UnsupportedOperationException();
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/support/spi/InstanceContextSupport.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/support/spi/PortletInvocationContextSupport.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/support/spi/PortletInvocationContextSupport.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/support/spi/PortletInvocationContextSupport.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,69 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.support.spi;
+
+import org.jboss.portal.Mode;
+import org.jboss.portal.WindowState;
+import org.jboss.portal.common.invocation.AbstractInvocationContext;
+import org.jboss.portal.common.util.MarkupInfo;
+import org.jboss.portal.portlet.PortletURL;
+import org.jboss.portal.portlet.StateString;
+import org.jboss.portal.portlet.spi.PortletInvocationContext;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5064 $
+ */
+public class PortletInvocationContextSupport extends AbstractInvocationContext implements
PortletInvocationContext
+{
+
+ public StateString getNavigationalState()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public Mode getMode()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public WindowState getWindowState()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public MarkupInfo getMarkupInfo()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public String encodeResourceURL(String url) throws IllegalArgumentException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public String renderURL(PortletURL portletURL, Boolean wantSecure, Boolean
wantAuthenticated, boolean relative)
+ {
+ throw new UnsupportedOperationException();
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/support/spi/PortletInvocationContextSupport.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/support/spi/RenderContextSupport.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/support/spi/RenderContextSupport.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/support/spi/RenderContextSupport.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,33 @@
+/******************************************************************************
+ * 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.support.spi;
+
+import org.jboss.portal.portlet.spi.RenderContext;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public class RenderContextSupport extends PortletInvocationContextSupport implements
RenderContext
+{
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/support/spi/RenderContextSupport.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/support/spi/SecurityContextSupport.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/support/spi/SecurityContextSupport.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/support/spi/SecurityContextSupport.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -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.portlet.support.spi;
+
+import org.jboss.portal.portlet.spi.SecurityContext;
+
+import java.security.Principal;
+
+/**
+ * @author <a
href="mailto:chris.laprun@jboss.com?subject=org.jboss.portal.portlet.support.spi.SecurityContextSupport">Chris
+ * Laprun</a>
+ * @version $Revision: 5448 $
+ * @since 2.4
+ */
+public class SecurityContextSupport implements SecurityContext
+{
+ public boolean isSecure()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public String getAuthType()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public String getRemoteUser()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public Principal getUserPrincipal()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public boolean isUserInRole(String roleName)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+
+ public boolean isAuthenticated()
+ {
+ throw new UnsupportedOperationException();
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/support/spi/SecurityContextSupport.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/support/spi/UserContextSupport.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/support/spi/UserContextSupport.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/support/spi/UserContextSupport.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,70 @@
+/******************************************************************************
+ * 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.support.spi;
+
+import org.jboss.portal.portlet.spi.UserContext;
+
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.Collections;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 6195 $
+ */
+public class UserContextSupport implements UserContext
+{
+
+ /**
+ * Returns null.
+ */
+ public String getId()
+ {
+ return null;
+ }
+
+ /**
+ * Returns <code>Collections.EMPTY_MAP</code>.
+ */
+ public Map getInformations()
+ {
+ return Collections.EMPTY_MAP;
+ }
+
+ /**
+ * Returns <code>Locale.ENGLISH</code>.
+ */
+ public Locale getLocale()
+ {
+ return Locale.ENGLISH;
+ }
+
+ /**
+ * Returns <code>Collections.EMPTY_LIST</code>.
+ */
+ public List getLocales()
+ {
+ return Collections.EMPTY_LIST;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/support/spi/UserContextSupport.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/test/ActionContextImpl.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/test/ActionContextImpl.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/test/ActionContextImpl.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,56 @@
+/******************************************************************************
+ * 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.common.invocation.resolver.MapAttributeResolver;
+import org.jboss.portal.portlet.invocation.PortletInvocation;
+import org.jboss.portal.portlet.support.spi.ActionContextSupport;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5113 $
+ */
+public class ActionContextImpl extends ActionContextSupport
+{
+
+ /** . */
+ private final Mode mode;
+
+ public ActionContextImpl(Mode mode)
+ {
+ this.mode = mode;
+ addResolver(PortletInvocation.REQUEST_SCOPE, new MapAttributeResolver());
+ addResolver(PortletInvocation.INVOCATION_SCOPE, new MapAttributeResolver());
+ }
+
+ public ActionContextImpl()
+ {
+ this(Mode.EDIT);
+ }
+
+ public Mode getMode()
+ {
+ return mode;
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/test/InstanceContextImpl.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/test/InstanceContextImpl.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/test/InstanceContextImpl.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,102 @@
+/******************************************************************************
+ * 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.portlet.PortletContext;
+import org.jboss.portal.portlet.StateEvent;
+import org.jboss.portal.portlet.spi.InstanceContext;
+import org.jboss.portal.portlet.state.AccessMode;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class InstanceContextImpl implements InstanceContext
+{
+
+ /** . */
+ private final String id;
+
+ /** . */
+ private final AccessMode accessMode;
+
+ /** . */
+ private PortletContext clonedContext;
+
+ /** . */
+ private PortletContext modifiedContext;
+
+ public InstanceContextImpl(String id)
+ {
+ this(id, AccessMode.READ_ONLY);
+ }
+
+ public InstanceContextImpl(String id, AccessMode accessMode)
+ {
+ if (id == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ if (accessMode == null)
+ {
+ throw new IllegalArgumentException();
+ }
+
+ //
+ this.id = id;
+ this.accessMode = accessMode;
+ }
+
+ public String getId()
+ {
+ return id;
+ }
+
+ public AccessMode getAccessMode()
+ {
+ return accessMode;
+ }
+
+ public void onStateEvent(StateEvent event)
+ {
+ StateEvent.StateEventType type = event.getType();
+ if (StateEvent.PORTLET_CLONED_EVENT.equals(type))
+ {
+ clonedContext = event.getPortletContext();
+ }
+ else if (StateEvent.PORTLET_MODIFIED_EVENT.equals(type))
+ {
+ modifiedContext = event.getPortletContext();
+ }
+ }
+
+ public PortletContext getClonedContext()
+ {
+ return clonedContext;
+ }
+
+ public PortletContext getModifiedContext()
+ {
+ return modifiedContext;
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/test/TestPortalContext.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/test/TestPortalContext.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/test/TestPortalContext.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,76 @@
+/******************************************************************************
+ * 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.util.CollectionBuilder;
+import org.jboss.portal.portlet.spi.PortalContext;
+
+import java.util.Collections;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 7001 $
+ */
+public class TestPortalContext implements PortalContext
+{
+
+ /** . */
+ private final Set windowStates;
+
+ /** . */
+ private final Set modes;
+
+ /** . */
+ private final Map props;
+
+ public TestPortalContext()
+ {
+ windowStates = Collections.unmodifiableSet(new
CollectionBuilder().add(WindowState.MAXIMIZED).add(WindowState.MINIMIZED).add(WindowState.NORMAL).toHashSet());
+ modes = Collections.unmodifiableSet(new
CollectionBuilder().add(Mode.EDIT).add(Mode.HELP).add(Mode.VIEW).toHashSet());
+ props = Collections.EMPTY_MAP;
+ }
+
+ public String getInfo()
+ {
+ return "JBossPortal/1.0";
+ }
+
+ public Set getWindowStates()
+ {
+ return windowStates;
+ }
+
+ public Set getModes()
+ {
+ return modes;
+ }
+
+ public Map getProperties()
+ {
+ return props;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/test/TestPortalContext.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/test/TestPortletInvoker.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/test/TestPortletInvoker.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/test/TestPortletInvoker.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,157 @@
+/******************************************************************************
+ * 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.InterceptorStackFactory;
+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.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.invocation.PortletInvocation;
+import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
+import org.jboss.portal.portlet.state.PropertyChange;
+import org.jboss.portal.portlet.state.PropertyMap;
+
+import java.util.List;
+import java.util.Set;
+
+/**
+ * A simple consumer.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 6712 $
+ */
+public class TestPortletInvoker implements PortletInvoker
+{
+
+ /** . */
+ private InterceptorStackFactory stackFactory;
+
+ /** . */
+ private PortletInvoker producer;
+
+ /** . */
+ private InvocationHandler handler = new InvocationHandler()
+ {
+ public Object invoke(Invocation invocation) throws Exception, InvocationException
+ {
+ PortletInvocation portletInvocation = (PortletInvocation)invocation;
+ try
+ {
+ portletInvocation.setHandler(null);
+ return producer.invoke(portletInvocation);
+ }
+ finally
+ {
+ portletInvocation.setHandler(this);
+ }
+ }
+ };
+
+ public InterceptorStackFactory getStackFactory()
+ {
+ return stackFactory;
+ }
+
+ public void setStackFactory(InterceptorStackFactory stackFactory)
+ {
+ this.stackFactory = stackFactory;
+ }
+
+ public PortletInvoker getProducer()
+ {
+ return producer;
+ }
+
+ public void setProducer(PortletInvoker producer)
+ {
+ this.producer = producer;
+ }
+
+ public Set getPortlets() throws PortletInvokerException
+ {
+ return producer.getPortlets();
+ }
+
+ public Portlet getPortlet(PortletContext portletContext) throws
IllegalArgumentException, PortletInvokerException
+ {
+ return producer.getPortlet(portletContext);
+ }
+
+ public PortletInvocationResponse invoke(PortletInvocation invocation) throws
PortletInvokerException
+ {
+ InvocationHandler prevHandler = invocation.getHandler();
+ try
+ {
+ invocation.setHandler(handler);
+ return
(PortletInvocationResponse)invocation.invoke(stackFactory.getInterceptorStack());
+ }
+ catch (Exception e)
+ {
+ if (e instanceof PortletInvokerException)
+ {
+ throw(PortletInvokerException)e;
+ }
+ else if (e instanceof RuntimeException)
+ {
+ throw(RuntimeException)e;
+ }
+ else
+ {
+ throw new PortletInvokerException(e);
+ }
+ }
+ finally
+ {
+ invocation.setHandler(prevHandler);
+ }
+ }
+
+ public PortletContext createClone(PortletContext portletContext) throws
IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public List destroyClones(List portletContexts) throws IllegalArgumentException,
PortletInvokerException, UnsupportedOperationException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public PropertyMap getProperties(PortletContext portletContext, Set keys) throws
IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public PropertyMap getProperties(PortletContext portletContext) throws
IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public PortletContext setProperties(PortletContext portletContext, PropertyChange[]
changes) throws IllegalArgumentException, PortletInvokerException,
UnsupportedOperationException
+ {
+ throw new UnsupportedOperationException();
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/test/TestPortletInvoker.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/test/UserContextImpl.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/test/UserContextImpl.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/test/UserContextImpl.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,55 @@
+/******************************************************************************
+ * 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.portlet.support.spi.UserContextSupport;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 3188 $
+ */
+public class UserContextImpl extends UserContextSupport
+{
+
+ /** . */
+ private final String id;
+
+ public UserContextImpl(String id)
+ {
+ if (id == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ this.id = id;
+ }
+
+ public UserContextImpl()
+ {
+ this.id = null;
+ }
+
+ public String getId()
+ {
+ return id;
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/test/ValueMapAssert.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/test/ValueMapAssert.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/test/ValueMapAssert.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,65 @@
+/******************************************************************************
+ * 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 junit.framework.Assert;
+import org.jboss.portal.common.value.Value;
+import org.jboss.portal.portlet.state.PropertyMap;
+
+import java.util.HashSet;
+import java.util.Iterator;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public class ValueMapAssert extends Assert
+{
+ public static void assertEquals(PropertyMap vm1, PropertyMap vm2)
+ {
+ if (vm1 == null)
+ {
+ if (vm2 != null)
+ {
+ fail("Value map should be null");
+ }
+ }
+ else
+ {
+ if (vm2 == null)
+ {
+ fail("Value map should not be null");
+ }
+ assertEquals("Value maps don't have the same keys", new
HashSet(vm1.keySet()), new HashSet(vm2.keySet()));
+ for (Iterator i = vm1.keySet().iterator(); i.hasNext();)
+ {
+ String key = (String)i.next();
+ Value v1 = vm1.getProperty(key);
+ Value v2 = vm2.getProperty(key);
+ assertEquals("Values for key " + key + " are not equals",
v1, v2);
+ }
+ }
+ }
+
+
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/test/ValueMapAssert.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/test/support/PortletInvokerSupport.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/test/support/PortletInvokerSupport.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/test/support/PortletInvokerSupport.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,259 @@
+/******************************************************************************
+ * 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.support;
+
+import org.jboss.portal.portlet.InvalidPortletIdException;
+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.support.info.PortletInfoSupport;
+import org.jboss.portal.portlet.info.PortletInfo;
+import org.jboss.portal.portlet.invocation.PortletInvocation;
+import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
+import org.jboss.portal.portlet.state.PropertyChange;
+import org.jboss.portal.portlet.state.PropertyMap;
+import org.jboss.portal.portlet.state.SimplePropertyMap;
+import org.jboss.portal.common.value.Value;
+
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.Iterator;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 6712 $
+ */
+public class PortletInvokerSupport implements PortletInvoker
+{
+
+ /** . */
+ private Map portlets;
+
+ public PortletInvokerSupport()
+ {
+ this.portlets = new HashMap();
+ }
+
+ public void setValid(String portletId, boolean valid)
+ {
+ getInternalPortlet(portletId).valid = valid;
+ }
+
+ public InternalPortlet addInternalPortlet(String portletId, PortletInfoSupport info)
+ {
+ return addInternalPortlet(portletId, new PortletSupport(info));
+ }
+
+ public InternalPortlet addInternalPortlet(String portletId, PortletSupport support)
+ {
+ if (portletId == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ if (support == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ InternalPortlet portlet = new InternalPortlet(portletId, support);
+ if (portlets.put(portletId, portlet) != null)
+ {
+ throw new IllegalStateException();
+ }
+ return portlet;
+ }
+
+ public PortletInvokerSupport removeInternalPortlet(String portletId)
+ {
+ if (portlets.remove(portletId) == null)
+ {
+ throw new IllegalStateException();
+ }
+ return this;
+ }
+
+ public InternalPortlet getInternalPortlet(String portletId)
+ {
+ if (portletId == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ InternalPortlet portlet = (InternalPortlet)portlets.get(portletId);
+ if (portlet == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ return portlet;
+ }
+
+ public Set getPortlets()
+ {
+ return new HashSet(portlets.values());
+ }
+
+ public Portlet getPortlet(PortletContext portletContext) throws
IllegalArgumentException, PortletInvokerException
+ {
+ return internalGetPortlet(portletContext);
+ }
+
+ public PortletInvocationResponse invoke(PortletInvocation invocation) throws
PortletInvokerException
+ {
+ PortletContext portletContext = invocation.getTarget();
+ InternalPortlet portlet = internalGetPortlet(portletContext);
+ return portlet.support.invoke(invocation);
+ }
+
+ private InternalPortlet internalGetPortlet(PortletContext portletContext) throws
IllegalArgumentException, PortletInvokerException
+ {
+ if (portletContext == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ String portletId = portletContext.getId();
+ InternalPortlet portlet = (InternalPortlet)portlets.get(portletId);
+ if (portlet == null)
+ {
+ throw new NoSuchPortletException(portletId);
+ }
+ if (portlet.isValid() == false)
+ {
+ throw new InvalidPortletIdException(portletId);
+ }
+ return portlet;
+ }
+
+ public static class InternalPortlet implements Portlet
+ {
+
+ /** . */
+ private final PortletContext portletContext;
+
+ /** . */
+ private final PortletSupport support;
+
+ /** . */
+ private boolean valid;
+
+ /** . */
+ private Map state;
+
+ public InternalPortlet(String portletId, PortletSupport support)
+ {
+ if (portletId == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ if (support == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ this.portletContext = PortletContext.createPortletContext(portletId);
+ this.support = support;
+ this.valid = true;
+ this.state = new HashMap();
+ }
+
+ public void addPreference(String key, Value value)
+ {
+ support.getInfoSupport().getPreferencesSupport().addPreference(key);
+ state.put(key, value);
+ }
+
+ public void addPreference(String key, Value value, Boolean readOnly)
+ {
+ support.getInfoSupport().getPreferencesSupport().addPreference(key, readOnly);
+ state.put(key, value);
+ }
+
+ public PortletContext getContext()
+ {
+ return portletContext;
+ }
+
+ public PortletInfo getInfo()
+ {
+ return support.getInfoSupport();
+ }
+
+ public boolean isRemote()
+ {
+ return false;
+ }
+
+ public boolean isValid()
+ {
+ return valid;
+ }
+ }
+
+ public PropertyMap getProperties(PortletContext portletContext, Set keys) throws
IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
+ {
+ InternalPortlet internalPortlet = internalGetPortlet(portletContext);
+ PropertyMap props = new SimplePropertyMap();
+ for (Iterator i = keys.iterator();i.hasNext();)
+ {
+ String key = (String)i.next();
+ Value value = (Value)internalPortlet.state.get(key);
+ if (value != null)
+ {
+ props.put(key, value.clone());
+ }
+ }
+ return props;
+ }
+
+ public PropertyMap getProperties(PortletContext portletContext) throws
IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
+ {
+ InternalPortlet internalPortlet = internalGetPortlet(portletContext);
+ PropertyMap props = new SimplePropertyMap();
+ for (Iterator i = internalPortlet.state.keySet().iterator();i.hasNext();)
+ {
+ String key = (String)i.next();
+ Value value = (Value)internalPortlet.state.get(key);
+ if (value != null)
+ {
+ props.put(key, value.clone());
+ }
+ }
+ return props;
+ }
+
+ public PortletContext createClone(PortletContext portletContext) throws
IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public List destroyClones(List portletContexts) throws IllegalArgumentException,
PortletInvokerException, UnsupportedOperationException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public PortletContext setProperties(PortletContext portletContext, PropertyChange[]
changes) throws IllegalArgumentException, PortletInvokerException,
UnsupportedOperationException
+ {
+ throw new UnsupportedOperationException();
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/test/support/PortletInvokerSupport.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/test/support/PortletSupport.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/test/support/PortletSupport.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/test/support/PortletSupport.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -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.portlet.test.support;
+
+import org.jboss.portal.portlet.PortletInvokerException;
+import org.jboss.portal.portlet.support.info.PortletInfoSupport;
+import org.jboss.portal.portlet.info.PortletInfo;
+import org.jboss.portal.portlet.invocation.PortletInvocation;
+import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 6116 $
+ */
+public class PortletSupport
+{
+
+ /** . */
+ protected final PortletInfoSupport info;
+
+ /** . */
+ protected boolean valid;
+
+ public PortletSupport(PortletInfoSupport info)
+ {
+ if (info == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ this.info = info;
+ this.valid = true;
+ }
+
+ public PortletSupport()
+ {
+ this(new PortletInfoSupport());
+ }
+
+ public PortletInfoSupport getInfoSupport()
+ {
+ return info;
+ }
+
+ public PortletInvocationResponse invoke(PortletInvocation invocation) throws
PortletInvokerException
+ {
+ throw new PortletInvokerException("No implementations");
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/portlet/test/support/PortletSupport.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/Joinpoint.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/Joinpoint.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/Joinpoint.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,97 @@
+/******************************************************************************
+ * 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.portlet;
+
+/**
+ * Defines a binding point for component id and its method.
+ *
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 5510 $
+ */
+public class Joinpoint
+{
+
+ /** . */
+ public static int PORTLET_RENDER = 0;
+
+ /** . */
+ public static int PORTLET_ACTION = 1;
+
+ /** . */
+ //public static int PORTLET_INIT = 1;
+
+ /** . */
+ public static int SERVLET_SERVICE = 2;
+
+
+ /** Id of component like "portlet A", "Servlet B". */
+ private final String id;
+
+ /** method in component like "render" and etc. */
+ private final int point;
+
+ public Joinpoint(String id, int point)
+ {
+ if (id == null)
+ {
+ throw new IllegalArgumentException("Component id value cannot be
'null'");
+ }
+ else if (point < 0)
+ {
+ throw new IllegalArgumentException("Binding point has wrong value");
+ }
+ this.id = id;
+ this.point = point;
+ }
+
+ public String getId()
+ {
+ return id;
+ }
+
+ public int getPoint()
+ {
+ return point;
+ }
+
+ public int hashCode()
+ {
+ return id.hashCode() * point;
+ }
+
+ public boolean equals(Object obj)
+ {
+ if (!(obj instanceof Joinpoint))
+ {
+ throw new IllegalArgumentException("Cannot compare with different object
class");
+ }
+ Joinpoint j = (Joinpoint)obj;
+ return id.equals(j.id) && point == j.point;
+ }
+
+ public String toString()
+ {
+ return id + "_" + point;
+ }
+}
+
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/Joinpoint.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/PortletTest.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/PortletTest.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/PortletTest.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,145 @@
+/******************************************************************************
+ * 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.portlet;
+
+import org.jboss.portal.test.framework.server.NodeId;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+import java.util.HashSet;
+
+/**
+ * Keeps sequents of TestActions for one test. Actions are binded to specific request
counts with Jointcuts
+ *
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 6752 $
+ */
+public class PortletTest
+{
+
+ /** . */
+ private Map actionMap;
+
+ /** . */
+ Set parameters;
+
+ public PortletTest()
+ {
+ actionMap = new HashMap();
+ parameters = new HashSet();
+ }
+
+ public void addParameter(String parameterName)
+ {
+ parameters.add(parameterName);
+ }
+
+ public void addAction(int requestCount, Joinpoint joinpoint, TestAction action)
+ {
+ addAction(requestCount, NodeId.DEFAULT, joinpoint, action);
+ }
+
+ public void addAction(int requestCount, NodeId nodeId, Joinpoint joinpoint, TestAction
action)
+ {
+ if (action == null)
+ {
+ throw new IllegalArgumentException("Action can't be null");
+ }
+ Key key = new Key(requestCount, nodeId, joinpoint);
+ if (actionMap.containsKey(key))
+ {
+ throw new IllegalStateException("Action for this joinpoint already defined
in provided request count");
+ }
+ else
+ {
+ actionMap.put(key, action);
+ }
+ }
+
+ public TestAction getAction(int requestCount, Joinpoint joinpoint)
+ {
+ return getAction(requestCount, NodeId.DEFAULT, joinpoint);
+ }
+
+ public TestAction getAction(int requestCount, NodeId nodeId, Joinpoint joinpoint)
+ {
+ Key key = new Key(requestCount, nodeId, joinpoint);
+ return (TestAction)actionMap.get(key);
+ }
+
+ private static class Key
+ {
+
+ /** . */
+ private final int requestCount;
+
+ /** . */
+ private final NodeId nodeId;
+
+ /** . */
+ private final Joinpoint joinpoint;
+
+ public Key(int requestCount, NodeId nodeId, Joinpoint joinpoint)
+ {
+ if (requestCount < 0)
+ {
+ throw new IllegalArgumentException("Request Number must be
positive");
+ }
+ if (nodeId == null)
+ {
+ throw new IllegalArgumentException("No node id provided");
+ }
+ if (joinpoint == null)
+ {
+ throw new IllegalArgumentException("Joinpoint can't be null");
+ }
+ this.requestCount = requestCount;
+ this.nodeId = nodeId;
+ this.joinpoint = joinpoint;
+ }
+
+ public boolean equals(Object o)
+ {
+ if (this == o)
+ {
+ return true;
+ }
+ if (o instanceof Key)
+ {
+ Key that = (Key)o;
+ return this.requestCount == that.requestCount &&
this.joinpoint.equals(that.joinpoint) && this.nodeId.equals(that.nodeId);
+ }
+ return false;
+ }
+
+ public int hashCode()
+ {
+ int result;
+ result = requestCount;
+ result = 29 * result + nodeId.hashCode();
+ result = 29 * result + joinpoint.hashCode();
+ return result;
+ }
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/PortletTest.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/PortletTestContext.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/PortletTestContext.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/PortletTestContext.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,83 @@
+/******************************************************************************
+ * 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.portlet;
+
+import org.jboss.portal.test.framework.driver.DriverResponse;
+import org.jboss.portal.test.framework.driver.remote.TestContext;
+import org.jboss.portal.test.framework.server.NodeId;
+import org.jboss.portal.test.framework.TestParameterValue;
+
+import java.net.MalformedURLException;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class PortletTestContext
+{
+
+ final String testName;
+
+ /** . */
+ final TestContext testContext;
+
+ public PortletTestContext(String testName, TestContext httpTestContext)
+ {
+ if (httpTestContext == null)
+ {
+ throw new IllegalArgumentException("No http test context to wrap");
+ }
+ this.testName = testName;
+ this.testContext = httpTestContext;
+ }
+
+ public String getTestName()
+ {
+ return testName;
+ }
+
+ public void setResponse(DriverResponse response)
+ {
+ testContext.setResponse(response);
+ }
+
+ public int getRequestCount()
+ {
+ return testContext.getRequestCount();
+ }
+
+ public String rewriteURLForNode(String url, NodeId nodeId) throws
MalformedURLException
+ {
+ return testContext.rewriteURLForNode(url, nodeId);
+ }
+
+ public String getParameter(String parameterName)
+ {
+ if (parameterName == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ TestParameterValue parameterValue =
testContext.getParametrization().getParameterValue(parameterName);
+ return parameterValue != null ? (String)parameterValue.get() : null;
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/PortletTestDriver.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/PortletTestDriver.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/PortletTestDriver.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,143 @@
+/******************************************************************************
+ * 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.portlet;
+
+import org.jboss.portal.test.framework.info.TestInfo;
+import org.jboss.portal.test.framework.info.TestContainerInfo;
+import org.jboss.portal.test.framework.info.TestItemInfo;
+import org.jboss.portal.test.framework.info.TestParameterInfo;
+import org.jboss.portal.test.framework.driver.DriverResponse;
+import org.jboss.portal.test.framework.driver.DriverCommand;
+import org.jboss.portal.test.framework.driver.TestDriverException;
+import org.jboss.portal.test.framework.driver.http.response.InvokeGetResponse;
+import org.jboss.portal.test.framework.driver.http.HttpTestDriver;
+import org.jboss.portal.test.framework.driver.remote.TestContext;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Collections;
+import java.util.Iterator;
+
+/**
+ * Registry of action sequences. Every sequence is binded with test id
+ *
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 6720 $
+ */
+public class PortletTestDriver implements HttpTestDriver
+{
+
+ /** . */
+ private final Map entries;
+
+ /** . */
+ protected final TestContainerInfo container;
+
+ /** . */
+ private static PortletTestContext context;
+
+ public PortletTestDriver(String name)
+ {
+ entries = Collections.synchronizedMap(new HashMap());
+ container = new TestContainerInfo(name);
+ }
+
+ /**
+ * Adding sequence to registry. Sequence can be null as this will clear the binding
+ *
+ * @param testName
+ * @param portletTest
+ */
+ public void addSequence(String testName, PortletTest portletTest)
+ {
+ if (testName == null)
+ {
+ throw new IllegalArgumentException("Test name must be provided");
+ }
+ if (portletTest == null)
+ {
+ throw new IllegalArgumentException("Portlet test can't be null");
+ }
+ if (entries.containsKey(testName))
+ {
+ throw new IllegalArgumentException("Portlet test cannot be bound
twice");
+ }
+
+ //
+ TestInfo test = new TestInfo(testName);
+ for (Iterator i = portletTest.parameters.iterator();i.hasNext();)
+ {
+ String parameterName = (String)i.next();
+ test.addParameter(new TestParameterInfo(parameterName));
+ }
+
+ //
+ entries.put(testName, portletTest);
+ container.addChild(test);
+ }
+
+ public void removeSequence(String testName)
+ {
+ container.removeChild(testName);
+ }
+
+ public PortletTest getSequence(String testName)
+ {
+ if (testName == null)
+ {
+ throw new IllegalArgumentException("Test name can't be null");
+ }
+ return (PortletTest)entries.get(testName);
+ }
+
+ public TestItemInfo getInfo()
+ {
+ return container;
+ }
+
+ public DriverResponse invoke(String testId, DriverCommand command) throws
TestDriverException
+ {
+ TestInfo info = (TestInfo)getInfo().findItem(testId);
+ return new InvokeGetResponse("/test/" + info.getName());
+ }
+
+ public void pushContext(String testId, TestContext testContext)
+ {
+ context = new PortletTestContext(testId, testContext);
+ }
+
+ public TestContext popContext(String testId)
+ {
+ return context.testContext;
+ }
+
+ /**
+ * The current portlet test context statically available.
+ *
+ * @return the portlet test context.
+ */
+ public static PortletTestContext getPortletTestContext()
+ {
+ return context;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/PortletTestDriver.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/PortletTestParameters.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/PortletTestParameters.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/PortletTestParameters.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,43 @@
+/******************************************************************************
+ * 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.portlet;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class PortletTestParameters
+{
+
+ /**
+ * Defines the behavior of the portal with respect to the state management behavior
+ * when the portal calls the portlet container. Legal values are "mutable"
and "immutable".
+ * The "mutable" literal means that the portal will allow the portlet
container to modify
+ * the state and take in account any clone operation done during the request. The
"immutable"
+ * literal means that the portal will call the portlet container without allowing him
to
+ * perform cloning operations. When the parameter is not specific explicitely the
default
+ * behavior should be to treat the value a mutable.
+ */
+ public static final String PORTAL_PORTLET_STATE_MANAGEMENT =
"portal.portlet_state_management";
+
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/PortletTestSuite.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/PortletTestSuite.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/PortletTestSuite.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,128 @@
+/******************************************************************************
+ * 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.portlet;
+
+import org.apache.log4j.Logger;
+
+import javax.servlet.ServletContextEvent;
+import javax.servlet.ServletContextListener;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.util.Arrays;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.regex.Pattern;
+
+/**
+ * Builder is invoked when web application initialization process is starting. It builds
sequence of tests for this
+ * action
+ *
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 6989 $
+ */
+public abstract class PortletTestSuite implements ServletContextListener
+{
+
+ /** . */
+ private final Logger log = Logger.getLogger(getClass());
+
+ /** Defines pattern for method names like createXXX. */
+ public static String METHOD_PATTERN = "create.*";
+
+ /** . */
+ private final PortletTestDriver driver;
+
+ protected PortletTestSuite()
+ {
+ this.driver = new PortletTestDriver(getClass().getName());
+ }
+
+ /**
+ * Finds all methods matching pattern in current instance and invokes them. Methods
add Sequence into
+ * SequenceRegistry. Then SequenceRegistry is injected into ServletContext
+ *
+ * @param sce
+ */
+ public void contextInitialized(ServletContextEvent sce)
+ {
+
+ log.info("PortletTestSuite invoked with instance of: '" +
this.getClass().getName() + "' class");
+
+ // We invoke all createXXX methods to fill seqenceRegistry
+ List methods = introspectMethods(METHOD_PATTERN);
+ for (int i = 0; i < methods.size(); i++)
+ {
+ Method m = (Method)methods.get(i);
+ try
+ {
+ log.info("Invoking method: '" + m.getName() + "'
");
+ m.invoke(this, new Object[]{driver});
+ }
+ catch (IllegalAccessException e)
+ {
+ log.info("Error during '" + m.getName() + "' method
invokation: " + e.getMessage());
+ e.printStackTrace();
+ }
+ catch (InvocationTargetException e)
+ {
+ log.info("Error during '" + m.getName() + "' method
invokation: " + e.getMessage());
+ e.printStackTrace();
+ }
+ }
+
+ //
+ sce.getServletContext().setAttribute("SequenceRegistry", driver);
+ TestDriverRegistryAccess.getInstance().getTestDriverRegistry().addDriver(driver);
+ }
+
+ public void contextDestroyed(ServletContextEvent sce)
+ {
+ sce.getServletContext().removeAttribute("SequenceRegistry");
+
TestDriverRegistryAccess.getInstance().getTestDriverRegistry().removeDriver(driver);
+ }
+
+ /**
+ * Returning List of Method objects matching given name pattern
+ *
+ * @param namePattern
+ * @return List of Method objects
+ */
+ private List introspectMethods(String namePattern)
+ {
+ List allMethods = Arrays.asList(getClass().getMethods());
+ List methods = new ArrayList(allMethods.size());
+ for (int i = 0; i < allMethods.size(); i++)
+ {
+ Method m = (Method)allMethods.get(i);
+ if (Pattern.matches(namePattern, m.getName()) &&
+ m.getParameterTypes().length == 1 &&
+ m.getParameterTypes()[0].equals(PortletTestDriver.class) &&
+ Modifier.isPublic(m.getModifiers()))
+ {
+ methods.add(m);
+ }
+ }
+ return methods;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/PortletTestSuite.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/TestAction.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/TestAction.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/TestAction.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,33 @@
+/******************************************************************************
+ * 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.portlet;
+
+import org.jboss.portal.common.junit.ExtendedAssert;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 7018 $
+ */
+public abstract class TestAction extends ExtendedAssert
+{
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/TestAction.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/TestContants.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/TestContants.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/TestContants.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,43 @@
+/******************************************************************************
+ * 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.portlet;
+
+/**
+ * Constants for test asserts
+ *
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 5510 $
+ */
+public class TestContants
+{
+
+ /** String from <code>PortletContext.getServerInfo()</code/>. */
+ public static final String SERVER_INVO = "JBossPortal/1.0";
+
+ /** int for <code>PortletContext.getMinorVersion()</code/>. */
+ public static final int MINOR_VERSION = 0;
+
+ /** int for <code>PortletContext.getMajorVersion()</code/>. */
+ public static final int MAJOR_VERSION = 1;
+
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/TestContants.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/TestDriverRegistryAccess.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/TestDriverRegistryAccess.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/TestDriverRegistryAccess.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,72 @@
+/******************************************************************************
+ * 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.portlet;
+
+import org.jboss.portal.test.framework.driver.TestDriverContainer;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class TestDriverRegistryAccess
+{
+
+ /** . */
+ private static TestDriverContainer testDriverContainer;
+
+ /** . */
+ private static TestDriverRegistryAccess instance;
+
+ public TestDriverContainer getTestDriverRegistry()
+ {
+ return testDriverContainer;
+ }
+
+ public void setTestDriverRegistry(TestDriverContainer testDriverContainer)
+ {
+ this.testDriverContainer = testDriverContainer;
+ }
+
+ public void start() throws Exception
+ {
+ if (instance != null)
+ {
+ throw new IllegalStateException("A sequence registry already exist");
+ }
+ instance = this;
+ }
+
+ public void stop() throws Exception
+ {
+ instance = null;
+ }
+
+ public static TestDriverRegistryAccess getInstance() throws IllegalStateException
+ {
+ if (instance == null)
+ {
+ throw new IllegalStateException("No existing instance");
+ }
+ return instance;
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/actions/PortletActionTestAction.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/actions/PortletActionTestAction.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/actions/PortletActionTestAction.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,60 @@
+/******************************************************************************
+ * 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.portlet.actions;
+
+import org.jboss.portal.test.framework.driver.DriverResponse;
+import org.jboss.portal.test.framework.driver.response.FailureResponse;
+import org.jboss.portal.test.framework.portlet.TestAction;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.Portlet;
+import javax.portlet.PortletException;
+import java.io.IOException;
+
+import junit.framework.AssertionFailedError;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 7954 $
+ */
+public abstract class PortletActionTestAction extends TestAction
+{
+
+ public DriverResponse execute(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context) throws PortletException, IOException
+ {
+ try
+ {
+ run(portlet, request, response, context);
+ return null;
+ }
+ catch (AssertionFailedError t)
+ {
+ return new FailureResponse(t);
+ }
+ }
+
+ protected abstract void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context) throws PortletException, IOException;
+
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/actions/PortletActionTestAction.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/actions/PortletRenderTestAction.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/actions/PortletRenderTestAction.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/actions/PortletRenderTestAction.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,58 @@
+/******************************************************************************
+ * 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.portlet.actions;
+
+import org.jboss.portal.test.framework.driver.DriverResponse;
+import org.jboss.portal.test.framework.driver.response.FailureResponse;
+import org.jboss.portal.test.framework.portlet.TestAction;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+
+import javax.portlet.Portlet;
+import javax.portlet.PortletException;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import java.io.IOException;
+
+import junit.framework.AssertionFailedError;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 7954 $
+ */
+public abstract class PortletRenderTestAction extends TestAction
+{
+
+ public DriverResponse execute(Portlet servlet, RenderRequest request, RenderResponse
response, PortletTestContext context) throws PortletException, IOException
+ {
+ try
+ {
+ return run(servlet, request, response, context);
+ }
+ catch (AssertionFailedError t)
+ {
+ return new FailureResponse(t);
+ }
+ }
+
+ protected abstract DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws PortletException,
IOException;
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/actions/PortletRenderTestAction.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/actions/ServletServiceTestAction.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/actions/ServletServiceTestAction.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/actions/ServletServiceTestAction.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,55 @@
+/******************************************************************************
+ * 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.portlet.actions;
+
+import org.jboss.portal.test.framework.driver.DriverResponse;
+import org.jboss.portal.test.framework.junit.ThrowableDecoder;
+import org.jboss.portal.test.framework.portlet.TestAction;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+
+import javax.servlet.Servlet;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 7954 $
+ */
+public abstract class ServletServiceTestAction extends TestAction
+{
+ protected abstract DriverResponse run(Servlet servlet, HttpServletRequest request,
HttpServletResponse response, PortletTestContext context) throws ServletException,
IOException;
+
+ public DriverResponse execute(Servlet servlet, HttpServletRequest request,
HttpServletResponse response, PortletTestContext context) throws ServletException,
IOException
+ {
+ try
+ {
+ return run(servlet, request, response, context);
+ }
+ catch (Throwable t)
+ {
+ return ThrowableDecoder.decode(t);
+ }
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/actions/ServletServiceTestAction.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/basictests/BasicTestSequenceBuilder.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/basictests/BasicTestSequenceBuilder.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/basictests/BasicTestSequenceBuilder.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,166 @@
+/******************************************************************************
+ * 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.portlet.basictests;
+
+import org.jboss.portal.test.framework.driver.response.EndTestResponse;
+import org.jboss.portal.test.framework.driver.response.FailureResponse;
+import org.jboss.portal.test.framework.driver.http.response.InvokeGetResponse;
+import org.jboss.portal.test.framework.driver.DriverResponse;
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestDriver;
+import org.jboss.portal.test.framework.portlet.PortletTestSuite;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.actions.PortletActionTestAction;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.framework.UTP1;
+import org.jboss.portal.test.portlet.framework.UTP2;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.Portlet;
+import javax.portlet.PortletURL;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 7954 $
+ */
+public class BasicTestSequenceBuilder extends PortletTestSuite
+{
+
+ public void createOnePortletTestCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("OnePortlet", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ public void createFailurePortletTestCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("FailurePortlet", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new FailureResponse();
+ }
+ });
+ }
+
+ public void createFailAssertPortletTestCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("FailAssertPortlet", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ fail();
+ return null;
+ }
+ });
+ }
+
+ public void createFailAssertInActionPortletTestCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("FailAssertInActionPortlet", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ PortletURL url = response.createActionURL();
+ return new InvokeGetResponse(url.toString());
+ }
+ });
+
+ seq.addAction(1, UTP1.ACTION_JOINPOINT, new PortletActionTestAction()
+ {
+ protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context)
+ {
+ fail();
+ }
+ });
+
+ //this shouldn't be reached
+ seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ public void createTwoPortletTestCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("TwoPortlet", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ PortletURL url = response.createActionURL();
+ return new InvokeGetResponse(url.toString());
+ }
+ });
+
+ seq.addAction(1, UTP2.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ public void createTwoResultPortletTestCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("TwoResultPortlet", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new EndTestResponse();
+ }
+ });
+
+ seq.addAction(0, UTP2.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new EndTestResponse();
+ }
+ });
+ }
+
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/basictests/BasicTestSequenceBuilder.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/basictests/BasicTestSuite.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/basictests/BasicTestSuite.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/basictests/BasicTestSuite.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -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.test.framework.portlet.basictests;
+
+import junit.framework.Test;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 5510 $
+ */
+public class BasicTestSuite
+{
+ public static Test suite()
+ {
+// TestSuite suite = new TestSuite("test-basic.war");
+//
+//
+// suite.addTest(new TestCase("OnePortlet"));
+// suite.addTest(new TestCase("FailurePortlet"));
+// suite.addTest(new TestCase("FailAssertPortlet"));
+// suite.addTest(new TestCase("FailAssertInActionPortlet"));
+// suite.addTest(new TestCase("TwoPortlet"));
+// suite.addTest(new TestCase("TwoResultPortlet"));
+//
+// return suite;
+ return null;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/basictests/BasicTestSuite.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/basictests/PortletA.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/basictests/PortletA.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/basictests/PortletA.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -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.test.framework.portlet.basictests;
+
+import org.jboss.portal.test.framework.portlet.components.AbstractUniversalTestPortlet;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 5448 $
+ */
+public class PortletA extends AbstractUniversalTestPortlet
+{
+ protected String createComponentId()
+ {
+ return "PortletA";
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/basictests/PortletA.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/basictests/PortletB.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/basictests/PortletB.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/basictests/PortletB.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -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.test.framework.portlet.basictests;
+
+import org.jboss.portal.test.framework.portlet.components.AbstractUniversalTestPortlet;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 5448 $
+ */
+public class PortletB extends AbstractUniversalTestPortlet
+{
+ protected String createComponentId()
+ {
+ return "PortletB";
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/basictests/PortletB.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/basictests/classes/JoinpointTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/basictests/classes/JoinpointTestCase.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/basictests/classes/JoinpointTestCase.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,41 @@
+/******************************************************************************
+ * 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.portlet.basictests.classes;
+
+import junit.framework.TestCase;
+import org.jboss.portal.test.framework.portlet.Joinpoint;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 5448 $
+ */
+public class JoinpointTestCase extends TestCase
+{
+ public void testCreate()
+ {
+ Joinpoint joinpoint = new Joinpoint("portlet1",
Joinpoint.PORTLET_ACTION);
+ assertEquals("portlet1", joinpoint.getId());
+ assertEquals(Joinpoint.PORTLET_ACTION, joinpoint.getPoint());
+ }
+
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/basictests/classes/JoinpointTestCase.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/basictests/classes/SequenceRegistryBuilderTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/basictests/classes/SequenceRegistryBuilderTestCase.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/basictests/classes/SequenceRegistryBuilderTestCase.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,93 @@
+/******************************************************************************
+ * 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.portlet.basictests.classes;
+
+import junit.framework.TestCase;
+import org.jboss.portal.test.framework.portlet.PortletTestDriver;
+
+import java.util.LinkedList;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 6752 $
+ */
+public class SequenceRegistryBuilderTestCase extends TestCase
+{
+ public void testBuilder()
+ {
+ final PortletTestDriver sr = new PortletTestDriver("toto");
+
+ final List invoked = new LinkedList();
+
+
+ TestBuilder srb2 = new TestBuilder();
+
+ assertEquals(0, srb2.counter);
+
+ srb2.contextInitialized(null);
+
+ assertEquals(2, srb2.counter);
+
+ /*SequenceRegistryBuilder srb = new SequenceRegistryBuilder()
+ {
+ protected SequenceRegistry getRegistry()
+ {
+ return sr;
+ }
+
+ public void createTestOne(SequenceRegistry registry)
+ {
+ invoked.add("testOne");
+ }
+
+ public void createTestTwo(SequenceRegistry registry)
+ {
+ invoked.add("testTwo");
+ }
+
+ //override this to avoid NullPointerException
+
+ protected void saveRegistry(SequenceRegistry registry)
+ {
+ //nothing
+ }
+ };
+
+
+
+
+ assertTrue(!invoked.contains("testOne"));
+ assertTrue(!invoked.contains("testTwo"));
+ assertNotNull(invoked);
+
+ srb.contextInitialized(null);
+
+ //assertNotNull(invoked);
+ assertTrue(invoked.contains("testOne"));
+ assertTrue(invoked.contains("testTwo"));*/
+
+
+ }
+
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/basictests/classes/SequenceRegistryBuilderTestCase.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/basictests/classes/SequenceRegistryTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/basictests/classes/SequenceRegistryTestCase.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/basictests/classes/SequenceRegistryTestCase.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,49 @@
+/******************************************************************************
+ * 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.portlet.basictests.classes;
+
+import junit.framework.TestCase;
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestDriver;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 6752 $
+ */
+public class SequenceRegistryTestCase extends TestCase
+{
+ public void testSequenceRegistry()
+ {
+ PortletTest portletTest = new PortletTest();
+
+ PortletTestDriver sr = new PortletTestDriver("toto");
+
+ sr.addSequence("testA", portletTest);
+
+ assertNull(sr.getSequence("blah"));
+ assertNull(sr.getSequence(""));
+ assertNotNull(sr.getSequence("testA"));
+
+
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/basictests/classes/SequenceRegistryTestCase.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/basictests/classes/SequenceTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/basictests/classes/SequenceTestCase.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/basictests/classes/SequenceTestCase.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,71 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.framework.portlet.basictests.classes;
+
+import junit.framework.TestCase;
+import org.jboss.portal.test.framework.driver.http.response.InvokeGetResponse;
+import org.jboss.portal.test.framework.driver.DriverResponse;
+import org.jboss.portal.test.framework.portlet.Joinpoint;
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.framework.portlet.TestAction;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 7954 $
+ */
+public class SequenceTestCase extends TestCase
+{
+ public void testSequence()
+ {
+ PortletTest portletTest = new PortletTest();
+ Joinpoint joinpoint = new Joinpoint("PortletA",
Joinpoint.PORTLET_RENDER);
+ TestAction action = new PortletRenderTestAction()
+ {
+ public DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse
response, PortletTestContext context)
+ {
+ return new InvokeGetResponse("http://www.jboss.com");
+ }
+ };
+
+
+ portletTest.addAction(1, joinpoint, action);
+
+ assertNull(portletTest.getAction(2, joinpoint));
+ assertNull(portletTest.getAction(0, joinpoint));
+ assertNotNull(portletTest.getAction(1, joinpoint));
+
+ assertTrue(portletTest.getAction(1, joinpoint) instanceof
PortletRenderTestAction);
+
+ portletTest.addAction(1, joinpoint, null);
+ assertNull(portletTest.getAction(1, joinpoint));
+
+
+ }
+
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/basictests/classes/SequenceTestCase.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/basictests/classes/TestBuilder.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/basictests/classes/TestBuilder.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/basictests/classes/TestBuilder.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,55 @@
+/******************************************************************************
+ * 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.portlet.basictests.classes;
+
+import org.jboss.portal.test.framework.portlet.PortletTestDriver;
+import org.jboss.portal.test.framework.portlet.PortletTestSuite;
+
+import javax.servlet.ServletContext;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 6752 $
+ */
+public class TestBuilder extends PortletTestSuite
+{
+
+ public int counter = 0;
+
+ public void createOne(PortletTestDriver registry)
+ {
+ counter++;
+ }
+
+ public void createTwo(PortletTestDriver registry)
+ {
+ counter++;
+ }
+
+ protected void saveRegistry(PortletTestDriver registry, ServletContext context)
+ {
+ //nothing
+ }
+
+
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/basictests/classes/TestBuilder.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/components/AbstractTestGenericPortlet.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/components/AbstractTestGenericPortlet.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/components/AbstractTestGenericPortlet.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,153 @@
+/******************************************************************************
+ * 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.portlet.components;
+
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.PortletTestDriver;
+import org.jboss.portal.common.util.Tools;
+import org.jboss.portal.test.framework.driver.DriverResponse;
+import org.jboss.portal.test.framework.driver.response.FailureResponse;
+import org.jboss.portal.test.framework.driver.response.ErrorResponse;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.GenericPortlet;
+import javax.portlet.PortletException;
+import javax.portlet.PortletSecurityException;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import java.io.IOException;
+
+import junit.framework.AssertionFailedError;
+
+/**
+ * Abstract test class for testing GenericPortlet implementation
+ *
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 7954 $
+ */
+public abstract class AbstractTestGenericPortlet extends GenericPortlet
+{
+
+ /** The test id. */
+ private final String testName;
+
+ /** Construct a test portlet with a test name computed with the method
<code>getTestId(Class)</code>. */
+ public AbstractTestGenericPortlet()
+ {
+ testName = createTestName(getClass());
+ }
+
+ /** Get the test id from the class name. It can be overriden. */
+ protected String createTestName(Class clazz)
+ {
+ return Tools.getShortNameOf(clazz);
+ }
+
+ public void processAction(ActionRequest req, ActionResponse resp) throws
PortletException, IOException
+ {
+ PortletTestContext context = PortletTestDriver.getPortletTestContext();
+ if (testName.equals(context.getTestName()))
+ {
+ DriverResponse response;
+ try
+ {
+ response = doProcessAction(req, resp, context);
+ }
+ catch (AssertionFailedError e)
+ {
+ response = new FailureResponse(e);
+ }
+
+ //
+ if (response != null)
+ {
+ context.setResponse(response);
+ }
+ }
+ else
+ {
+ context.setResponse(new ErrorResponse());
+ }
+ }
+
+ public void render(RenderRequest req, RenderResponse resp) throws PortletException,
IOException
+ {
+ PortletTestContext context = PortletTestDriver.getPortletTestContext();
+ if (testName.equals(context.getTestName()))
+ {
+ DriverResponse response;
+ try
+ {
+ preRender(req, resp, context);
+ super.render(req, resp);
+ response = postRender(req, resp, context);
+ }
+ catch (AssertionFailedError e)
+ {
+ response = new FailureResponse(e);
+ }
+
+ //
+ if (response != null)
+ {
+ context.setResponse(response);
+ }
+ }
+ }
+
+ protected DriverResponse doProcessAction(ActionRequest req, ActionResponse resp,
PortletTestContext context) throws PortletException, IOException
+ {
+ throw new PortletException();
+ }
+
+ /**
+ * Invoked by render() method if current test is running. After this method
GenericPortlet.render() will be called.
+ *
+ * @param req
+ * @param resp
+ * @param context
+ * @throws PortletException
+ * @throws PortletSecurityException
+ * @throws IOException
+ */
+ protected void preRender(RenderRequest req, RenderResponse resp, PortletTestContext
context) throws PortletException, IOException
+ {
+ throw new PortletException();
+ }
+
+ /**
+ * Invoked by render() method after GenericPortlet.render() invocation.
+ *
+ * @param req
+ * @param resp
+ * @param context
+ * @throws PortletException
+ * @throws PortletSecurityException
+ * @throws IOException
+ */
+ protected DriverResponse postRender(RenderRequest req, RenderResponse resp,
PortletTestContext context) throws PortletException, IOException
+ {
+ return null;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/components/AbstractTestGenericPortlet.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/components/AbstractTestPortlet.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/components/AbstractTestPortlet.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/components/AbstractTestPortlet.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,179 @@
+/******************************************************************************
+ * 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.portlet.components;
+
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.PortletTestDriver;
+import org.jboss.portal.test.framework.driver.DriverResponse;
+import org.jboss.portal.test.framework.driver.response.FailureResponse;
+import org.jboss.portal.test.framework.driver.response.ErrorResponse;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.Portlet;
+import javax.portlet.PortletConfig;
+import javax.portlet.PortletContext;
+import javax.portlet.PortletException;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import java.io.IOException;
+
+import junit.framework.AssertionFailedError;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.com">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 7954 $
+ */
+public abstract class AbstractTestPortlet implements Portlet
+{
+
+ /** The test id. */
+ private final String testName;
+
+ /** To keep PortletConfig for some tests* */
+ private PortletConfig config;
+
+ /** Construct a test portlet with a test id computed with the method
<code>getTestId(Class)</code>. */
+ public AbstractTestPortlet()
+ {
+ testName = createTestName(getClass());
+ }
+
+ /**
+ * Construct a test portlet with the specified id.
+ *
+ * @param testCaseId
+ */
+ public AbstractTestPortlet(String testCaseId)
+ {
+ if (testCaseId == null)
+ {
+ throw new IllegalArgumentException("No null test case id accepted");
+ }
+
+ //
+ this.testName = testCaseId;
+ }
+
+ public void init(PortletConfig config) throws PortletException
+ {
+ this.config = config;
+ }
+
+ /**
+ * Returns the PortletConfig object of this portlet.
+ *
+ * @return the PortletConfig object of this portlet
+ */
+ public PortletConfig getPortletConfig()
+ {
+ return config;
+ }
+
+ /**
+ * Returns the <code>PortletContext</code> of the portlet application the
portlet is in.
+ *
+ * @return the portlet application context
+ */
+ public PortletContext getPortletContext()
+ {
+ return config.getPortletContext();
+ }
+
+ public final void processAction(ActionRequest req, ActionResponse resp) throws
PortletException, IOException
+ {
+ PortletTestContext context = PortletTestDriver.getPortletTestContext();
+ if (testName.equals(context.getTestName()))
+ {
+ DriverResponse response;
+ try
+ {
+ response = doProcessAction(req, resp, context);
+ }
+ catch (AssertionFailedError e)
+ {
+ response = new FailureResponse(e);
+ }
+
+ //
+ if (response != null)
+ {
+ context.setResponse(response);
+ }
+ }
+ else
+ {
+ context.setResponse(new ErrorResponse());
+ }
+ }
+
+ public final void render(RenderRequest req, RenderResponse resp) throws
PortletException, IOException
+ {
+ PortletTestContext context = PortletTestDriver.getPortletTestContext();
+ if (testName.equals(context.getTestName()))
+ {
+ DriverResponse response;
+ try
+ {
+ response = doRender(req, resp, context);
+ }
+ catch (AssertionFailedError e)
+ {
+ response = new FailureResponse(e);
+ }
+
+ //
+ if (response != null)
+ {
+ context.setResponse(response);
+ }
+ }
+ }
+
+ public void destroy()
+ {
+ }
+
+ protected DriverResponse doProcessAction(ActionRequest req, ActionResponse resp,
PortletTestContext context) throws PortletException, IOException
+ {
+ throw new PortletException();
+ }
+
+ protected DriverResponse doRender(RenderRequest req, RenderResponse resp,
PortletTestContext context) throws PortletException, IOException
+ {
+ throw new PortletException();
+ }
+
+ /** Get the test id from the class name. It can be overriden. */
+ protected String createTestName(Class clazz)
+ {
+ String s = clazz.getName();
+ int index = s.lastIndexOf('.');
+ if (index != -1)
+ {
+ s = s.substring(index + 1);
+ }
+ return s;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/components/AbstractTestPortlet.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/components/AbstractUniversalTestPortlet.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/components/AbstractUniversalTestPortlet.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/components/AbstractUniversalTestPortlet.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,311 @@
+/******************************************************************************
+ * 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.portlet.components;
+
+import org.apache.log4j.Logger;
+import org.jboss.portal.test.framework.driver.response.FailureResponse;
+import org.jboss.portal.test.framework.driver.DriverResponse;
+import org.jboss.portal.test.framework.portlet.Joinpoint;
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestDriver;
+import org.jboss.portal.test.framework.portlet.actions.PortletActionTestAction;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.framework.portlet.TestAction;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.server.NodeId;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.Portlet;
+import javax.portlet.PortletConfig;
+import javax.portlet.PortletContext;
+import javax.portlet.PortletException;
+import javax.portlet.PortletSecurityException;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import java.io.IOException;
+
+/**
+ * Universal test portlet that enables to reuse portlet instances across several tests
+ *
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.com">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 7954 $
+ */
+public abstract class AbstractUniversalTestPortlet implements Portlet
+{
+
+ /** . */
+ private final Logger log = createLogger();
+
+ /** The component id. */
+ private String componentId;
+
+ /** Joinpoint for render phase. */
+ private Joinpoint renderJoinpoint;
+
+ /** Joinpoint for action phase. */
+ private Joinpoint actionJoinpoint;
+
+ /** To keep PortletConfig for some tests*-. */
+ private PortletConfig config;
+
+ /** Construct a test portlet with a test id computed with the method
<code>getComponentId()</code>. */
+ public AbstractUniversalTestPortlet()
+ {
+ String componentId = createComponentId();
+ init(componentId);
+ }
+
+ /**
+ * Construct a test portlet with the specified id.
+ *
+ * @param componentId
+ */
+ public AbstractUniversalTestPortlet(String componentId)
+ {
+ init(componentId);
+ }
+
+ private void init(String componentId)
+ {
+ if (componentId == null)
+ {
+ throw new IllegalArgumentException("No null component id accepted");
+ }
+ this.componentId = componentId;
+ this.actionJoinpoint = new Joinpoint(componentId, Joinpoint.PORTLET_ACTION);
+ this.renderJoinpoint = new Joinpoint(componentId, Joinpoint.PORTLET_RENDER);
+ }
+
+ public void init(PortletConfig config) throws PortletException
+ {
+ this.config = config;
+ log.debug("Component '" + getComponentId() + "' init()
method invoked");
+ }
+
+ /**
+ * Returns the PortletConfig object of this portlet.
+ *
+ * @return the PortletConfig object of this portlet
+ */
+ public PortletConfig getPortletConfig()
+ {
+ return config;
+ }
+
+ /**
+ * Returns the <code>PortletContext</code> of the portlet application the
portlet is in.
+ *
+ * @return the portlet application context
+ */
+ public PortletContext getPortletContext()
+ {
+ return config.getPortletContext();
+ }
+
+ /**
+ * invokes current action from Sequence
+ *
+ * @param req
+ * @param resp
+ * @throws PortletException
+ * @throws PortletSecurityException
+ * @throws IOException
+ */
+ public final void processAction(ActionRequest req, ActionResponse resp) throws
PortletException, IOException
+ {
+ PortletTestContext ctx = PortletTestDriver.getPortletTestContext();
+
+ //
+ log.debug("Component '" + getComponentId() + "'
processAction() method invoked for '"
+ + ctx.getTestName() + "' testId and '" +
+ +ctx.getRequestCount() + "' request count");
+
+ //
+ PortletTest portletTest = getSequence(ctx.getTestName());
+
+ //
+ if (portletTest != null)
+ {
+ //
+ TestAction action = portletTest.getAction(ctx.getRequestCount(),
NodeId.locate(), actionJoinpoint);
+
+ //
+ if (action == null)
+ {
+ ctx.setResponse(new FailureResponse("No action for " +
ctx.getRequestCount() + " " + NodeId.locate() + " " +
actionJoinpoint));
+ }
+ else if (action instanceof PortletActionTestAction == false)
+ {
+ ctx.setResponse(new FailureResponse("Action for " +
ctx.getRequestCount() + " " + NodeId.locate() + " " + actionJoinpoint
+ " is not an instance of " + PortletActionTestAction.class.getName() + "
but is " + action.getClass().getName()));
+ }
+ else
+ {
+ log.debug("Found action for jointpoint " + actionJoinpoint + "
: " + action);
+
+ //
+ DriverResponse response = ((PortletActionTestAction)action).execute(this,
req, resp, ctx);
+
+ //
+ ctx.setResponse(response);
+ }
+ }
+ }
+
+ /**
+ * Invokes current action from Sequence. If failed AssertResult was returned in
previouse portlet action phase it
+ * will be marshalled.
+ *
+ * @param req
+ * @param resp
+ * @throws PortletException
+ * @throws PortletSecurityException
+ * @throws IOException
+ */
+ public final void render(RenderRequest req, RenderResponse resp) throws
PortletException, IOException
+ {
+ PortletTestContext ctx = PortletTestDriver.getPortletTestContext();
+
+ //
+ log.debug("Component '" + getComponentId() + "' render()
method invoked for '"
+ + ctx.getTestName() + "' testId and '" +
+ +ctx.getRequestCount() + "' request count");
+
+ // Reset AssertResult at begining of test
+ if (ctx.getRequestCount() == 0)
+ {
+ reset();
+ }
+
+
+ // Get the action
+ TestAction action = null;
+ PortletTest portletTest = getSequence(ctx.getTestName());
+ if (portletTest != null)
+ {
+ action = portletTest.getAction(ctx.getRequestCount(), NodeId.locate(),
renderJoinpoint);
+
+ }
+
+ //
+ if (action != null)
+ {
+ log.debug("Found action for jointpoint " + renderJoinpoint + " :
" + action);
+
+ // Get the result
+ DriverResponse sr = ((PortletRenderTestAction)action).execute(this, req, resp,
ctx);
+
+ // If we have one result it is meant to be returned to the client
+ if (sr != null)
+ {
+ ctx.setResponse(sr);
+ }
+ }
+ else
+ {
+ // As we are not involved we don't want content to be cached that would
prevent
+ // the test to run when it should be invoked
+ resp.setProperty(RenderResponse.EXPIRATION_CACHE, "0");
+ }
+ }
+
+ public void destroy()
+ {
+ }
+
+ /** Get the componentId from the class name. */
+ protected String createComponentId()
+ {
+ String s = getClass().getName();
+ int index = s.lastIndexOf('.');
+ if (index != -1)
+ {
+ s = s.substring(index + 1);
+ }
+ return s;
+ }
+
+ /**
+ * Returns SequenceRegistry which should be injected into ServletContext Returns null
if there is no SequenceRegistry
+ * in context
+ *
+ * @return SequenceRegistry
+ */
+ private PortletTestDriver getSequenceRegistry()
+ {
+ return
(PortletTestDriver)getPortletContext().getAttribute("SequenceRegistry");
+ }
+
+ /**
+ * Returns Sequence for current testId Returns null if there is no Sequence for
current testId
+ *
+ * @return
+ * @throws PortletException if there is no SequenceRegistry
+ */
+ private PortletTest getSequence(String testId) throws PortletException
+ {
+ PortletTestDriver registry = getSequenceRegistry();
+ if (registry == null)
+ {
+ log.error("No SequenceRegistry object found in current context");
+ throw new PortletException("No SequenceRegistry object found in
context");
+ }
+ return registry.getSequence(testId);
+ }
+
+ protected String getComponentId()
+ {
+ return componentId;
+ }
+
+ public Joinpoint getActionJointpoint()
+ {
+ return actionJoinpoint;
+ }
+
+ public Joinpoint getRenderJointpoint()
+ {
+ return renderJoinpoint;
+ }
+
+ protected void reset()
+ {
+ }
+
+ /** Can be subclassed to provide an alternative way to create the logger. */
+ protected Logger createLogger()
+ {
+ if (log != null)
+ {
+ throw new IllegalStateException("The logger should not be re");
+ }
+ return Logger.getLogger(getClass());
+ }
+
+ /** Return the logger. */
+ public final Logger getLogger()
+ {
+ return log;
+ }
+}
+
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/components/AbstractUniversalTestPortlet.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/components/AbstractUniversalTestServlet.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/components/AbstractUniversalTestServlet.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/components/AbstractUniversalTestServlet.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,189 @@
+/******************************************************************************
+ * 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.portlet.components;
+
+import org.apache.log4j.Logger;
+import org.jboss.portal.test.framework.driver.DriverResponse;
+import org.jboss.portal.test.framework.portlet.Joinpoint;
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestDriver;
+import org.jboss.portal.test.framework.portlet.actions.ServletServiceTestAction;
+import org.jboss.portal.test.framework.portlet.TestAction;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.server.NodeId;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+
+/**
+ * Universal test servlet that enables to reuse servlet instances across several tests
+ *
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.com">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 7954 $
+ */
+public abstract class AbstractUniversalTestServlet extends HttpServlet
+{
+
+ /** The logger. */
+ private final Logger log = Logger.getLogger(getClass());
+
+ /** The component id. */
+ private String componentId;
+
+ /** Jointpoint for service method. */
+ protected Joinpoint serviceJoinpoint;
+
+ /** Construct a test servlet with a test id computed with the method
<code>getTestId(Class)</code>. */
+ public AbstractUniversalTestServlet()
+ {
+ super();
+ componentId = createComponentId(getClass());
+ setServiceJointpoint(new Joinpoint(componentId, Joinpoint.SERVLET_SERVICE));
+ }
+
+ /**
+ * Construct a test servlet with the specified id.
+ *
+ * @param componentId
+ */
+ public AbstractUniversalTestServlet(String componentId)
+ {
+ super();
+ if (componentId == null)
+ {
+ throw new IllegalArgumentException("No null component id accepted");
+ }
+
+ //
+ this.componentId = componentId;
+ setServiceJointpoint(new Joinpoint(componentId, Joinpoint.SERVLET_SERVICE));
+
+ }
+
+ /**
+ * Standart implementation of service() method to handle requests and invoke actions
from sequence
+ *
+ * @param request
+ * @param response
+ * @throws ServletException
+ * @throws IOException
+ */
+ protected void service(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
+ {
+ PortletTestContext ctx = PortletTestDriver.getPortletTestContext();
+
+ //
+ log.info("Component '" + getComponentId() + "' service()
method invoked for '"
+ + ctx.getTestName() + "' testId and '" +
+ +ctx.getRequestCount() + "' request count");
+
+ // Reset instance state
+ if (ctx.getRequestCount() == 0)
+ {
+ reset();
+ }
+
+ PortletTest portletTest = getSequence(ctx.getTestName());
+ if (portletTest != null)
+ {
+ TestAction action = portletTest.getAction(ctx.getRequestCount(),
NodeId.locate(), getServiceJointpoint());
+ if (action != null && action instanceof ServletServiceTestAction)
+ {
+ log.info("Found Action for this jointpoint");
+ DriverResponse dr = ((ServletServiceTestAction)action).execute(this, request,
response, ctx);
+ if (dr != null)
+ {
+ ctx.setResponse(dr);
+ }
+ }
+
+ }
+ }
+
+ /** Get the componentId from the class name. */
+ protected String createComponentId(Class clazz)
+ {
+ String s = clazz.getName();
+ int index = s.lastIndexOf('.');
+ if (index != -1)
+ {
+ s = s.substring(index + 1);
+ }
+ return s;
+ }
+
+
+ /**
+ * Returns SequenceRegistry which should be injected into ServletContext Returns null
if there is no SequenceRegistry
+ * in context
+ *
+ * @return SequenceRegistry
+ */
+ private PortletTestDriver getSequenceRegistry()
+ {
+ return
(PortletTestDriver)getServletContext().getAttribute("SequenceRegistry");
+ }
+
+ /**
+ * Returns Sequence for current testId Returns null if there is no Sequence for
current testId
+ *
+ * @return
+ * @throws javax.servlet.ServletException if there is no SequenceRegistry
+ */
+ protected PortletTest getSequence(String testId) throws ServletException
+ {
+ PortletTestDriver registry = getSequenceRegistry();
+ if (registry == null)
+ {
+ log.info("No SequenceRegistry object found in current context");
+ throw new ServletException("No SequenceRegistry object found in
context");
+ }
+ return registry.getSequence(testId);
+ }
+
+ protected String getComponentId()
+ {
+ return componentId;
+ }
+
+ protected void setComponentId(String componentId)
+ {
+ this.componentId = componentId;
+ }
+
+ public Joinpoint getServiceJointpoint()
+ {
+ return serviceJoinpoint;
+ }
+
+ protected void setServiceJointpoint(Joinpoint serviceJoinpoint)
+ {
+ this.serviceJoinpoint = serviceJoinpoint;
+ }
+
+ public abstract void reset();
+
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/components/AbstractUniversalTestServlet.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/ContentTypesTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/ContentTypesTestCase.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/ContentTypesTestCase.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -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: 6720 $
+ * @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:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/ContentTypesTestCase.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/ParametersTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/ParametersTestCase.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/ParametersTestCase.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,326 @@
+/******************************************************************************
+ * 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 org.jboss.portal.common.junit.ExtendedAssert;
+import org.jboss.portal.portlet.PortletParameters;
+
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+
+import junit.framework.TestCase;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 6639 $
+ */
+public class ParametersTestCase
+ extends TestCase
+{
+
+ public ParametersTestCase(String name)
+ {
+ super(name);
+ }
+
+ private PortletParameters param;
+
+ public void setUp()
+ {
+ param = new PortletParameters();
+ }
+
+ public void tearDown()
+ {
+ param = null;
+ }
+
+ public void testGetWithNullName()
+ {
+ try
+ {
+ param.getValue(null);
+ fail("Expected IllegalArgumentException");
+ }
+ catch (NullPointerException e)
+ {
+ }
+ }
+
+ public void testSet()
+ {
+ param.setValue("a", "b");
+ assertEquals(param.getValue("a"), "b");
+ }
+
+ public void testSetWithNullName()
+ {
+ try
+ {
+ param.setValue(null, "b");
+ fail("Expected IllegalArgumentException");
+ }
+ catch (NullPointerException e)
+ {
+ }
+ }
+
+ public void testSetWithNullValue()
+ {
+ try
+ {
+ param.setValue("a", null);
+ fail("Expected IllegalArgumentException");
+ }
+ catch (IllegalArgumentException e)
+ {
+ }
+ }
+
+ public void testRemoveWithNullName()
+ {
+ try
+ {
+ param.remove(null);
+ fail("Expected IllegalArgumentException");
+ }
+ catch (NullPointerException e)
+ {
+ }
+ }
+
+ public void testRemove()
+ {
+ param.setValue("a", "b");
+ param.remove("a");
+ assertEquals(param.getValue("a"), null);
+ }
+
+ public void testSetValues()
+ {
+ param.setValues("a", new String[]{"b", "c"});
+ assertTrue(Arrays.equals(param.getValues("a"), new String[]{
+ "b", "c"}));
+ assertEquals(param.getValue("a"), "b");
+ }
+
+ public void testSetValuesWithNullName()
+ {
+ try
+ {
+ param.setValues(null, new String[]{"a"});
+ fail("Expected IllegalArgumentException");
+ }
+ catch (NullPointerException e)
+ {
+ }
+ }
+
+ public void testSetValuesWithNullValues()
+ {
+ try
+ {
+ param.setValues("a", null);
+ fail("Expected IllegalArgumentException");
+ }
+ catch (NullPointerException e)
+ {
+ }
+ }
+
+ public void testSetValuesWithZeroLengthValues()
+ {
+ try
+ {
+ param.setValues("a", new String[0]);
+ fail("Expected IllegalArgumentException");
+ }
+ catch (IllegalArgumentException e)
+ {
+ }
+ }
+
+ public void testSetValuesWithOneNullValue()
+ {
+ try
+ {
+ param.setValues("a", new String[]{"a", null});
+ fail("Expected IllegalArgumentException");
+ }
+ catch (IllegalArgumentException e)
+ {
+ }
+ }
+
+ public void testReplaceWithParameters()
+ {
+ PortletParameters other = new PortletParameters();
+ other.setValue("a", "b");
+ other.setValues("c", new String[]{"d", "e"});
+ param.replace(other);
+ assertEquals("b", param.getValue("a"));
+ assertTrue(Arrays.equals(param.getValues("c"), new
String[]{"d", "e"}));
+ }
+
+ public void testCopyConstructorWithNullParameters()
+ {
+ try
+ {
+ new PortletParameters(null);
+ fail("Expected IllegalArgumentException");
+ }
+ catch (IllegalArgumentException e)
+ {
+ }
+ }
+
+ public void testCopyConstructorWithNullMap()
+ {
+ try
+ {
+ new PortletParameters((Map)null);
+ fail("Expected IllegalArgumentException");
+ }
+ catch (IllegalArgumentException e)
+ {
+ }
+ }
+
+ public void testReplaceWithNullMap()
+ {
+ try
+ {
+ param.replace(null);
+ fail("Expected NullPointerException");
+ }
+ catch (NullPointerException e)
+ {
+ }
+ }
+
+ public void testReplaceWithInvalidMap()
+ {
+ Map[] maps = buildInvalidMaps();
+ Class[] exceptionClasses = buildExceptionClasses();
+ for (int i = 0; i < maps.length; i++)
+ {
+ try
+ {
+ Map map = maps[i];
+ param.replace(map);
+ fail("Expected IllegalArgumentException with map=" + map);
+ }
+ catch (Exception e)
+ {
+ assertTrue(exceptionClasses[i].isAssignableFrom(e.getClass()));
+ }
+ }
+ }
+
+ public void testReplace()
+ {
+ param.setValue("a", "b");
+ param.setValues("c", new String[]{"d", "e"});
+ param.setValue("f", "g");
+ Map map = new HashMap();
+ map.put("a", new String[]{"_b"});
+ map.put("c", new String[]{"_d", "_e"});
+ map.put("h", new String[]{"_i"});
+ param.replace(map);
+ assertEquals(3, param.size());
+ ExtendedAssert.assertEquals(param.getValues("a"), new
String[]{"_b"});
+ ExtendedAssert.assertEquals(param.getValues("c"), new
String[]{"_d", "_e"});
+ ExtendedAssert.assertEquals(param.getValues("h"), new
String[]{"_i"});
+ }
+
+ public void testAppendWithInvalidMap()
+ {
+ Map[] maps = buildInvalidMaps();
+ Class[] exceptionClasses = buildExceptionClasses();
+ for (int i = 0; i < maps.length; i++)
+ {
+ try
+ {
+ Map map = maps[i];
+ param.append(map);
+ fail("Expected IllegalArgumentException with map=" + map);
+ }
+ catch (Exception e)
+ {
+ if (!exceptionClasses[i].isAssignableFrom(e.getClass()))
+ {
+ fail("Exception class " + exceptionClasses[i].getName() + "
(index=" + i + ") should be assignable from caught exception " +
e.getClass());
+ }
+ }
+ }
+ }
+
+ public void testAppend()
+ {
+ param.setValue("a", "b");
+ param.setValues("c", new String[]{"d", "e"});
+ param.setValue("f", "g");
+ Map map = new HashMap();
+ map.put("a", new String[]{"_b"});
+ map.put("c", new String[]{"_d", "_e"});
+ map.put("h", new String[]{"_i"});
+ param.append(map);
+ assertEquals(4, param.size());
+ ExtendedAssert.assertEquals(param.getValues("a"), new
String[]{"b", "_b"});
+ ExtendedAssert.assertEquals(param.getValues("c"), new
String[]{"d", "e", "_d", "_e"});
+ ExtendedAssert.assertEquals(param.getValues("f"), new
String[]{"g"});
+ ExtendedAssert.assertEquals(param.getValues("h"), new
String[]{"_i"});
+ }
+
+ public void testClear()
+ {
+ param.setValue("a", "b");
+ param.clear();
+ assertNull(param.getValue("a"));
+ }
+
+ public Class[] buildExceptionClasses()
+ {
+ return new Class[]
+ {
+ NullPointerException.class,
+ IllegalArgumentException.class,
+ IllegalArgumentException.class,
+ ClassCastException.class
+ };
+ }
+
+ public Map[] buildInvalidMaps()
+ {
+ Map map1 = new HashMap();
+ map1.put("a", null);
+ Map map2 = new HashMap();
+ map2.put("a", new String[0]);
+ Map map3 = new HashMap();
+ map3.put("a", new String[]{null});
+ Map map4 = new HashMap();
+ map4.put("a", new Object());
+ return new Map[]{map1, map2, map3, map4};
+ }
+}
\ No newline at end of file
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/ParametersTestCase.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/PortletRequestDecoderTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/PortletRequestDecoderTestCase.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/PortletRequestDecoderTestCase.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,670 @@
+/******************************************************************************
+ * 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.WindowState;
+import org.jboss.portal.portlet.OpaqueStateString;
+import org.jboss.portal.portlet.PortletParameters;
+import org.jboss.portal.portlet.PortletParametersStateString;
+import org.jboss.portal.portlet.impl.PortletRequestDecoder;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 6549 $
+ */
+public class PortletRequestDecoderTestCase extends TestCase
+{
+
+ public PortletRequestDecoderTestCase(String name)
+ {
+ super(name);
+ }
+
+ private String[] asStringArray(String s)
+ {
+ return new String[]{s};
+ }
+
+ public void testCorruped()
+ {
+ Map queryParams = new HashMap();
+ Map bodyParams = new HashMap();
+ PortletRequestDecoder o = new PortletRequestDecoder();
+
+ // Action + Render
+ try
+ {
+ queryParams.put(PortletRequestDecoder.META_PARAMETER,
asStringArray(Integer.toHexString(PortletRequestDecoder.RENDER_MASK |
PortletRequestDecoder.ACTION_MASK)));
+ o.decode(queryParams, null);
+ fail();
+ }
+ catch (IllegalArgumentException expected)
+ {
+ queryParams.clear();
+ }
+
+ // Action + Mode
+ try
+ {
+ queryParams.put(PortletRequestDecoder.META_PARAMETER,
asStringArray(Integer.toHexString(PortletRequestDecoder.MODE_MASK |
PortletRequestDecoder.ACTION_MASK)));
+ o.decode(queryParams, null);
+ fail();
+ }
+ catch (IllegalArgumentException expected)
+ {
+ queryParams.clear();
+ }
+ try
+ {
+ queryParams.put(PortletRequestDecoder.META_PARAMETER,
asStringArray(Integer.toHexString(PortletRequestDecoder.MODE_MASK |
PortletRequestDecoder.ACTION_MASK)));
+ bodyParams.put(PortletRequestDecoder.MODE_PARAMETER,
asStringArray(Mode.VIEW.toString()));
+ o.decode(queryParams, bodyParams);
+ fail();
+ }
+ catch (IllegalArgumentException expected)
+ {
+ queryParams.clear();
+ bodyParams.clear();
+ }
+
+ // Action + WindowState
+ try
+ {
+ queryParams.put(PortletRequestDecoder.META_PARAMETER,
asStringArray(Integer.toHexString(PortletRequestDecoder.WINDOW_STATE_MASK |
PortletRequestDecoder.ACTION_MASK)));
+ o.decode(queryParams, null);
+ fail();
+ }
+ catch (IllegalArgumentException expected)
+ {
+ queryParams.clear();
+ }
+ try
+ {
+ queryParams.put(PortletRequestDecoder.META_PARAMETER,
asStringArray(Integer.toHexString(PortletRequestDecoder.WINDOW_STATE_MASK |
PortletRequestDecoder.ACTION_MASK)));
+ bodyParams.put(PortletRequestDecoder.WINDOW_STATE_PARAMETER,
asStringArray(WindowState.NORMAL.toString()));
+ o.decode(queryParams, bodyParams);
+ fail();
+ }
+ catch (IllegalArgumentException expected)
+ {
+ queryParams.clear();
+ bodyParams.clear();
+ }
+
+ // Render + Mode
+ try
+ {
+ queryParams.put(PortletRequestDecoder.META_PARAMETER,
asStringArray(Integer.toHexString(PortletRequestDecoder.MODE_MASK |
PortletRequestDecoder.RENDER_MASK)));
+ o.decode(queryParams, null);
+ fail();
+ }
+ catch (IllegalArgumentException expected)
+ {
+ queryParams.clear();
+ }
+ try
+ {
+ queryParams.put(PortletRequestDecoder.META_PARAMETER,
asStringArray(Integer.toHexString(PortletRequestDecoder.MODE_MASK |
PortletRequestDecoder.ACTION_MASK)));
+ bodyParams.put(PortletRequestDecoder.MODE_PARAMETER,
asStringArray(Mode.VIEW.toString()));
+ o.decode(queryParams, bodyParams);
+ fail();
+ }
+ catch (IllegalArgumentException expected)
+ {
+ queryParams.clear();
+ bodyParams.clear();
+ }
+
+ // Render + WindowState
+ try
+ {
+ queryParams.put(PortletRequestDecoder.META_PARAMETER,
asStringArray(Integer.toHexString(PortletRequestDecoder.WINDOW_STATE_MASK |
PortletRequestDecoder.RENDER_MASK)));
+ o.decode(queryParams, bodyParams);
+ fail();
+ }
+ catch (IllegalArgumentException expected)
+ {
+ queryParams.clear();
+ }
+ try
+ {
+ queryParams.put(PortletRequestDecoder.META_PARAMETER,
asStringArray(Integer.toHexString(PortletRequestDecoder.WINDOW_STATE_MASK |
PortletRequestDecoder.ACTION_MASK)));
+ bodyParams.put(PortletRequestDecoder.WINDOW_STATE_PARAMETER,
asStringArray(WindowState.NORMAL.toString()));
+ o.decode(queryParams, bodyParams);
+ fail();
+ }
+ catch (IllegalArgumentException expected)
+ {
+ queryParams.clear();
+ bodyParams.clear();
+ }
+ }
+
+ public void testNav()
+ {
+ Map queryParams = new HashMap();
+ Map bodyParams = new HashMap();
+ PortletRequestDecoder o = new PortletRequestDecoder();
+
+ // Empty
+ o.decode(queryParams, null);
+ assertNull(o.getForm());
+ assertNull(o.getInteractionState());
+ assertNull(o.getNavigationalState());
+ assertEquals(PortletRequestDecoder.NAV_TYPE, o.getType());
+ assertNull(o.getMode());
+ assertNull(o.getWindowState());
+ queryParams.clear();
+
+ // Query mode
+ queryParams.put(PortletRequestDecoder.MODE_PARAMETER,
asStringArray(Mode.VIEW.toString()));
+ o.decode(queryParams, null);
+ assertNull(o.getForm());
+ assertNull(o.getInteractionState());
+ assertNull(o.getNavigationalState());
+ assertEquals(PortletRequestDecoder.NAV_TYPE, o.getType());
+ assertEquals(Mode.VIEW, o.getMode());
+ assertNull(o.getWindowState());
+ queryParams.clear();
+
+ // Query mode two values
+ queryParams.put(PortletRequestDecoder.MODE_PARAMETER, new
String[]{Mode.VIEW.toString(), Mode.EDIT.toString()});
+ o.decode(queryParams, null);
+ assertNull(o.getForm());
+ assertNull(o.getInteractionState());
+ assertNull(o.getNavigationalState());
+ assertEquals(PortletRequestDecoder.NAV_TYPE, o.getType());
+ assertEquals(Mode.VIEW, o.getMode());
+ assertNull(o.getWindowState());
+ queryParams.clear();
+
+ // Body mode
+ bodyParams.put(PortletRequestDecoder.MODE_PARAMETER,
asStringArray(Mode.VIEW.toString()));
+ o.decode(queryParams, bodyParams);
+ assertNull(o.getForm());
+ assertNull(o.getInteractionState());
+ assertNull(o.getNavigationalState());
+ assertEquals(PortletRequestDecoder.NAV_TYPE, o.getType());
+ assertNull(o.getMode());
+ assertNull(o.getWindowState());
+ bodyParams.clear();
+
+ // Query mode + Body mode
+ queryParams.put(PortletRequestDecoder.MODE_PARAMETER, new
String[]{Mode.VIEW.toString()});
+ bodyParams.put(PortletRequestDecoder.MODE_PARAMETER, new
String[]{Mode.EDIT.toString()});
+ o.decode(queryParams, bodyParams);
+ assertNull(o.getForm());
+ assertNull(o.getInteractionState());
+ assertNull(o.getNavigationalState());
+ assertEquals(PortletRequestDecoder.NAV_TYPE, o.getType());
+ assertEquals(Mode.VIEW, o.getMode());
+ assertNull(o.getWindowState());
+ queryParams.clear();
+ bodyParams.clear();
+
+ // Query window state
+ queryParams.put(PortletRequestDecoder.WINDOW_STATE_PARAMETER,
asStringArray(WindowState.NORMAL.toString()));
+ o.decode(queryParams, null);
+ assertNull(o.getForm());
+ assertNull(o.getInteractionState());
+ assertNull(o.getNavigationalState());
+ assertEquals(PortletRequestDecoder.NAV_TYPE, o.getType());
+ assertNull(o.getMode());
+ assertEquals(WindowState.NORMAL, o.getWindowState());
+ queryParams.clear();
+
+ // Body window state
+ bodyParams.put(PortletRequestDecoder.WINDOW_STATE_PARAMETER,
asStringArray(WindowState.NORMAL.toString()));
+ o.decode(queryParams, bodyParams);
+ assertNull(o.getForm());
+ assertNull(o.getInteractionState());
+ assertNull(o.getNavigationalState());
+ assertEquals(PortletRequestDecoder.NAV_TYPE, o.getType());
+ assertNull(o.getMode());
+ assertNull(o.getWindowState());
+ bodyParams.clear();
+ }
+
+ public void testRender()
+ {
+ Map queryParams = new HashMap();
+ PortletRequestDecoder o = new PortletRequestDecoder();
+
+ // Empty
+ queryParams.put(PortletRequestDecoder.META_PARAMETER,
asStringArray(Integer.toHexString(PortletRequestDecoder.RENDER_MASK)));
+ o.decode(queryParams, null);
+ assertNull(o.getForm());
+ assertNull(o.getInteractionState());
+ assertEquals(new PortletParametersStateString(), o.getNavigationalState());
+ assertEquals(PortletRequestDecoder.RENDER_TYPE, o.getType());
+ assertNull(o.getMode());
+ assertNull(o.getWindowState());
+ queryParams.clear();
+
+ // Query mode
+ queryParams.put(PortletRequestDecoder.META_PARAMETER,
asStringArray(Integer.toHexString(PortletRequestDecoder.RENDER_MASK |
PortletRequestDecoder.MODE_MASK)));
+ queryParams.put(PortletRequestDecoder.MODE_PARAMETER,
asStringArray(Mode.VIEW.toString()));
+ o.decode(queryParams, null);
+ assertNull(o.getForm());
+ assertNull(o.getInteractionState());
+ assertEquals(new PortletParametersStateString(), o.getNavigationalState());
+ assertEquals(PortletRequestDecoder.RENDER_TYPE, o.getType());
+ assertEquals(Mode.VIEW, o.getMode());
+ assertNull(o.getWindowState());
+ queryParams.clear();
+
+ // Query window state
+ queryParams.put(PortletRequestDecoder.META_PARAMETER,
asStringArray(Integer.toHexString(PortletRequestDecoder.RENDER_MASK |
PortletRequestDecoder.WINDOW_STATE_MASK)));
+ queryParams.put(PortletRequestDecoder.WINDOW_STATE_PARAMETER,
asStringArray(WindowState.NORMAL.toString()));
+ o.decode(queryParams, null);
+ assertNull(o.getForm());
+ assertNull(o.getInteractionState());
+ assertEquals(new PortletParametersStateString(), o.getNavigationalState());
+ assertEquals(PortletRequestDecoder.RENDER_TYPE, o.getType());
+ assertNull(o.getMode());
+ assertEquals(WindowState.NORMAL, o.getWindowState());
+ queryParams.clear();
+ }
+
+ public void testRenderNonOpaque()
+ {
+ Map queryParams = new HashMap();
+ Map bodyParams = new HashMap();
+ PortletRequestDecoder o = new PortletRequestDecoder();
+ PortletParametersStateString navState = new PortletParametersStateString();
+
+ // Query parameter
+ queryParams.put(PortletRequestDecoder.META_PARAMETER,
asStringArray(Integer.toHexString(PortletRequestDecoder.RENDER_MASK)));
+ queryParams.put("foo", asStringArray("bar"));
+ o.decode(queryParams, null);
+ assertNull(o.getForm());
+ assertNull(o.getInteractionState());
+ navState.setValue("foo", "bar");
+ assertEquals(navState, o.getNavigationalState());
+ assertEquals(PortletRequestDecoder.RENDER_TYPE, o.getType());
+ assertNull(o.getMode());
+ assertNull(o.getWindowState());
+ navState.clear();
+ queryParams.clear();
+
+ // Query meta parameter
+ queryParams.put(PortletRequestDecoder.META_PARAMETER, new
String[]{Integer.toHexString(PortletRequestDecoder.RENDER_MASK), "bar"});
+ o.decode(queryParams, null);
+ assertNull(o.getForm());
+ assertNull(o.getInteractionState());
+ navState.setValue(PortletRequestDecoder.META_PARAMETER, "bar");
+ assertEquals(navState, o.getNavigationalState());
+ assertEquals(PortletRequestDecoder.RENDER_TYPE, o.getType());
+ assertNull(o.getMode());
+ assertNull(o.getWindowState());
+ navState.clear();
+ queryParams.clear();
+
+ // Query window state parameter + window state meta parameter
+ queryParams.put(PortletRequestDecoder.META_PARAMETER, new
String[]{Integer.toHexString(PortletRequestDecoder.RENDER_MASK |
PortletRequestDecoder.WINDOW_STATE_MASK)});
+ queryParams.put(PortletRequestDecoder.WINDOW_STATE_PARAMETER, new
String[]{WindowState.NORMAL.toString(), "bar"});
+ o.decode(queryParams, null);
+ assertNull(o.getForm());
+ assertNull(o.getInteractionState());
+ navState.setValue(PortletRequestDecoder.WINDOW_STATE_PARAMETER, "bar");
+ assertEquals(navState, o.getNavigationalState());
+ assertEquals(PortletRequestDecoder.RENDER_TYPE, o.getType());
+ assertNull(o.getMode());
+ assertEquals(WindowState.NORMAL, o.getWindowState());
+ navState.clear();
+ queryParams.clear();
+
+ // Query window state parameter
+ queryParams.put(PortletRequestDecoder.META_PARAMETER, new
String[]{Integer.toHexString(PortletRequestDecoder.RENDER_MASK)});
+ queryParams.put(PortletRequestDecoder.WINDOW_STATE_PARAMETER, new
String[]{"bar"});
+ o.decode(queryParams, null);
+ assertNull(o.getForm());
+ assertNull(o.getInteractionState());
+ navState.setValue(PortletRequestDecoder.WINDOW_STATE_PARAMETER, "bar");
+ assertEquals(navState, o.getNavigationalState());
+ assertEquals(PortletRequestDecoder.RENDER_TYPE, o.getType());
+ assertNull(o.getMode());
+ assertNull(o.getWindowState());
+ navState.clear();
+ queryParams.clear();
+
+ // Query mode parameter + mode meta parameter
+ queryParams.put(PortletRequestDecoder.META_PARAMETER, new
String[]{Integer.toHexString(PortletRequestDecoder.RENDER_MASK |
PortletRequestDecoder.MODE_MASK)});
+ queryParams.put(PortletRequestDecoder.MODE_PARAMETER, new
String[]{Mode.VIEW.toString(), "bar"});
+ o.decode(queryParams, null);
+ assertNull(o.getForm());
+ assertNull(o.getInteractionState());
+ navState.setValue(PortletRequestDecoder.MODE_PARAMETER, "bar");
+ assertEquals(navState, o.getNavigationalState());
+ assertEquals(PortletRequestDecoder.RENDER_TYPE, o.getType());
+ assertEquals(Mode.VIEW, o.getMode());
+ assertNull(o.getWindowState());
+ navState.clear();
+ queryParams.clear();
+
+ // Query mode parameter
+ queryParams.put(PortletRequestDecoder.META_PARAMETER, new
String[]{Integer.toHexString(PortletRequestDecoder.RENDER_MASK)});
+ queryParams.put(PortletRequestDecoder.MODE_PARAMETER, new
String[]{"bar"});
+ o.decode(queryParams, null);
+ assertNull(o.getForm());
+ assertNull(o.getInteractionState());
+ navState.setValue(PortletRequestDecoder.MODE_PARAMETER, "bar");
+ assertEquals(navState, o.getNavigationalState());
+ assertEquals(PortletRequestDecoder.RENDER_TYPE, o.getType());
+ assertNull(o.getMode());
+ assertNull(o.getWindowState());
+ navState.clear();
+ queryParams.clear();
+
+ // Body parameter
+ queryParams.put(PortletRequestDecoder.META_PARAMETER,
asStringArray(Integer.toHexString(PortletRequestDecoder.RENDER_MASK)));
+ bodyParams.put("foo", asStringArray("bar2"));
+ o.decode(queryParams, bodyParams);
+ assertNull(o.getForm());
+ assertNull(o.getInteractionState());
+ assertEquals(navState, o.getNavigationalState());
+ assertEquals(PortletRequestDecoder.RENDER_TYPE, o.getType());
+ assertNull(o.getMode());
+ assertNull(o.getWindowState());
+ navState.clear();
+ queryParams.clear();
+ bodyParams.clear();
+
+ // Query multivalued parameter
+ queryParams.put(PortletRequestDecoder.META_PARAMETER,
asStringArray(Integer.toHexString(PortletRequestDecoder.RENDER_MASK)));
+ queryParams.put("foo", new String[]{"bar1",
"bar2"});
+ o.decode(queryParams, null);
+ assertNull(o.getForm());
+ assertNull(o.getInteractionState());
+ navState.setValues("foo", new String[]{"bar1",
"bar2"});
+ assertEquals(navState, o.getNavigationalState());
+ assertEquals(PortletRequestDecoder.RENDER_TYPE, o.getType());
+ assertNull(o.getMode());
+ assertNull(o.getWindowState());
+ navState.clear();
+ queryParams.clear();
+
+ // Query + Body parameter
+ queryParams.put(PortletRequestDecoder.META_PARAMETER,
asStringArray(Integer.toHexString(PortletRequestDecoder.RENDER_MASK)));
+ queryParams.put("foo", new String[]{"bar1"});
+ bodyParams.put("foo", new String[]{"bar2"});
+ o.decode(queryParams, bodyParams);
+ assertNull(o.getForm());
+ assertNull(o.getInteractionState());
+ navState.setValue("foo", "bar1");
+ assertEquals(navState, o.getNavigationalState());
+ assertEquals(PortletRequestDecoder.RENDER_TYPE, o.getType());
+ assertNull(o.getMode());
+ assertNull(o.getWindowState());
+ navState.clear();
+ queryParams.clear();
+ bodyParams.clear();
+ }
+
+ public void testRenderOpaque()
+ {
+ Map queryParams = new HashMap();
+ Map bodyParams = new HashMap();
+ PortletRequestDecoder o = new PortletRequestDecoder();
+
+ // Empty
+ queryParams.put(PortletRequestDecoder.META_PARAMETER,
asStringArray(Integer.toHexString(PortletRequestDecoder.RENDER_MASK |
PortletRequestDecoder.OPAQUE_MASK)));
+ o.decode(queryParams, null);
+ assertNull(o.getForm());
+ assertNull(o.getInteractionState());
+ assertNull(o.getNavigationalState());
+ assertEquals(PortletRequestDecoder.RENDER_TYPE, o.getType());
+ assertNull(o.getMode());
+ assertNull(o.getWindowState());
+ queryParams.clear();
+
+ // Query nav state
+ queryParams.put(PortletRequestDecoder.META_PARAMETER,
asStringArray(Integer.toHexString(PortletRequestDecoder.RENDER_MASK |
PortletRequestDecoder.OPAQUE_MASK)));
+ queryParams.put(PortletRequestDecoder.NAVIGATIONAL_STATE_PARAMETER,
asStringArray("navstatevalue"));
+ o.decode(queryParams, bodyParams);
+ assertNull(o.getForm());
+ assertNull(o.getInteractionState());
+ assertEquals(new OpaqueStateString("navstatevalue"),
o.getNavigationalState());
+ assertEquals(PortletRequestDecoder.RENDER_TYPE, o.getType());
+ assertNull(o.getMode());
+ assertNull(o.getWindowState());
+ queryParams.clear();
+
+ // Body nav state
+ queryParams.put(PortletRequestDecoder.META_PARAMETER,
asStringArray(Integer.toHexString(PortletRequestDecoder.RENDER_MASK |
PortletRequestDecoder.OPAQUE_MASK)));
+ bodyParams.put(PortletRequestDecoder.NAVIGATIONAL_STATE_PARAMETER,
asStringArray("navstatevalue"));
+ o.decode(queryParams, bodyParams);
+ assertNull(o.getForm());
+ assertNull(o.getInteractionState());
+ assertNull(o.getNavigationalState());
+ assertEquals(PortletRequestDecoder.RENDER_TYPE, o.getType());
+ assertNull(o.getMode());
+ assertNull(o.getWindowState());
+ queryParams.clear();
+ bodyParams.clear();
+
+ // Query int state is ignored
+ queryParams.put(PortletRequestDecoder.META_PARAMETER,
asStringArray(Integer.toHexString(PortletRequestDecoder.RENDER_MASK |
PortletRequestDecoder.OPAQUE_MASK)));
+ queryParams.put(PortletRequestDecoder.INTERACTION_STATE_PARAMETER,
asStringArray("intstatevalue"));
+ o.decode(queryParams, null);
+ assertNull(o.getForm());
+ assertNull(o.getInteractionState());
+ assertNull(o.getNavigationalState());
+ assertEquals(PortletRequestDecoder.RENDER_TYPE, o.getType());
+ assertNull(o.getMode());
+ assertNull(o.getWindowState());
+ queryParams.clear();
+
+ // Body int state is ignored
+ queryParams.put(PortletRequestDecoder.META_PARAMETER,
asStringArray(Integer.toHexString(PortletRequestDecoder.RENDER_MASK |
PortletRequestDecoder.OPAQUE_MASK)));
+ bodyParams.put(PortletRequestDecoder.INTERACTION_STATE_PARAMETER,
asStringArray("intstatevalue"));
+ o.decode(queryParams, bodyParams);
+ assertNull(o.getForm());
+ assertNull(o.getInteractionState());
+ assertNull(o.getNavigationalState());
+ assertEquals(PortletRequestDecoder.RENDER_TYPE, o.getType());
+ assertNull(o.getMode());
+ assertNull(o.getWindowState());
+ queryParams.clear();
+ bodyParams.clear();
+ }
+
+ public void testAction()
+ {
+ Map queryParams = new HashMap();
+ PortletRequestDecoder o = new PortletRequestDecoder();
+
+ // Empty
+ queryParams.put(PortletRequestDecoder.META_PARAMETER,
asStringArray(Integer.toHexString(PortletRequestDecoder.ACTION_MASK)));
+ o.decode(queryParams, null);
+ assertEquals(new PortletParameters(), o.getForm());
+ assertEquals(new PortletParametersStateString(), o.getInteractionState());
+ assertNull(o.getNavigationalState());
+ assertEquals(PortletRequestDecoder.ACTION_TYPE, o.getType());
+ assertNull(o.getMode());
+ assertNull(o.getWindowState());
+ queryParams.clear();
+
+ // Query mode
+ queryParams.put(PortletRequestDecoder.META_PARAMETER,
asStringArray(Integer.toHexString(PortletRequestDecoder.ACTION_MASK |
PortletRequestDecoder.MODE_MASK)));
+ queryParams.put(PortletRequestDecoder.MODE_PARAMETER,
asStringArray(Mode.VIEW.toString()));
+ o.decode(queryParams, null);
+ assertEquals(new PortletParameters(), o.getForm());
+ assertEquals(new PortletParametersStateString(), o.getInteractionState());
+ assertNull(o.getNavigationalState());
+ assertEquals(PortletRequestDecoder.ACTION_TYPE, o.getType());
+ assertEquals(Mode.VIEW, o.getMode());
+ assertNull(o.getWindowState());
+ queryParams.clear();
+
+ // Query window state
+ queryParams.put(PortletRequestDecoder.META_PARAMETER,
asStringArray(Integer.toHexString(PortletRequestDecoder.ACTION_MASK |
PortletRequestDecoder.WINDOW_STATE_MASK)));
+ queryParams.put(PortletRequestDecoder.WINDOW_STATE_PARAMETER,
asStringArray(WindowState.NORMAL.toString()));
+ o.decode(queryParams, null);
+ assertEquals(new PortletParameters(), o.getForm());
+ assertEquals(new PortletParametersStateString(), o.getInteractionState());
+ assertNull(o.getNavigationalState());
+ assertEquals(PortletRequestDecoder.ACTION_TYPE, o.getType());
+ assertNull(o.getMode());
+ assertEquals(WindowState.NORMAL, o.getWindowState());
+ queryParams.clear();
+ }
+
+ public void testActionNonOpaque()
+ {
+ Map queryParams = new HashMap();
+ Map bodyParams = new HashMap();
+ PortletRequestDecoder o = new PortletRequestDecoder();
+ PortletParametersStateString intState = new PortletParametersStateString();
+ PortletParameters form = new PortletParameters();
+
+ // Query parameter
+ queryParams.put(PortletRequestDecoder.META_PARAMETER,
asStringArray(Integer.toHexString(PortletRequestDecoder.ACTION_MASK)));
+ queryParams.put("foo", asStringArray("bar"));
+ o.decode(queryParams, null);
+ assertEquals(form, o.getForm());
+ intState.setValue("foo", "bar");
+ assertEquals(intState, o.getInteractionState());
+ assertNull(o.getNavigationalState());
+ assertEquals(PortletRequestDecoder.ACTION_TYPE, o.getType());
+ assertNull(o.getMode());
+ assertNull(o.getWindowState());
+ intState.clear();
+ queryParams.clear();
+ form.clear();
+
+ // Query multivalued parameter
+ queryParams.put(PortletRequestDecoder.META_PARAMETER,
asStringArray(Integer.toHexString(PortletRequestDecoder.ACTION_MASK)));
+ queryParams.put("foo", new String[]{"bar1",
"bar2"});
+ o.decode(queryParams, null);
+ assertEquals(form, o.getForm());
+ intState.setValues("foo", new String[]{"bar1",
"bar2"});
+ assertEquals(intState, o.getInteractionState());
+ assertNull(o.getNavigationalState());
+ assertEquals(PortletRequestDecoder.ACTION_TYPE, o.getType());
+ assertNull(o.getMode());
+ assertNull(o.getWindowState());
+ intState.clear();
+ queryParams.clear();
+ form.clear();
+
+ // Body parameter
+ queryParams.put(PortletRequestDecoder.META_PARAMETER,
asStringArray(Integer.toHexString(PortletRequestDecoder.ACTION_MASK)));
+ bodyParams.put("foo", asStringArray("bar"));
+ o.decode(queryParams, bodyParams);
+ form.setValue("foo", "bar");
+ assertEquals(form, o.getForm());
+ assertEquals(intState, o.getInteractionState());
+ assertNull(o.getNavigationalState());
+ assertEquals(PortletRequestDecoder.ACTION_TYPE, o.getType());
+ assertNull(o.getMode());
+ assertNull(o.getWindowState());
+ form.clear();
+ queryParams.clear();
+ bodyParams.clear();
+ form.clear();
+
+ // Body multivalued parameter
+ queryParams.put(PortletRequestDecoder.META_PARAMETER,
asStringArray(Integer.toHexString(PortletRequestDecoder.ACTION_MASK)));
+ bodyParams.put("foo", new String[]{"bar1", "bar2"});
+ o.decode(queryParams, bodyParams);
+ form.setValues("foo", new String[]{"bar1", "bar2"});
+ assertEquals(form, o.getForm());
+ assertEquals(intState, o.getInteractionState());
+ assertNull(o.getNavigationalState());
+ assertEquals(PortletRequestDecoder.ACTION_TYPE, o.getType());
+ assertNull(o.getMode());
+ assertNull(o.getWindowState());
+ form.clear();
+ queryParams.clear();
+ bodyParams.clear();
+ form.clear();
+ }
+
+ public void testActionOpaque()
+ {
+ Map queryParams = new HashMap();
+ Map bodyParams = new HashMap();
+ PortletRequestDecoder o = new PortletRequestDecoder();
+
+ // Empty
+ queryParams.put(PortletRequestDecoder.META_PARAMETER,
asStringArray(Integer.toHexString(PortletRequestDecoder.ACTION_MASK |
PortletRequestDecoder.OPAQUE_MASK)));
+ o.decode(queryParams, null);
+ assertEquals(new PortletParameters(), o.getForm());
+ assertNull(o.getInteractionState());
+ assertNull(o.getNavigationalState());
+ assertEquals(PortletRequestDecoder.ACTION_TYPE, o.getType());
+ assertNull(o.getMode());
+ assertNull(o.getWindowState());
+ queryParams.clear();
+
+ // Query nav state
+ queryParams.put(PortletRequestDecoder.META_PARAMETER,
asStringArray(Integer.toHexString(PortletRequestDecoder.ACTION_MASK |
PortletRequestDecoder.OPAQUE_MASK)));
+ queryParams.put(PortletRequestDecoder.NAVIGATIONAL_STATE_PARAMETER,
asStringArray("navstatevalue"));
+ o.decode(queryParams, null);
+ assertEquals(new PortletParameters(), o.getForm());
+ assertNull(o.getInteractionState());
+ assertEquals(new OpaqueStateString("navstatevalue"),
o.getNavigationalState());
+ assertEquals(PortletRequestDecoder.ACTION_TYPE, o.getType());
+ assertNull(o.getMode());
+ assertNull(o.getWindowState());
+ queryParams.clear();
+
+ // Query int state
+ queryParams.put(PortletRequestDecoder.META_PARAMETER,
asStringArray(Integer.toHexString(PortletRequestDecoder.ACTION_MASK |
PortletRequestDecoder.OPAQUE_MASK)));
+ queryParams.put(PortletRequestDecoder.INTERACTION_STATE_PARAMETER,
asStringArray("intstatevalue"));
+ o.decode(queryParams, null);
+ assertEquals(new PortletParameters(), o.getForm());
+ assertEquals(new OpaqueStateString("intstatevalue"),
o.getInteractionState());
+ assertNull(o.getNavigationalState());
+ assertEquals(PortletRequestDecoder.ACTION_TYPE, o.getType());
+ assertNull(o.getMode());
+ assertNull(o.getWindowState());
+ queryParams.clear();
+
+ // Body parameters
+ queryParams.put(PortletRequestDecoder.META_PARAMETER,
asStringArray(Integer.toHexString(PortletRequestDecoder.ACTION_MASK |
PortletRequestDecoder.OPAQUE_MASK)));
+ bodyParams.put("foo1", asStringArray("bar1"));
+ bodyParams.put("foo2", new String[]{"bar2",
"bar3"});
+ queryParams.put("foo3", new String[]{"bar4"});
+ bodyParams.put("foo3", new String[]{"bar5"});
+ o.decode(queryParams, bodyParams);
+ PortletParameters form = new PortletParameters();
+ form.setValue("foo1", "bar1");
+ form.setValues("foo2", new String[]{"bar2",
"bar3"});
+ form.setValues("foo3", new String[]{"bar5"});
+ assertEquals(form, o.getForm());
+ assertNull(o.getInteractionState());
+ assertNull(o.getNavigationalState());
+ assertEquals(PortletRequestDecoder.ACTION_TYPE, o.getType());
+ assertNull(o.getMode());
+ assertNull(o.getWindowState());
+ queryParams.clear();
+ bodyParams.clear();
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/PortletRequestDecoderTestCase.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/PortletRequestEncoderTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/PortletRequestEncoderTestCase.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/PortletRequestEncoderTestCase.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,217 @@
+/******************************************************************************
+ * 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.portlet.impl.PortletRequestEncoder;
+import org.jboss.portal.portlet.impl.PortletRequestDecoder;
+import org.jboss.portal.portlet.PortletParameters;
+import org.jboss.portal.portlet.PortletParametersStateString;
+import org.jboss.portal.common.util.ParameterMap;
+import org.jboss.portal.common.junit.ExtendedAssert;
+import org.jboss.portal.Mode;
+import org.jboss.portal.WindowState;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class PortletRequestEncoderTestCase extends TestCase
+{
+
+ /** . */
+ public static final int RENDER = 0;
+
+ /** . */
+ public static final int ACTION = 1;
+
+ /** . */
+ private ParameterMap params;
+
+ /** . */
+ private PortletRequestEncoder encoder;
+
+ protected void setUp() throws Exception
+ {
+ params = new PortletParameters();
+ encoder = new PortletRequestEncoder(params);
+ }
+
+ protected void tearDown() throws Exception
+ {
+ params = null;
+ encoder = null;
+ }
+
+ public void testEncodeRender()
+ {
+ _testEncodeRender(RENDER, PortletRequestDecoder.RENDER_MASK);
+ }
+
+ public void testEncodeAction()
+ {
+ _testEncodeRender(ACTION, PortletRequestDecoder.ACTION_MASK);
+ }
+
+ public void _testEncodeRender(int lifecycle, int lifecycleMask)
+ {
+ PortletParametersStateString pp = new PortletParametersStateString();
+ encode(pp, null, null, lifecycle);
+ assertEquals(1, params.size());
+ assertEquals(lifecycleMask,
params.getValues(PortletRequestDecoder.META_PARAMETER));
+
+ //
+ pp = new PortletParametersStateString();
+ pp.setValue(PortletRequestDecoder.META_PARAMETER, "foo");
+ encode(pp, null, null, lifecycle);
+ assertEquals(1, params.size());
+ assertEquals(new String[]{Integer.toHexString(lifecycleMask),"foo"},
params.getValues(PortletRequestDecoder.META_PARAMETER));
+
+ //
+ pp = new PortletParametersStateString();
+ pp.setValue("foo", "bar");
+ encode(pp, null, null, lifecycle);
+ assertEquals(2, params.size());
+ assertEquals(lifecycleMask,
params.getValues(PortletRequestDecoder.META_PARAMETER));
+ assertEquals("bar", params.getValues("foo"));
+
+ //
+ pp = new PortletParametersStateString();
+ encode(pp, Mode.VIEW, null, lifecycle);
+ assertEquals(2, params.size());
+ assertEquals(lifecycleMask | PortletRequestDecoder.MODE_MASK,
params.getValues(PortletRequestDecoder.META_PARAMETER));
+ assertEquals(Mode.VIEW, params.getValues(PortletRequestDecoder.MODE_PARAMETER));
+
+ //
+ pp = new PortletParametersStateString();
+ pp.setValue(PortletRequestDecoder.MODE_PARAMETER, "foo");
+ encode(pp, Mode.VIEW, null, lifecycle);
+ assertEquals(2, params.size());
+ assertEquals(lifecycleMask | PortletRequestDecoder.MODE_MASK,
params.getValues(PortletRequestDecoder.META_PARAMETER));
+ assertEquals(new String[]{Mode.VIEW.toString(),"foo"},
params.getValues(PortletRequestDecoder.MODE_PARAMETER));
+
+ //
+ pp = new PortletParametersStateString();
+ pp.setValue("foo", "bar");
+ encode(pp, Mode.VIEW, null, lifecycle);
+ assertEquals(3, params.size());
+ assertEquals(lifecycleMask | PortletRequestDecoder.MODE_MASK,
params.getValues(PortletRequestDecoder.META_PARAMETER));
+ assertEquals(Mode.VIEW, params.getValues(PortletRequestDecoder.MODE_PARAMETER));
+ assertEquals("bar", params.getValues("foo"));
+
+ //
+ pp = new PortletParametersStateString();
+ encode(pp, null, WindowState.NORMAL, lifecycle);
+ assertEquals(2, params.size());
+ assertEquals(lifecycleMask | PortletRequestDecoder.WINDOW_STATE_MASK,
params.getValues(PortletRequestDecoder.META_PARAMETER));
+ assertEquals(WindowState.NORMAL,
params.getValues(PortletRequestDecoder.WINDOW_STATE_PARAMETER));
+
+ //
+ pp = new PortletParametersStateString();
+ pp.setValue(PortletRequestDecoder.WINDOW_STATE_PARAMETER, "foo");
+ encode(pp, null, WindowState.NORMAL, lifecycle);
+ assertEquals(2, params.size());
+ assertEquals(lifecycleMask | PortletRequestDecoder.WINDOW_STATE_MASK,
params.getValues(PortletRequestDecoder.META_PARAMETER));
+ assertEquals(new String[]{WindowState.NORMAL.toString(),"foo"},
params.getValues(PortletRequestDecoder.WINDOW_STATE_PARAMETER));
+
+ //
+ pp = new PortletParametersStateString();
+ pp.setValue("foo", "bar");
+ encode(pp, null, WindowState.NORMAL, lifecycle);
+ assertEquals(3, params.size());
+ assertEquals(lifecycleMask | PortletRequestDecoder.WINDOW_STATE_MASK,
params.getValues(PortletRequestDecoder.META_PARAMETER));
+ assertEquals(WindowState.NORMAL,
params.getValues(PortletRequestDecoder.WINDOW_STATE_PARAMETER));
+ assertEquals("bar", params.getValues("foo"));
+
+ //
+ pp = new PortletParametersStateString();
+ encode(pp, Mode.VIEW, WindowState.NORMAL, lifecycle);
+ assertEquals(3, params.size());
+ assertEquals(lifecycleMask | PortletRequestDecoder.MODE_MASK |
PortletRequestDecoder.WINDOW_STATE_MASK,
params.getValues(PortletRequestDecoder.META_PARAMETER));
+ assertEquals(Mode.VIEW, params.getValues(PortletRequestDecoder.MODE_PARAMETER));
+ assertEquals(WindowState.NORMAL,
params.getValues(PortletRequestDecoder.WINDOW_STATE_PARAMETER));
+
+ //
+ pp = new PortletParametersStateString();
+ pp.setValue("foo", "bar");
+ encode(pp, Mode.VIEW, WindowState.NORMAL, lifecycle);
+ assertEquals(4, params.size());
+ assertEquals(lifecycleMask | PortletRequestDecoder.MODE_MASK |
PortletRequestDecoder.WINDOW_STATE_MASK,
params.getValues(PortletRequestDecoder.META_PARAMETER));
+ assertEquals(Mode.VIEW, params.getValues(PortletRequestDecoder.MODE_PARAMETER));
+ assertEquals(WindowState.NORMAL,
params.getValues(PortletRequestDecoder.WINDOW_STATE_PARAMETER));
+ assertEquals("bar", params.getValues("foo"));
+ }
+
+ public void testEncodeNav()
+ {
+ encode(null, null, null, RENDER);
+ assertEquals(0, params.size());
+
+ //
+ encode(null, Mode.VIEW, null, RENDER);
+ assertEquals(1, params.size());
+ assertEquals(Mode.VIEW, params.getValues(PortletRequestDecoder.MODE_PARAMETER));
+
+ //
+ encode(null, null, WindowState.NORMAL, RENDER);
+ assertEquals(1, params.size());
+ assertEquals(WindowState.NORMAL,
params.getValues(PortletRequestDecoder.WINDOW_STATE_PARAMETER));
+
+ //
+ encode(null, Mode.VIEW, WindowState.NORMAL, RENDER);
+ assertEquals(2, params.size());
+ assertEquals(Mode.VIEW, params.getValues(PortletRequestDecoder.MODE_PARAMETER));
+ assertEquals(WindowState.NORMAL,
params.getValues(PortletRequestDecoder.WINDOW_STATE_PARAMETER));
+ }
+
+ private void encode(PortletParametersStateString params, Mode view, WindowState
normal, int lifecycle)
+ {
+ if (lifecycle == RENDER)
+ {
+ encoder.encodeRender(params, view, normal);
+ }
+ else if (lifecycle == ACTION)
+ {
+ encoder.encodeAction(null, params, view, normal);
+ }
+ else
+ {
+ fail();
+ }
+ }
+
+ void assertEquals(int expected, String[] actual)
+ {
+ ExtendedAssert.assertEquals(new String[]{Integer.toHexString(expected)}, actual);
+ }
+
+ void assertEquals(Object expected, String[] actual)
+ {
+ ExtendedAssert.assertEquals(new String[]{"" + expected}, actual);
+ }
+
+ void assertEquals(String[] expected, String[] actual)
+ {
+ ExtendedAssert.assertEquals(expected, actual);
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/PropertiesTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/PropertiesTestCase.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/PropertiesTestCase.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,117 @@
+/******************************************************************************
+ * 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.common.util.Tools;
+import org.jboss.portal.portlet.Properties;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public class PropertiesTestCase extends TestCase
+{
+
+ public PropertiesTestCase(String name)
+ {
+ super(name);
+ }
+
+ public void testA()
+ {
+ Properties props = new Properties();
+ props.setProperty("name1", "value1");
+
+ props.addProperty("name2", "value2");
+
+ props.setProperty("name3", "value3-1");
+ props.addProperty("name3", "value3-2");
+
+ props.addProperty("name4", "value4-1");
+ props.addProperty("name4", "value4-2");
+
+ props.setProperty("name5", "value5-1");
+ props.setProperty("name5", "value5-2");
+
+ props.addProperty("name6", "value6-1");
+ props.setProperty("name6", "value6-2");
+
+ assertEquals("value1", props.getProperty("name1"));
+ assertEquals(1, props.getProperties("name1").size());
+ assertEquals("value1", props.getProperties("name1").get(0));
+
+ assertEquals("value2", props.getProperty("name2"));
+ assertEquals(1, props.getProperties("name2").size());
+ assertEquals("value2", props.getProperties("name2").get(0));
+
+ assertEquals("value3-1", props.getProperty("name3"));
+ assertEquals(2, props.getProperties("name3").size());
+ assertEquals("value3-1", props.getProperties("name3").get(0));
+ assertEquals("value3-2", props.getProperties("name3").get(1));
+
+ assertEquals("value4-1", props.getProperty("name4"));
+ assertEquals(2, props.getProperties("name4").size());
+ assertEquals("value4-1", props.getProperties("name4").get(0));
+ assertEquals("value4-2", props.getProperties("name4").get(1));
+
+ assertEquals(1, props.getProperties("name5").size());
+ assertEquals("value5-2", props.getProperties("name5").get(0));
+
+ assertEquals("value6-2", props.getProperty("name6"));
+ assertEquals(1, props.getProperties("name6").size());
+ assertEquals("value6-2", props.getProperties("name6").get(0));
+
+ assertEquals(null, props.getProperties("not here"));
+ assertNull(props.getProperty("not here"));
+ assertEquals(Tools.toSet(new Object[]{"name1", "name2",
"name3", "name4", "name5", "name6"}),
props.getPropertyNames());
+
+ try
+ {
+ props.setProperty(null, "not null");
+ fail("Expected IllegalArgumentException");
+ }
+ catch (IllegalArgumentException e)
+ {
+ }
+
+ try
+ {
+ props.setProperty("not null", null);
+ fail("Expected IllegalArgumentException");
+ }
+ catch (IllegalArgumentException e)
+ {
+ }
+
+ try
+ {
+ props.setProperty(null, null);
+ fail("Expected IllegalArgumentException");
+ }
+ catch (IllegalArgumentException e)
+ {
+ }
+ }
+
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/PropertiesTestCase.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/deployment/UnmarshallerTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/deployment/UnmarshallerTestCase.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/deployment/UnmarshallerTestCase.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,208 @@
+/******************************************************************************
+ * 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.deployment;
+
+import junit.framework.TestCase;
+import org.jboss.portal.common.transaction.Transactions;
+import org.jboss.portal.common.net.URLTools;
+import org.jboss.portal.portlet.TransportGuarantee;
+import org.jboss.portal.portlet.deployment.JBossApplicationMetaDataFactory;
+import org.jboss.portal.portlet.deployment.PortletApplicationMetaDataFactory;
+import org.jboss.portal.portlet.impl.jsr168.metadata.LocalizedValueMetaData;
+import org.jboss.portal.portlet.impl.jsr168.metadata.ParameterMetaData;
+import org.jboss.portal.portlet.impl.jsr168.metadata.PortletApplicationMetaData;
+import org.jboss.portal.portlet.impl.jsr168.metadata.PortletMetaData;
+import org.jboss.portal.portlet.impl.jsr168.metadata.SecurityRoleRefMetaData;
+import org.jboss.portal.portlet.impl.jsr168.metadata.UserAttributeMetaData;
+import org.jboss.portal.portlet.metadata.JBossApplicationMetaData;
+import org.jboss.portal.portlet.metadata.JBossPortletMetaData;
+import org.jboss.xb.binding.Unmarshaller;
+import org.jboss.xb.binding.UnmarshallerFactory;
+
+import java.net.URL;
+import java.util.Locale;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 7379 $
+ */
+public class UnmarshallerTestCase extends TestCase
+{
+
+ public void testJBossPortletXML() throws Exception
+ {
+ URL jbossPortletXML =
Thread.currentThread().getContextClassLoader().getResource("test/deployment/jboss-portlet.xml");
+ assertTrue(URLTools.exists(jbossPortletXML));
+
+ //
+ JBossApplicationMetaDataFactory factory = new JBossApplicationMetaDataFactory();
+
+ //
+ Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
+
+ //
+ Object o = unmarshaller.unmarshal(jbossPortletXML.openStream(), factory, null);
+ assertNotNull(o);
+ assertTrue(o instanceof JBossApplicationMetaData);
+ JBossApplicationMetaData app = (JBossApplicationMetaData)o;
+
+ //
+ assertNotNull(app.getPortlets());
+ assertEquals(2, app.getPortlets().size());
+
+ //
+ JBossPortletMetaData portlet1 =
(JBossPortletMetaData)app.getPortlets().get("Portlet1");
+ assertNotNull(portlet1);
+ assertEquals("Portlet1", portlet1.getName());
+ assertEquals(Boolean.FALSE, portlet1.getRemotable());
+ assertEquals(Transactions.TYPE_REQUIRED, portlet1.getTxType());
+// assertNotNull(portlet1.getSecurityConstraint());
+// assertNotNull(portlet1.getSecurityConstraint().getPolicyPermissions());
+// assertEquals(2, portlet1.getSecurityConstraint().getPolicyPermissions().size());
+//
assertNotNull(portlet1.getSecurityConstraint().getPolicyPermissions().get("Admin"));
+// assertEquals("Admin",
((PolicyPermissionMetaData)portlet1.getSecurityConstraint().getPolicyPermissions().get("Admin")).getRoleName());
+// assertEquals(new
CollectionBuilder().add("view").add("create").toHashSet(),
((PolicyPermissionMetaData)portlet1.getSecurityConstraint().getPolicyPermissions().get("Admin")).getActions());
+// assertEquals("User",
((PolicyPermissionMetaData)portlet1.getSecurityConstraint().getPolicyPermissions().get("User")).getRoleName());
+// assertEquals(new
CollectionBuilder().add("view").add("destroy").toHashSet(),
((PolicyPermissionMetaData)portlet1.getSecurityConstraint().getPolicyPermissions().get("User")).getActions());
+
+ JBossPortletMetaData portlet2 =
(JBossPortletMetaData)app.getPortlets().get("Portlet2");
+ assertNotNull(portlet2);
+ assertEquals("Portlet2", portlet2.getName());
+ Boolean remotable = portlet2.getRemotable();
+ assertNotNull(remotable);
+ assertTrue(remotable.booleanValue());
+ }
+
+ public void testPortletXML() throws Exception
+ {
+ URL portletXML =
Thread.currentThread().getContextClassLoader().getResource("test/deployment/portlet.xml");
+ assertTrue(URLTools.exists(portletXML));
+
+ //
+// URL portletXSD =
Thread.currentThread().getContextClassLoader().getResource("portlet-app_1_0.xsd");
+// assertTrue(Tools.exists(portletXSD));
+
+ //
+ PortletApplicationMetaDataFactory factory = new
PortletApplicationMetaDataFactory();
+
+ //
+ Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
+
+ //
+ Object o = unmarshaller.unmarshal(portletXML.openStream(), factory, null);
+ assertNotNull(o);
+ assertTrue(o instanceof PortletApplicationMetaData);
+ PortletApplicationMetaData app = (PortletApplicationMetaData)o;
+
+ //
+ assertEquals(2, app.getPortlets().size());
+
+ //
+ PortletMetaData portlet1 = app.getPortlet("Portlet1");
+ assertNotNull(portlet1);
+
+ //
+ assertEquals("Portlet1", portlet1.getName());
+ assertEquals("org.jboss.portal.test.portlet.TestPortlet",
portlet1.getClassName());
+
+// <display-name>display</display-name>
+// <display-name xml:lang="fr">affichage</display-name>
+
+ assertNotNull(portlet1.getDescription());
+ assertNotNull(portlet1.getDescription().getValues());
+ assertEquals(2, portlet1.getDescription().getValues().size());
+ assertEquals(null,
((LocalizedValueMetaData)portlet1.getDescription().getValues().get(0)).getLocale());
+ assertEquals("default",
((LocalizedValueMetaData)portlet1.getDescription().getValues().get(0)).getValue());
+ assertEquals(Locale.FRENCH,
((LocalizedValueMetaData)portlet1.getDescription().getValues().get(1)).getLocale());
+ assertEquals("defaut",
((LocalizedValueMetaData)portlet1.getDescription().getValues().get(1)).getValue());
+ assertNotNull(portlet1.getDisplayName());
+ assertNotNull(portlet1.getDisplayName().getValues());
+ assertEquals(2, portlet1.getDisplayName().getValues().size());
+ assertEquals(null,
((LocalizedValueMetaData)portlet1.getDisplayName().getValues().get(0)).getLocale());
+ assertEquals("display",
((LocalizedValueMetaData)portlet1.getDisplayName().getValues().get(0)).getValue());
+ assertEquals(Locale.FRENCH,
((LocalizedValueMetaData)portlet1.getDisplayName().getValues().get(1)).getLocale());
+ assertEquals("affichage",
((LocalizedValueMetaData)portlet1.getDisplayName().getValues().get(1)).getValue());
+ assertNotNull(portlet1.getParameters());
+ assertEquals(2, portlet1.getParameters().size());
+ assertNotNull(portlet1.getParameters().get("one"));
+ assertNotNull(portlet1.getCacheConfig());
+ assertEquals(0, portlet1.getCacheConfig().getExpirationTime());
+ assertEquals("one",
((ParameterMetaData)portlet1.getParameters().get("one")).getName());
+ assertEquals("1",
((ParameterMetaData)portlet1.getParameters().get("one")).getValue());
+ assertEquals("two",
((ParameterMetaData)portlet1.getParameters().get("two")).getName());
+ assertEquals("2",
((ParameterMetaData)portlet1.getParameters().get("two")).getValue());
+ assertNotNull(portlet1.getLanguages());
+ assertNotNull(portlet1.getLanguages().getInfo());
+ assertEquals("very long portlet title",
portlet1.getLanguages().getInfo().getTitle());
+ assertEquals("short portlet title",
portlet1.getLanguages().getInfo().getShortTitle());
+ assertEquals("a,b,c,d,e,f",
portlet1.getLanguages().getInfo().getKeywords());
+ assertEquals("MyResourceBundle",
portlet1.getLanguages().getResourceBundle());
+ assertNotNull(portlet1.getLanguages().getSupportedLocales());
+ assertEquals(2, portlet1.getLanguages().getSupportedLocales().size());
+ assertEquals(Locale.ENGLISH,
portlet1.getLanguages().getSupportedLocales().get(0));
+ assertEquals(Locale.FRENCH, portlet1.getLanguages().getSupportedLocales().get(1));
+ assertNotNull(portlet1.getPreferences());
+ assertEquals(4, portlet1.getPreferences().size());
+ assertNotNull(portlet1.getPreferences().getPreference("one"));
+ assertNotNull(portlet1.getPreferences().getPreference("two"));
+ assertNotNull(portlet1.getPreferences().getPreference("three"));
+ assertNotNull(portlet1.getPreferences().getPreference("all"));
+ assertEquals("one",
portlet1.getPreferences().getPreference("one").getName());
+ assertEquals("two",
portlet1.getPreferences().getPreference("two").getName());
+ assertEquals("three",
portlet1.getPreferences().getPreference("three").getName());
+ assertEquals("all",
portlet1.getPreferences().getPreference("all").getName());
+
assertNotNull(portlet1.getPreferences().getPreference("one").getValues());
+
assertNotNull(portlet1.getPreferences().getPreference("two").getValues());
+
assertNotNull(portlet1.getPreferences().getPreference("three").getValues());
+
assertNotNull(portlet1.getPreferences().getPreference("all").getValues());
+ assertEquals(1,
portlet1.getPreferences().getPreference("one").getValues().length);
+ assertEquals(1,
portlet1.getPreferences().getPreference("two").getValues().length);
+ assertEquals(1,
portlet1.getPreferences().getPreference("three").getValues().length);
+ assertEquals(3,
portlet1.getPreferences().getPreference("all").getValues().length);
+
assertFalse(portlet1.getPreferences().getPreference("one").isReadOnly());
+
assertFalse(portlet1.getPreferences().getPreference("two").isReadOnly());
+
assertTrue(portlet1.getPreferences().getPreference("three").isReadOnly());
+
assertFalse(portlet1.getPreferences().getPreference("all").isReadOnly());
+ assertEquals("MyValidator", portlet1.getPreferences().getValidator());
+ assertNotNull(portlet1.getSecurityRoleRefs());
+ assertEquals(2, portlet1.getSecurityRoleRefs().size());
+ assertNotNull(portlet1.getSecurityRoleRefs().get(0));
+ assertNotNull(portlet1.getSecurityRoleRefs().get(1));
+ assertEquals("ROLE_NAME_WITHOUT_LINK",
((SecurityRoleRefMetaData)portlet1.getSecurityRoleRefs().get(0)).getRoleName());
+ assertEquals(null,
((SecurityRoleRefMetaData)portlet1.getSecurityRoleRefs().get(0)).getRoleLink());
+ assertEquals("ROLE_NAME_WITH_LINK",
((SecurityRoleRefMetaData)portlet1.getSecurityRoleRefs().get(1)).getRoleName());
+ assertEquals("ROLE_LINK",
((SecurityRoleRefMetaData)portlet1.getSecurityRoleRefs().get(1)).getRoleLink());
+
+
assertTrue(portlet1.getTransportGuarantees().contains(TransportGuarantee.CONFIDENTIAL));
+
assertTrue(portlet1.getTransportGuarantees().contains(TransportGuarantee.INTEGRAL));
+
+ //
+ assertNotNull(app.getUserAttributes());
+ assertEquals(2, app.getUserAttributes().size());
+ assertNotNull(app.getUserAttributes().get("att1"));
+ assertEquals("att1",
((UserAttributeMetaData)app.getUserAttributes().get("att1")).getName());
+ assertNotNull(app.getUserAttributes().get("att2"));
+ assertEquals("att2",
((UserAttributeMetaData)app.getUserAttributes().get("att2")).getName());
+ }
+
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/deployment/UnmarshallerTestCase.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/framework/NoopServlet.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/framework/NoopServlet.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/framework/NoopServlet.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,41 @@
+/******************************************************************************
+ * 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.framework;
+
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.ServletException;
+import java.io.IOException;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class NoopServlet extends HttpServlet
+{
+
+ protected void service(HttpServletRequest req, HttpServletResponse resp) throws
ServletException, IOException
+ {
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/framework/UTP1.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/framework/UTP1.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/framework/UTP1.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,74 @@
+/******************************************************************************
+ * 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.framework;
+
+import org.jboss.portal.test.framework.portlet.Joinpoint;
+import org.jboss.portal.test.framework.portlet.components.AbstractUniversalTestPortlet;
+
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 5568 $
+ */
+public class UTP1 extends AbstractUniversalTestPortlet
+{
+ public static ThreadLocal local = new ThreadLocal();
+
+ public static ThreadLocal local1 = new ThreadLocal();
+
+ public static ThreadLocal local2 = new ThreadLocal();
+
+ public static ThreadLocal local3 = new ThreadLocal();
+
+ public static ThreadLocal local4 = new ThreadLocal();
+
+ public static ThreadLocal local5 = new ThreadLocal();
+
+ public static Object holder;
+
+ public static String NAME = "Portlet1";
+
+ public final static Joinpoint RENDER_JOINPOINT = new Joinpoint(NAME,
Joinpoint.PORTLET_RENDER);
+
+ public final static Joinpoint ACTION_JOINPOINT = new Joinpoint(NAME,
Joinpoint.PORTLET_ACTION);
+
+ protected String createComponentId()
+ {
+ return NAME;
+ }
+
+ /** Resets helper variables */
+ public void reset()
+ {
+ local = new ThreadLocal();
+ local1 = new ThreadLocal();
+ local2 = new ThreadLocal();
+ local3 = new ThreadLocal();
+ local4 = new ThreadLocal();
+ local5 = new ThreadLocal();
+
+ holder = null;
+ }
+
+
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/framework/UTP1.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/framework/UTP10.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/framework/UTP10.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/framework/UTP10.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,55 @@
+/******************************************************************************
+ * 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.framework;
+
+import org.jboss.portal.test.framework.portlet.Joinpoint;
+import org.jboss.portal.test.framework.portlet.components.AbstractUniversalTestPortlet;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 5568 $
+ */
+public class UTP10 extends AbstractUniversalTestPortlet
+{
+ public static ThreadLocal local = new ThreadLocal();
+
+ public static Object holder;
+
+ public static String NAME = "Portlet10";
+
+ public final static Joinpoint RENDER_JOINPOINT = new Joinpoint(UTP10.NAME,
Joinpoint.PORTLET_RENDER);
+
+ public final static Joinpoint ACTION_JOINPOINT = new Joinpoint(UTP10.NAME,
Joinpoint.PORTLET_ACTION);
+
+ protected String createComponentId()
+ {
+ return UTP10.NAME;
+ }
+
+ /** Resets helper variables */
+ public void reset()
+ {
+ UTP10.local = new ThreadLocal();
+ UTP10.holder = null;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/framework/UTP10.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/framework/UTP11.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/framework/UTP11.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/framework/UTP11.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,55 @@
+/******************************************************************************
+ * 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.framework;
+
+import org.jboss.portal.test.framework.portlet.components.AbstractUniversalTestPortlet;
+import org.jboss.portal.test.framework.portlet.Joinpoint;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 5568 $
+ */
+public class UTP11 extends AbstractUniversalTestPortlet
+{
+ public static ThreadLocal local = new ThreadLocal();
+
+ public static Object holder;
+
+ public static String NAME = "Portlet11";
+
+ public final static Joinpoint RENDER_JOINPOINT = new Joinpoint(NAME,
Joinpoint.PORTLET_RENDER);
+
+ public final static Joinpoint ACTION_JOINPOINT = new Joinpoint(NAME,
Joinpoint.PORTLET_ACTION);
+
+ protected String createComponentId()
+ {
+ return NAME;
+ }
+
+ /** Resets helper variables */
+ public void reset()
+ {
+ local = new ThreadLocal();
+ holder = null;
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/framework/UTP2.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/framework/UTP2.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/framework/UTP2.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,55 @@
+/******************************************************************************
+ * 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.framework;
+
+import org.jboss.portal.test.framework.portlet.Joinpoint;
+import org.jboss.portal.test.framework.portlet.components.AbstractUniversalTestPortlet;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 5568 $
+ */
+public class UTP2 extends AbstractUniversalTestPortlet
+{
+ public static ThreadLocal local = new ThreadLocal();
+
+ public static Object holder;
+
+ public static String NAME = "Portlet2";
+
+ public final static Joinpoint RENDER_JOINPOINT = new Joinpoint(NAME,
Joinpoint.PORTLET_RENDER);
+
+ public final static Joinpoint ACTION_JOINPOINT = new Joinpoint(NAME,
Joinpoint.PORTLET_ACTION);
+
+ protected String createComponentId()
+ {
+ return NAME;
+ }
+
+ /** Resets helper variables */
+ public void reset()
+ {
+ local.set(null);
+ holder = null;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/framework/UTP2.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/framework/UTP3.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/framework/UTP3.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/framework/UTP3.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,55 @@
+/******************************************************************************
+ * 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.framework;
+
+import org.jboss.portal.test.framework.portlet.Joinpoint;
+import org.jboss.portal.test.framework.portlet.components.AbstractUniversalTestPortlet;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 5568 $
+ */
+public class UTP3 extends AbstractUniversalTestPortlet
+{
+ public static ThreadLocal local = new ThreadLocal();
+
+ public static Object holder;
+
+ public static String NAME = "Portlet3";
+
+ public final static Joinpoint RENDER_JOINPOINT = new Joinpoint(UTP3.NAME,
Joinpoint.PORTLET_RENDER);
+
+ public final static Joinpoint ACTION_JOINPOINT = new Joinpoint(UTP3.NAME,
Joinpoint.PORTLET_ACTION);
+
+ protected String createComponentId()
+ {
+ return UTP3.NAME;
+ }
+
+ /** Resets helper variables */
+ public void reset()
+ {
+ local = new ThreadLocal();
+ holder = null;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/framework/UTP3.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/framework/UTP4.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/framework/UTP4.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/framework/UTP4.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,55 @@
+/******************************************************************************
+ * 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.framework;
+
+import org.jboss.portal.test.framework.portlet.Joinpoint;
+import org.jboss.portal.test.framework.portlet.components.AbstractUniversalTestPortlet;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 5568 $
+ */
+public class UTP4 extends AbstractUniversalTestPortlet
+{
+ public static ThreadLocal local = new ThreadLocal();
+
+ public static Object holder;
+
+ public static String NAME = "Portlet4";
+
+ public final static Joinpoint RENDER_JOINPOINT = new Joinpoint(UTP4.NAME,
Joinpoint.PORTLET_RENDER);
+
+ public final static Joinpoint ACTION_JOINPOINT = new Joinpoint(UTP4.NAME,
Joinpoint.PORTLET_ACTION);
+
+ protected String createComponentId()
+ {
+ return UTP4.NAME;
+ }
+
+ /** Resets helper variables */
+ public void reset()
+ {
+ UTP4.local = new ThreadLocal();
+ UTP4.holder = null;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/framework/UTP4.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/framework/UTP5.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/framework/UTP5.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/framework/UTP5.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,55 @@
+/******************************************************************************
+ * 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.framework;
+
+import org.jboss.portal.test.framework.portlet.Joinpoint;
+import org.jboss.portal.test.framework.portlet.components.AbstractUniversalTestPortlet;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 5568 $
+ */
+public class UTP5 extends AbstractUniversalTestPortlet
+{
+ public static ThreadLocal local = new ThreadLocal();
+
+ public static Object holder;
+
+ public static String NAME = "Portlet5";
+
+ public final static Joinpoint RENDER_JOINPOINT = new Joinpoint(UTP5.NAME,
Joinpoint.PORTLET_RENDER);
+
+ public final static Joinpoint ACTION_JOINPOINT = new Joinpoint(UTP5.NAME,
Joinpoint.PORTLET_ACTION);
+
+ protected String createComponentId()
+ {
+ return UTP5.NAME;
+ }
+
+ /** Resets helper variables */
+ public void reset()
+ {
+ UTP5.local = new ThreadLocal();
+ UTP5.holder = null;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/framework/UTP5.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/framework/UTP6.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/framework/UTP6.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/framework/UTP6.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,55 @@
+/******************************************************************************
+ * 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.framework;
+
+import org.jboss.portal.test.framework.portlet.Joinpoint;
+import org.jboss.portal.test.framework.portlet.components.AbstractUniversalTestPortlet;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 5568 $
+ */
+public class UTP6 extends AbstractUniversalTestPortlet
+{
+ public static ThreadLocal local = new ThreadLocal();
+
+ public static Object holder;
+
+ public static String NAME = "Portlet6";
+
+ public final static Joinpoint RENDER_JOINPOINT = new Joinpoint(UTP6.NAME,
Joinpoint.PORTLET_RENDER);
+
+ public final static Joinpoint ACTION_JOINPOINT = new Joinpoint(UTP6.NAME,
Joinpoint.PORTLET_ACTION);
+
+ protected String createComponentId()
+ {
+ return UTP6.NAME;
+ }
+
+ /** Resets helper variables */
+ public void reset()
+ {
+ UTP6.local = new ThreadLocal();
+ UTP6.holder = null;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/framework/UTP6.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/framework/UTP7.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/framework/UTP7.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/framework/UTP7.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,55 @@
+/******************************************************************************
+ * 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.framework;
+
+import org.jboss.portal.test.framework.portlet.Joinpoint;
+import org.jboss.portal.test.framework.portlet.components.AbstractUniversalTestPortlet;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 5568 $
+ */
+public class UTP7 extends AbstractUniversalTestPortlet
+{
+ public static ThreadLocal local = new ThreadLocal();
+
+ public static Object holder;
+
+ public static String NAME = "Portlet7";
+
+ public final static Joinpoint RENDER_JOINPOINT = new Joinpoint(UTP7.NAME,
Joinpoint.PORTLET_RENDER);
+
+ public final static Joinpoint ACTION_JOINPOINT = new Joinpoint(UTP7.NAME,
Joinpoint.PORTLET_ACTION);
+
+ protected String createComponentId()
+ {
+ return UTP7.NAME;
+ }
+
+ /** Resets helper variables */
+ public void reset()
+ {
+ UTP7.local = new ThreadLocal();
+ UTP7.holder = null;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/framework/UTP7.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/framework/UTP8.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/framework/UTP8.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/framework/UTP8.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,55 @@
+/******************************************************************************
+ * 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.framework;
+
+import org.jboss.portal.test.framework.portlet.Joinpoint;
+import org.jboss.portal.test.framework.portlet.components.AbstractUniversalTestPortlet;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 5568 $
+ */
+public class UTP8 extends AbstractUniversalTestPortlet
+{
+ public static ThreadLocal local = new ThreadLocal();
+
+ public static Object holder;
+
+ public static String NAME = "Portlet8";
+
+ public final static Joinpoint RENDER_JOINPOINT = new Joinpoint(UTP8.NAME,
Joinpoint.PORTLET_RENDER);
+
+ public final static Joinpoint ACTION_JOINPOINT = new Joinpoint(UTP8.NAME,
Joinpoint.PORTLET_ACTION);
+
+ protected String createComponentId()
+ {
+ return UTP8.NAME;
+ }
+
+ /** Resets helper variables */
+ public void reset()
+ {
+ UTP8.local = new ThreadLocal();
+ UTP8.holder = null;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/framework/UTP8.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/framework/UTP9.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/framework/UTP9.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/framework/UTP9.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,55 @@
+/******************************************************************************
+ * 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.framework;
+
+import org.jboss.portal.test.framework.portlet.Joinpoint;
+import org.jboss.portal.test.framework.portlet.components.AbstractUniversalTestPortlet;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 5568 $
+ */
+public class UTP9 extends AbstractUniversalTestPortlet
+{
+ public static ThreadLocal local = new ThreadLocal();
+
+ public static Object holder;
+
+ public static String NAME = "Portlet9";
+
+ public final static Joinpoint RENDER_JOINPOINT = new Joinpoint(UTP9.NAME,
Joinpoint.PORTLET_RENDER);
+
+ public final static Joinpoint ACTION_JOINPOINT = new Joinpoint(UTP9.NAME,
Joinpoint.PORTLET_ACTION);
+
+ protected String createComponentId()
+ {
+ return UTP9.NAME;
+ }
+
+ /** Resets helper variables */
+ public void reset()
+ {
+ UTP9.local = new ThreadLocal();
+ UTP9.holder = null;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/framework/UTP9.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/framework/UTS1.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/framework/UTS1.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/framework/UTS1.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,52 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.portlet.framework;
+
+import org.jboss.portal.test.framework.portlet.Joinpoint;
+import org.jboss.portal.test.framework.portlet.components.AbstractUniversalTestServlet;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 5568 $
+ */
+public class UTS1 extends AbstractUniversalTestServlet
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 7731715767678536862L;
+
+ public static ThreadLocal local = new ThreadLocal();
+
+ public static String NAME = "ServletA";
+
+ public final static Joinpoint SERVICE_JOINPOINT = new Joinpoint(UTS1.NAME,
Joinpoint.SERVLET_SERVICE);
+
+ protected String createComponentId(Class clazz)
+ {
+ return UTS1.NAME;
+ }
+
+ public void reset()
+ {
+ local = new ThreadLocal();
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/framework/UTS1.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/framework/UTS2.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/framework/UTS2.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/framework/UTS2.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,52 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.portlet.framework;
+
+import org.jboss.portal.test.framework.portlet.Joinpoint;
+import org.jboss.portal.test.framework.portlet.components.AbstractUniversalTestServlet;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 5568 $
+ */
+public class UTS2 extends AbstractUniversalTestServlet
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = -6331478437141464198L;
+
+ public static ThreadLocal local = new ThreadLocal();
+
+ public static String NAME = "ServletB";
+
+ public final static Joinpoint SERVICE_JOINPOINT = new Joinpoint(UTS2.NAME,
Joinpoint.SERVLET_SERVICE);
+
+ protected String createComponentId(Class clazz)
+ {
+ return UTS2.NAME;
+ }
+
+ public void reset()
+ {
+ local = new ThreadLocal();
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/framework/UTS2.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/ha/session/MutableValue.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/ha/session/MutableValue.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/ha/session/MutableValue.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,82 @@
+/******************************************************************************
+ * 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.ha.session;
+
+import java.io.Serializable;
+import java.io.IOException;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5985 $
+ */
+public class MutableValue implements Serializable
+{
+
+ private String string;
+
+ public MutableValue(String string)
+ {
+ this.string = string;
+ }
+
+ public String getString()
+ {
+ return string;
+ }
+
+ public void setString(String string)
+ {
+ this.string = string;
+ }
+
+ public boolean equals(Object obj)
+ {
+ if (obj == this)
+ {
+ return true;
+ }
+ if (obj instanceof MutableValue)
+ {
+ MutableValue that = (MutableValue)obj;
+ return string == null ? that.string == null : string.equals(that.string);
+ }
+ return false;
+ }
+
+ private void writeObject(java.io.ObjectOutputStream out) throws IOException
+ {
+ out.writeUTF(string);
+ System.out.print("Serializing " + string);
+ }
+
+ private void readObject(java.io.ObjectInputStream in) throws IOException,
ClassNotFoundException
+ {
+ string = in.readUTF();
+ System.out.print("Unserializing " + string);
+ }
+
+ public String toString()
+ {
+ return "MutableValue[" + string + "]";
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/ha/session/MutableValue.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/ha/session/SessionSequenceBuilder.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/ha/session/SessionSequenceBuilder.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/ha/session/SessionSequenceBuilder.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,160 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.portlet.ha.session;
+
+import org.jboss.portal.test.framework.driver.http.response.InvokeGetResponse;
+import org.jboss.portal.test.framework.driver.DriverResponse;
+import org.jboss.portal.test.framework.driver.response.EndTestResponse;
+import org.jboss.portal.common.util.Tools;
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestDriver;
+import org.jboss.portal.test.framework.portlet.PortletTestSuite;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.framework.UTP1;
+import org.jboss.portal.test.framework.server.NodeId;
+
+import javax.portlet.Portlet;
+import javax.portlet.PortletException;
+import javax.portlet.PortletSecurityException;
+import javax.portlet.PortletSession;
+import javax.portlet.PortletURL;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import java.io.IOException;
+import java.util.Collections;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 7954 $
+ */
+public class SessionSequenceBuilder extends PortletTestSuite
+{
+ public void createTestReplicateImmutableValue(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("TestReplicateImmutableValue", seq);
+ seq.addAction(0, NodeId.PORTS_01, UTP1.RENDER_JOINPOINT, new
PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws PortletException,
PortletSecurityException, IOException
+ {
+ assertNull(request.getPortletSession(false));
+ PortletSession session = request.getPortletSession();
+ assertNotNull(session);
+ session.setAttribute("immutable", "abcdef");
+ PortletURL portletURL = response.createRenderURL();
+ String url = context.rewriteURLForNode(portletURL.toString(),
NodeId.PORTS_02);
+ return new InvokeGetResponse(url);
+ }
+ });
+ seq.addAction(1, NodeId.PORTS_02, UTP1.RENDER_JOINPOINT, new
PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ PortletSession session = request.getPortletSession();
+ assertNotNull(session);
+ assertEquals("abcdef",
session.getAttribute("immutable"));
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ public void createTestReplicateMutableValue(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("TestReplicateMutableValue", seq);
+ seq.addAction(0, NodeId.PORTS_01, UTP1.RENDER_JOINPOINT, new
PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws IOException
+ {
+ assertNull(request.getPortletSession(false));
+ PortletSession session = request.getPortletSession();
+ assertNotNull(session);
+ MutableValue value = new MutableValue("abcdef");
+ session.setAttribute("mutable", value);
+ value.setString("fedcba");
+ PortletURL portletURL = response.createRenderURL();
+ String url = context.rewriteURLForNode(portletURL.toString(),
NodeId.PORTS_02);
+ return new InvokeGetResponse(url);
+ }
+ });
+ seq.addAction(1, NodeId.PORTS_02, UTP1.RENDER_JOINPOINT, new
PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ PortletSession session = request.getPortletSession();
+ assertNotNull(session);
+ assertEquals(new MutableValue("fedcba"),
session.getAttribute("mutable"));
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ public void
createTestModifyExistingAttributeWithoutExplicitSetDoesNotReplicate(PortletTestDriver
registry)
+ {
+ PortletTest seq = new PortletTest();
+
registry.addSequence("TestModifyExistingAttributeWithoutExplicitSetDoesNotReplicate",
seq);
+ seq.addAction(0, NodeId.PORTS_01, UTP1.RENDER_JOINPOINT, new
PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws IOException
+ {
+ assertNull(request.getPortletSession(false));
+ PortletSession session = request.getPortletSession();
+ assertNotNull(session);
+ assertEquals(Collections.EMPTY_LIST,
Tools.toList(session.getAttributeNames()));
+ MutableValue value = new MutableValue("abcdef");
+ session.setAttribute("mutable", value);
+ PortletURL portletURL = response.createRenderURL();
+ String url = portletURL.toString();
+ return new InvokeGetResponse(url);
+ }
+ });
+ seq.addAction(1, NodeId.PORTS_01, UTP1.RENDER_JOINPOINT, new
PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws IOException
+ {
+ PortletSession session = request.getPortletSession();
+ assertEquals(Collections.singletonList("mutable"),
Tools.toList(session.getAttributeNames()));
+ Object o = session.getAttribute("mutable");
+ assertNotNull(o);
+ assertEquals(MutableValue.class, o.getClass());
+ MutableValue value = (MutableValue)o;
+ value.setString("fedcba");
+ PortletURL portletURL = response.createRenderURL();
+ String url = context.rewriteURLForNode(portletURL.toString(),
NodeId.PORTS_02);
+ return new InvokeGetResponse(url);
+ }
+ });
+ seq.addAction(2, NodeId.PORTS_02, UTP1.RENDER_JOINPOINT, new
PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ PortletSession session = request.getPortletSession();
+ assertNotNull(session);
+ assertEquals(Collections.singletonList("mutable"),
Tools.toList(session.getAttributeNames()));
+ assertEquals(new MutableValue("abcdef"),
session.getAttribute("mutable"));
+ return new EndTestResponse();
+ }
+ });
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/ha/session/SessionSequenceBuilder.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/ha/session/SessionTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/ha/session/SessionTestCase.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/ha/session/SessionTestCase.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,38 @@
+/******************************************************************************
+ * 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.ha.session;
+
+import org.jboss.portal.test.framework.runner.HTTPTestRunner;
+import org.jboss.portal.test.framework.server.NodeId;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class SessionTestCase extends HTTPTestRunner
+{
+ public SessionTestCase()
+ {
+ super("test-ha-session.war", new
NodeId[]{NodeId.PORTS_01,NodeId.PORTS_02});
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/info/AbstractInfoTest.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/info/AbstractInfoTest.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/info/AbstractInfoTest.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,141 @@
+/******************************************************************************
+ * 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.info;
+
+import org.jboss.portal.portlet.container.PortletApplicationRegistry;
+import org.jboss.portal.test.framework.driver.DriverResponse;
+import org.jboss.portal.test.framework.driver.DriverCommand;
+import org.jboss.portal.test.framework.driver.TestDriverException;
+import org.jboss.portal.test.framework.driver.TestDriverContainer;
+import org.jboss.portal.test.framework.driver.response.ErrorResponse;
+import org.jboss.portal.test.framework.driver.response.EndTestResponse;
+import org.jboss.portal.test.framework.driver.command.StartTestCommand;
+import org.jboss.portal.test.framework.info.TestItemInfo;
+import org.jboss.portal.test.framework.info.TestInfo;
+import org.jboss.portal.test.framework.driver.http.HttpTestDriver;
+import org.jboss.portal.test.framework.driver.remote.TestContext;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public abstract class AbstractInfoTest implements HttpTestDriver
+{
+
+ /** The test id. */
+ protected final String testCaseId;
+
+ /** The test info. */
+ protected final TestInfo testInfo;
+
+ /** . */
+ protected PortletApplicationRegistry registry;
+
+ /** The controller. */
+ protected TestDriverContainer testDriverContainer;
+
+ /** Not really used for now, we need the concept of non http test context. */
+ private TestContext testContext;
+
+ public AbstractInfoTest(String testCaseId)
+ {
+ if (testCaseId == null)
+ {
+ throw new IllegalArgumentException("No null test case id accepted");
+ }
+
+ //
+ this.testCaseId = testCaseId;
+ this.testInfo = new TestInfo(testCaseId);
+ }
+
+ public void pushContext(String testId, TestContext testContext)
+ {
+ this.testContext = testContext;
+ }
+
+ public TestContext popContext(String testId)
+ {
+ return testContext;
+ }
+
+ public PortletApplicationRegistry getRegistry()
+ {
+ return registry;
+ }
+
+ public void setRegistry(PortletApplicationRegistry registry)
+ {
+ this.registry = registry;
+ }
+
+ public TestDriverContainer getTestDriverRegistry()
+ {
+ return testDriverContainer;
+ }
+
+ public void setTestDriverRegistry(TestDriverContainer testDriverContainer)
+ {
+ this.testDriverContainer = testDriverContainer;
+ }
+
+ public void create()
+ {
+ testDriverContainer.addDriver(this);
+ }
+
+ public void destroy()
+ {
+ testDriverContainer.removeDriver(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();
+
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/info/CacheInfoTest.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/info/CacheInfoTest.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/info/CacheInfoTest.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -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.test.portlet.info;
+
+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.common.junit.ExtendedAssert;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.com">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 7954 $
+ */
+public class CacheInfoTest extends AbstractInfoTest
+{
+
+ public CacheInfoTest()
+ {
+ super("CacheInfoTest");
+ }
+
+ 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();
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/info/CacheInfoTest.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/info/CapabilitiesInfoTest.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/info/CapabilitiesInfoTest.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/info/CapabilitiesInfoTest.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,159 @@
+/******************************************************************************
+ * 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.info;
+
+import org.jboss.portal.Mode;
+import org.jboss.portal.WindowState;
+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.portlet.info.PortletInfo;
+import org.jboss.portal.portlet.info.WindowStateInfo;
+import org.jboss.portal.common.junit.ExtendedAssert;
+
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Locale;
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
+ * @version $Revision: 6720 $
+ */
+public class CapabilitiesInfoTest extends AbstractInfoTest
+{
+
+ public CapabilitiesInfoTest()
+ {
+ super("CapabilitiesInfoTest");
+ }
+
+ public void execute()
+ {
+ PortletContainer container =
registry.getPortletApplication("/test-info").getPortletContainer("CapabilitiesPortlet");
+ PortletInfo info = container.getInfo();
+ CapabilitiesInfo capInfo = info.getCapabilities();
+
+ //TODO: finish locales asserts
+ // locales should at least contain Locale.ENGLISH
+ Set allLocales = capInfo.getAllLocales();
+ ExtendedAssert.assertNotNull(allLocales);
+ ExtendedAssert.assertTrue(allLocales.contains(Locale.ENGLISH));
+
+ //check mime types
+ Set types = capInfo.getMimeTypes();
+ String[] mt = new String[types.size()];
+ int count = 0;
+ for (Iterator i = types.iterator(); i.hasNext();)
+ {
+ Object o = i.next();
+ mt[count++] = (String)o;
+ }
+ ExtendedAssert.assertEquals(new String[]{"text/vnd.wap.wml",
"text/html"}, mt);
+
+ //check all modes
+ Set modeInfos = capInfo.getAllModes();
+ Set modes = extractModes(modeInfos);
+
+ ExtendedAssert.assertTrue(modes.contains(Mode.VIEW));
+ ExtendedAssert.assertTrue(modes.contains(Mode.HELP));
+ ExtendedAssert.assertTrue(modes.contains(Mode.EDIT));
+
+ //check text/html modes
+ modeInfos = capInfo.getModes("text/html");
+ modes = extractModes(modeInfos);
+ ExtendedAssert.assertEquals(2, modes.size());
+ ExtendedAssert.assertTrue(modes.contains(Mode.VIEW));
+ ExtendedAssert.assertTrue(modes.contains(Mode.HELP));
+
+ //check text/vnd.wap.wml modes
+ modeInfos = capInfo.getModes("text/vnd.wap.wml");
+ modes = extractModes(modeInfos);
+ ExtendedAssert.assertEquals(2, modes.size());
+ ExtendedAssert.assertTrue(modes.contains(Mode.VIEW));
+ ExtendedAssert.assertTrue(modes.contains(Mode.EDIT));
+
+ //check undeclared
+ modeInfos = capInfo.getModes("text/undeclared");
+ modes = extractModes(modeInfos);
+ ExtendedAssert.assertEquals(0, modes.size());
+
+ //check all window states
+ Set stateInfos = capInfo.getAllWindowStates();
+ Set states = extractWindowStates(stateInfos);
+ ExtendedAssert.assertEquals(3, states.size());
+ ExtendedAssert.assertTrue(states.contains(WindowState.NORMAL));
+ ExtendedAssert.assertTrue(states.contains(WindowState.MINIMIZED));
+ ExtendedAssert.assertTrue(states.contains(WindowState.MAXIMIZED));
+
+ //check for text/html
+ stateInfos = capInfo.getWindowStates("text/html");
+ states = extractWindowStates(stateInfos);
+ ExtendedAssert.assertEquals(3, states.size());
+ ExtendedAssert.assertTrue(states.contains(WindowState.NORMAL));
+ ExtendedAssert.assertTrue(states.contains(WindowState.MINIMIZED));
+ ExtendedAssert.assertTrue(states.contains(WindowState.MAXIMIZED));
+
+ //simple check for text/vnd.wap.wml
+ //TODO:is this really expected behaviour? shouldn't it return no states as this
is unsupported by portal one?
+ states = capInfo.getWindowStates("text/vnd.wap.wml");
+ ExtendedAssert.assertEquals(3, states.size());
+
+ //check undeclared
+ states = capInfo.getWindowStates("undeclared/mime");
+ ExtendedAssert.assertEquals(0, states.size());
+
+ //fail();
+
+ //throw new UnsupportedOperationException("CapabilitiesInfoTest: Finish
implementation!");
+ }
+
+ public Set extractWindowStates(Set infos)
+ {
+ Set states = new HashSet();
+
+ for (Iterator i = infos.iterator(); i.hasNext();)
+ {
+ WindowStateInfo info = (WindowStateInfo)i.next();
+ WindowState state = info.getWindowState();
+ ExtendedAssert.assertEquals(state.toString(), (info.getWindowStateName()));
+ states.add(state);
+ }
+ return states;
+ }
+
+ public Set extractModes(Set infos)
+ {
+ Set modes = new HashSet();
+
+ for (Iterator i = infos.iterator(); i.hasNext();)
+ {
+ ModeInfo info = (ModeInfo)i.next();
+ Mode mode = info.getMode();
+ ExtendedAssert.assertEquals(mode.toString(), (info.getModeName()));
+ modes.add(mode);
+ }
+ return modes;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/info/CapabilitiesInfoTest.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/info/MetaInfoTest.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/info/MetaInfoTest.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/info/MetaInfoTest.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,66 @@
+/******************************************************************************
+ * 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.info;
+
+import org.jboss.portal.common.i18n.LocalizedString;
+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.common.junit.ExtendedAssert;
+
+import java.util.Locale;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 6818 $
+ */
+public class MetaInfoTest extends AbstractInfoTest
+{
+
+ public MetaInfoTest()
+ {
+ super("MetaInfoTest");
+ }
+
+ public void execute()
+ {
+ PortletContainer container =
registry.getPortletApplication("/test-info").getPortletContainer("NoBundlePortlet");
+ PortletInfo info = container.getInfo();
+ MetaInfo metaInfo = info.getMeta();
+
+ //
+ LocalizedString title = metaInfo.getMetaValue(MetaInfo.TITLE);
+ String titleEn = title.getString(Locale.ENGLISH, false);
+ ExtendedAssert.assertEquals("title", titleEn);
+
+ //
+ LocalizedString shortTitle = metaInfo.getMetaValue(MetaInfo.SHORT_TITLE);
+ String shortTitleEn = shortTitle.getString(Locale.ENGLISH, false);
+ ExtendedAssert.assertEquals("short-title", shortTitleEn);
+
+ //
+ LocalizedString keywords = metaInfo.getMetaValue(MetaInfo.KEYWORDS);
+ String keywordsEn = keywords.getString(Locale.ENGLISH, false);
+ ExtendedAssert.assertEquals("keywords", keywordsEn);
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/info/MetaInfoTest.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/info/ModeInfoTest.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/info/ModeInfoTest.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/info/ModeInfoTest.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,92 @@
+/******************************************************************************
+ * 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.info;
+
+import org.jboss.portal.Mode;
+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.common.junit.ExtendedAssert;
+
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.com">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 7954 $
+ */
+public class ModeInfoTest extends AbstractInfoTest
+{
+
+ public ModeInfoTest()
+ {
+ super("ModeInfoTest");
+ }
+
+ public void execute()
+ {
+ PortletContainer container1 =
registry.getPortletApplication("/test-info").getPortletContainer("ModePortlet1");
+ PortletContainer container2 =
registry.getPortletApplication("/test-info").getPortletContainer("ModePortlet2");
+ CapabilitiesInfo capaInfo = container1.getInfo().getCapabilities();
+
+ //Portlet 1 with VIEW, EDIT, HELP
+ Set modeInfos = capaInfo.getModes("text/html");
+
+ //shoule be 3 modes
+ ExtendedAssert.assertEquals(3, modeInfos.size());
+
+ Set portletModes = new HashSet();
+ for (Iterator i = modeInfos.iterator(); i.hasNext();)
+ {
+ ModeInfo mode = (ModeInfo)i.next();
+ portletModes.add(mode.getMode());
+ ExtendedAssert.assertEquals(mode.getModeName(), mode.getMode().toString());
+ }
+
+
+ ExtendedAssert.assertTrue(portletModes.contains(Mode.VIEW));
+ ExtendedAssert.assertTrue(portletModes.contains(Mode.HELP));
+ ExtendedAssert.assertTrue(portletModes.contains(Mode.EDIT));
+
+ //Portlet 2 with only VIEW
+ capaInfo = container2.getInfo().getCapabilities();
+ modeInfos = capaInfo.getModes("text/html");
+
+ //shoule be 1 mode
+ ExtendedAssert.assertEquals(1, modeInfos.size());
+
+
+ portletModes = new HashSet();
+ for (Iterator i = modeInfos.iterator(); i.hasNext();)
+ {
+ ModeInfo mode = (ModeInfo)i.next();
+ portletModes.add(mode.getMode());
+ ExtendedAssert.assertEquals(mode.getModeName(), mode.getMode().toString());
+ }
+
+ ExtendedAssert.assertTrue(portletModes.contains(Mode.VIEW));
+ ExtendedAssert.assertTrue(!portletModes.contains(Mode.HELP));
+ ExtendedAssert.assertTrue(!portletModes.contains(Mode.EDIT));
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/info/ModeInfoTest.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/info/PortletInfoTest.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/info/PortletInfoTest.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/info/PortletInfoTest.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,64 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.portlet.info;
+
+import org.jboss.portal.portlet.container.PortletContainer;
+import org.jboss.portal.portlet.info.PortletInfo;
+import org.jboss.portal.common.junit.ExtendedAssert;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 6720 $
+ */
+public class PortletInfoTest extends AbstractInfoTest
+{
+
+ public PortletInfoTest()
+ {
+ super("PortletInfoTest");
+ }
+
+ public void execute()
+ {
+ //This asserts only .isRemotable() as rest is checked in other tests
+ PortletContainer container =
registry.getPortletApplication("/test-info").getPortletContainer("RemotablePortlet1");
+ PortletInfo info = container.getInfo();
+ ExtendedAssert.assertEquals(Boolean.TRUE, info.isRemotable());
+
+ //just simple test if we get other infos...
+ ExtendedAssert.assertNotNull(info.getCache());
+ ExtendedAssert.assertNotNull(info.getCapabilities());
+ ExtendedAssert.assertNotNull(info.getMeta());
+ ExtendedAssert.assertNotNull(info.getPreferences());
+ ExtendedAssert.assertNotNull(info.getSecurity());
+ ExtendedAssert.assertNotNull(info.getSession());
+
+ container =
registry.getPortletApplication("/test-info").getPortletContainer("RemotablePortlet2");
+ info = container.getInfo();
+ ExtendedAssert.assertEquals(Boolean.FALSE, info.isRemotable());
+
+ container =
registry.getPortletApplication("/test-info").getPortletContainer("RemotablePortlet3");
+ info = container.getInfo();
+ ExtendedAssert.assertEquals(Boolean.TRUE, info.isRemotable());
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/info/PortletInfoTest.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/info/PreferenceInfoTest.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/info/PreferenceInfoTest.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/info/PreferenceInfoTest.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,98 @@
+/******************************************************************************
+ * 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.info;
+
+import org.jboss.portal.portlet.container.PortletContainer;
+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.common.junit.ExtendedAssert;
+
+import java.util.Locale;
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 6720 $
+ */
+public class PreferenceInfoTest extends AbstractInfoTest
+{
+
+ public PreferenceInfoTest()
+ {
+ super("PreferenceInfoTest");
+ }
+
+ public void execute()
+ {
+ PortletContainer container =
registry.getPortletApplication("/test-info").getPortletContainer("PreferenceInfoPortlet");
+
+ //
+ PortletInfo info = container.getInfo();
+ ContainerPreferencesInfo prefsInfo =
(ContainerPreferencesInfo)info.getPreferences();
+
+ //
+ ContainerPreferenceInfo prefInfo =
prefsInfo.getContainerPreference("localized_pref");
+ ExtendedAssert.assertEquals("localized_pref", prefInfo.getKey());
+ ExtendedAssert.assertEquals("english localized description",
prefInfo.getDescription().getString(Locale.ENGLISH, false));
+ ExtendedAssert.assertEquals("polish localized description",
prefInfo.getDescription().getString(new Locale("pl"), false));
+ ExtendedAssert.assertEquals("english_localized_name",
prefInfo.getDisplayName().getString(Locale.ENGLISH, false));
+ ExtendedAssert.assertEquals("polish_localized_name",
prefInfo.getDisplayName().getString(new Locale("pl"), false));
+
+ //
+ Set keys = prefsInfo.getKeys();
+ ExtendedAssert.assertTrue(keys.contains("localized_pref"));
+ ExtendedAssert.assertTrue(keys.contains("single_pref"));
+ ExtendedAssert.assertTrue(keys.contains("multi_pref"));
+ ExtendedAssert.assertTrue(keys.contains("single_pref_bis"));
+ ExtendedAssert.assertTrue(keys.contains("multi_pref_bis"));
+
+ //
+ prefInfo = prefsInfo.getContainerPreference("single_pref");
+ ExtendedAssert.assertEquals("single_pref", prefInfo.getKey());
+ String[] values = prefInfo.getDefaultValue().asStringArray();
+ ExtendedAssert.assertEquals(new String[]{"single_pref_value"}, values);
+ ExtendedAssert.assertTrue(!prefInfo.isReadOnly().booleanValue());
+
+ //
+ prefInfo = prefsInfo.getContainerPreference("multi_pref");
+ ExtendedAssert.assertEquals("multi_pref", prefInfo.getKey());
+ values = prefInfo.getDefaultValue().asStringArray();
+ ExtendedAssert.assertEquals(new String[]{"multi_pref_value_1",
"multi_pref_value_2"}, values);
+ ExtendedAssert.assertTrue(!prefInfo.isReadOnly().booleanValue());
+
+ //
+ prefInfo = prefsInfo.getContainerPreference("single_pref_bis");
+ ExtendedAssert.assertEquals("single_pref_bis", prefInfo.getKey());
+ values = prefInfo.getDefaultValue().asStringArray();
+ ExtendedAssert.assertEquals(new String[]{"single_pref_value"}, values);
+ ExtendedAssert.assertTrue(prefInfo.isReadOnly().booleanValue());
+
+ //
+ prefInfo = prefsInfo.getContainerPreference("multi_pref_bis");
+ ExtendedAssert.assertEquals("multi_pref_bis", prefInfo.getKey());
+ values = prefInfo.getDefaultValue().asStringArray();
+ ExtendedAssert.assertEquals(new String[]{"multi_pref_value_1",
"multi_pref_value_2"}, values);
+ ExtendedAssert.assertTrue(prefInfo.isReadOnly().booleanValue());
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/info/PreferenceInfoTest.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/info/SecurityInfoTest.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/info/SecurityInfoTest.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/info/SecurityInfoTest.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,76 @@
+/******************************************************************************
+ * 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.info;
+
+import org.jboss.portal.portlet.TransportGuarantee;
+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.common.junit.ExtendedAssert;
+import org.jboss.portal.test.framework.driver.http.HttpTestContext;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 6720 $
+ */
+public class SecurityInfoTest extends AbstractInfoTest
+{
+
+ public SecurityInfoTest()
+ {
+ super("SecurityInfoTest");
+ }
+
+ public void execute()
+ {
+ //This asserts only .isRemotable() as rest is checked in other tests
+
+ PortletContainer container =
registry.getPortletApplication("/test-info").getPortletContainer("SecuredPortlet1");
+ PortletInfo info = container.getInfo();
+ SecurityInfo secInfo = info.getSecurity();
+
+ secInfo = info.getSecurity();
+ ExtendedAssert.assertEquals(2, secInfo.getTransportGuarantees().size());
+
ExtendedAssert.assertTrue(secInfo.containsTransportGuarantee(TransportGuarantee.CONFIDENTIAL));
+
//ExtendedAssert.assertTrue(secInfo.containsTransportGuarantee(TransportGuarantee.INTEGRAL));
+
ExtendedAssert.assertTrue(secInfo.containsTransportGuarantee(TransportGuarantee.NONE));
+
+
+ container =
registry.getPortletApplication("/test-info").getPortletContainer("SecuredPortlet2");
+ info = container.getInfo();
+
+ secInfo = info.getSecurity();
+ ExtendedAssert.assertEquals(3, secInfo.getTransportGuarantees().size());
+
ExtendedAssert.assertTrue(secInfo.containsTransportGuarantee(TransportGuarantee.INTEGRAL));
+
ExtendedAssert.assertTrue(secInfo.containsTransportGuarantee(TransportGuarantee.CONFIDENTIAL));
+
ExtendedAssert.assertTrue(secInfo.containsTransportGuarantee(TransportGuarantee.NONE));
+
+
+ container =
registry.getPortletApplication("/test-info").getPortletContainer("SecuredPortlet3");
+ info = container.getInfo();
+ secInfo = info.getSecurity();
+ ExtendedAssert.assertEquals(2, secInfo.getTransportGuarantees().size());
+
ExtendedAssert.assertTrue(secInfo.containsTransportGuarantee(TransportGuarantee.INTEGRAL));
+
ExtendedAssert.assertTrue(secInfo.containsTransportGuarantee(TransportGuarantee.NONE));
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/info/SecurityInfoTest.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/info/SessionInfoTest.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/info/SessionInfoTest.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/info/SessionInfoTest.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,59 @@
+/******************************************************************************
+ * 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.info;
+
+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.common.junit.ExtendedAssert;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.com">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 6720 $
+ */
+public class SessionInfoTest extends AbstractInfoTest
+{
+
+ public SessionInfoTest()
+ {
+ super("SessionInfoTest");
+ }
+
+ public void execute()
+ {
+ PortletContainer container =
registry.getPortletApplication("/test-info").getPortletContainer("DistributedPortlet1");
+ PortletInfo info = container.getInfo();
+ SessionInfo sessionInfo = info.getSession();
+ ExtendedAssert.assertNotNull(sessionInfo);
+ Boolean distributed = sessionInfo.getDistributed();
+ ExtendedAssert.assertEquals(Boolean.TRUE, distributed);
+
+
+ container =
registry.getPortletApplication("/test-info").getPortletContainer("DistributedPortlet2");
+ info = container.getInfo();
+ sessionInfo = info.getSession();
+ ExtendedAssert.assertNotNull(sessionInfo);
+ distributed = sessionInfo.getDistributed();
+ ExtendedAssert.assertEquals(Boolean.FALSE, distributed);
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/info/SessionInfoTest.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/info/universal/SimplePortlet.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/info/universal/SimplePortlet.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/info/universal/SimplePortlet.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,33 @@
+/******************************************************************************
+ * 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.info.universal;
+
+import javax.portlet.GenericPortlet;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public class SimplePortlet extends GenericPortlet
+{
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/info/universal/SimplePortlet.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/actionrequest/ActionRequestAPITestSuite.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/actionrequest/ActionRequestAPITestSuite.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/actionrequest/ActionRequestAPITestSuite.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,85 @@
+/******************************************************************************
+ * 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.jsr168.api.actionrequest;
+
+import junit.framework.Test;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.com">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 5510 $
+ */
+public class ActionRequestAPITestSuite
+{
+
+ public static Test suite()
+ {
+// TestSuite suite = new TestSuite("test-jsr168-api-actionrequest.war");
+//
+// /**
+// * ActionRequest.getPortletInputStream()
+// * ActionRequest.getReader()
+// *
+// * TESTED in TCK assertions
+// */
+//
+// /**
+// * ActionRequest.setCharacterEncoding()
+// *
+// * it is owned by PortletContainer - implementation simply throw
IllegalStateException all the time
+// */
+//
+// //So here we go to PortletRequest interface asserts:
+//
+// /**
+// * ActionRequest.BASIC_AUTH
+// * ActionRequest.CLIENT_CERT_AUTH
+// * ActionRequest.DIGEST_AUTH
+// * ActionRequest.FORM_AUTH
+// * ActionRequest.USER_INFO
+// */
+// suite.addTest(new TestCase("Constants"));
+//
+// /**
+// * ActionRequest.getProperty()
+// * ActionRequest.getProperties()
+// */
+// suite.addTest(new TestCase("Property"));
+//
+// /**
+// * ActionRequest.getAttribute()
+// * ActionRequest.setAttribute()
+// * ActionRequest.removeAttribute()
+// */
+// suite.addTest(new TestCase("Attribute"));
+//
+// /**
+// * ActionRequest.getParameter()
+// * ActionRequest.getParameterValues()
+// */
+// suite.addTest(new TestCase("Parameter"));
+//
+//
+// return suite;
+ return null;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/actionrequest/ActionRequestAPITestSuite.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/actionrequest/ActionRequestSequenceBuilder.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/actionrequest/ActionRequestSequenceBuilder.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/actionrequest/ActionRequestSequenceBuilder.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,228 @@
+/******************************************************************************
+ * 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.jsr168.api.actionrequest;
+
+import org.jboss.portal.test.framework.driver.response.EndTestResponse;
+import org.jboss.portal.test.framework.driver.http.response.InvokeGetResponse;
+import org.jboss.portal.test.framework.driver.DriverResponse;
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestDriver;
+import org.jboss.portal.test.framework.portlet.PortletTestSuite;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.actions.PortletActionTestAction;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.framework.UTP1;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 7954 $
+ */
+public class ActionRequestSequenceBuilder extends PortletTestSuite
+{
+
+ //********************************
+ //PortletRequest interface Asserts
+ //********************************
+
+ /**
+ * ActionRequest.BASIC_AUTH ActionRequest.CLIENT_CERT_AUTH ActionRequest.DIGEST_AUTH
ActionRequest.FORM_AUTH
+ * ActionRequest.USER_INFO
+ */
+ public void createConstantsCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("Constants", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+
+ assertEquals("javax.portlet.userinfo", ActionRequest.USER_INFO);
+ assertEquals("BASIC", ActionRequest.BASIC_AUTH);
+ assertEquals("FORM", ActionRequest.FORM_AUTH);
+ assertEquals("CLIENT_CERT", ActionRequest.CLIENT_CERT_AUTH);
+ assertEquals("DIGEST", ActionRequest.DIGEST_AUTH);
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ /** ActionRequest.getProperty() ActionRequest.getProperties() */
+ public void createPropertyCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("Property", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new InvokeGetResponse(response.createActionURL().toString());
+ }
+ });
+
+ seq.addAction(1, UTP1.ACTION_JOINPOINT, new PortletActionTestAction()
+ {
+ protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context)
+ {
+ try
+ {
+ request.getProperty(null);
+ fail();
+ }
+ catch (IllegalArgumentException expected)
+ {
+ }
+
+ try
+ {
+ request.getProperties(null);
+ fail();
+ }
+ catch (IllegalArgumentException expected)
+ {
+ }
+ }
+ });
+
+ seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ /** ActionRequest.getAttribute() ActionRequest.setAttribute()
ActionRequest.removeAttribute() */
+ public void createAttributeCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("Attribute", seq);
+
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new InvokeGetResponse(response.createActionURL().toString());
+ }
+ });
+
+ seq.addAction(1, UTP1.ACTION_JOINPOINT, new PortletActionTestAction()
+ {
+ protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context)
+ {
+
+ try
+ {
+ request.getAttribute(null);
+ fail();
+ }
+ catch (IllegalArgumentException expected)
+ {
+ }
+
+ try
+ {
+ request.setAttribute(null, new Object());
+ fail();
+ }
+ catch (IllegalArgumentException expected)
+ {
+ }
+
+ try
+ {
+ request.removeAttribute(null);
+ fail();
+ }
+ catch (IllegalArgumentException e)
+ {
+ }
+ }
+ });
+
+ seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ /** ActionRequest.getParameter() ActionRequest.getParameterValues() */
+ public void createParameterCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("Parameter", seq);
+
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new InvokeGetResponse(response.createActionURL().toString());
+ }
+ });
+
+ seq.addAction(1, UTP1.ACTION_JOINPOINT, new PortletActionTestAction()
+ {
+ protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context)
+ {
+ try
+ {
+ request.getParameter(null);
+ fail();
+ }
+ catch (IllegalArgumentException expected)
+ {
+ }
+
+ try
+ {
+ request.getParameterValues(null);
+ fail();
+ }
+ catch (IllegalArgumentException expected)
+ {
+ }
+ }
+ });
+
+ seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new EndTestResponse();
+ }
+ });
+ }
+
+
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/actionrequest/ActionRequestSequenceBuilder.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/actionresponse/ActionResponseAPITestSuite.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/actionresponse/ActionResponseAPITestSuite.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/actionresponse/ActionResponseAPITestSuite.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,72 @@
+/******************************************************************************
+ * 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.jsr168.api.actionresponse;
+
+import junit.framework.Test;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.com">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 5510 $
+ */
+public class ActionResponseAPITestSuite
+{
+
+ public static Test suite()
+ {
+// TestSuite suite = new TestSuite("test-jsr168-api-actionresponse.war");
+//
+// /**
+// * ActionResponse.setWindowState()
+// * ActionResponse.setPortletMode()
+// *
+// * TESTED in TCK asserts
+// */
+//
+// /**
+// * ActionResponse.setRedirect()
+// *
+// * TESTED in TCK asserts
+// */
+//
+// /**
+// * ActionResponse.setRenderParameter()
+// * ActionResponse.setRenderParameter()
+// * ActionResponse.setRenderParameters()
+// */
+// suite.addTest(new TestCase("RenderParameter"));
+//
+// /**
+// * ActionResponse.setProperty()
+// * ActionResponse.addProperty()
+// */
+// suite.addTest(new TestCase("Property"));
+//
+// /**
+// * ActionResponse.encodeURL()
+// */
+// suite.addTest(new TestCase("EncodeURL"));
+//
+// return suite;
+ return null;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/actionresponse/ActionResponseAPITestSuite.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/actionresponse/ActionResponseSequenceBuilder.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/actionresponse/ActionResponseSequenceBuilder.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/actionresponse/ActionResponseSequenceBuilder.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,288 @@
+/******************************************************************************
+ * 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.jsr168.api.actionresponse;
+
+import org.jboss.portal.test.framework.driver.response.EndTestResponse;
+import org.jboss.portal.test.framework.driver.http.response.InvokeGetResponse;
+import org.jboss.portal.test.framework.driver.DriverResponse;
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestDriver;
+import org.jboss.portal.test.framework.portlet.PortletTestSuite;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.actions.PortletActionTestAction;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.framework.UTP1;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 7954 $
+ */
+public class ActionResponseSequenceBuilder extends PortletTestSuite
+{
+
+ /** ActionResponse.setRenderParameter() ActionResponse.setRenderParameter()
ActionResponse.setRenderParameters() */
+ public void createRenderParameterCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("RenderParameter", seq);
+
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new InvokeGetResponse(response.createActionURL().toString());
+ }
+ });
+
+ seq.addAction(1, UTP1.ACTION_JOINPOINT, new PortletActionTestAction()
+ {
+ protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context)
+ {
+
+ String val = null;
+ String[] vals = null;
+
+ try
+ {
+ response.setRenderParameter("name", val);
+ fail();
+ }
+ catch (IllegalArgumentException e)
+ {
+ //expected
+ }
+
+ try
+ {
+ response.setRenderParameter(null, "val");
+ fail();
+ }
+ catch (IllegalArgumentException e)
+ {
+ //
+ }
+
+ try
+ {
+ response.setRenderParameter("name", vals);
+ fail();
+ }
+ catch (IllegalArgumentException e)
+ {
+ //
+ }
+
+ try
+ {
+ response.setRenderParameter(null, new String[]{"val1, val2"});
+ fail();
+ }
+ catch (IllegalArgumentException e)
+ {
+ //
+ }
+
+ try
+ {
+ response.setRenderParameter(null, val);
+ fail();
+ }
+ catch (IllegalArgumentException e)
+ {
+ //
+ }
+
+ try
+ {
+ response.setRenderParameter(null, vals);
+ fail();
+ }
+ catch (IllegalArgumentException e)
+ {
+ //
+ }
+
+
+ try
+ {
+ response.setRenderParameters(null);
+ fail();
+ }
+ catch (IllegalArgumentException e)
+ {
+ //
+ }
+
+ Map map = new HashMap();
+
+ map.put("name", "val");
+ map.put(null, "val");
+
+ try
+ {
+ response.setRenderParameters(map);
+ fail();
+ }
+ catch (IllegalArgumentException e)
+ {
+ //
+ }
+
+ map = new HashMap();
+ map.put("name", "val");
+ map.put("name2", new Object());
+
+ try
+ {
+ response.setRenderParameters(map);
+ fail();
+ }
+ catch (IllegalArgumentException e)
+ {
+ //
+ }
+
+ map = new HashMap();
+ map.put("name", new String[]{"val"});
+ map.put("name2", null);
+
+ try
+ {
+ response.setRenderParameters(map);
+ fail();
+ }
+ catch (IllegalArgumentException e)
+ {
+ //
+ }
+ }
+ });
+
+ seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ //************************
+ //PortletResponse methods:
+ //************************
+
+ /** ActionResponse.setProperty() ActionResponse.addProperty() */
+ public void createPropertyCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("Property", seq);
+
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new InvokeGetResponse(response.createActionURL().toString());
+ }
+ });
+
+ seq.addAction(1, UTP1.ACTION_JOINPOINT, new PortletActionTestAction()
+ {
+ protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context)
+ {
+ try
+ {
+ response.addProperty(null, "val");
+ fail();
+ }
+ catch (IllegalArgumentException expected)
+ {
+ }
+
+ try
+ {
+ response.setProperty(null, "val");
+ fail();
+ }
+ catch (IllegalArgumentException expected)
+ {
+ }
+ }
+ });
+
+ seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ /** ActionResponse.encodeURL() */
+ public void createEncodeURLCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("EncodeURL", seq);
+
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new InvokeGetResponse(response.createActionURL().toString());
+ }
+ });
+
+ seq.addAction(1, UTP1.ACTION_JOINPOINT, new PortletActionTestAction()
+ {
+ protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context)
+ {
+ try
+ {
+ response.encodeURL("not_absolute_and_not_slash_leading_path");
+ fail();
+ }
+ catch (IllegalArgumentException expected)
+ {
+ }
+ }
+ });
+
+ seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new EndTestResponse();
+ }
+ });
+ }
+
+
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/actionresponse/ActionResponseSequenceBuilder.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portalcontext/PortalContextAPITestSuite.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portalcontext/PortalContextAPITestSuite.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portalcontext/PortalContextAPITestSuite.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,62 @@
+/******************************************************************************
+ * 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.jsr168.api.portalcontext;
+
+import junit.framework.Test;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.com">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 5510 $
+ */
+public class PortalContextAPITestSuite
+{
+
+ public static Test suite()
+ {
+// TestSuite suite = new TestSuite("test-jsr168-api-portalcontext.war");
+//
+// /**
+// * PortalContext.getSupportedPortletModes()
+// */
+// suite.addTest(new TestCase("SupportedPortletModes"));
+//
+// /**
+// * PortalContext.getSupportedWindowStates()
+// */
+// suite.addTest(new TestCase("SupportedWindowStates"));
+//
+// /**
+// * PortalContext.getPortalInfo()
+// */
+// suite.addTest(new TestCase("PortalInfo"));
+//
+// /**
+// * PortalContext.getProperty()
+// */
+// suite.addTest(new TestCase("Property"));
+//
+//
+// return suite;
+ return null;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portalcontext/PortalContextAPITestSuite.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portalcontext/PortalContextSequenceBuilder.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portalcontext/PortalContextSequenceBuilder.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portalcontext/PortalContextSequenceBuilder.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,152 @@
+/******************************************************************************
+ * 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.jsr168.api.portalcontext;
+
+import org.jboss.portal.test.framework.driver.response.EndTestResponse;
+import org.jboss.portal.test.framework.driver.DriverResponse;
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestDriver;
+import org.jboss.portal.test.framework.portlet.PortletTestSuite;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.framework.UTP1;
+
+import javax.portlet.Portlet;
+import javax.portlet.PortletMode;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.WindowState;
+import java.util.Enumeration;
+import java.util.LinkedList;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 7954 $
+ */
+public class PortalContextSequenceBuilder extends PortletTestSuite
+{
+ /** PortalContext.getSupportedPortletModes() */
+ public void createSupportedPortletModesCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("SupportedPortletModes", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ Enumeration modesEnum =
request.getPortalContext().getSupportedPortletModes();
+
+ List modes = new LinkedList();
+
+ while (modesEnum.hasMoreElements())
+ {
+ modes.add(modesEnum.nextElement());
+ }
+
+ //there should be three modes
+ assertTrue(modes.size() == 3);
+ assertTrue(modes.contains(PortletMode.VIEW));
+ assertTrue(modes.contains(PortletMode.EDIT));
+ assertTrue(modes.contains(PortletMode.HELP));
+
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ /** PortalContext.getSupportedWindowStates() */
+ public void createSupportedWindowStatesCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("SupportedWindowStates", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ Enumeration statesEnum =
request.getPortalContext().getSupportedWindowStates();
+
+ List states = new LinkedList();
+
+ while (statesEnum.hasMoreElements())
+ {
+ states.add(statesEnum.nextElement());
+ }
+
+ //there should be three modes
+ assertTrue(states.size() == 3);
+ assertTrue(states.contains(WindowState.NORMAL));
+ assertTrue(states.contains(WindowState.MAXIMIZED));
+ assertTrue(states.contains(WindowState.MINIMIZED));
+
+
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ /** PortalContext.getPortalInfo() */
+ public void createPortalInfoCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("PortalInfo", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ String info = request.getPortalContext().getPortalInfo();
+
+ assertTrue(info.length() > 0);
+ assertTrue(info.startsWith("JBossPortal"));
+
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ /** PortalContext.getProperty() */
+ public void createPropertyCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("Property", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ //assert Exception is thrown
+ try
+ {
+ request.getPortalContext().getProperty(null);
+ fail();
+ }
+ catch (IllegalArgumentException e)
+ {
+ //expected
+ }
+
+ return new EndTestResponse();
+ }
+ });
+ }
+
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portalcontext/PortalContextSequenceBuilder.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletconfig/PortletConfigAPITestSuite.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletconfig/PortletConfigAPITestSuite.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletconfig/PortletConfigAPITestSuite.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,67 @@
+/******************************************************************************
+ * 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.jsr168.api.portletconfig;
+
+import junit.framework.Test;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.com">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 5510 $
+ */
+public class PortletConfigAPITestSuite
+{
+
+ public static Test suite()
+ {
+// TestSuite suite = new TestSuite("test-jsr168-api-portletconfig.war");
+//
+// /**
+// * These are tested in TCKAssertion tests:
+// * PortletConfig.getResourceBundle
+// */
+//
+// /**
+// * PortletConfig.getPortletName()
+// */
+// suite.addTest(new TestCase("PortletName"));
+//
+// /**
+// * PortletConfig.getPortletContext()
+// */
+// suite.addTest(new TestCase("PortletContext"));
+//
+// /**
+// * PortletConfig.getInitParameter()
+// */
+// suite.addTest(new TestCase("InitParameter"));
+//
+// /**
+// * PortletConfig.getInitParameterNames()
+// */
+// suite.addTest(new TestCase("InitParameterNames"));
+//
+//
+// return suite;
+ return null;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletconfig/PortletConfigAPITestSuite.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletconfig/PortletConfigSequenceBuilder.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletconfig/PortletConfigSequenceBuilder.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletconfig/PortletConfigSequenceBuilder.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,187 @@
+/******************************************************************************
+ * 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.jsr168.api.portletconfig;
+
+import org.jboss.portal.test.framework.driver.response.EndTestResponse;
+import org.jboss.portal.test.framework.driver.DriverResponse;
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestDriver;
+import org.jboss.portal.test.framework.portlet.PortletTestSuite;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.framework.portlet.components.AbstractUniversalTestPortlet;
+import org.jboss.portal.test.portlet.framework.UTP1;
+import org.jboss.portal.test.portlet.framework.UTP2;
+
+import javax.portlet.Portlet;
+import javax.portlet.PortletConfig;
+import javax.portlet.PortletContext;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import java.util.Enumeration;
+import java.util.LinkedList;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 7954 $
+ */
+public class PortletConfigSequenceBuilder extends PortletTestSuite
+{
+
+ /** @portlet.api assert="PortletConfig.getPortletName()" */
+ public void createPortletNameCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("PortletName", seq);
+
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ AbstractUniversalTestPortlet aport = (AbstractUniversalTestPortlet)portlet;
+ PortletConfig config = aport.getPortletConfig();
+ assertNotNull(config);
+ assertEquals("TestUniversalPortletA", config.getPortletName());
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ /** @portlet.api assert="PortletConfig.getPortletContext()" */
+ public void createPortletContextCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("PortletContext", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ AbstractUniversalTestPortlet aport = (AbstractUniversalTestPortlet)portlet;
+ PortletConfig config = aport.getPortletConfig();
+
+ assertNotNull(config);
+
+ PortletContext portletContext = config.getPortletContext();
+
+ assertNotNull(portletContext);
+
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ /** @portlet.api assert="PortletConfig.getInitParameter()" */
+ public void createInitParameterCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("InitParameter", seq);
+ seq.addAction(0, UTP2.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ AbstractUniversalTestPortlet aport = (AbstractUniversalTestPortlet)portlet;
+ PortletConfig config = aport.getPortletConfig();
+
+ assertNotNull(config);
+
+ //assert correct values
+ assertEquals("InitParamAValue",
config.getInitParameter("InitParamA"));
+ assertEquals("InitParamBValue",
config.getInitParameter("InitParamB"));
+
+ //assert param not exists
+ assertNull(config.getInitParameter("InitParamC"));
+
+ //assert IllegalArgumentException when name is null
+ try
+ {
+ config.getInitParameter(null);
+ fail();
+ }
+ catch (IllegalArgumentException e)
+ {
+ //expected
+ }
+
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ /** @portlet.api assert="PortletConfig.getInitParameterNames()" */
+ public void createInitParameterNamesCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("InitParameterNames", seq);
+
+ //this portlet has no init params defined
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ AbstractUniversalTestPortlet aport = (AbstractUniversalTestPortlet)portlet;
+ PortletConfig config = aport.getPortletConfig();
+
+ assertNotNull(config);
+ Enumeration e = config.getInitParameterNames();
+
+ //should be EMPTY
+ assertTrue(!e.hasMoreElements());
+
+ //we do nothing. response will be rendered by other portlet. If failed there
will be
+ //two results so whole test case will fail;
+ return null;
+ }
+ });
+
+ seq.addAction(0, UTP2.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ AbstractUniversalTestPortlet aport = (AbstractUniversalTestPortlet)portlet;
+ PortletConfig config = aport.getPortletConfig();
+
+ assertNotNull(config);
+
+ Enumeration enumer = config.getInitParameterNames();
+ //construct list from names enumeration
+ List names = new LinkedList();
+
+ while (enumer.hasMoreElements())
+ {
+ names.add(enumer.nextElement());
+ }
+
+ //assert it contains correct names
+ assertEquals(2, names.size());
+
+ assertTrue(names.contains("InitParamA"));
+ assertTrue(names.contains("InitParamB"));
+
+ return new EndTestResponse();
+ }
+ });
+ }
+
+
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletconfig/PortletConfigSequenceBuilder.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletcontext/PortletContextAPITestSuite.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletcontext/PortletContextAPITestSuite.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletcontext/PortletContextAPITestSuite.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,96 @@
+/******************************************************************************
+ * 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.jsr168.api.portletcontext;
+
+import junit.framework.Test;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.com">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 5510 $
+ */
+public class PortletContextAPITestSuite
+{
+
+ public static Test suite()
+ {
+// TestSuite suite = new TestSuite("test-jsr168-api-portletcontext.war");
+//
+// /**
+// * PortletContext.getServerInfo()
+// */
+// suite.addTest(new TestCase("ServerInfo"));
+//
+// /**
+// * PortletContext.getRequestDispatcher()
+// * PortletContext.getNamedDispatcher()
+// */
+// suite.addTest(new TestCase("Dispatcher"));
+//
+// /**
+// * PortletContext.getResource()
+// * PortletContext.getResourceAsStream()
+// * tested in TCK asserts
+// */
+//
+// /**
+// * PortletContext.getMinorVersion()
+// * PortletContext.getMajorVersion()
+// */
+// suite.addTest(new TestCase("Version"));
+//
+// /**
+// * PortletContext.getMimeType()
+// */
+// suite.addTest(new TestCase("MimeType"));
+//
+// /**
+// * PortletContext.getResourcePaths()
+// */
+// suite.addTest(new TestCase("ResourcePaths"));
+//
+// /**
+// * PortletContext.getResource()
+// */
+// suite.addTest(new TestCase("Resource"));
+//
+// /**
+// * PortletContext.getAttribute()
+// * PortletContext.removeAttribute()
+// * PortletContext.setAttribute()
+// */
+// suite.addTest(new TestCase("Attribute"));
+//
+// /**
+// * PortletContext.getInitParameter()
+// */
+// suite.addTest(new TestCase("InitParameter"));
+//
+// /**
+// * PortletContext.getPortletContextName()
+// */
+// suite.addTest(new TestCase("PortletContextName"));
+//
+// return suite;
+ return null;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletcontext/PortletContextAPITestSuite.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletcontext/PortletContextSequenceBuilder.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletcontext/PortletContextSequenceBuilder.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletcontext/PortletContextSequenceBuilder.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,286 @@
+/******************************************************************************
+ * 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.jsr168.api.portletcontext;
+
+import org.jboss.portal.test.framework.driver.response.EndTestResponse;
+import org.jboss.portal.test.framework.driver.DriverResponse;
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestDriver;
+import org.jboss.portal.test.framework.portlet.PortletTestSuite;
+import org.jboss.portal.test.framework.portlet.TestContants;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.framework.portlet.components.AbstractUniversalTestPortlet;
+import org.jboss.portal.test.portlet.framework.UTP1;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import java.net.MalformedURLException;
+import java.util.Set;
+import java.util.regex.Pattern;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 7954 $
+ */
+public class PortletContextSequenceBuilder extends PortletTestSuite
+{
+
+ /** . */
+ private static final String VERSION_REGEX = "JBossPortal/[0-9]+\\.[0-9]+";
+
+ /** . */
+ private static final Pattern VERSION_PATTERN = Pattern.compile(VERSION_REGEX,
Pattern.CASE_INSENSITIVE);
+
+ /** PortletContext.getServerInfo() */
+ public void createServerInfoCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("ServerInfo", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ AbstractUniversalTestPortlet aport = (AbstractUniversalTestPortlet)portlet;
+ String info = aport.getPortletContext().getServerInfo();
+ boolean matches = VERSION_PATTERN.matcher(info).matches();
+ assertTrue("Version " + info + " does not match the
format", matches);
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ /** PortletContext.getRequestDispatcher() PortletContext.getNamedDispatcher() */
+ public void createDispatcherCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("Dispatcher", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ AbstractUniversalTestPortlet aport = (AbstractUniversalTestPortlet)portlet;
+
+ //when dispatcher is not obtained it should return null
+
//assertNull(aport.getPortletContext().getRequestDispatcher("/notExistingDispatcher.jsp"));
+
assertNull(aport.getPortletContext().getNamedDispatcher("NotExistingDispatcher"));
+
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ /** PortletContext.getMinorVersion() PortletContext.getMajorVersion() */
+ public void createVersionCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("Version", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ AbstractUniversalTestPortlet aport = (AbstractUniversalTestPortlet)portlet;
+
+ assertEquals(TestContants.MINOR_VERSION,
aport.getPortletContext().getMinorVersion());
+ assertEquals(TestContants.MAJOR_VERSION,
aport.getPortletContext().getMajorVersion());
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ /** PortletContext.getMimeType() */
+ public void createMimeTypeCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("MimeType", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ AbstractUniversalTestPortlet aport = (AbstractUniversalTestPortlet)portlet;
+ assertEquals("text/plain",
aport.getPortletContext().getMimeType("/simple_resource.txt"));
+
assertNull(aport.getPortletContext().getMimeType("/notExistingResource"));
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ /** PortletContext.getResourcePaths() */
+ public void createResourcePathsCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("ResourcePaths", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ AbstractUniversalTestPortlet aport = (AbstractUniversalTestPortlet)portlet;
+
+
assertNull(aport.getPortletContext().getResourcePaths("/NotExistingResourcePath/"));
+
+ Set paths = aport.getPortletContext().getResourcePaths("/");
+ assertTrue(paths.contains("/WEB-INF/"));
+ assertTrue(paths.contains("/simple_resource.txt"));
+
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ /** PortletContext.getResource() */
+ public void createResourceCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("Resource", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ AbstractUniversalTestPortlet aport = (AbstractUniversalTestPortlet)portlet;
+
+ //wrong url format
+ try
+ {
+ aport.getPortletContext().getResource("simple_resource.txt");
+ fail();
+ }
+ catch (MalformedURLException e)
+ {
+ //expected
+ }
+
+ //not existing resource
+ try
+ {
+
assertNull(aport.getPortletContext().getResource("/NotExist.txt"));
+ }
+ catch (MalformedURLException e)
+ {
+ //something wrong?
+ fail();
+ }
+
+
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ /** PortletContext.getAttribute() PortletContext.removeAttribute()
PortletContext.setAttribute() */
+ public void createAttributeCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("Attribute", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+
+ AbstractUniversalTestPortlet aport = (AbstractUniversalTestPortlet)portlet;
+
+ try
+ {
+ aport.getPortletContext().getAttribute(null);
+ fail();
+ }
+ catch (IllegalArgumentException e)
+ {
+ //expected
+ }
+
+ try
+ {
+ aport.getPortletContext().setAttribute(null, null);
+ fail();
+ }
+ catch (IllegalArgumentException e)
+ {
+ //expected
+ }
+
+ try
+ {
+ aport.getPortletContext().removeAttribute(null);
+ fail();
+ }
+ catch (IllegalArgumentException e)
+ {
+ //expected
+ }
+
+
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ /** PortletContext.getInitParameter() */
+ public void createInitParameterCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("InitParameter", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+
+ AbstractUniversalTestPortlet aport = (AbstractUniversalTestPortlet)portlet;
+
+
assertNull(aport.getPortletContext().getInitParameter("NotExistingParamName"));
+
+ try
+ {
+ aport.getPortletContext().getInitParameter(null);
+ fail();
+ }
+ catch (IllegalArgumentException e)
+ {
+ //expected
+ }
+
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ /** PortletContext.getPortletContextName() */
+ public void createPortletContextNameCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("PortletContextName", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+
+ AbstractUniversalTestPortlet aport = (AbstractUniversalTestPortlet)portlet;
+
+ assertEquals("PortletContext WebApp",
aport.getPortletContext().getPortletContextName());
+ return new EndTestResponse();
+ }
+ });
+ }
+
+
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletcontext/PortletContextSequenceBuilder.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletmode/PortletModeAPITestSuite.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletmode/PortletModeAPITestSuite.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletmode/PortletModeAPITestSuite.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,63 @@
+/******************************************************************************
+ * 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.jsr168.api.portletmode;
+
+import junit.framework.Test;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.com">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 5510 $
+ */
+public class PortletModeAPITestSuite
+{
+
+ public static Test suite()
+ {
+// TestSuite suite = new TestSuite("test-jsr168-api-portletmode.war");
+//
+// /**
+// * PortletMode.VIEW
+// * PortletMode.EDIT
+// * PortletMode.HELP
+// */
+// suite.addTest(new TestCase("Modes"));
+//
+// /**
+// * PortletMode.PortletMode()
+// */
+// suite.addTest(new TestCase("Constructor"));
+//
+// /**
+// * @portlet.api assert="PortletConfig.equals()"
+// */
+// suite.addTest(new TestCase("Equals"));
+//
+// /**
+// * @portlet.api assert="PortletConfig.hashCode()"
+// */
+// suite.addTest(new TestCase("HashCode"));
+//
+// return suite;
+ return null;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletmode/PortletModeAPITestSuite.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletmode/PortletModeSequenceBuilder.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletmode/PortletModeSequenceBuilder.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletmode/PortletModeSequenceBuilder.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,136 @@
+/******************************************************************************
+ * 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.jsr168.api.portletmode;
+
+import org.jboss.portal.test.framework.driver.response.EndTestResponse;
+import org.jboss.portal.test.framework.driver.DriverResponse;
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestDriver;
+import org.jboss.portal.test.framework.portlet.PortletTestSuite;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.framework.UTP1;
+
+import javax.portlet.Portlet;
+import javax.portlet.PortletMode;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 7954 $
+ */
+public class PortletModeSequenceBuilder extends PortletTestSuite
+{
+
+ /** @portlet.api assert="PortletMode.EDIT, PortletMode.HELP,
PortletMode.VIEW" */
+ public void createModesCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("Modes", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ assertEquals("view", "" + PortletMode.VIEW);
+ assertEquals("edit", "" + PortletMode.EDIT);
+ assertEquals("help", "" + PortletMode.HELP);
+
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ /** @portlet.api assert="PortletMode.PortletMode()" */
+ public void createConstructorCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("Constructor", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ assertEquals("testmode", "" + new
PortletMode("testmode"));
+ assertEquals("testmode", "" + new
PortletMode("TESTMODE"));
+ assertEquals("testmode", "" + new
PortletMode("TestMode"));
+ assertEquals("", "" + new PortletMode(""));
+
+
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ /** @portlet.api assert="PortletConfig.equals()" */
+ public void createEqualsCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("Equals", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ PortletMode pm1 = new PortletMode("TestMode");
+ PortletMode pm2 = new PortletMode("TestMode");
+ PortletMode pm3 = new PortletMode("OtherMode");
+
+ //true
+ assertTrue(pm1.equals(pm2));
+ //false
+ assertTrue(!pm1.equals(pm3));
+
+
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ /** @portlet.api assert="PortletConfig.hashCode()" */
+ public void createHashCodeCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("HashCode", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ PortletMode pm1 = new PortletMode("TestMode");
+ PortletMode pm2 = new PortletMode("TestMode");
+ PortletMode pm3 = new PortletMode("OtherMode");
+
+ //true
+ assertTrue(pm1.hashCode() == pm2.hashCode());
+ //false
+ assertTrue(pm1.hashCode() != pm3.hashCode());
+
+ //Hashcodes are constructed from strings
+ assertEquals("testmode".hashCode(), pm1.hashCode());
+ assertEquals("testmode".hashCode(), pm2.hashCode());
+ assertEquals("othermode".hashCode(), pm3.hashCode());
+
+
+ return new EndTestResponse();
+ }
+ });
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletmode/PortletModeSequenceBuilder.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletpreferences/PortletPreferencesAPITestSuite.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletpreferences/PortletPreferencesAPITestSuite.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletpreferences/PortletPreferencesAPITestSuite.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,61 @@
+/******************************************************************************
+ * 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.jsr168.api.portletpreferences;
+
+import junit.framework.Test;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.com">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 5510 $
+ */
+public class PortletPreferencesAPITestSuite
+{
+
+ public static Test suite()
+ {
+// TestSuite suite = new
TestSuite("test-jsr168-api-portletpreferences.war");
+//
+// /**
+// * PortletPreferences.isReadOnly()
+// */
+// suite.addTest(new TestCase("ReadOnly"));
+//
+// /**
+// * PortletPreferences.getValue()
+// * PortletPreferences.getValues()
+// * PortletPreferences.setValue()
+// * PortletPreferences.setValues()
+// */
+// suite.addTest(new TestCase("Value"));
+//
+// /**
+// * PortletPreferences.reset()
+// */
+// suite.addTest(new TestCase("ResetNullKeyThrowsNPE"));
+// suite.addTest(new TestCase("ZeroLengthArrayValue"));
+//
+//
+// return suite;
+ return null;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletpreferences/PortletPreferencesAPITestSuite.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletpreferences/PortletPreferencesSequenceBuilder.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletpreferences/PortletPreferencesSequenceBuilder.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletpreferences/PortletPreferencesSequenceBuilder.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,281 @@
+/******************************************************************************
+ * 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.jsr168.api.portletpreferences;
+
+import org.jboss.portal.test.framework.driver.response.EndTestResponse;
+import org.jboss.portal.test.framework.driver.http.response.InvokeGetResponse;
+import org.jboss.portal.test.framework.driver.DriverResponse;
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestDriver;
+import org.jboss.portal.test.framework.portlet.PortletTestSuite;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.actions.PortletActionTestAction;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.framework.UTP1;
+import org.jboss.portal.test.portlet.framework.UTP2;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.Portlet;
+import javax.portlet.PortletPreferences;
+import javax.portlet.PortletURL;
+import javax.portlet.ReadOnlyException;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.ValidatorException;
+import java.io.IOException;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 7954 $
+ */
+public class PortletPreferencesSequenceBuilder extends PortletTestSuite
+{
+
+ /** PortletPreferences.isReadOnly() */
+ public void createReadOnlyCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("ReadOnly", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+
+ try
+ {
+ request.getPreferences().isReadOnly(null);
+ fail();
+ }
+ catch (IllegalArgumentException e)
+ {
+ //expected
+ }
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ /**
+ * PortletPreferences.getValue() PortletPreferences.getValues()
PortletPreferences.setValue()
+ * PortletPreferences.setValues()
+ */
+ public void createValueCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("Value", seq);
+
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new InvokeGetResponse(response.createActionURL().toString());
+ }
+ });
+
+ seq.addAction(1, UTP1.ACTION_JOINPOINT, new PortletActionTestAction()
+ {
+ protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context) throws ReadOnlyException
+ {
+ PortletPreferences prefs = request.getPreferences();
+
+ //correct
+ try
+ {
+ prefs.getValue("name", null);
+
+ }
+ catch (IllegalArgumentException e)
+ {
+ fail();
+ }
+
+ try
+ {
+ prefs.getValues("name", null);
+ }
+ catch (IllegalArgumentException e)
+ {
+ fail();
+ }
+
+ //wrong
+ try
+ {
+ prefs.getValue(null, "val");
+ fail();
+ }
+ catch (IllegalArgumentException e)
+ {
+ //
+ }
+
+ try
+ {
+ prefs.getValues(null, new String[]{"val"});
+ fail();
+ }
+ catch (IllegalArgumentException e)
+ {
+ //
+ }
+
+ //and the "set" ones
+
+ //correct
+ //(need user auth)
+ /*try
+ {
+ prefs.setValue("name", null);
+ }
+ catch (IllegalArgumentException e)
+ {
+ fail();
+ }
+
+ try
+ {
+ prefs.setValues("name", null);
+ }
+ catch (IllegalArgumentException e)
+ {
+ fail();
+ }*/
+
+ //wrong
+ try
+ {
+ prefs.setValue(null, null);
+ fail();
+ }
+ catch (IllegalArgumentException e)
+ {
+ //
+ }
+
+ try
+ {
+ prefs.setValues(null, null);
+ fail();
+ }
+ catch (IllegalArgumentException e)
+ {
+ //
+ }
+ }
+ });
+
+ seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ /** PortletPreferences.reset() */
+ public void createResetNullKeyThrowsNPE(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("ResetNullKeyThrowsNPE", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws ReadOnlyException
+ {
+ try
+ {
+ request.getPreferences().reset(null);
+ fail();
+ }
+ catch (IllegalArgumentException e)
+ {
+ //expected
+ }
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ /**
+ *
+ */
+ public void createZeroLengthArrayValue(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("ZeroLengthArrayValue", seq);
+ seq.addAction(0, UTP2.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ PortletPreferences prefs = request.getPreferences();
+
+ // With the default value coming from the portlet.xml descriptor
+ String value = prefs.getValue("empty", "other");
+ assertEquals("other", value);
+ assertEquals(new String[0], prefs.getValues("empty", new
String[]{"other"}));
+
+ //
+ PortletURL url = response.createActionURL();
+ return new InvokeGetResponse(url.toString());
+ }
+ });
+ seq.addAction(1, UTP2.ACTION_JOINPOINT, new PortletActionTestAction()
+ {
+ protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context) throws ReadOnlyException, IOException,
ValidatorException
+ {
+ PortletPreferences prefs = request.getPreferences();
+
+ // Check it does not exist yet
+ assertEquals("other", prefs.getValue("dynamic",
"other"));
+ assertEquals(new String[]{"other"},
prefs.getValues("dynamic", new String[]{"other"}));
+
+ // Set the value to the empty array and check we get the other value
+ prefs.setValues("dynamic", new String[0]);
+ assertEquals("other", prefs.getValue("dynamic",
"other"));
+ assertEquals(new String[0], prefs.getValues("dynamic", new
String[]{"other"}));
+
+ // Commit change
+ prefs.store();
+
+ // Check we still have the other value
+ assertEquals("other", prefs.getValue("dynamic",
"other"));
+ assertEquals(new String[0], prefs.getValues("dynamic", new
String[]{"other"}));
+ }
+ });
+ seq.addAction(1, UTP2.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ PortletPreferences prefs = request.getPreferences();
+
+ // Check we still have the other value
+ assertEquals("other", prefs.getValue("dynamic",
"other"));
+ assertEquals(new String[0], prefs.getValues("dynamic", new
String[]{"other"}));
+
+ //
+ return new EndTestResponse();
+ }
+ });
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletpreferences/PortletPreferencesSequenceBuilder.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsession/PortletSessionAPITestSuite.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsession/PortletSessionAPITestSuite.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsession/PortletSessionAPITestSuite.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,82 @@
+/******************************************************************************
+ * 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.jsr168.api.portletsession;
+
+import junit.framework.Test;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.com">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 5510 $
+ */
+public class PortletSessionAPITestSuite
+{
+
+ public static Test suite()
+ {
+// TestSuite suite = new TestSuite("test-jsr168-api-portletsession.war");
+//
+// /**
+// * PortletSession.APPLICATION_SCOPE
+// * PortletSession.PORTLET_SCOPE
+// */
+// suite.addTest(new TestCase("Constants"));
+//
+// /**
+// * PortletSession.getAttribute()
+// */
+// suite.addTest(new TestCase("GetAttribute"));
+//
+// /**
+// * PortletSession.getAttributeNames()
+// */
+// suite.addTest(new TestCase("AttributeNames"));
+//
+// /**
+// * PortletSession.getCreationTime()
+// */
+// suite.addTest(new TestCase("CreationTime"));
+//
+// /**
+// * PortletSession.invalidate()
+// */
+// suite.addTest(new TestCase("Invalidate"));
+//
+// /**
+// * PortletSession.isNew()
+// */
+// suite.addTest(new TestCase("New"));
+//
+// /**
+// * PortletSession.removeAttribute()
+// */
+// suite.addTest(new TestCase("RemoveAttribute"));
+//
+// /**
+// * PortletSession.setAttribute()
+// */
+// suite.addTest(new TestCase("SetAttribute"));
+//
+// return suite;
+ return null;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsession/PortletSessionAPITestSuite.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsession/PortletSessionSequenceBuilder.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsession/PortletSessionSequenceBuilder.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsession/PortletSessionSequenceBuilder.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,369 @@
+/******************************************************************************
+ * 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.jsr168.api.portletsession;
+
+import org.jboss.portal.test.framework.driver.response.EndTestResponse;
+import org.jboss.portal.test.framework.driver.DriverResponse;
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestDriver;
+import org.jboss.portal.test.framework.portlet.PortletTestSuite;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.framework.UTP1;
+
+import javax.portlet.Portlet;
+import javax.portlet.PortletSession;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 7954 $
+ */
+public class PortletSessionSequenceBuilder extends PortletTestSuite
+{
+
+ /** PortletSession.APPLICATION_SCOPE PortletSession.PORTLET_SCOPE */
+ public void createConstantsCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("Constants", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ assertEquals(0x01, PortletSession.APPLICATION_SCOPE);
+ assertEquals(0x02, PortletSession.PORTLET_SCOPE);
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ /** PortletSession.getAttribute() */
+ public void createGetAttributeCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("GetAttribute", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ PortletSession session = request.getPortletSession();
+
+ try
+ {
+ session.getAttribute(null);
+ fail();
+ }
+ catch (IllegalArgumentException expected)
+ {
+ }
+
+ try
+ {
+ session.getAttribute(null, PortletSession.APPLICATION_SCOPE);
+ fail();
+ }
+ catch (IllegalArgumentException expected)
+ {
+ }
+
+
+ session.invalidate();
+
+ //After invalidate
+ try
+ {
+ session.getAttribute("name");
+ fail();
+ }
+ catch (IllegalStateException expecte)
+ {
+ }
+
+ try
+ {
+ session.getAttribute("name", PortletSession.PORTLET_SCOPE);
+ fail();
+ }
+ catch (IllegalStateException expected)
+ {
+ }
+
+
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ /** PortletSession.getAttributeNames() */
+ public void createAttributeNamesCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("AttributeNames", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ PortletSession session = request.getPortletSession();
+
+ //before invalidate
+ session.getAttributeNames();
+ session.getAttributeNames(PortletSession.APPLICATION_SCOPE);
+
+ session.invalidate();
+
+ //after invalidate
+
+ try
+ {
+ session.getAttributeNames();
+ fail();
+ }
+ catch (IllegalStateException expected)
+ {
+ }
+
+ try
+ {
+ session.getAttributeNames(PortletSession.APPLICATION_SCOPE);
+ fail();
+ }
+ catch (IllegalStateException expected)
+ {
+ }
+
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ /** PortletSession.getCreationTime() */
+ public void createCreationTimeCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("CreationTime", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ PortletSession session = request.getPortletSession();
+
+ //before invalidate
+ session.getCreationTime();
+
+ session.invalidate();
+
+ //after invalidate
+ try
+ {
+ session.getCreationTime();
+ fail();
+ }
+ catch (IllegalStateException expected)
+ {
+ }
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ /** PortletSession.invalidate() */
+ public void createInvalidateCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("Invalidate", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ PortletSession session = request.getPortletSession();
+
+ session.invalidate();
+
+ //one more...
+ try
+ {
+ session.invalidate();
+ fail();
+ }
+ catch (IllegalStateException expected)
+ {
+ }
+
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ /** PortletSession.isNew() */
+ public void createNewCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("New", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ PortletSession session = request.getPortletSession();
+
+ //before invalidation
+ session.isNew();
+
+ session.invalidate();
+
+ //after invalidation
+ try
+ {
+ session.isNew();
+ fail();
+ }
+ catch (IllegalStateException expected)
+ {
+ }
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ /** PortletSession.removeAttribute() */
+ public void createRemoveAttributeCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("RemoveAttribute", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ PortletSession session = request.getPortletSession();
+
+ try
+ {
+ session.removeAttribute(null);
+ fail();
+ }
+ catch (IllegalArgumentException expected)
+ {
+ }
+
+ try
+ {
+ session.removeAttribute(null, PortletSession.APPLICATION_SCOPE);
+ fail();
+ }
+ catch (IllegalArgumentException expected)
+ {
+ }
+
+ //before invalidation
+ session.removeAttribute("name");
+ session.removeAttribute("name", PortletSession.APPLICATION_SCOPE);
+
+ session.invalidate();
+
+ //after invalidation
+ try
+ {
+ session.removeAttribute("name");
+ fail();
+ }
+ catch (IllegalStateException expected)
+ {
+ }
+
+ try
+ {
+ session.removeAttribute("name",
PortletSession.APPLICATION_SCOPE);
+ fail();
+ }
+ catch (IllegalStateException expected)
+ {
+ }
+
+
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ /** PortletSession.setAttribute() */
+ public void createSetAttributeCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("SetAttribute", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ PortletSession session = request.getPortletSession();
+
+ try
+ {
+ session.setAttribute(null, new Object());
+ fail();
+ }
+ catch (IllegalArgumentException expected)
+ {
+ }
+
+ try
+ {
+ session.setAttribute(null, new Object(),
PortletSession.APPLICATION_SCOPE);
+ fail();
+ }
+ catch (IllegalArgumentException expected)
+ {
+ }
+
+ //before invalidation
+ session.setAttribute("name", new Object());
+ session.setAttribute("name", new Object(),
PortletSession.APPLICATION_SCOPE);
+
+ session.invalidate();
+
+ //after invalidation
+ try
+ {
+ session.setAttribute("name", new Object());
+ fail();
+ }
+ catch (IllegalStateException expected)
+ {
+ }
+
+ try
+ {
+ session.setAttribute("name", new Object(),
PortletSession.APPLICATION_SCOPE);
+ fail();
+ }
+ catch (IllegalStateException expected)
+ {
+ }
+
+ return new EndTestResponse();
+ }
+ });
+ }
+
+
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsession/PortletSessionSequenceBuilder.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsessionutil/PortletSessionUtilAPITestSuite.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsessionutil/PortletSessionUtilAPITestSuite.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsessionutil/PortletSessionUtilAPITestSuite.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,52 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.portlet.jsr168.api.portletsessionutil;
+
+import junit.framework.Test;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.com">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 5510 $
+ */
+public class PortletSessionUtilAPITestSuite
+{
+
+ public static Test suite()
+ {
+// TestSuite suite = new
TestSuite("test-jsr168-api-portletsessionutil.war");
+//
+// /**
+// * PortletSessionUtil.decodeAttributeName();
+// */
+// suite.addTest(new TestCase("DecodeAttributeName"));
+//
+// /**
+// * PortletSessionUtil.decodeScope();
+// */
+// suite.addTest(new TestCase("DecodeScope"));
+//
+//
+// return suite;
+ return null;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsessionutil/PortletSessionUtilAPITestSuite.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsessionutil/PortletSessionUtilSequenceBuilder.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsessionutil/PortletSessionUtilSequenceBuilder.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsessionutil/PortletSessionUtilSequenceBuilder.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,93 @@
+/******************************************************************************
+ * 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.jsr168.api.portletsessionutil;
+
+import org.jboss.portal.test.framework.driver.response.EndTestResponse;
+import org.jboss.portal.test.framework.driver.DriverResponse;
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestDriver;
+import org.jboss.portal.test.framework.portlet.PortletTestSuite;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.framework.UTP1;
+
+import javax.portlet.Portlet;
+import javax.portlet.PortletSession;
+import javax.portlet.PortletSessionUtil;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 7954 $
+ */
+public class PortletSessionUtilSequenceBuilder extends PortletTestSuite
+{
+ public void createDecodeAttributeNameCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("DecodeAttributeName", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+
+ assertEquals("name",
PortletSessionUtil.decodeAttributeName("name"));
+ //PORTLET_SCOPE
+ assertEquals("name",
PortletSessionUtil.decodeAttributeName("javax.portlet.p.id?name"));
+ assertEquals("name",
PortletSessionUtil.decodeAttributeName("javax.portlet.p.some.strange.id?name"));
+ assertEquals("strange.long.name",
PortletSessionUtil.decodeAttributeName("javax.portlet.p.some.strange.id?strange.long.name"));
+
+
+ assertEquals("javaxx.portlet.p.strange.id?name",
PortletSessionUtil.decodeAttributeName("javaxx.portlet.p.strange.id?name"));
+ assertEquals("javax.portlet.p.strange.idname",
PortletSessionUtil.decodeAttributeName("javax.portlet.p.strange.idname"));
+ assertEquals("javax.portlet.strange.id?name",
PortletSessionUtil.decodeAttributeName("javax.portlet.strange.id?name"));
+
+
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ public void createDecodeScopeCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("DecodeScope", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ assertEquals(PortletSession.APPLICATION_SCOPE,
PortletSessionUtil.decodeScope("simpleName"));
+ assertEquals(PortletSession.APPLICATION_SCOPE,
PortletSessionUtil.decodeScope("javax.portlet.name"));
+ assertEquals(PortletSession.APPLICATION_SCOPE,
PortletSessionUtil.decodeScope("javax.portlet.p.name"));
+ assertEquals(PortletSession.APPLICATION_SCOPE,
PortletSessionUtil.decodeScope("jjavax.portlet.p.id?name"));
+ assertEquals(PortletSession.APPLICATION_SCOPE,
PortletSessionUtil.decodeScope("id?name"));
+ assertEquals(PortletSession.APPLICATION_SCOPE,
PortletSessionUtil.decodeScope("portlet.p.id?name"));
+
+
+ assertEquals(PortletSession.PORTLET_SCOPE,
PortletSessionUtil.decodeScope("javax.portlet.p.id?name"));
+ return new EndTestResponse();
+ }
+ });
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portletsessionutil/PortletSessionUtilSequenceBuilder.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portleturl/PortletURLAPITestSuite.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portleturl/PortletURLAPITestSuite.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portleturl/PortletURLAPITestSuite.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,66 @@
+/******************************************************************************
+ * 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.jsr168.api.portleturl;
+
+import junit.framework.Test;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.com">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 5510 $
+ */
+public class PortletURLAPITestSuite
+{
+
+ public static Test suite()
+ {
+// TestSuite suite = new TestSuite("test-jsr168-api-portleturl.war");
+//
+// /**
+// * PortletURL.setWindowState()
+// * PortletURL.setPortletMode()
+// *
+// * TESTED in TCK assertions
+// */
+//
+// /**
+// * PortletURL.setParameter()
+// * PortletURL.setParameter()
+// * PortletURL.setParameters()
+// */
+// suite.addTest(new TestCase("Parameter"));
+//
+// /**
+// * TODO: PortletURL.setSecure()
+// */
+//
+// /**
+// * PortletURL.toString()
+// *
+// * TESTED in most of assertions
+// */
+//
+//
+// return suite;
+ return null;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portleturl/PortletURLAPITestSuite.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portleturl/PortletURLSequenceBuilder.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portleturl/PortletURLSequenceBuilder.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portleturl/PortletURLSequenceBuilder.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,183 @@
+/******************************************************************************
+ * 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.jsr168.api.portleturl;
+
+import org.jboss.portal.test.framework.driver.response.EndTestResponse;
+import org.jboss.portal.test.framework.driver.DriverResponse;
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestDriver;
+import org.jboss.portal.test.framework.portlet.PortletTestSuite;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.framework.UTP1;
+
+import javax.portlet.Portlet;
+import javax.portlet.PortletURL;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 7954 $
+ */
+public class PortletURLSequenceBuilder extends PortletTestSuite
+{
+
+ /** PortletURL.setParameter() PortletURL.setParameter() PortletURL.setParameters() */
+ public void createParameterCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("Parameter", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ PortletURL url = response.createRenderURL();
+
+ String val = null;
+ String[] vals = null;
+
+ try
+ {
+ url.setParameter("name", val);
+ fail();
+ }
+ catch (IllegalArgumentException e)
+ {
+ //expected
+ }
+
+ try
+ {
+ url.setParameter(null, "val");
+ fail();
+ }
+ catch (IllegalArgumentException e)
+ {
+ //
+ }
+
+ try
+ {
+ url.setParameter("name", vals);
+ fail();
+ }
+ catch (IllegalArgumentException e)
+ {
+ //
+ }
+
+ try
+ {
+ url.setParameter(null, new String[]{"val1, val2"});
+ fail();
+ }
+ catch (IllegalArgumentException e)
+ {
+ //
+ }
+
+ try
+ {
+ url.setParameter(null, val);
+ fail();
+ }
+ catch (IllegalArgumentException e)
+ {
+ //
+ }
+
+ try
+ {
+ url.setParameter(null, vals);
+ fail();
+ }
+ catch (IllegalArgumentException e)
+ {
+ //
+ }
+
+
+ try
+ {
+ url.setParameters(null);
+ fail();
+ }
+ catch (IllegalArgumentException e)
+ {
+ //
+ }
+
+ Map map = new HashMap();
+
+ map.put("name", "val");
+ map.put(null, "val");
+
+ try
+ {
+ url.setParameters(map);
+ fail();
+ }
+ catch (IllegalArgumentException e)
+ {
+ //
+ }
+
+ map = new HashMap();
+ map.put("name", "val");
+ map.put("name2", new Object());
+
+ try
+ {
+ url.setParameters(map);
+ fail();
+ }
+ catch (IllegalArgumentException e)
+ {
+ //
+ }
+
+ map = new HashMap();
+ map.put("name", new String[]{"val"});
+ map.put("name2", null);
+
+ try
+ {
+ url.setParameters(map);
+ fail();
+ }
+ catch (IllegalArgumentException e)
+ {
+ //
+ }
+
+
+ return new EndTestResponse();
+ }
+ });
+ }
+
+
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/portleturl/PortletURLSequenceBuilder.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/renderrequest/RenderRequestAPITestSuite.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/renderrequest/RenderRequestAPITestSuite.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/renderrequest/RenderRequestAPITestSuite.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,74 @@
+/******************************************************************************
+ * 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.jsr168.api.renderrequest;
+
+import junit.framework.Test;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.com">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 5510 $
+ */
+public class RenderRequestAPITestSuite
+{
+
+ public static Test suite()
+ {
+// TestSuite suite = new TestSuite("test-jsr168-api-renderrequest.war");
+//
+// //So... all methods are from PortletRequest
+//
+// //And here we go to PortletRequest interface asserts:
+//
+// /**
+// * RenderRequest.BASIC_AUTH
+// * RenderRequest.CLIENT_CERT_AUTH
+// * RenderRequest.DIGEST_AUTH
+// * RenderRequest.FORM_AUTH
+// * RenderRequest.USER_INFO
+// */
+// suite.addTest(new TestCase("Constants"));
+//
+// /**
+// * RenderRequest.getProperty()
+// * RenderRequest.getProperties()
+// */
+// suite.addTest(new TestCase("Property"));
+//
+// /**
+// * RenderRequest.getAttribute()
+// * RenderRequest.setAttribute()
+// * RenderRequest.removeAttribute()
+// */
+// suite.addTest(new TestCase("Attribute"));
+//
+// /**
+// * RenderRequest.getParameter()
+// * RenderRequest.getParameterValues()
+// */
+// suite.addTest(new TestCase("Parameter"));
+//
+//
+// return suite;
+ return null;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/renderrequest/RenderRequestAPITestSuite.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/renderrequest/RenderRequestSequenceBuilder.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/renderrequest/RenderRequestSequenceBuilder.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/renderrequest/RenderRequestSequenceBuilder.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,178 @@
+/******************************************************************************
+ * 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.jsr168.api.renderrequest;
+
+import org.jboss.portal.test.framework.driver.response.EndTestResponse;
+import org.jboss.portal.test.framework.driver.DriverResponse;
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestDriver;
+import org.jboss.portal.test.framework.portlet.PortletTestSuite;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.framework.UTP1;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 7954 $
+ */
+public class RenderRequestSequenceBuilder extends PortletTestSuite
+{
+ //********************************
+ //PortletRequest interface Asserts
+ //********************************
+
+ /**
+ * RenderRequest.BASIC_AUTH RenderRequest.CLIENT_CERT_AUTH RenderRequest.DIGEST_AUTH
RenderRequest.FORM_AUTH
+ * RenderRequest.USER_INFO
+ */
+ public void createConstantsCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("Constants", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+
+ assertEquals("javax.portlet.userinfo", RenderRequest.USER_INFO);
+ assertEquals("BASIC", RenderRequest.BASIC_AUTH);
+ assertEquals("FORM", RenderRequest.FORM_AUTH);
+ assertEquals("CLIENT_CERT", RenderRequest.CLIENT_CERT_AUTH);
+ assertEquals("DIGEST", RenderRequest.DIGEST_AUTH);
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ /** RenderRequest.getProperty() RenderRequest.getProperties() */
+ public void createPropertyCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("Property", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+
+ try
+ {
+ request.getProperty(null);
+ fail();
+ }
+ catch (IllegalArgumentException expected)
+ {
+ }
+
+ try
+ {
+ request.getProperties(null);
+ fail();
+ }
+ catch (IllegalArgumentException expected)
+ {
+ }
+
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ /** RenderRequest.getAttribute() RenderRequest.setAttribute()
RenderRequest.removeAttribute() */
+ public void createAttributeCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("Attribute", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ try
+ {
+ request.getAttribute(null);
+ fail();
+ }
+ catch (IllegalArgumentException expected)
+ {
+ }
+
+ try
+ {
+ request.setAttribute(null, new Object());
+ fail();
+ }
+ catch (IllegalArgumentException expected)
+ {
+ }
+
+ try
+ {
+ request.removeAttribute(null);
+ fail();
+ }
+ catch (IllegalArgumentException e)
+ {
+ }
+
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ /** RenderRequest.getParameter() RenderRequest.getParameterValues() */
+ public void createParameterCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("Parameter", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ try
+ {
+ request.getParameter(null);
+ fail();
+ }
+ catch (IllegalArgumentException expected)
+ {
+ }
+
+ try
+ {
+ request.getParameterValues(null);
+ fail();
+ }
+ catch (IllegalArgumentException expected)
+ {
+ }
+
+ return new EndTestResponse();
+ }
+ });
+ }
+
+
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/renderrequest/RenderRequestSequenceBuilder.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/renderresponse/RenderResponseAPITestSuite.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/renderresponse/RenderResponseAPITestSuite.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/renderresponse/RenderResponseAPITestSuite.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,76 @@
+/******************************************************************************
+ * 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.jsr168.api.renderresponse;
+
+import junit.framework.Test;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.com">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 5510 $
+ */
+public class RenderResponseAPITestSuite
+{
+
+ public static Test suite()
+ {
+// TestSuite suite = new TestSuite("test-jsr168-api-renderresponse.war");
+//
+// /**
+// * RenderResponse.EXPIRATION_CACHE
+// */
+// suite.addTest(new TestCase("Constants"));
+//
+// /**
+// * RenderResponse.setContentType()
+// */
+// suite.addTest(new TestCase("ContentType"));
+//
+// /**
+// * RenderResponse.getWriter()
+// * RenderResponse.getPortletOutputStream()
+// *
+// * TESTED in TCK asserts
+// */
+//
+// /**
+// * RenderResponse.setBufferSize()
+// *
+// * TESTED in TCK asserts
+// * (and it's not implemented in portal now)
+// */
+//
+// /**
+// * ActionResponse.setProperty()
+// * ActionResponse.addProperty()
+// */
+// suite.addTest(new TestCase("Property"));
+//
+// /**
+// * ActionResponse.encodeURL()
+// */
+// suite.addTest(new TestCase("EncodeURL"));
+//
+// return suite;
+ return null;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/renderresponse/RenderResponseAPITestSuite.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/renderresponse/RenderResponseSequenceBuilder.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/renderresponse/RenderResponseSequenceBuilder.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/renderresponse/RenderResponseSequenceBuilder.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,144 @@
+/******************************************************************************
+ * 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.jsr168.api.renderresponse;
+
+import org.jboss.portal.test.framework.driver.response.EndTestResponse;
+import org.jboss.portal.test.framework.driver.DriverResponse;
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestDriver;
+import org.jboss.portal.test.framework.portlet.PortletTestSuite;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.framework.UTP1;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 7954 $
+ */
+public class RenderResponseSequenceBuilder extends PortletTestSuite
+{
+
+ /** RenderResponse.EXPIRATION_CACHE */
+ public void createConstantsCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("Constants", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ assertEquals("portlet.expiration-cache",
RenderResponse.EXPIRATION_CACHE);
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ /** RenderResponse.setContentType() */
+ public void createContentTypeCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("ContentType", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ try
+ {
+ response.setContentType("UNSUPPORTED/TYPE");
+ fail();
+ }
+ catch (IllegalArgumentException expected)
+ {
+ }
+
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ //************************
+ //PortletResponse methods:
+ //************************
+
+ /** RenderResponse.setProperty() RenderResponse.addProperty() */
+ public void createPropertyCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("Property", seq);
+
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ try
+ {
+ response.addProperty(null, "val");
+ fail();
+ }
+ catch (IllegalArgumentException expected)
+ {
+ }
+
+ try
+ {
+ response.setProperty(null, "val");
+ fail();
+ }
+ catch (IllegalArgumentException expected)
+ {
+ }
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ /** RenderResponse.encodeURL() */
+ public void createEncodeURLCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("EncodeURL", seq);
+
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ try
+ {
+ response.encodeURL("not_absolute_and_not_slash_leading_path");
+ fail();
+ }
+ catch (IllegalArgumentException expected)
+ {
+ }
+
+ return new EndTestResponse();
+ }
+ });
+ }
+
+
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/renderresponse/RenderResponseSequenceBuilder.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/windowstate/WindowStateAPITestSuite.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/windowstate/WindowStateAPITestSuite.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/windowstate/WindowStateAPITestSuite.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,63 @@
+/******************************************************************************
+ * 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.jsr168.api.windowstate;
+
+import junit.framework.Test;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.com">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 5510 $
+ */
+public class WindowStateAPITestSuite
+{
+
+ public static Test suite()
+ {
+// TestSuite suite = new TestSuite("test-jsr168-api-windowstate.war");
+//
+// /**
+// * WindowState.MAXIMIZED
+// * WindowState.MINIMIZED
+// * WindowState.NORMAL
+// */
+// suite.addTest(new TestCase("States"));
+//
+// /**
+// * WindowState.WindowState()
+// */
+// suite.addTest(new TestCase("Constructor"));
+//
+// /**
+// * @portlet.api assert="WindowState.equals()"
+// */
+// suite.addTest(new TestCase("Equals"));
+//
+// /**
+// * @portlet.api assert="WindowState.hashCode()"
+// */
+// suite.addTest(new TestCase("HashCode"));
+//
+// return suite;
+ return null;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/windowstate/WindowStateAPITestSuite.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/windowstate/WindowStateSequenceBuilder.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/windowstate/WindowStateSequenceBuilder.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/windowstate/WindowStateSequenceBuilder.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,136 @@
+/******************************************************************************
+ * 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.jsr168.api.windowstate;
+
+import org.jboss.portal.test.framework.driver.response.EndTestResponse;
+import org.jboss.portal.test.framework.driver.DriverResponse;
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestDriver;
+import org.jboss.portal.test.framework.portlet.PortletTestSuite;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.framework.UTP1;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.WindowState;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 7954 $
+ */
+public class WindowStateSequenceBuilder extends PortletTestSuite
+{
+
+ /** @portlet.api assert="WindowState.MINIMIZED WindowState.MAXIMIZED
WindowState.NORMAL" */
+ public void createStatesCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("States", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ assertEquals("minimized", "" + WindowState.MINIMIZED);
+ assertEquals("maximized", "" + WindowState.MAXIMIZED);
+ assertEquals("normal", "" + WindowState.NORMAL);
+
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ /** @portlet.api assert="WindowState.WindowState()" */
+ public void createConstructorCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("Constructor", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ assertEquals("teststate", "" + new
WindowState("teststate"));
+ assertEquals("teststate", "" + new
WindowState("TESTSTATE"));
+ assertEquals("teststate", "" + new
WindowState("TestState"));
+ assertEquals("", "" + new WindowState(""));
+
+
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ /** @portlet.api assert="WindowState.equals()" */
+ public void createEqualsCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("Equals", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ WindowState ws1 = new WindowState("TestState");
+ WindowState ws2 = new WindowState("teststate");
+ WindowState ws3 = new WindowState("OtherState");
+
+ //true
+ assertTrue(ws1.equals(ws2));
+ //false
+ assertTrue(!ws1.equals(ws3));
+
+
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ /** @portlet.api assert="WindowState.hashCode()" */
+ public void createHashCodeCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("HashCode", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ WindowState ws1 = new WindowState("TestState");
+ WindowState ws2 = new WindowState("teststate");
+ WindowState ws3 = new WindowState("OtherState");
+
+ //true
+ assertTrue(ws1.hashCode() == ws2.hashCode());
+ //false
+ assertTrue(ws1.hashCode() != ws3.hashCode());
+
+ //Hashcodes are constructed from strings
+ assertEquals("teststate".hashCode(), ws1.hashCode());
+ assertEquals("teststate".hashCode(), ws2.hashCode());
+ assertEquals("otherstate".hashCode(), ws3.hashCode());
+
+
+ return new EndTestResponse();
+ }
+ });
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/windowstate/WindowStateSequenceBuilder.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/common/AbstractCacheSequenceBuilder.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/common/AbstractCacheSequenceBuilder.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/common/AbstractCacheSequenceBuilder.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,390 @@
+/******************************************************************************
+ * 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.jsr168.ext.common;
+
+import org.jboss.portal.test.framework.portlet.PortletTestSuite;
+import org.jboss.portal.test.framework.portlet.PortletTestDriver;
+import org.jboss.portal.test.framework.portlet.Joinpoint;
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.framework.portlet.actions.PortletActionTestAction;
+import org.jboss.portal.test.framework.driver.http.response.InvokeGetResponse;
+import org.jboss.portal.test.framework.driver.DriverResponse;
+import org.jboss.portal.test.framework.driver.response.EndTestResponse;
+import org.jboss.portal.common.util.CollectionBuilder;
+
+import javax.portlet.PortletURL;
+import javax.portlet.RenderResponse;
+import javax.portlet.ActionResponse;
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.PortletException;
+import javax.portlet.ActionRequest;
+import javax.portlet.WindowState;
+import javax.portlet.WindowStateException;
+import javax.portlet.PortletMode;
+import javax.portlet.PortletModeException;
+import java.util.Set;
+import java.util.HashSet;
+import java.io.IOException;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class AbstractCacheSequenceBuilder extends PortletTestSuite
+{
+
+ protected final AbstractCacheSequenceBuilder.NavigationalStateConfigurator
renderParameterConfigurator = new
AbstractCacheSequenceBuilder.NavigationalStateConfigurator()
+ {
+ public PortletURL createPortletURL(RenderResponse resp)
+ {
+ PortletURL url = resp.createRenderURL();
+ url.setParameter("abc", "def");
+ return url;
+ }
+ public void configureNavigationalState(ActionResponse resp)
+ {
+ resp.setRenderParameter("abc", "fed");
+ }
+ };
+
+ protected final AbstractCacheSequenceBuilder.NavigationalStateConfigurator
windowStateConfigurator = new
AbstractCacheSequenceBuilder.NavigationalStateConfigurator()
+ {
+ public PortletURL createPortletURL(RenderResponse resp) throws
WindowStateException
+ {
+ PortletURL url = resp.createRenderURL();
+ url.setWindowState(WindowState.MAXIMIZED);
+ return url;
+ }
+ public void configureNavigationalState(ActionResponse resp) throws
WindowStateException
+ {
+ resp.setWindowState(WindowState.MAXIMIZED);
+ }
+ };
+
+ protected final AbstractCacheSequenceBuilder.NavigationalStateConfigurator
portletModeConfigurator = new
AbstractCacheSequenceBuilder.NavigationalStateConfigurator()
+ {
+ public PortletURL createPortletURL(RenderResponse resp) throws
PortletModeException
+ {
+ PortletURL url = resp.createRenderURL();
+ url.setPortletMode(PortletMode.EDIT);
+ return url;
+ }
+ public void configureNavigationalState(ActionResponse resp) throws
PortletModeException
+ {
+ resp.setPortletMode(PortletMode.EDIT);
+ }
+ };
+
+ /**
+ * Overriding the expiration cache to 0 disable the cache on a render or an
action/render.
+ */
+ protected void createDisableDuringRender(String testName, PortletTestDriver registry,
Joinpoint renderjp, Joinpoint actionjp)
+ {
+ final Set calls = new HashSet();
+ PortletTest seq = new PortletTest();
+ registry.addSequence(testName, seq);
+
+ //
+ seq.addAction(0, renderjp, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws IOException, PortletException
+ {
+ //
+ calls.add("0");
+ response.setProperty(RenderResponse.EXPIRATION_CACHE, "0");
+
+ // Refresh
+ String url = response.createRenderURL().toString();
+ return new InvokeGetResponse(url);
+ }
+ });
+
+ //
+ seq.addAction(1, renderjp, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws IOException, PortletException
+ {
+ //
+ calls.add("1");
+ response.setProperty(RenderResponse.EXPIRATION_CACHE, "0");
+
+ // Refresh
+ String url = response.createActionURL().toString();
+ return new InvokeGetResponse(url);
+ }
+ });
+
+ //
+ seq.addAction(2, actionjp, new PortletActionTestAction()
+ {
+ protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context) throws PortletException, IOException
+ {
+ //
+ calls.add("2_action");
+ }
+ });
+ seq.addAction(2, renderjp, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws IOException, PortletException
+ {
+ // Content is not cached
+ calls.add("2_render");
+
+ //
+ Set expected = new
CollectionBuilder().add("0").add("1").add("2_action").add("2_render").toHashSet();
+ assertEquals(expected, calls);
+
+ // End test
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ protected interface NavigationalStateConfigurator
+ {
+ PortletURL createPortletURL(RenderResponse resp) throws PortletException;
+ void configureNavigationalState(ActionResponse resp) throws PortletException;
+ }
+
+ /**
+ * Calling render on the portlet with different render parameters invalidates the
cache
+ */
+ protected void createCacheMarkup(
+ String testName,
+ PortletTestDriver registry,
+ Joinpoint p1renderjp,
+ Joinpoint p1actionjp,
+ Joinpoint p2renderjp,
+ final AbstractCacheSequenceBuilder.NavigationalStateConfigurator configurator)
+ {
+ final Set calls = new HashSet();
+ final String[] url = new String[1];
+ PortletTest seq = new PortletTest();
+ registry.addSequence(testName, seq);
+
+ //
+ seq.addAction(0, p1renderjp, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws IOException, PortletException
+ {
+ // Content is not cached
+ calls.add("0");
+
+ // Create invalidating action url for later use
+ url[0] = response.createActionURL().toString();
+
+ // Refresh
+ return new InvokeGetResponse(response.createRenderURL().toString());
+ }
+ });
+
+ //
+ seq.addAction(1, p1renderjp, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws IOException, PortletException
+ {
+ // Should not be called
+ calls.add("1");
+ return null;
+ }
+ });
+ seq.addAction(1, p2renderjp, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws IOException, PortletException
+ {
+ // Invalidate with action
+ return new InvokeGetResponse(url[0]);
+ }
+ });
+
+ //
+ seq.addAction(2, p1actionjp, new PortletActionTestAction()
+ {
+ protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context) throws PortletException, IOException
+ {
+ calls.add("2_action");
+ }
+ });
+ seq.addAction(2, p1renderjp, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws IOException, PortletException
+ {
+ // Should be called
+ calls.add("2_render");
+
+ // Refresh with different URL
+ PortletURL url = configurator.createPortletURL(response);
+ return new InvokeGetResponse(url.toString());
+ }
+ });
+
+ //
+ seq.addAction(3, p1renderjp, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws IOException, PortletException
+ {
+ // Should be called
+ calls.add("3");
+
+ // Invoke with same different URL
+ PortletURL url = configurator.createPortletURL(response);
+ return new InvokeGetResponse(url.toString());
+ }
+ });
+
+ //
+ seq.addAction(4, p1renderjp, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws IOException, PortletException
+ {
+ // Should not be called
+ calls.add("4");
+ return null;
+ }
+ });
+ seq.addAction(4, p2renderjp, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws IOException, PortletException
+ {
+ // Invalidate with action
+ return new InvokeGetResponse(url[0]);
+ }
+ });
+
+ //
+ seq.addAction(5, p1actionjp, new PortletActionTestAction()
+ {
+ protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context) throws PortletException, IOException
+ {
+ calls.add("5_action");
+
+ // Configure the navitional state
+ configurator.configureNavigationalState(response);
+ }
+ });
+ seq.addAction(5, p1renderjp, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws IOException, PortletException
+ {
+ // Should be called
+ calls.add("5_render");
+
+ // Refresh with different navigational state to check it will be called in
the next render phase
+ PortletURL url = response.createRenderURL();
+ return new InvokeGetResponse(url.toString());
+ }
+ });
+
+ //
+ seq.addAction(6, p1renderjp, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws IOException, PortletException
+ {
+ Set expected = new
CollectionBuilder().add("0").add("2_action").add("2_render").add("3").add("5_action").add("5_render").toHashSet();
+ assertEquals(expected, calls);
+
+ // Refresh
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ /**
+ * Calling action on the portlet invalidates the cache.
+ */
+ protected void createActionInvalidates(
+ String testName,
+ PortletTestDriver registry,
+ Joinpoint p1renderjp,
+ Joinpoint p1actionjp,
+ Joinpoint p2renderjp)
+ {
+ final Set calls = new HashSet();
+ final String[] url = new String[1];
+ PortletTest seq = new PortletTest();
+ registry.addSequence(testName, seq);
+
+ //
+ seq.addAction(0, p1renderjp, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws IOException, PortletException
+ {
+ // Content is not cached
+ calls.add("0");
+
+ // Refresh
+ url[0] = response.createActionURL().toString();
+ return new InvokeGetResponse(response.createRenderURL().toString());
+ }
+ });
+
+ //
+ seq.addAction(1, p1renderjp, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws IOException, PortletException
+ {
+ // Should no be called
+ calls.add("1");
+ return null;
+ }
+ });
+ seq.addAction(1, p2renderjp, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws IOException, PortletException
+ {
+ // Invalidate
+ return new InvokeGetResponse(url[0]);
+ }
+ });
+
+ //
+ seq.addAction(2, p1actionjp, new PortletActionTestAction()
+ {
+ protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context) throws PortletException, IOException
+ {
+ //
+ calls.add("2_action");
+ }
+ });
+ seq.addAction(2, p1renderjp, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws IOException, PortletException
+ {
+ // Content is not cached
+ calls.add("2_render");
+
+ //
+ Set expected = new
CollectionBuilder().add("0").add("2_action").add("2_render").toHashSet();
+ assertEquals(expected, calls);
+
+ // End test
+ return new EndTestResponse();
+ }
+ });
+ }
+
+
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/dispatcher/DispatcherSequenceBuilder.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/dispatcher/DispatcherSequenceBuilder.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/dispatcher/DispatcherSequenceBuilder.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,198 @@
+/******************************************************************************
+ * 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.jsr168.ext.dispatcher;
+
+import org.jboss.portal.common.util.Tools;
+import org.jboss.portal.common.util.CollectionBuilder;
+import org.jboss.portal.test.framework.driver.response.EndTestResponse;
+import org.jboss.portal.test.framework.driver.http.response.InvokeGetResponse;
+import org.jboss.portal.test.framework.driver.DriverResponse;
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestDriver;
+import org.jboss.portal.test.framework.portlet.PortletTestSuite;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.framework.portlet.actions.ServletServiceTestAction;
+import org.jboss.portal.test.framework.portlet.components.AbstractUniversalTestPortlet;
+import org.jboss.portal.test.portlet.framework.UTP1;
+import org.jboss.portal.test.portlet.framework.UTS1;
+import org.jboss.portal.test.portlet.framework.UTP2;
+import org.jboss.portal.test.portlet.framework.UTP3;
+
+import javax.portlet.Portlet;
+import javax.portlet.PortletException;
+import javax.portlet.PortletRequestDispatcher;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.servlet.Servlet;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.util.Enumeration;
+import java.util.Set;
+import java.util.Collections;
+
+/**
+ * Tests for request dispatching from a portlet to a servlet.
+ *
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 7954 $
+ */
+public class DispatcherSequenceBuilder extends PortletTestSuite
+{
+
+ public static final String SERVLET_A_URI =
"/test-jsr168-ext-dispatcher/universalServletA";
+ public static final String SERVLET_B_URI =
"/test-jsr168-ext-dispatcher/universalServletB";
+
+ public void createGetRequestURICase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("GetRequestURI", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws IOException, PortletException
+ {
+ PortletRequestDispatcher dispatcher =
((AbstractUniversalTestPortlet)portlet).getPortletContext().getRequestDispatcher("/universalServletA");
+ response.setContentType("text/html");
+ dispatcher.include(request, response);
+ return null;
+ }
+ });
+
+
+ seq.addAction(0, UTS1.SERVICE_JOINPOINT, new ServletServiceTestAction()
+ {
+ protected DriverResponse run(Servlet servlet, HttpServletRequest request,
HttpServletResponse response, PortletTestContext context) throws ServletException,
IOException
+ {
+
assertEquals(org.jboss.portal.test.portlet.jsr168.ext.dispatcher.DispatcherSequenceBuilder.SERVLET_A_URI,
request.getRequestURI());
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ /** Show that we can access request headers from the portlet request properties. */
+ public void createRequestHeaderAccess(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("RequestHeaderAccess", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ // Test the value is not there yet
+ Set propertyNames = Tools.toSet(request.getPropertyNames());
+ assertFalse(propertyNames.contains("myheader"));
+ assertNull(request.getProperty("myheader"));
+ assertFalse(request.getProperties("myheader").hasMoreElements());
+
+ // Invoke render with header
+ InvokeGetResponse render = new
InvokeGetResponse(response.createRenderURL().toString());
+ render.addHeader("myheader").addElement("render-value");
+ return render;
+ }
+ });
+
+ seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws IOException, PortletException
+ {
+ PortletRequestDispatcher dispatcher =
((AbstractUniversalTestPortlet)portlet).getPortletContext().getRequestDispatcher("/universalServletA");
+ response.setContentType("text/html");
+ dispatcher.include(request, response);
+ return null;
+ }
+ });
+
+ seq.addAction(1, UTS1.SERVICE_JOINPOINT, new ServletServiceTestAction()
+ {
+ protected DriverResponse run(Servlet servlet, HttpServletRequest request,
HttpServletResponse response, PortletTestContext context)
+ {
+ // Test the header is here
+ Set headerNames = Tools.toSet(request.getHeaderNames());
+ assertTrue(headerNames.contains("myheader"));
+ assertEquals("render-value",
request.getHeader("myheader"));
+ Enumeration values = request.getHeaders("myheader");
+ assertTrue(values.hasMoreElements());
+ assertEquals("render-value", values.nextElement());
+ assertFalse(values.hasMoreElements());
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ public void createFilters(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("Filters", seq);
+ seq.addAction(0, UTP2.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws IOException, PortletException
+ {
+ PortletRequestDispatcher prd =
request.getPortletSession().getPortletContext().getRequestDispatcher("/noop");
+ assertNotNull(prd);
+ ServletFilter.ids.clear();
+ prd.include(request, response);
+ assertEquals(new
CollectionBuilder().add("INCLUDE_URL_PATTERN_FILTER").add("INCLUDE_NAMED_FILTER").toHashSet(),
ServletFilter.ids);
+
+ //
+ prd =
request.getPortletSession().getPortletContext().getNamedDispatcher("NoopServlet");
+ assertNotNull(prd);
+ ServletFilter.ids.clear();
+ prd.include(request, response);
+ assertEquals(Collections.singleton("INCLUDE_NAMED_FILTER"),
ServletFilter.ids);
+
+ //
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ public void createDispatchingFilter(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("DispatchingFilter", seq);
+ seq.addAction(0, UTP3.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws IOException, PortletException
+ {
+
+ // Need to set content type as we will include a JSP that will produce
output
+ response.setContentType("text/html");
+
+ //
+ PortletRequestDispatcher prd =
request.getPortletSession().getPortletContext().getNamedDispatcher("TargetForIncludeNamedDispatchingFilter");
+ assertNotNull(prd);
+ prd.include(request, response);
+
+ //
+ prd =
request.getPortletSession().getPortletContext().getRequestDispatcher("/TargetForIncludeURLPatternDispatchingFilter");
+ assertNotNull(prd);
+ prd.include(request, response);
+
+ //
+ return new EndTestResponse();
+ }
+ });
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/dispatcher/DispatcherSequenceBuilder.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/dispatcher/DispatchingFilter.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/dispatcher/DispatchingFilter.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/dispatcher/DispatchingFilter.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,67 @@
+/******************************************************************************
+ * 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.jsr168.ext.dispatcher;
+
+import javax.servlet.Filter;
+import javax.servlet.FilterConfig;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.FilterChain;
+import javax.servlet.RequestDispatcher;
+import java.io.IOException;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class DispatchingFilter implements Filter
+{
+
+ private FilterConfig cfg;
+
+ public void init(FilterConfig cfg) throws ServletException
+ {
+ this.cfg = cfg;
+ }
+
+ public void doFilter(ServletRequest req, ServletResponse resp, FilterChain chain)
throws IOException, ServletException
+ {
+
+ System.out.println("In the CHAIN " + cfg.getFilterName());
+ System.out.println("In the CHAIN " + cfg.getFilterName());
+ System.out.println("In the CHAIN " + cfg.getFilterName());
+ System.out.println("In the CHAIN " + cfg.getFilterName());
+ System.out.println("In the CHAIN " + cfg.getFilterName());
+ System.out.println("In the CHAIN " + cfg.getFilterName());
+
+ RequestDispatcher rd =
cfg.getServletContext().getRequestDispatcher("/dispatchedFromFilter.jsp");
+ rd.include(req, resp);
+
+ }
+
+ public void destroy()
+ {
+ this.cfg = null;
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/dispatcher/ServletFilter.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/dispatcher/ServletFilter.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/dispatcher/ServletFilter.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,69 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.portlet.jsr168.ext.dispatcher;
+
+import javax.servlet.Filter;
+import javax.servlet.FilterConfig;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.FilterChain;
+import java.io.IOException;
+import java.util.Set;
+import java.util.HashSet;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class ServletFilter implements Filter
+{
+
+ public static final Set ids = new HashSet();
+
+ private String id;
+
+ public void init(FilterConfig cfg) throws ServletException
+ {
+ id = cfg.getInitParameter("id");
+ }
+
+ public void doFilter(ServletRequest req, ServletResponse resp, FilterChain chain)
throws IOException, ServletException
+ {
+ if (id == null)
+ {
+ throw new ServletException("No id found in the servlet filter
config");
+ }
+
+ //
+ ids.add(id);
+
+ //
+ chain.doFilter(req, resp);
+ }
+
+ public void destroy()
+ {
+ id = null;
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/expiringcache/ExpiringCacheSequenceBuilder.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/expiringcache/ExpiringCacheSequenceBuilder.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/expiringcache/ExpiringCacheSequenceBuilder.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,265 @@
+/******************************************************************************
+ * 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.jsr168.ext.expiringcache;
+
+import org.jboss.portal.test.framework.portlet.PortletTestDriver;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.framework.driver.http.response.InvokeGetResponse;
+import org.jboss.portal.test.portlet.framework.UTP1;
+import org.jboss.portal.test.portlet.framework.UTP2;
+import org.jboss.portal.test.portlet.framework.UTP3;
+import org.jboss.portal.test.portlet.framework.UTP4;
+import org.jboss.portal.test.portlet.framework.UTP5;
+import org.jboss.portal.test.portlet.framework.UTP6;
+import org.jboss.portal.test.portlet.framework.UTP7;
+import org.jboss.portal.test.portlet.framework.UTP8;
+import org.jboss.portal.test.portlet.framework.UTP9;
+import org.jboss.portal.test.portlet.framework.UTP10;
+import org.jboss.portal.test.portlet.framework.UTP11;
+import org.jboss.portal.test.portlet.jsr168.ext.common.AbstractCacheSequenceBuilder;
+import org.jboss.portal.test.framework.driver.DriverResponse;
+import org.jboss.portal.test.framework.driver.response.ErrorResponse;
+import org.jboss.portal.test.framework.driver.response.EndTestResponse;
+import org.jboss.portal.common.util.CollectionBuilder;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.PortletException;
+import javax.portlet.PortletURL;
+import java.io.IOException;
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class ExpiringCacheSequenceBuilder extends AbstractCacheSequenceBuilder
+{
+
+ public void createDisableDuringRenderExpiringCache(PortletTestDriver registry)
+ {
+ createDisableDuringRender("DisableDuringRenderExpiringCache", registry,
UTP1.RENDER_JOINPOINT, UTP1.ACTION_JOINPOINT);
+ }
+
+ public void createActionInvalidatesExpiringCache(PortletTestDriver registry)
+ {
+ createActionInvalidates("ActionInvalidatesExpiringCache", registry,
UTP2.RENDER_JOINPOINT, UTP2.ACTION_JOINPOINT, UTP3.RENDER_JOINPOINT);
+ }
+
+ public void createExpiringCacheWithRenderParameters(PortletTestDriver registry)
+ {
+ createCacheMarkup("ExpiringCacheWithRenderParameters", registry,
UTP4.RENDER_JOINPOINT, UTP4.ACTION_JOINPOINT, UTP5.RENDER_JOINPOINT,
renderParameterConfigurator);
+ }
+
+ public void createExpiringCacheWithWindowState(PortletTestDriver registry)
+ {
+ createCacheMarkup("ExpiringCacheWithWindowState", registry,
UTP6.RENDER_JOINPOINT, UTP6.ACTION_JOINPOINT, UTP7.RENDER_JOINPOINT,
windowStateConfigurator);
+ }
+
+ public void createExpiringCacheWithPortletMode(PortletTestDriver registry)
+ {
+ createCacheMarkup("ExpiringCacheWithPortletMode", registry,
UTP8.RENDER_JOINPOINT, UTP8.ACTION_JOINPOINT, UTP9.RENDER_JOINPOINT,
portletModeConfigurator);
+ }
+
+ /**
+ * Check that content is cached for at most 5 seconds in various situations.
+ */
+ public void createExpiringCache(PortletTestDriver registry)
+ {
+ final Set calls = new HashSet();
+ final String[] url = new String[1];
+ PortletTest seq = new PortletTest();
+ registry.addSequence("ExpiringCache", seq);
+
+ //
+ seq.addAction(0, UTP10.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws IOException, PortletException
+ {
+ // Content is not cached
+ calls.add("0");
+
+ // Refresh
+ url[0] = response.createRenderURL().toString();
+ return new InvokeGetResponse(url[0]);
+ }
+ });
+
+ //
+ seq.addAction(1, UTP10.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws IOException, PortletException
+ {
+ // Should not be called
+ calls.add("1");
+ return null;
+ }
+ });
+ seq.addAction(1, UTP11.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws IOException, PortletException
+ {
+ // Refresh
+ return new InvokeGetResponse(url[0]);
+ }
+ });
+
+ //
+ seq.addAction(2, UTP10.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws IOException, PortletException
+ {
+ // Could be called depending on whether the portal
+ // decides to invoke UTP2 or UTP3 first
+ // so if it's called we need to disable cache otherwise the next
+ // render will probably not be called
+ response.setProperty(RenderResponse.EXPIRATION_CACHE, "0");
+ return null;
+ }
+ });
+ seq.addAction(2, UTP11.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws IOException, PortletException
+ {
+ try
+ {
+ assertFalse(calls.contains("1"));
+
+ // Wait 5 seconds for the cache entry to be invalid
+ Thread.sleep(5 * 1000);
+
+ // Refresh
+ return new InvokeGetResponse(url[0]);
+ }
+ catch (InterruptedException e)
+ {
+ return new ErrorResponse(e);
+ }
+ }
+ });
+
+ //
+ seq.addAction(3, UTP10.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws IOException, PortletException
+ {
+ // Should be called
+ calls.add("3");
+
+ // Invoke the same but with different render parameter
+ PortletURL tmp = response.createRenderURL();
+ tmp.setParameter("abc", "def");
+ url[0] = tmp.toString();
+ return new InvokeGetResponse(url[0]);
+ }
+ });
+
+ //
+ seq.addAction(4, UTP10.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws IOException, PortletException
+ {
+ // Should be called
+ calls.add("4");
+
+ // Refresh
+ return new InvokeGetResponse(url[0]);
+ }
+ });
+
+ //
+ seq.addAction(5, UTP10.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws IOException, PortletException
+ {
+ // Should not be called
+ calls.add("5");
+ return null;
+ }
+ });
+ seq.addAction(5, UTP11.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws IOException, PortletException
+ {
+ // Refresh
+ return new InvokeGetResponse(url[0]);
+ }
+ });
+
+ //
+ seq.addAction(6, UTP10.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws IOException, PortletException
+ {
+ // Could be called depending on whether the portal
+ // decides to invoke UTP2 or UTP3 first
+ // so if it's called we need to disable cache otherwise the next
+ // render will probably not be called
+ response.setProperty(RenderResponse.EXPIRATION_CACHE, "0");
+ return null;
+ }
+ });
+ seq.addAction(6, UTP11.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws IOException, PortletException
+ {
+ try
+ {
+ assertFalse(calls.contains("5"));
+
+ // Wait 5 seconds for the cache entry to be invalid
+ Thread.sleep(5 * 1000);
+
+ // Refresh
+ return new InvokeGetResponse(url[0]);
+ }
+ catch (InterruptedException e)
+ {
+ return new ErrorResponse(e);
+ }
+ }
+ });
+
+ //
+ seq.addAction(7, UTP10.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws IOException, PortletException
+ {
+ // Should be called
+ calls.add("7");
+
+ //
+ Set expected = new
CollectionBuilder().add("0").add("3").add("4").add("7").toHashSet();
+ assertEquals(expected, calls);
+
+ // Refresh
+ return new EndTestResponse();
+ }
+ });
+ }
+
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/neverexpiringcache/NeverExpiringCacheSequenceBuilder.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/neverexpiringcache/NeverExpiringCacheSequenceBuilder.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/neverexpiringcache/NeverExpiringCacheSequenceBuilder.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -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.portlet.jsr168.ext.neverexpiringcache;
+
+import org.jboss.portal.test.portlet.jsr168.ext.common.AbstractCacheSequenceBuilder;
+import org.jboss.portal.test.portlet.framework.UTP1;
+import org.jboss.portal.test.portlet.framework.UTP2;
+import org.jboss.portal.test.portlet.framework.UTP3;
+import org.jboss.portal.test.portlet.framework.UTP4;
+import org.jboss.portal.test.portlet.framework.UTP5;
+import org.jboss.portal.test.portlet.framework.UTP6;
+import org.jboss.portal.test.portlet.framework.UTP7;
+import org.jboss.portal.test.portlet.framework.UTP8;
+import org.jboss.portal.test.portlet.framework.UTP9;
+import org.jboss.portal.test.framework.portlet.PortletTestDriver;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class NeverExpiringCacheSequenceBuilder extends AbstractCacheSequenceBuilder
+{
+
+ public void createDisableDuringRenderNeverExpiringCache(PortletTestDriver registry)
+ {
+ createDisableDuringRender("DisableDuringRenderNeverExpiringCache",
registry, UTP1.RENDER_JOINPOINT, UTP1.ACTION_JOINPOINT);
+ }
+
+ public void createActionInvalidatesNeverExpiringCache(PortletTestDriver registry)
+ {
+ createActionInvalidates("ActionInvalidatesNeverExpiringCache", registry,
UTP2.RENDER_JOINPOINT, UTP2.ACTION_JOINPOINT, UTP3.RENDER_JOINPOINT);
+ }
+
+ public void createNeverExpiringCacheWithRenderParameters(PortletTestDriver registry)
+ {
+ createCacheMarkup("NeverExpiringCacheWithRenderParameters", registry,
UTP4.RENDER_JOINPOINT, UTP4.ACTION_JOINPOINT, UTP5.RENDER_JOINPOINT,
renderParameterConfigurator);
+ }
+
+ public void createNeverExpiringCacheWithWindowState(PortletTestDriver registry)
+ {
+ createCacheMarkup("NeverExpiringCacheWithWindowState", registry,
UTP6.RENDER_JOINPOINT, UTP6.ACTION_JOINPOINT, UTP7.RENDER_JOINPOINT,
windowStateConfigurator);
+ }
+
+ public void createNeverExpiringCacheWithPortletMode(PortletTestDriver registry)
+ {
+ createCacheMarkup("NeverExpiringCacheWithPortletMode", registry,
UTP8.RENDER_JOINPOINT, UTP8.ACTION_JOINPOINT, UTP9.RENDER_JOINPOINT,
portletModeConfigurator);
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/nocache/NoCacheSequenceBuilder.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/nocache/NoCacheSequenceBuilder.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/nocache/NoCacheSequenceBuilder.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,228 @@
+/******************************************************************************
+ * 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.jsr168.ext.nocache;
+
+import org.jboss.portal.test.framework.portlet.PortletTestSuite;
+import org.jboss.portal.test.framework.portlet.PortletTestDriver;
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.Joinpoint;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.framework.portlet.actions.PortletActionTestAction;
+import org.jboss.portal.test.framework.driver.http.response.InvokeGetResponse;
+import org.jboss.portal.test.portlet.framework.UTP1;
+import org.jboss.portal.test.portlet.framework.UTP2;
+import org.jboss.portal.test.portlet.framework.UTP3;
+import org.jboss.portal.test.portlet.framework.UTP4;
+import org.jboss.portal.test.framework.driver.DriverResponse;
+import org.jboss.portal.test.framework.driver.response.EndTestResponse;
+import org.jboss.portal.test.framework.driver.response.ErrorResponse;
+import org.jboss.portal.common.util.CollectionBuilder;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.PortletException;
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import java.util.Set;
+import java.util.HashSet;
+import java.io.IOException;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class NoCacheSequenceBuilder extends PortletTestSuite
+{
+
+ public void createExplicitNoCache(PortletTestDriver registry)
+ {
+ create("ExplicitNoCache", registry, UTP1.RENDER_JOINPOINT,
UTP1.ACTION_JOINPOINT, UTP2.RENDER_JOINPOINT);
+ }
+
+ public void createImplicitNoCache(PortletTestDriver registry)
+ {
+ create("ImplicitNoCache", registry, UTP3.RENDER_JOINPOINT,
UTP3.ACTION_JOINPOINT, UTP4.RENDER_JOINPOINT);
+ }
+
+ /**
+ * Setting expiration cache value force caching for a certain amount of time and
+ * can be invalidated by an action or by time.
+ */
+ private void create(
+ String testName,
+ PortletTestDriver registry,
+ Joinpoint p1renderjp,
+ Joinpoint p1actionjp,
+ Joinpoint p2renderjp)
+ {
+ final Set calls = new HashSet();
+ final String[] url = new String[1];
+ PortletTest seq = new PortletTest();
+ registry.addSequence(testName, seq);
+
+ //
+ seq.addAction(0, p1renderjp, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws IOException, PortletException
+ {
+ // Should be called
+ calls.add("0");
+
+ // Refresh
+ url[0] = response.createRenderURL().toString();
+ return new InvokeGetResponse(url[0]);
+ }
+ });
+
+ //
+ seq.addAction(1, p1renderjp, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws IOException, PortletException
+ {
+ // Should be called
+ calls.add("1");
+ response.setProperty(RenderResponse.EXPIRATION_CACHE, "0");
+
+ // Refresh
+ return new InvokeGetResponse(url[0]);
+ }
+ });
+
+ //
+ seq.addAction(2, p1renderjp, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws IOException, PortletException
+ {
+ // Should be called
+ calls.add("2");
+ response.setProperty(RenderResponse.EXPIRATION_CACHE, "5");
+
+ // Refresh
+ return new InvokeGetResponse(url[0]);
+ }
+ });
+
+ //
+ seq.addAction(3, p1renderjp, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws IOException, PortletException
+ {
+ // Should not be called
+ calls.add("3");
+ return null;
+ }
+ });
+ seq.addAction(3, p2renderjp, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws IOException, PortletException
+ {
+ // Refresh
+ return new InvokeGetResponse(url[0]);
+ }
+ });
+
+ //
+ seq.addAction(4, p1renderjp, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws IOException, PortletException
+ {
+ // Could be called or not depending on the page rendering ordre
+ return null;
+ }
+ });
+ seq.addAction(4, p2renderjp, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws IOException, PortletException
+ {
+ try
+ {
+ // Wait 5 seconds for the cache entry to be invalid
+ Thread.sleep(5 * 1000);
+
+ // Refresh
+ return new InvokeGetResponse(url[0]);
+ }
+ catch (InterruptedException e)
+ {
+ return new ErrorResponse(e);
+ }
+ }
+ });
+
+ //
+ seq.addAction(5, p1renderjp, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws IOException, PortletException
+ {
+ // Should be called
+ calls.add("5");
+ response.setProperty(RenderResponse.EXPIRATION_CACHE, "5");
+ url[0] = response.createActionURL().toString();
+ return new InvokeGetResponse(url[0]);
+ }
+ });
+
+ //
+ seq.addAction(6, p1actionjp, new PortletActionTestAction()
+ {
+ protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context) throws PortletException, IOException
+ {
+ // Should be called
+ calls.add("6_action");
+ }
+ });
+ seq.addAction(6, p1renderjp, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws IOException, PortletException
+ {
+ // Should be called
+ calls.add("6_render");
+ return new InvokeGetResponse(response.createRenderURL().toString());
+ }
+ });
+
+ //
+ seq.addAction(7, p1renderjp, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws IOException, PortletException
+ {
+ //
+ return null;
+ }
+ });
+ seq.addAction(7, p2renderjp, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws IOException, PortletException
+ {
+ //
+ Set expected = new
CollectionBuilder().add("0").add("1").add("2").add("5").add("6_render").add("6_action").toHashSet();
+ assertEquals(expected, calls);
+
+ // Refresh
+ return new EndTestResponse();
+ }
+ });
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletconfig/PortletConfigSequenceBuilder.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletconfig/PortletConfigSequenceBuilder.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletconfig/PortletConfigSequenceBuilder.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,167 @@
+/******************************************************************************
+ * 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.jsr168.ext.portletconfig;
+
+import org.jboss.portal.test.framework.driver.response.EndTestResponse;
+import org.jboss.portal.test.framework.driver.DriverResponse;
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestDriver;
+import org.jboss.portal.test.framework.portlet.PortletTestSuite;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.framework.portlet.components.AbstractUniversalTestPortlet;
+import
org.jboss.portal.test.portlet.jsr168.ext.portletconfig.extended.GetResourceBundleDuringInitPortlet;
+import
org.jboss.portal.test.portlet.jsr168.ext.portletconfig.extended.ResourceBundleCascadePortlet;
+import
org.jboss.portal.test.portlet.jsr168.ext.portletconfig.extended.ResourceBundlePortlet;
+
+import javax.portlet.Portlet;
+import javax.portlet.PortletConfig;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import java.util.Locale;
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 7954 $
+ */
+public class PortletConfigSequenceBuilder extends PortletTestSuite
+{
+ public void createGetResourceBundleDuringInit(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("GetResourceBundleDuringInit", seq);
+
+ seq.addAction(0, GetResourceBundleDuringInitPortlet.RENDER_JOINPOINT, new
PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ ResourceBundle bundle = GetResourceBundleDuringInitPortlet.bundle;
+ assertNotNull(bundle);
+ assertEquals("bar", bundle.getObject("foo"));
+ assertEquals(Locale.ENGLISH, bundle.getLocale());
+ return new EndTestResponse();
+ }
+ });
+ }
+
+
+ public void createResourceBundleCascade(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("ResourceBundleCascade", seq);
+
+ seq.addAction(0, ResourceBundleCascadePortlet.RENDER_JOINPOINT, new
PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ PortletConfig cfg =
((AbstractUniversalTestPortlet)portlet).getPortletConfig();
+
+ ResourceBundle bundle_en = cfg.getResourceBundle(Locale.ENGLISH);
+ ResourceBundle bundle_it = cfg.getResourceBundle(Locale.ITALIAN);
+ ResourceBundle bundle_zz = cfg.getResourceBundle(new
Locale("zz"));
+ ResourceBundle bundle_en_GB = cfg.getResourceBundle(Locale.UK);
+ ResourceBundle bundle_de = cfg.getResourceBundle(Locale.GERMAN);
+ ResourceBundle bundle_de_DE = cfg.getResourceBundle(Locale.GERMANY);
+ ResourceBundle bundle_fr = cfg.getResourceBundle(Locale.FRENCH);
+ ResourceBundle bundle_fr_FR = cfg.getResourceBundle(Locale.FRANCE);
+ ResourceBundle bundle_fr_FR_aa = cfg.getResourceBundle(new
Locale(Locale.FRANCE.getLanguage(), Locale.FRANCE.getCountry(), "aa"));
+
+ assertEquals(Locale.ENGLISH, bundle_en.getLocale());
+ assertEquals(Locale.ENGLISH, bundle_it.getLocale());
+ assertEquals(Locale.ENGLISH, bundle_zz.getLocale());
+ assertEquals(Locale.UK, bundle_en_GB.getLocale());
+ assertEquals(Locale.GERMAN, bundle_de.getLocale());
+ assertEquals(Locale.GERMANY, bundle_de_DE.getLocale());
+ assertEquals(Locale.FRENCH, bundle_fr.getLocale());
+ assertEquals(Locale.FRANCE, bundle_fr_FR.getLocale());
+ assertEquals(Locale.FRANCE, bundle_fr_FR_aa.getLocale());
+
+ assertEquals("title",
bundle_en.getString("javax.portlet.title"));
+ assertEquals("title",
bundle_it.getString("javax.portlet.title"));
+ assertEquals("title",
bundle_zz.getString("javax.portlet.title"));
+ assertEquals("title",
bundle_en_GB.getString("javax.portlet.title"));
+ assertEquals("title",
bundle_de.getString("javax.portlet.title"));
+ assertEquals("title",
bundle_de_DE.getString("javax.portlet.title"));
+ assertEquals("title",
bundle_fr.getString("javax.portlet.title"));
+ assertEquals("title",
bundle_fr_FR.getString("javax.portlet.title"));
+ assertEquals("title",
bundle_fr_FR_aa.getString("javax.portlet.title"));
+
+ assertEquals("short-title",
bundle_en.getString("javax.portlet.short-title"));
+ assertEquals("short-title",
bundle_it.getString("javax.portlet.short-title"));
+ assertEquals("short-title",
bundle_zz.getString("javax.portlet.short-title"));
+ assertEquals("short-title",
bundle_de.getString("javax.portlet.short-title"));
+ assertEquals("short-title_de_DE",
bundle_de_DE.getString("javax.portlet.short-title"));
+ assertEquals("short-title_fr",
bundle_fr.getString("javax.portlet.short-title"));
+ assertEquals("short-title_fr_FR",
bundle_fr_FR.getString("javax.portlet.short-title"));
+ assertEquals("short-title_fr_FR",
bundle_fr_FR_aa.getString("javax.portlet.short-title"));
+
+ assertThrowsMissingResourceException(bundle_en);
+ assertThrowsMissingResourceException(bundle_it);
+ assertThrowsMissingResourceException(bundle_zz);
+ assertThrowsMissingResourceException(bundle_de);
+ assertThrowsMissingResourceException(bundle_de_DE);
+ assertThrowsMissingResourceException(bundle_fr);
+ assertThrowsMissingResourceException(bundle_fr_FR);
+ assertThrowsMissingResourceException(bundle_fr_FR_aa);
+ return new EndTestResponse();
+ }
+
+ private void assertThrowsMissingResourceException(ResourceBundle bundle)
+ {
+ try
+ {
+ bundle.getString("javax.portlet.keywords");
+ fail();
+ }
+ catch (MissingResourceException expected)
+ {
+ }
+ }
+ });
+ }
+
+ public void createResourceBundle(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("ResourceBundle", seq);
+
+ seq.addAction(0, ResourceBundlePortlet.RENDER_JOINPOINT, new
PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ PortletConfig cfg =
((AbstractUniversalTestPortlet)portlet).getPortletConfig();
+ ResourceBundle bundle = cfg.getResourceBundle(Locale.ENGLISH);
+
+ String example = bundle.getString("example-key");
+ assertEquals("example-value", example);
+
+ //
+ String title = bundle.getString("javax.portlet.title");
+ assertEquals("the title", title);
+ return new EndTestResponse();
+ }
+ });
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletconfig/PortletConfigSequenceBuilder.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletconfig/extended/GetResourceBundleDuringInitPortlet.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletconfig/extended/GetResourceBundleDuringInitPortlet.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletconfig/extended/GetResourceBundleDuringInitPortlet.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,75 @@
+/******************************************************************************
+ * 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.jsr168.ext.portletconfig.extended;
+
+import org.jboss.portal.test.framework.portlet.Joinpoint;
+import org.jboss.portal.test.framework.portlet.components.AbstractUniversalTestPortlet;
+
+import javax.portlet.PortletConfig;
+import javax.portlet.PortletException;
+import java.util.Locale;
+import java.util.ResourceBundle;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.com">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 5572 $
+ */
+public class GetResourceBundleDuringInitPortlet extends AbstractUniversalTestPortlet
+{
+ public static ResourceBundle bundle = null;
+
+ public static ThreadLocal local = new ThreadLocal();
+
+ public static String NAME = "GetResourceBundleDuringInitPortlet";
+
+ public final static Joinpoint RENDER_JOINPOINT = new Joinpoint(NAME,
Joinpoint.PORTLET_RENDER);
+
+ public final static Joinpoint ACTION_JOINPOINT = new Joinpoint(NAME,
Joinpoint.PORTLET_ACTION);
+
+ protected String createComponentId()
+ {
+ return NAME;
+ }
+
+ protected void reset()
+ {
+ local.set(null);
+ }
+
+ public void init(PortletConfig config) throws PortletException
+ {
+ super.init(config);
+
+ //
+ try
+ {
+ bundle = config.getResourceBundle(Locale.ENGLISH);
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletconfig/extended/GetResourceBundleDuringInitPortlet.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletconfig/extended/ResourceBundleCascadePortlet.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletconfig/extended/ResourceBundleCascadePortlet.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletconfig/extended/ResourceBundleCascadePortlet.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,53 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.portlet.jsr168.ext.portletconfig.extended;
+
+import org.jboss.portal.test.framework.portlet.Joinpoint;
+import org.jboss.portal.test.framework.portlet.components.AbstractUniversalTestPortlet;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.com">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 5448 $
+ */
+public class ResourceBundleCascadePortlet extends AbstractUniversalTestPortlet
+{
+
+ public static ThreadLocal local = new ThreadLocal();
+
+ public static String NAME = "ResourceBundleCascadePortlet";
+
+ public final static Joinpoint RENDER_JOINPOINT = new Joinpoint(NAME,
Joinpoint.PORTLET_RENDER);
+
+ public final static Joinpoint ACTION_JOINPOINT = new Joinpoint(NAME,
Joinpoint.PORTLET_ACTION);
+
+ protected String createComponentId()
+ {
+ return NAME;
+ }
+
+ protected void reset()
+ {
+ local.set(null);
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletconfig/extended/ResourceBundleCascadePortlet.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletconfig/extended/ResourceBundlePortlet.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletconfig/extended/ResourceBundlePortlet.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletconfig/extended/ResourceBundlePortlet.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,53 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.portlet.jsr168.ext.portletconfig.extended;
+
+import org.jboss.portal.test.framework.portlet.Joinpoint;
+import org.jboss.portal.test.framework.portlet.components.AbstractUniversalTestPortlet;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.com">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 5448 $
+ */
+public class ResourceBundlePortlet extends AbstractUniversalTestPortlet
+{
+ public static ThreadLocal local = new ThreadLocal();
+
+ public static String NAME = "ResourceBundlePortlet";
+
+ public final static Joinpoint RENDER_JOINPOINT = new Joinpoint(NAME,
Joinpoint.PORTLET_RENDER);
+
+ public final static Joinpoint ACTION_JOINPOINT = new Joinpoint(NAME,
Joinpoint.PORTLET_ACTION);
+
+ protected String createComponentId()
+ {
+ return NAME;
+ }
+
+ protected void reset()
+ {
+ local = new ThreadLocal();
+ }
+
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletconfig/extended/ResourceBundlePortlet.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletmode/PortletModeSequenceBuilder.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletmode/PortletModeSequenceBuilder.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletmode/PortletModeSequenceBuilder.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,148 @@
+/******************************************************************************
+ * 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.jsr168.ext.portletmode;
+
+import org.jboss.portal.test.framework.driver.response.EndTestResponse;
+import org.jboss.portal.test.framework.driver.http.response.InvokeGetResponse;
+import org.jboss.portal.test.framework.driver.DriverResponse;
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestDriver;
+import org.jboss.portal.test.framework.portlet.PortletTestSuite;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.actions.PortletActionTestAction;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.framework.UTP1;
+import
org.jboss.portal.test.portlet.jsr168.ext.portletmode.extended.TestActionWithPortletModePortlet;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.Portlet;
+import javax.portlet.PortletMode;
+import javax.portlet.PortletModeException;
+import javax.portlet.PortletURL;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 7954 $
+ */
+public class PortletModeSequenceBuilder extends PortletTestSuite
+{
+ public void createTestActionWithPortletModeCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("TestActionWithPortletMode", seq);
+ seq.addAction(0, TestActionWithPortletModePortlet.RENDER_JOINPOINT, new
PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws PortletModeException
+ {
+ PortletURL url = response.createActionURL();
+ url.setPortletMode(PortletMode.EDIT);
+ InvokeGetResponse result = new InvokeGetResponse(url.toString());
+ return result;
+ }
+ });
+
+ seq.addAction(1, TestActionWithPortletModePortlet.ACTION_JOINPOINT, new
PortletActionTestAction()
+ {
+ protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context)
+ {
+ assertEquals(PortletMode.EDIT, request.getPortletMode());
+ }
+ });
+
+ seq.addAction(1, TestActionWithPortletModePortlet.RENDER_JOINPOINT, new
PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ public void createTestDuringActionCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("TestDuringAction", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ PortletURL url = response.createActionURL();
+ InvokeGetResponse result = new InvokeGetResponse(url.toString());
+ return result;
+ }
+ });
+
+ seq.addAction(1, UTP1.ACTION_JOINPOINT, new PortletActionTestAction()
+ {
+ protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context) throws PortletModeException
+ {
+ // Test we can set null portlet mode
+ response.setPortletMode(null);
+ }
+ });
+
+ seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new EndTestResponse();
+ }
+ });
+
+ }
+
+ public void createTestDuringRenderCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("TestDuringRender", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws PortletModeException
+ {
+ // Test null returns false
+ assertFalse(request.isPortletModeAllowed(null));
+
+ // Test that we can use set the portlet mode on render URL
+ // before having set the content type on the response
+ PortletURL url1 = response.createRenderURL();
+ url1.setPortletMode(PortletMode.VIEW);
+
+ // Test we can set null portlet mode
+ url1.setPortletMode(null);
+
+ // Test that we can use set the portlet mode on action URL
+ // before having set the content type on the response
+ PortletURL url2 = response.createActionURL();
+ url2.setPortletMode(PortletMode.VIEW);
+
+ // Test we can set null portlet mode
+ url2.setPortletMode(null);
+ return new EndTestResponse();
+ }
+ });
+ }
+
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletmode/PortletModeSequenceBuilder.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletmode/extended/TestActionWithPortletModePortlet.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletmode/extended/TestActionWithPortletModePortlet.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletmode/extended/TestActionWithPortletModePortlet.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,97 @@
+/******************************************************************************
+ * 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.jsr168.ext.portletmode.extended;
+
+import org.jboss.portal.test.framework.portlet.Joinpoint;
+import org.jboss.portal.test.framework.portlet.components.AbstractUniversalTestPortlet;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.com">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 5448 $
+ */
+public class TestActionWithPortletModePortlet extends AbstractUniversalTestPortlet
+{
+
+ public static String NAME = "TestActionWithPortletModePortlet";
+
+ public final static Joinpoint RENDER_JOINPOINT = new
Joinpoint(org.jboss.portal.test.portlet.jsr168.ext.portletmode.extended.TestActionWithPortletModePortlet.NAME,
Joinpoint.PORTLET_RENDER);
+
+ public final static Joinpoint ACTION_JOINPOINT = new
Joinpoint(org.jboss.portal.test.portlet.jsr168.ext.portletmode.extended.TestActionWithPortletModePortlet.NAME,
Joinpoint.PORTLET_ACTION);
+
+ protected String createComponentId()
+ {
+ return
org.jboss.portal.test.portlet.jsr168.ext.portletmode.extended.TestActionWithPortletModePortlet.NAME;
+ }
+
+ /*private AssertResult result;
+
+ protected void doProcessAction(final ActionRequest req, ActionResponse resp) throws
PortletException, PortletSecurityException, IOException
+ {
+
+ if (TestContext.getCurrentRequestCount() == 1 && result == null);
+ {
+ result = new AssertResult();
+ result.execute(new AssertResult.Test()
+ {
+ public void run() throws Exception
+ {
+ // Test we get the right portlet mode
+ assertEquals(PortletMode.EDIT, req.getPortletMode());
+ }
+ });
+ }
+ }
+
+ protected void doRender(RenderRequest req, RenderResponse resp) throws
PortletException, PortletSecurityException, IOException
+ {
+ if (result == null)
+ {
+ if (TestContext.getCurrentRequestCount() == 0)
+ {
+ PortletURL url = resp.createActionURL();
+ url.setPortletMode(PortletMode.EDIT);
+ InvokeGetResult result = new InvokeGetResult();
+ result.setURL(url.toString());
+ marshall(result, resp, TestContext.getCurrentTestCaseId());
+ }
+ else
+ {
+ marshall(new FailureResult("The assert result was expected to be not
null"), resp, TestContext.getCurrentTestCaseId());
+ }
+ }
+ else
+ {
+ if (TestContext.getCurrentRequestCount() == 0)
+ {
+ marshall(new FailureResult("The assert result was expected to be not
null"), resp, TestContext.getCurrentTestCaseId());
+ }
+ else if (TestContext.getCurrentRequestCount() == 1)
+ {
+ marshall(result, resp, TestContext.getCurrentTestCaseId());
+ result = null;
+
+ }
+ }
+ }*/
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletmode/extended/TestActionWithPortletModePortlet.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletrequests/PortletRequestsSequenceBuilder.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletrequests/PortletRequestsSequenceBuilder.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletrequests/PortletRequestsSequenceBuilder.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,464 @@
+/******************************************************************************
+ * 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.jsr168.ext.portletrequests;
+
+import org.jboss.portal.common.util.Tools;
+import org.jboss.portal.test.framework.driver.response.EndTestResponse;
+import org.jboss.portal.test.framework.driver.http.response.InvokeGetResponse;
+import org.jboss.portal.test.framework.driver.DriverResponse;
+import org.jboss.portal.common.http.HttpRequest;
+import org.jboss.portal.common.io.IOTools;
+import org.jboss.portal.test.framework.driver.http.response.InvokePostResponse;
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestDriver;
+import org.jboss.portal.test.framework.portlet.PortletTestSuite;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.actions.PortletActionTestAction;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.framework.UTP1;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.Portlet;
+import javax.portlet.PortletURL;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.Reader;
+import java.io.StringWriter;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 7954 $
+ */
+public class PortletRequestsSequenceBuilder extends PortletTestSuite
+{
+
+ private final byte[] byteContent = {65, 66, 67, 68, 69, 70};
+
+ /**
+ * Test that a POST request having a content type set to x-www-form-urlencoded will
make the body content unavailable
+ * as an input stream or a reader and the parameters are decoded.
+ */
+ public void createActionRequestUseFormCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("ActionRequestUseForm", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ InvokePostResponse iur = new InvokePostResponse();
+ PortletURL url = response.createActionURL();
+ url.setParameter("g_foo1", "g_bar1_1");
+ url.setParameter("g_foo2", new String[]{"g_bar2_1",
"g_bar2_2"});
+ url.setParameter("g_foo3", new String[]{"g_bar3_1"});
+ iur.setURL(url.toString());
+ HttpRequest.Form body = new HttpRequest.Form();
+ body.addParameter("g_foo3", new String[]{"g_bar3_2"});
+ body.addParameter("g_foo4", new String[]{"g_bar4_1"});
+ body.addParameter("g_foo5", new String[]{"g_bar5_1",
"g_bar5_2"});
+ iur.setBody(body);
+ iur.setContentType(InvokePostResponse.APPLICATION_X_WWW_FORM_URLENCODED);
+ return iur;
+ }
+ });
+
+ seq.addAction(1, UTP1.ACTION_JOINPOINT, new PortletActionTestAction()
+ {
+ protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context) throws IOException
+ {
+ assertEquals(new String[]{"g_bar1_1"},
request.getParameterValues("g_foo1"));
+ assertEquals(new String[]{"g_bar2_1", "g_bar2_2"},
request.getParameterValues("g_foo2"));
+ assertEquals(new String[]{"g_bar3_1", "g_bar3_2"},
request.getParameterValues("g_foo3"));
+ assertEquals(new String[]{"g_bar4_1"},
request.getParameterValues("g_foo4"));
+ assertEquals(new String[]{"g_bar5_1", "g_bar5_2"},
request.getParameterValues("g_foo5"));
+ assertEquals(InvokePostResponse.APPLICATION_X_WWW_FORM_URLENCODED,
request.getContentType());
+
+ try
+ {
+ request.getPortletInputStream();
+ fail("Should not get the input stream");
+ }
+ catch (IllegalStateException expected)
+ {
+ //expected
+ }
+
+ try
+ {
+ request.getReader();
+ fail("Should not get the reader");
+ }
+ catch (IllegalStateException expected)
+ {
+ //expected
+ }
+ }
+ });
+
+ seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ /**
+ * Test that a POST request having a content type not set to x-www-form-urlencoded
will make the body content
+ * available as an input stream.
+ */
+ public void createActionRequestUseInputStreamCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("ActionRequestUseInputStream", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ InvokePostResponse iur = new InvokePostResponse();
+ PortletURL url = response.createActionURL();
+ url.setParameter("g_foo1", "g_bar1_1");
+ url.setParameter("g_foo2", new String[]{"g_bar2_1",
"g_bar2_2"});
+ iur.setURL(url.toString());
+ HttpRequest.Raw body = new HttpRequest.Raw();
+ body.setBytes(byteContent);
+ iur.setBody(body);
+ iur.setContentType(InvokePostResponse.MULTIPART_FORM_DATA);
+ return iur;
+ }
+ });
+
+ seq.addAction(1, UTP1.ACTION_JOINPOINT, new PortletActionTestAction()
+ {
+
+ protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context) throws IOException
+ {
+
+ assertEquals(new String[]{"g_bar1_1"},
request.getParameterValues("g_foo1"));
+ assertEquals(new String[]{"g_bar2_1", "g_bar2_2"},
request.getParameterValues("g_foo2"));
+ assertEquals(InvokePostResponse.MULTIPART_FORM_DATA,
request.getContentType());
+ assertEquals(byteContent.length, request.getContentLength());
+ InputStream in = null;
+ try
+ {
+ in = request.getPortletInputStream();
+ ByteArrayOutputStream out = new ByteArrayOutputStream();
+ IOTools.copy(in, out);
+ out.close();
+ byte[] bytes = out.toByteArray();
+ assertEquals(-1, in.read());
+ assertEquals(byteContent, bytes);
+ }
+ catch (IllegalStateException e)
+ {
+ fail("Was not expecting an ISE");
+ }
+ catch (IOException e)
+ {
+ fail("Was not expecting an IOException");
+ }
+ finally
+ {
+ IOTools.safeClose(in);
+ }
+ try
+ {
+ request.getReader();
+ fail("The reader should not be available");
+ }
+ catch (IllegalStateException expected)
+ {
+ }
+ }
+ });
+
+ seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ /**
+ * Test that a POST request having a content type not set to x-www-form-urlencoded
will make the body content
+ * available as a reader.
+ */
+ public void createActionRequestUseReaderCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("ActionRequestUseReader", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ InvokePostResponse iur = new InvokePostResponse();
+ PortletURL url = response.createActionURL();
+ url.setParameter("g_foo1", "g_bar1_1");
+ url.setParameter("g_foo2", new String[]{"g_bar2_1",
"g_bar2_2"});
+ iur.setURL(url.toString());
+ HttpRequest.Raw body = new HttpRequest.Raw();
+ body.setBytes(byteContent);
+ iur.setBody(body);
+ iur.setContentType(InvokePostResponse.MULTIPART_FORM_DATA);
+ return iur;
+ }
+ });
+
+ seq.addAction(1, UTP1.ACTION_JOINPOINT, new PortletActionTestAction()
+ {
+ protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context) throws IOException
+ {
+ assertEquals(new String[]{"g_bar1_1"},
request.getParameterValues("g_foo1"));
+ assertEquals(new String[]{"g_bar2_1", "g_bar2_2"},
request.getParameterValues("g_foo2"));
+ assertEquals(InvokePostResponse.MULTIPART_FORM_DATA,
request.getContentType());
+ assertEquals(byteContent.length, request.getContentLength());
+ Reader in = null;
+ try
+ {
+ in = request.getReader();
+ StringWriter out = new StringWriter();
+ IOTools.copy(in, out);
+ out.close();
+ byte[] bytes = out.toString().getBytes("UTF-8");
+ assertEquals(-1, in.read());
+ assertEquals(byteContent, bytes);
+ }
+ catch (IllegalStateException e)
+ {
+ fail("Was not expecting an ISE");
+ }
+ catch (IOException e)
+ {
+ fail("Was not expecting an IOException");
+ }
+ finally
+ {
+ IOTools.safeClose(in);
+ }
+ try
+ {
+ request.getPortletInputStream();
+ fail("The inputstream should not be available");
+ }
+ catch (IllegalStateException expected)
+ {
+ }
+ }
+ });
+
+ seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ /**
+ * This case works with two portlets involved in the same render request. To pass the
test, the assert result of the
+ * two portlets must pass.
+ */
+ public void createRequestAttributeCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("RequestAttribute", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ // Take a snapshot of the attribute names
+ Set snapshot = Tools.toSet(request.getAttributeNames());
+
+ // Test that we can remove an attribute without affecting the incoming
request, i.e
+ // the same attribute will be present in other render request
+ assertNotNull(request.getAttribute("javax.portlet.config"));
+ request.removeAttribute("javax.portlet.config");
+ assertNull(request.getAttribute("javax.portlet.config"));
+
+ // Test addition of an attribute
+ request.setAttribute("bar", "bar");
+ assertEquals("bar", request.getAttribute("bar"));
+
+ // Test the portlet request names are what we expect
+ HashSet expectedNames = new HashSet(snapshot);
+ expectedNames.remove("javax.portlet.config");
+ expectedNames.add("bar");
+ assertEquals(expectedNames, Tools.toSet(request.getAttributeNames()));
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ /**
+ * This case works with two portlets involved in the same render request. To pass the
test, the assert result of the
+ * two portlets must pass.
+ */
+ public void createRequestAttributeScopingCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("RequestAttributeScoping", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ assertNull(request.getAttribute("foo"));
+ request.setAttribute("foo", "foo");
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ public void createRequestParameterCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("RequestParameter", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ PortletURL url = response.createActionURL();
+ url.setParameter("foo1", "bar1");
+ url.setParameter("foo2", new String[]{"bar2_1",
"bar2_2"});
+ return new InvokeGetResponse(url.toString());
+ }
+ });
+
+ seq.addAction(1, UTP1.ACTION_JOINPOINT, new PortletActionTestAction()
+ {
+ protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context)
+ {
+ // The expected map
+ Map expectedParameterMap = new HashMap();
+ expectedParameterMap.put("foo1", Tools.toSet(new
String[]{"bar1"}));
+ expectedParameterMap.put("foo2", Tools.toSet(new
String[]{"bar2_1", "bar2_2"}));
+
+ // Transform the map to be comparable
+ Map parameterMap = new HashMap(request.getParameterMap());
+ for (Iterator i = parameterMap.entrySet().iterator(); i.hasNext();)
+ {
+ Map.Entry entry = (Map.Entry)i.next();
+ String[] values = (String[])entry.getValue();
+ entry.setValue(Tools.toSet(values));
+ }
+
+ // Compare both
+ assertEquals(expectedParameterMap, parameterMap);
+
+ //
+ Set enumeration = Tools.toSet(request.getParameterNames());
+ Set expectedEnumeration = Tools.toSet(new Object[]{"foo1",
"foo2"});
+ assertEquals(expectedEnumeration, enumeration);
+ }
+ });
+
+ seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new EndTestResponse();
+ }
+ });
+ }
+
+
+ /** Show that we can access request headers from the portlet request properties. */
+ public void createRequestHeaderAccess(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("RequestHeaderAccess", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ // Test the value is not there yet
+ Set propertyNames = Tools.toSet(request.getPropertyNames());
+ assertFalse(propertyNames.contains("myheader"));
+ assertNull(request.getProperty("myheader"));
+ assertFalse(request.getProperties("myheader").hasMoreElements());
+
+ // Invoke render with header
+ InvokeGetResponse render = new
InvokeGetResponse(response.createRenderURL().toString());
+ render.addHeader("myheader").addElement("render-value");
+ return render;
+ }
+ });
+
+ seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ // Test the header is here
+ Set propertyNames = Tools.toSet(request.getPropertyNames());
+ assertTrue(propertyNames.contains("myheader"));
+ assertEquals("render-value",
request.getProperty("myheader"));
+ Enumeration values = request.getProperties("myheader");
+ assertTrue(values.hasMoreElements());
+ assertEquals("render-value", values.nextElement());
+ assertFalse(values.hasMoreElements());
+
+ // Invoke action with header
+ InvokeGetResponse action = new
InvokeGetResponse(response.createActionURL().toString());
+ action.addHeader("myheader").addElement("action-value");
+ return action;
+ }
+ });
+
+ seq.addAction(2, UTP1.ACTION_JOINPOINT, new PortletActionTestAction()
+ {
+ protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context)
+ {
+ // Test the header is here
+ Set propertyNames = Tools.toSet(request.getPropertyNames());
+ assertTrue(propertyNames.contains("myheader"));
+ assertEquals("action-value",
request.getProperty("myheader"));
+ Enumeration values = request.getProperties("myheader");
+ assertTrue(values.hasMoreElements());
+ assertEquals("action-value", values.nextElement());
+ assertFalse(values.hasMoreElements());
+ }
+ });
+
+ seq.addAction(2, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new EndTestResponse();
+ }
+ });
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletrequests/PortletRequestsSequenceBuilder.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletresponses/PortletResponsesSequenceBuilder.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletresponses/PortletResponsesSequenceBuilder.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletresponses/PortletResponsesSequenceBuilder.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,65 @@
+/******************************************************************************
+ * 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.jsr168.ext.portletresponses;
+
+import org.jboss.portal.test.framework.driver.response.EndTestResponse;
+import org.jboss.portal.test.framework.driver.DriverResponse;
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestDriver;
+import org.jboss.portal.test.framework.portlet.PortletTestSuite;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.framework.UTP1;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 7954 $
+ */
+public class PortletResponsesSequenceBuilder extends PortletTestSuite
+{
+ public void createContentTypeCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("ContentType", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ String responseContentType = request.getResponseContentType();
+ response.setContentType(responseContentType);
+ assertEquals(responseContentType, response.getContentType());
+
+ // Test that character encoding is ignored as specified by the spec in
PLT.12.3.1
+ response.setContentType(responseContentType + "; charset=UTF-8");
+ assertEquals(responseContentType, response.getContentType());
+ return new EndTestResponse();
+ }
+ });
+ }
+
+
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletresponses/PortletResponsesSequenceBuilder.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/preferences/PreferencesSequenceBuilder.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/preferences/PreferencesSequenceBuilder.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/preferences/PreferencesSequenceBuilder.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,240 @@
+/******************************************************************************
+ * 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.jsr168.ext.preferences;
+
+import org.jboss.portal.test.framework.driver.response.EndTestResponse;
+import org.jboss.portal.test.framework.driver.DriverResponse;
+import org.jboss.portal.test.framework.driver.http.response.InvokeGetResponse;
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestDriver;
+import org.jboss.portal.test.framework.portlet.PortletTestSuite;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.actions.PortletActionTestAction;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.framework.UTP2;
+import org.jboss.portal.test.portlet.framework.UTP4;
+import org.jboss.portal.test.portlet.framework.UTP3;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.Portlet;
+import javax.portlet.PortletPreferences;
+import javax.portlet.PortletURL;
+import javax.portlet.ReadOnlyException;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.ValidatorException;
+import java.io.IOException;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 7954 $
+ */
+public class PreferencesSequenceBuilder extends PortletTestSuite
+{
+
+ /**
+ * Asserts that isReadOnly() returns correct values during both render and action
phase
+ *
+ * @param registry
+ */
+ public void createIsReadOnlyCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("IsReadOnly", seq);
+
+
+ seq.addAction(0, UTP2.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ // Get prefs
+ PortletPreferences prefs = request.getPreferences();
+
+ //assert that isReadOnly returns correct values
+ assertEquals(true, prefs.isReadOnly("static_single_pref"));
+ assertEquals(false, prefs.isReadOnly("static_multi_pref"));
+ return new InvokeGetResponse(response.createActionURL().toString());
+ }
+ });
+
+ seq.addAction(1, UTP2.ACTION_JOINPOINT, new PortletActionTestAction()
+ {
+ protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context)
+ {
+ // Get prefs
+ PortletPreferences prefs = request.getPreferences();
+
+ //assert that isReadOnly returns correct values
+ assertEquals(true, prefs.isReadOnly("static_single_pref"));
+ assertEquals(false, prefs.isReadOnly("static_multi_pref"));
+ }
+ });
+
+ seq.addAction(1, UTP2.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ public void createStoreMustPersistAllChangesCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("StoreMustPersistAllChanges", seq);
+ seq.addAction(0, UTP4.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ PortletURL url = response.createActionURL();
+ return new InvokeGetResponse(url.toString());
+ }
+ });
+
+ seq.addAction(1, UTP4.ACTION_JOINPOINT, new PortletActionTestAction()
+ {
+ protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context) throws ReadOnlyException, IOException,
ValidatorException
+ {
+ // Get prefs
+ PortletPreferences prefs = request.getPreferences();
+
+ // Check the initial value are good
+ assertEquals("static_single_pref_value",
prefs.getValue("static_single_pref", "other"));
+ assertEquals(new String[]{"static_multi_pref_value_1",
"static_multi_pref_value_2"}, prefs.getValues("static_multi_pref", new
String[]{"other"}));
+ assertEquals("other",
prefs.getValue("dynamic_single_pref", "other"));
+ assertEquals(new String[]{"other"},
prefs.getValues("dynamic_multi_pref", new String[]{"other"}));
+
+ // Set values
+ prefs.setValue("static_single_pref",
"new_static_single_pref_value");
+ prefs.setValues("static_multi_pref", new
String[]{"new_static_multi_pref_value_1",
"new_static_multi_pref_value_2"});
+ prefs.setValue("dynamic_single_pref",
"new_dynamic_single_pref_value");
+ prefs.setValues("dynamic_multi_pref", new
String[]{"new_dynamic_multi_pref_value_1",
"new_dynamic_multi_pref_value_2"});
+
+ // Store
+ prefs.store();
+ }
+ });
+
+ seq.addAction(1, UTP4.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new InvokeGetResponse(response.createActionURL().toString());
+ }
+ });
+
+ seq.addAction(2, UTP4.ACTION_JOINPOINT, new PortletActionTestAction()
+ {
+ protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context)
+ {
+ // Get prefs
+ PortletPreferences prefs = request.getPreferences();
+
+ // Check the new value are good
+ assertEquals("new_static_single_pref_value",
prefs.getValue("static_single_pref", "other"));
+ assertEquals(new String[]{"new_static_multi_pref_value_1",
"new_static_multi_pref_value_2"}, prefs.getValues("static_multi_pref",
new String[]{"other"}));
+ assertEquals("new_dynamic_single_pref_value",
prefs.getValue("dynamic_single_pref", "other"));
+ assertEquals(new String[]{"new_dynamic_multi_pref_value_1",
"new_dynamic_multi_pref_value_2"},
prefs.getValues("dynamic_multi_pref", new String[]{"other"}));
+ }
+ });
+
+ seq.addAction(2, UTP4.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ public void createMapCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("Map", seq);
+
+ seq.addAction(0, UTP3.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new InvokeGetResponse(response.createActionURL().toString());
+ }
+ });
+
+ seq.addAction(1, UTP3.ACTION_JOINPOINT, new PortletActionTestAction()
+ {
+ protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context) throws ReadOnlyException
+ {
+ // Get prefs map
+ PortletPreferences prefs = request.getPreferences();
+ Map map = prefs.getMap();
+
+ //
+ assertEquals(2, map.size());
+ assertTrue(map.containsKey("single_pref"));
+ assertTrue(map.containsValue(new String[]{"single_pref_value"}));
+ assertEquals(new String[]{"single_pref_value"},
(Object[])map.get("single_pref"));
+ assertTrue(map.containsKey("multi_pref"));
+ assertTrue(map.containsValue(new String[]{"multi_pref_value_1",
"multi_pref_value_2"}));
+ assertEquals(new String[]{"multi_pref_value_1",
"multi_pref_value_2"}, (Object[])map.get("multi_pref"));
+
+ // Modify prefs
+ prefs.setValue("single_pref", "new_single_pref_value");
+ prefs.setValues("multi_pref", new
String[]{"new_multi_pref_value_1", "new_multi_pref_value_2"});
+
+ //
+ map = prefs.getMap();
+ assertEquals(2, map.size());
+ assertTrue(map.containsKey("single_pref"));
+ assertTrue(map.containsValue(new
String[]{"new_single_pref_value"}));
+ assertEquals(new String[]{"new_single_pref_value"},
(Object[])map.get("single_pref"));
+ assertTrue(map.containsKey("multi_pref"));
+ assertTrue(map.containsValue(new String[]{"new_multi_pref_value_1",
"new_multi_pref_value_2"}));
+ assertEquals(new String[]{"new_multi_pref_value_1",
"new_multi_pref_value_2"}, (Object[])map.get("multi_pref"));
+
+ // Modify prefs
+ prefs.setValue("single_pref", null);
+ prefs.setValues("multi_pref", null);
+
+ //
+ map = prefs.getMap();
+ assertEquals(2, map.size());
+ assertTrue(map.containsKey("single_pref"));
+ assertTrue(map.containsValue(new String[]{null}));
+ assertEquals(new String[]{null},
(Object[])map.get("single_pref"));
+ assertTrue(map.containsKey("multi_pref"));
+ assertEquals(new String[]{null}, (Object[])map.get("multi_pref"));
+ }
+ });
+
+ seq.addAction(1, UTP3.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new EndTestResponse();
+ }
+ });
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/preferences/PreferencesSequenceBuilder.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/session/SessionSequenceBuilder.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/session/SessionSequenceBuilder.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/session/SessionSequenceBuilder.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,164 @@
+/******************************************************************************
+ * 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.jsr168.ext.session;
+
+import org.jboss.portal.test.framework.driver.response.EndTestResponse;
+import org.jboss.portal.test.framework.driver.http.response.InvokeGetResponse;
+import org.jboss.portal.test.framework.driver.DriverResponse;
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestDriver;
+import org.jboss.portal.test.framework.portlet.PortletTestSuite;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.actions.PortletActionTestAction;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.framework.portlet.actions.ServletServiceTestAction;
+import org.jboss.portal.test.portlet.framework.UTP1;
+import org.jboss.portal.test.portlet.framework.UTS1;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.Portlet;
+import javax.portlet.PortletException;
+import javax.portlet.PortletSecurityException;
+import javax.portlet.PortletSession;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.servlet.Servlet;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
+import java.io.IOException;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 7954 $
+ */
+public class SessionSequenceBuilder extends PortletTestSuite
+{
+
+ /**
+ * Test that a session does not exist the first time the portlet is accessed.
+ *
+ * @param registry
+ */
+ public void createSessionDoesNotExistBeforeItIsRequested(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("SessionDoesNotExistBeforeItIsRequested", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ PortletSession session = request.getPortletSession(false);
+ assertNull(session);
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ /**
+ * .
+ *
+ * @param registry
+ */
+ public void createObtainNonNullSessionUsingCreateEqualsFalse(PortletTestDriver
registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("ObtainNonNullSessionUsingCreateEqualsFalse", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ PortletSession session = request.getPortletSession();
+ assertNotNull(session);
+ session.setAttribute("foo_1", "bar_1");
+ InvokeGetResponse igr = new
InvokeGetResponse(response.createActionURL().toString());
+ return igr;
+ }
+ });
+ seq.addAction(1, UTP1.ACTION_JOINPOINT, new PortletActionTestAction()
+ {
+ protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context) throws PortletException, PortletSecurityException,
IOException
+ {
+ PortletSession session = request.getPortletSession(false);
+ assertNotNull(session);
+ assertEquals("bar_1", session.getAttribute("foo_1"));
+ session.setAttribute("foo_2", "bar_2");
+ }
+ });
+ seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ PortletSession session = request.getPortletSession(false);
+ assertNotNull(session);
+ assertEquals("bar_1", session.getAttribute("foo_1"));
+ assertEquals("bar_2", session.getAttribute("foo_2"));
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ /**
+ * The goal is to test that cross context session attributes are set in container and
are accessible from the direct
+ * servlet.
+ * <p/>
+ * 1/ portlet put key=value in the http session 2/ portlet ask the client to perform
get on /servlet 3/ servlet check
+ * that key=value
+ */
+ public void createCrossContextSessionAttributeCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("CrossContextSessionAttribute", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ PortletSession session = request.getPortletSession();
+ session.setAttribute("key", "value",
PortletSession.APPLICATION_SCOPE);
+ String path = request.getContextPath();
+ InvokeGetResponse igr = new InvokeGetResponse(path +
"/universalServletA");
+ return igr;
+ }
+ });
+
+ /**
+ * This servlet is normally accessed after that the
CrossContextSessionAttributePortlet asked
+ * the client to do it. This portlet should have put in the session an attribute
that this servlet
+ * will assert the presence of.
+ */
+ seq.addAction(1, UTS1.SERVICE_JOINPOINT, new ServletServiceTestAction()
+ {
+ protected DriverResponse run(Servlet servlet, HttpServletRequest request,
HttpServletResponse response, PortletTestContext context) throws ServletException,
IOException
+ {
+ HttpSession session = request.getSession();
+ assertEquals("value", session.getAttribute("key"));
+ return new EndTestResponse();
+ }
+ });
+
+
+ }
+
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/session/SessionSequenceBuilder.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/misc/log4j/CustomLogger.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/misc/log4j/CustomLogger.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/misc/log4j/CustomLogger.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -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.test.portlet.jsr168.misc.log4j;
+
+import org.apache.log4j.Logger;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class CustomLogger extends Logger
+{
+ public CustomLogger(String name)
+ {
+ super(name);
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/misc/log4j/CustomLoggerFactory.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/misc/log4j/CustomLoggerFactory.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/misc/log4j/CustomLoggerFactory.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,42 @@
+/******************************************************************************
+ * 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.jsr168.misc.log4j;
+
+import org.apache.log4j.Logger;
+import org.apache.log4j.spi.LoggerFactory;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class CustomLoggerFactory implements LoggerFactory
+{
+ public CustomLoggerFactory()
+ {
+ }
+
+ public Logger makeNewLoggerInstance(String name)
+ {
+ return new CustomLogger(name);
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/misc/log4j/Log4jSequenceBuilder.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/misc/log4j/Log4jSequenceBuilder.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/misc/log4j/Log4jSequenceBuilder.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,59 @@
+/******************************************************************************
+ * 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.jsr168.misc.log4j;
+
+import org.apache.log4j.Logger;
+import org.jboss.portal.test.framework.driver.response.EndTestResponse;
+import org.jboss.portal.test.framework.driver.DriverResponse;
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestDriver;
+import org.jboss.portal.test.framework.portlet.PortletTestSuite;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 5113 $
+ */
+public class Log4jSequenceBuilder extends PortletTestSuite
+{
+ public void createLog4j(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("TestLog4j", seq);
+ seq.addAction(0, LoggingPortlet.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ Logger logger = ((LoggingPortlet)portlet).getLogger();
+ assertNotNull(logger);
+ assertTrue("Logger is an instance of " +
logger.getClass().getName() + " instead of " + CustomLogger.class.getName(),
logger instanceof CustomLogger);
+ return new EndTestResponse();
+ }
+ });
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/misc/log4j/LoggingPortlet.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/misc/log4j/LoggingPortlet.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/misc/log4j/LoggingPortlet.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,41 @@
+/******************************************************************************
+ * 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.jsr168.misc.log4j;
+
+import org.apache.log4j.Logger;
+import org.jboss.portal.test.framework.portlet.Joinpoint;
+import org.jboss.portal.test.framework.portlet.components.AbstractUniversalTestPortlet;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class LoggingPortlet extends AbstractUniversalTestPortlet
+{
+ public final static Joinpoint RENDER_JOINPOINT = new
Joinpoint("LoggingPortlet", Joinpoint.PORTLET_RENDER);
+
+ protected Logger createLogger()
+ {
+ return Logger.getLogger(getClass().getName(), new CustomLoggerFactory());
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/dispatcher/DispatcherSequenceBuilder.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/dispatcher/DispatcherSequenceBuilder.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/dispatcher/DispatcherSequenceBuilder.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,749 @@
+/******************************************************************************
+ * 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.jsr168.tck.dispatcher;
+
+import org.jboss.portal.test.framework.driver.response.EndTestResponse;
+import org.jboss.portal.test.framework.driver.http.response.InvokeGetResponse;
+import org.jboss.portal.test.framework.driver.DriverResponse;
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestDriver;
+import org.jboss.portal.test.framework.portlet.PortletTestSuite;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.actions.PortletActionTestAction;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.framework.portlet.actions.ServletServiceTestAction;
+import org.jboss.portal.test.framework.portlet.components.AbstractUniversalTestPortlet;
+import org.jboss.portal.test.portlet.framework.UTP1;
+import org.jboss.portal.test.portlet.framework.UTS1;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.Portlet;
+import javax.portlet.PortletException;
+import javax.portlet.PortletRequestDispatcher;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.servlet.Servlet;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.util.Enumeration;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 7954 $
+ */
+public class DispatcherSequenceBuilder extends PortletTestSuite
+{
+
+ public static final String SERVLET_A_URI =
"/test-jsr168-dispatcher/universalServletA";
+ public static final String SERVLET_B_URI =
"/test-jsr168-dispatcher/universalServletB";
+
+ /**
+ * @portlet.specification assert="SPEC:121 - The getRequestDispatcher method
takes a String argument describing a
+ * path within the scope of the PortletContext of a portlet application. This path
must begin with a �/� and it is
+ * relative to the PortletContext root."
+ * @portlet.specification assert="SPEC:122 - The getNamedDispatcher method takes
a String argument indicating the
+ * name of a servlet known to the PortletContext of the portlet application. If no
resource can be resolved based on
+ * the given path or name the methods must return null"
+ */
+ public void createObtainingDispatcherCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("ObtainingDispatcher", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ UTP1 p = (UTP1)portlet;
+ //correct
+ PortletRequestDispatcher dispatcher =
p.getPortletContext().getNamedDispatcher("UniversalServletA");
+ assertNotNull(dispatcher);
+
+ //incorrect
+ dispatcher =
p.getPortletContext().getNamedDispatcher("FAKE_NAME_SERVLET");
+ assertNull(dispatcher);
+
+ //incorrect
+ dispatcher = p.getPortletContext().getNamedDispatcher("/");
+ assertNull(dispatcher);
+
+ //incorrect
+ dispatcher =
p.getPortletContext().getNamedDispatcher("/universalServletA");
+ assertNull(dispatcher);
+
+ //incorrect
+ dispatcher =
p.getPortletContext().getRequestDispatcher("UniversalServletA");
+ assertNull(dispatcher);
+
+ //incorrect
+ dispatcher =
p.getPortletContext().getRequestDispatcher("universalServletA");
+ assertNull(dispatcher);
+
+ //incorrect
+ //dispatcher =
getPortletContext().getRequestDispatcher("/UniversalServletA");
+ //assertNull(dispatcher);
+
+ //incorrect
+ //dispatcher = getPortletContext().getRequestDispatcher("/");
+ //assertNull(dispatcher);
+
+ //correct
+ dispatcher =
p.getPortletContext().getRequestDispatcher("/universalServletA");
+ assertNotNull(dispatcher);
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ /**
+ * @portlet.specification assert="SPEC:123 - The parameters associated with a
PortletRequestDispatcher are scoped to
+ * apply only for the duration of the include call."
+ */
+ public void createQueryStringInRequestDispatcherCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("QueryStringInRequestDispatcher", seq);
+
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new InvokeGetResponse(response.createActionURL().toString());
+ }
+ });
+
+ seq.addAction(1, UTP1.ACTION_JOINPOINT, new PortletActionTestAction()
+ {
+ protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context)
+ {
+ //set some render params to test them in dispatcher include (precedense)
+ response.setRenderParameter("key1", "differentValue");
+ response.setRenderParameter("key3", "k3value1");
+ }
+ });
+
+ seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws IOException, PortletException
+ {
+ String path = "/universalServletA";
+ path += "?key1=k1value1&key2=k2value1";
+ PortletRequestDispatcher dispatcher =
((AbstractUniversalTestPortlet)portlet).getPortletContext().getRequestDispatcher(path);
+ assertNotNull(dispatcher);
+
+ dispatcher.include(request, response);
+
+ //assert that params from query string doesn't last longer then in
include call
+ assertEquals("differentValue",
request.getParameter("key1"));
+ assertNull(request.getParameter("key2"));
+ return new EndTestResponse();
+ }
+ });
+
+ seq.addAction(1, UTS1.SERVICE_JOINPOINT, new ServletServiceTestAction()
+ {
+ protected DriverResponse run(Servlet servlet, HttpServletRequest request,
HttpServletResponse response, PortletTestContext context) throws ServletException,
IOException
+ {
+ assertEquals("k1value1", request.getParameter("key1"));
+ assertEquals("k2value1", request.getParameter("key2"));
+ assertEquals("k3value1", request.getParameter("key3"));
+ return null;
+ }
+ });
+ }
+
+ /**
+ * @portlet.specification assert="SPEC:124 - To include a servlet or a JSP, a
portlet calls the include method of the
+ * PortletRequestDispatcher interface. The parameters to these methods must be the
request and response arguments
+ * that were passed in via the render method of the Portlet interface."
+ * @portlet.specification assert="SPEC:125 - The portlet container must ensure
that the servlet or JSP called through
+ * a PortletRequestDispatcher is called in the same thread as the
PortletRequestDispatcher include invocation."
+ */
+ public void createDispatchedRequestCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("DispatchedRequest", seq);
+
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws IOException, PortletException
+ {
+ PortletRequestDispatcher dispatcher =
((AbstractUniversalTestPortlet)portlet).getPortletContext().getNamedDispatcher("UniversalServletA");
+ assertNotNull(dispatcher);
+ try
+ {
+ dispatcher.include(request, response);
+ Object o = UTP1.local.get();
+ assertEquals(Boolean.TRUE, o);
+ }
+ finally
+ {
+ UTP1.local.set(null);
+ }
+ return new EndTestResponse();
+ }
+ });
+
+ seq.addAction(0, UTS1.SERVICE_JOINPOINT, new ServletServiceTestAction()
+ {
+ protected DriverResponse run(Servlet servlet, HttpServletRequest request,
HttpServletResponse response, PortletTestContext context) throws ServletException,
IOException
+ {
+ StringBuffer buffer = request.getRequestURL();
+ UTP1.local.set(buffer == null ? Boolean.TRUE : Boolean.FALSE);
+ return null;
+ }
+ });
+ }
+
+
+ /**
+ * @portlet.specification assert="SPEC:126 - Servlets and JSPs included from
portlets must be handled as HTTP GET
+ * requests."
+ */
+ public void createGETMethodCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("GETMethod", seq);
+
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws IOException, PortletException
+ {
+ PortletRequestDispatcher dispatcher =
((AbstractUniversalTestPortlet)portlet).getPortletContext().getNamedDispatcher("UniversalServletA");
+ assertNotNull(dispatcher);
+
+
+ dispatcher.include(request, response);
+
+ //assert that servlet handle this as GET
+ assertEquals(Boolean.TRUE, (Boolean)UTP1.local.get());
+ return new EndTestResponse();
+ }
+ });
+
+ seq.addAction(0, UTS1.SERVICE_JOINPOINT, new ServletServiceTestAction()
+ {
+ protected DriverResponse run(Servlet servlet, HttpServletRequest request,
HttpServletResponse response, PortletTestContext context) throws ServletException,
IOException
+ {
+ if (request.getMethod().equals("GET"))
+ {
+ UTP1.local.set(Boolean.TRUE);
+ }
+ return null;
+ }
+ });
+ }
+
+ /**
+ * @portlet.specification assert="SPEC:127 - Except for servlets obtained by
using the getNamedDispatcher method, a
+ * servlet or JSP being used from within an include call has access to the path used
to obtain the
+ * PortletRequestDispatcher. The following request attributes must be set:
javax.servlet.include.request_uri,
+ * javax.servlet.include.context_path javax.servlet.include.servlet_path,
javax.servlet.include.path_info,
+ * javax.servlet.include.query_string"
+ */
+ public void createIncludedRequestParametersCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("IncludedRequestParameters", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws IOException, PortletException
+ {
+ PortletRequestDispatcher dispatcher =
((AbstractUniversalTestPortlet)portlet).getPortletContext().getRequestDispatcher("/universalServletA/pathinfo?foo=bar");
+ assertNotNull(dispatcher);
+
+ //assert that servlet HAS access to specific request attributes
+ try
+ {
+ dispatcher.include(request, response);
+
assertEquals("/test-jsr168-dispatcher/universalServletA/pathinfo",
UTP1.local1.get());
+ assertEquals("/test-jsr168-dispatcher", UTP1.local2.get());
+ assertEquals("/universalServletA", UTP1.local3.get());
+ assertEquals("/pathinfo", UTP1.local4.get());
+ assertEquals("foo=bar", UTP1.local5.get());
+ }
+ finally
+ {
+ UTP1.local1.set(null);
+ UTP1.local2.set(null);
+ UTP1.local3.set(null);
+ UTP1.local4.set(null);
+ UTP1.local5.set(null);
+ }
+
+ //
+ dispatcher =
((AbstractUniversalTestPortlet)portlet).getPortletContext().getNamedDispatcher("UniversalServletA");
+ assertNotNull(dispatcher);
+
+ // Assert that servlet has NO access to specific request attributes
+ // it shouldn't access that attributes because getNamedDispatcher was
used
+ try
+ {
+ dispatcher.include(request, response);
+ assertNull(UTP1.local1.get());
+ assertNull(UTP1.local2.get());
+ assertNull(UTP1.local3.get());
+ assertNull(UTP1.local4.get());
+ assertNull(UTP1.local5.get());
+ }
+ finally
+ {
+ UTP1.local1.set(null);
+ UTP1.local2.set(null);
+ UTP1.local3.set(null);
+ UTP1.local4.set(null);
+ UTP1.local5.set(null);
+ }
+
+ return new EndTestResponse();
+ }
+ });
+
+ seq.addAction(0, UTS1.SERVICE_JOINPOINT, new ServletServiceTestAction()
+ {
+ protected DriverResponse run(Servlet servlet, HttpServletRequest request,
HttpServletResponse response, PortletTestContext context) throws ServletException,
IOException
+ {
+
UTP1.local1.set(request.getAttribute("javax.servlet.include.request_uri"));
+
UTP1.local2.set(request.getAttribute("javax.servlet.include.context_path"));
+
UTP1.local3.set(request.getAttribute("javax.servlet.include.servlet_path"));
+
UTP1.local4.set(request.getAttribute("javax.servlet.include.path_info"));
+
UTP1.local5.set(request.getAttribute("javax.servlet.include.query_string"));
+ return null;
+ }
+ });
+
+ }
+
+ /**
+ * @portlet.specification assert="SPEC:128 - javax.portlet.config,
javax.portlet.request, javax.portlet.response.
+ * These attributes must be the same Portlet API objects accessible to the portlet
doing the include call."
+ */
+ public void createIncludedRequestAttributesCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("IncludedRequestAttributes", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws IOException, PortletException
+ {
+ PortletRequestDispatcher dispatcher =
((AbstractUniversalTestPortlet)portlet).getPortletContext().getRequestDispatcher("/universalServletA");
+ assertNotNull(dispatcher);
+ dispatcher.include(request, response);
+ //assert that servlet has access to correct objects via attributes
+ assertAttributes((AbstractUniversalTestPortlet)portlet, request, response);
+
+ dispatcher =
((AbstractUniversalTestPortlet)portlet).getPortletContext().getNamedDispatcher("UniversalServletA");
+ assertNotNull(dispatcher);
+ dispatcher.include(request, response);
+ //assert that servlet has access to correct objects via attributes
+ assertAttributes((AbstractUniversalTestPortlet)portlet, request, response);
+
+ return new EndTestResponse();
+
+ }
+
+ public void assertAttributes(AbstractUniversalTestPortlet portlet, RenderRequest
request, RenderResponse response)
+ {
+ try
+ {
+ assertNotNull(UTP1.local1.get());
+ assertNotNull(UTP1.local2.get());
+ assertNotNull(UTP1.local3.get());
+
+ assertEquals(UTP1.local1.get(), portlet.getPortletConfig());
+ assertEquals(UTP1.local2.get(), request);
+ assertEquals(UTP1.local3.get(), response);
+
+ }
+ finally
+ {
+ UTP1.local1.set(null);
+ UTP1.local2.set(null);
+ UTP1.local3.set(null);
+ }
+ }
+ });
+
+ seq.addAction(0, UTS1.SERVICE_JOINPOINT, new ServletServiceTestAction()
+ {
+ protected DriverResponse run(Servlet servlet, HttpServletRequest request,
HttpServletResponse response, PortletTestContext context) throws ServletException,
IOException
+ {
+ UTP1.local1.set(request.getAttribute("javax.portlet.config"));
+ UTP1.local2.set(request.getAttribute("javax.portlet.request"));
+ UTP1.local3.set(request.getAttribute("javax.portlet.response"));
+ return null;
+ }
+ });
+ }
+
+ /**
+ * @portlet.specification assert="SPEC:129 - The following methods of the
HttpServletRequest must return null:
+ * getProtocol, getRemoteAddr, getRemoteHost, getRealPath, and getRequestURL."
+ * @portlet.specification assert="SPEC:130 - The following methods of the
HttpServletRequest must return the path and
+ * query string information used to obtain the PortletRequestDispatcher object:
getPathInfo, getPathTranslated,
+ * getQueryString, getRequestURI and getServletPath"
+ * @portlet.specification assert="SPEC:131 - The following methods of the
HttpServletRequest must be equivalent to
+ * the methods of the PortletRequest of similar name: getScheme,
getServerName,getServerPort, getAttribute,
+ * getAttributeNames, setAttribute,removeAttribute, getLocale, getLocales, isSecure,
getAuthType, getContextPath,
+ * getRemoteUser, getUserPrincipal, getRequestedSessionId,
isRequestedSessionIdValid"
+ * @portlet.specification assert="SPEC:132 - The following methods of the
HttpServletRequest must be equivalent to
+ * the methods of the PortletRequest of similar name with the provision defined in
PLT.16.1.1 Query Strings in
+ * Request Dispatcher Paths Section: getParameter, getParameterNames,
getParameterValues and getParameterMap."
+ * @portlet.specification assert="SPEC:133 - The following methods of the
HttpServletRequest must do no operations
+ * and return null: getCharacterEncoding, setCharacterEncoding, getContentType,
getInputStream and getReader."
+ * @portlet.specification assert="SPEC:134 - The getContentLength method of the
HttpServletRequest must return 0."
+ * @portlet.specification assert="SPEC:137 - The getMethod method of the
HttpServletRequest must always return
+ * �GET�"
+ */
+ public void createRequestObjectCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("RequestObject", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws IOException, PortletException
+ {
+ //we dispatch to servlet and assertions will be done there
+ String queryString = "?key1=k1value1&key2=k2value1";
+ PortletRequestDispatcher dispatcher =
((AbstractUniversalTestPortlet)portlet).getPortletContext().getRequestDispatcher("/universalServletA"
+ queryString);
+ response.setContentType("text/html");
+ dispatcher.include(request, response);
+ return null;
+ }
+ });
+
+
+ seq.addAction(0, UTS1.SERVICE_JOINPOINT, new ServletServiceTestAction()
+ {
+ protected DriverResponse run(Servlet servlet, HttpServletRequest request,
HttpServletResponse response, PortletTestContext context) throws ServletException,
IOException
+ {
+ //we get this object to assert some of it's method compare wieth http
request methods
+ RenderRequest portletRequest =
(RenderRequest)request.getAttribute("javax.portlet.request");
+
+ assertNotNull(portletRequest);
+
+ //SPEC:129
+ assertNull(request.getProtocol());
+ assertNull(request.getRemoteAddr());
+ assertNull(request.getRemoteHost());
+ assertNull(request.getRealPath("blah"));
+ assertNull(request.getRequestURL());
+
+ //SPEC:130
+ assertEquals(null, request.getPathInfo());
+ //TODO:I'm not sure what this should return - but it's not
implemented now so it fails
+ //assertEquals("",request.getPathTranslated());
+ assertEquals("key1=k1value1&key2=k2value1",
request.getQueryString());
+ //assertEquals("/requestObjectServlet",request.getRequestURI());
+ assertEquals("/universalServletA", request.getServletPath());
+
+ //SPEC:131
+ assertEquals(portletRequest.getScheme(), request.getScheme());
+ assertEquals(portletRequest.getServerName(), request.getServerName());
+ assertEquals(portletRequest.getServerPort(), request.getServerPort());
+
+ request.setAttribute("key1", "k1atrr1");
+ request.setAttribute("key2", "k2attr2");
+ List attrNames = new LinkedList();
+ Enumeration attrEnum = request.getAttributeNames();
+ while (attrEnum.hasMoreElements())
+ {
+ attrNames.add(attrEnum.nextElement());
+ }
+ assertNotNull(request.getAttribute("key1"));
+ assertNotNull(request.getAttribute("key2"));
+
+ assertTrue(attrNames.contains("key1"));
+ assertTrue(attrNames.contains("key2"));
+
+ request.removeAttribute("key1");
+ assertNull(request.getAttribute("key1"));
+ assertNotNull(request.getAttribute("key2"));
+
+ assertEquals(portletRequest.getLocale(), request.getLocale());
+
+ List portletLocales = new LinkedList();
+ List servletLocales = new LinkedList();
+ Enumeration pl = portletRequest.getLocales();
+ while (pl.hasMoreElements())
+ {
+ portletLocales.add(pl.nextElement());
+ }
+ Enumeration sl = request.getLocales();
+ while (sl.hasMoreElements())
+ {
+ servletLocales.add(sl.nextElement());
+ }
+
+ assertTrue(portletLocales.equals(servletLocales));
+
+ assertEquals(portletRequest.isSecure(), request.isSecure());
+ assertEquals(portletRequest.getAuthType(), request.getAuthType());
+ assertEquals(portletRequest.getContextPath(), request.getContextPath());
+ assertEquals(portletRequest.getRemoteUser(), request.getRemoteUser());
+ assertEquals(portletRequest.getUserPrincipal(), request.getUserPrincipal());
+ assertEquals(portletRequest.getRequestedSessionId(),
request.getRequestedSessionId());
+ assertEquals(portletRequest.isRequestedSessionIdValid(),
request.isRequestedSessionIdValid());
+
+ //SPEC:132
+ //in this assertions we use parameters passed in query string of dispatcher
+ List paramNames = new LinkedList();
+ Enumeration paramEnum = request.getParameterNames();
+ while (paramEnum.hasMoreElements())
+ {
+ paramNames.add(paramEnum.nextElement());
+ }
+ assertTrue(paramNames.contains("key1"));
+ assertTrue(paramNames.contains("key2"));
+
+ assertEquals("k1value1", request.getParameter("key1"));
+ assertEquals(new String[]{"k1value1"},
request.getParameterValues("key1"));
+
+ Map paramNamesMap = request.getParameterMap();
+ assertTrue(paramNamesMap.containsKey("key1"));
+ assertTrue(paramNamesMap.containsKey("key2"));
+
+ //SPEC:133
+ request.setCharacterEncoding("utf8");
+ assertNull(request.getCharacterEncoding());
+ assertNull(request.getContentType());
+ assertNull(request.getInputStream());
+ assertNull(request.getReader());
+
+ //SPEC:134
+ assertEquals(0, request.getContentLength());
+
+ //SPEC:137
+ assertEquals("GET", request.getMethod());
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ /**
+ * @portlet.specification assert="SPEC:138 - The following methods of the
HttpServletResponse must return
+ * null:encodeRedirectURL and encodeRedirectUrl"
+ * @portlet.specification assert="SPEC:141 - The getLocale method of the
HttpServletResponse must be based on the
+ * getLocale method of the RenderResponse."
+ */
+ public void createResponseObjectCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("ResponseObject", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws IOException, PortletException
+ {
+ //we dispatch to servlet and assertions will be done there
+ PortletRequestDispatcher dispatcher =
((AbstractUniversalTestPortlet)portlet).getPortletContext().getRequestDispatcher("/universalServletA");
+ //hack for testing dispatched servlet
+ response.setContentType("text/html");
+ dispatcher.include(request, response);
+ return null;
+ }
+ });
+
+ seq.addAction(0, UTS1.SERVICE_JOINPOINT, new ServletServiceTestAction()
+ {
+ protected DriverResponse run(Servlet servlet, HttpServletRequest request,
HttpServletResponse response, PortletTestContext context) throws ServletException,
IOException
+ {
+ //we get this object to assert some of it's method compare wieth http
request methods
+ RenderResponse portletResponse =
(RenderResponse)request.getAttribute("javax.portlet.response");
+
+ assertNotNull(portletResponse);
+
+ //SPEC:138
+ assertNull(response.encodeRedirectURL("blah"));
+ assertNull(response.encodeRedirectUrl("blah"));
+
+ //not defined spec assert
+ assertEquals(false, response.containsHeader("blah"));
+
+ //SPEC:141
+ assertEquals(portletResponse.getLocale(), response.getLocale());
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ /**
+ * @portlet.specification assert="SPEC:142 - If the servlet or JSP that is the
target of a request dispatcher throws
+ * a runtime exception or a checked exception of type IOException, it must be
propagated to the calling portlet."
+ * @portlet.specification assert="SPEC:143 - All other exceptions, including a
ServletException, must be wrapped with
+ * a PortletException. The root cause of the exception must be set to the original
exception before being
+ * propagated."
+ */
+ public void createErrorHandlingCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("ErrorHandling", seq);
+
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws IOException, PortletException
+ {
+
+ PortletRequestDispatcher dispatcher =
((AbstractUniversalTestPortlet)portlet).getPortletContext().getNamedDispatcher("UniversalServletA");
+ assertNotNull(dispatcher);
+ try
+ {
+ dispatcher.include(request, response);
+ fail();
+ }
+ catch (RuntimeException e)
+ {
+ //expected
+ }
+
+ return new InvokeGetResponse(response.createRenderURL().toString());
+ }
+ });
+
+ seq.addAction(0, UTS1.SERVICE_JOINPOINT, new ServletServiceTestAction()
+ {
+ protected DriverResponse run(Servlet servlet, HttpServletRequest request,
HttpServletResponse response, PortletTestContext context) throws ServletException,
IOException
+ {
+ return null;
+ }
+
+ public DriverResponse execute(Servlet servlet, HttpServletRequest request,
HttpServletResponse response, PortletTestContext context) throws ServletException,
IOException
+ {
+ //SPEC:142 - RuntimeException
+ throw new RuntimeException();
+ }
+ });
+
+ seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws PortletException
+ {
+ PortletRequestDispatcher dispatcher =
((AbstractUniversalTestPortlet)portlet).getPortletContext().getNamedDispatcher("UniversalServletA");
+ assertNotNull(dispatcher);
+ try
+ {
+ dispatcher.include(request, response);
+ fail();
+ }
+ catch (IOException e)
+ {
+ //expected
+ }
+
+ return new InvokeGetResponse(response.createRenderURL().toString());
+ }
+ });
+
+ seq.addAction(1, UTS1.SERVICE_JOINPOINT, new ServletServiceTestAction()
+ {
+ protected DriverResponse run(Servlet servlet, HttpServletRequest request,
HttpServletResponse response, PortletTestContext context) throws ServletException,
IOException
+ {
+ return null;
+ }
+
+ public DriverResponse execute(Servlet servlet, HttpServletRequest request,
HttpServletResponse response, PortletTestContext context) throws ServletException,
IOException
+ {
+ //SPEC:142 - checked exception of type IOException
+ throw new IOException();
+ }
+ });
+
+ seq.addAction(2, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws IOException
+ {
+
+ PortletRequestDispatcher dispatcher =
((AbstractUniversalTestPortlet)portlet).getPortletContext().getNamedDispatcher("UniversalServletA");
+ assertNotNull(dispatcher);
+ try
+ {
+ dispatcher.include(request, response);
+ fail();
+ }
+ catch (PortletException e)
+ {
+ //expected
+ if (!(e.getCause() instanceof ServletException))
+ {
+ fail();
+ }
+ }
+ return new InvokeGetResponse(response.createRenderURL().toString());
+ }
+ });
+
+ seq.addAction(2, UTS1.SERVICE_JOINPOINT, new ServletServiceTestAction()
+ {
+ protected DriverResponse run(Servlet servlet, HttpServletRequest request,
HttpServletResponse response, PortletTestContext context) throws ServletException,
IOException
+ {
+ return null;
+ }
+
+ public DriverResponse execute(Servlet servlet, HttpServletRequest request,
HttpServletResponse response, PortletTestContext context) throws ServletException,
IOException
+ {
+ //SPEC:143 - ServletException
+ throw new ServletException();
+ }
+ });
+
+ seq.addAction(3, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws IOException
+ {
+ /*PortletRequestDispatcher dispatcher =
((AbstractUniversalTestPortlet)portlet).getPortletContext().getNamedDispatcher("UniversalServletA");
+ assertNotNull(dispatcher);
+ try
+ {
+ dispatcher.include(request,response);
+ fail();
+ }
+ catch(Error e)
+ {
+ //expected
+ }*/
+
+ return new EndTestResponse();
+ }
+ });
+
+ seq.addAction(3, UTS1.SERVICE_JOINPOINT, new ServletServiceTestAction()
+ {
+ protected DriverResponse run(Servlet servlet, HttpServletRequest request,
HttpServletResponse response, PortletTestContext context) throws ServletException,
IOException
+ {
+ return null;
+ }
+
+ public DriverResponse execute(Servlet servlet, HttpServletRequest request,
HttpServletResponse response, PortletTestContext context) throws ServletException,
IOException
+ {
+ //SPEC:143 - 'other' exception
+ throw new Error();
+ }
+ });
+
+ }
+
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/dispatcher/DispatcherSequenceBuilder.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/dispatcher/DispatcherTestSuite.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/dispatcher/DispatcherTestSuite.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/dispatcher/DispatcherTestSuite.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,130 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.portlet.jsr168.tck.dispatcher;
+
+import junit.framework.Test;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.com">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 5510 $
+ */
+public class DispatcherTestSuite
+{
+ public static Test suite()
+ {
+// TestSuite suite = new TestSuite("test-jsr168-dispatcher.war");
+//
+// /**
+// * SPEC:121 Testable=true Section=PLT.16.1
+// * SPEC:122 Testable=true Section=PLT.16.1
+// * - ObtainingDispatcherPortlet
+// * - ObtainingDispatcherServlet
+// */
+// suite.addTest(new TestCase("ObtainingDispatcher"));
+//
+// /**
+// * SPEC:123 Testable= true Section=PLT.16.1.1
+// * - QueryStringInRequestDispatcherPortlet
+// * - QueryStringInRequestDispatcherServlet
+// */
+// suite.addTest(new TestCase("QueryStringInRequestDispatcher"));
+//
+// /**
+// * SPEC:124 Testable=true Section=PLT.16.2
+// * SPEC:125 Testable=true Section=PLT.16.2
+// * - DispatchedRequestPortlet
+// * - DispatchedRequestServlet
+// */
+// suite.addTest(new TestCase("DispatchedRequest"));
+//
+// /**
+// * SPEC:126 Testable=true Section=PLT.16.3
+// * - GETMethodPortlet
+// * - GETMethodServlet
+// */
+// suite.addTest(new TestCase("GETMethod"));
+//
+// /**
+// * SPEC:127 Testable=true Section=PLT.16.3.1
+// * - IncludedRequestParametersPortlet
+// * - IncludedRequestParametersDispatchedServlet
+// * - IncludedRequestParametersNamedDispatchedServlet
+// */
+// suite.addTest(new TestCase("IncludedRequestParameters"));
+//
+// /**
+// * SPEC:128 Testable=true Section=PLT.16.3.2
+// * - IncludedRequestAttributesPortlet
+// * - IncludedRequestAttributesDispatchedServlet
+// */
+// suite.addTest(new TestCase("IncludedRequestAttributes"));
+//
+// /**
+// * SPEC:129 Testable=true Section=PLT.16.3.3
+// * SPEC:130 Testable=true Section=PLT.16.3.3
+// * SPEC:131 Testable=true Section=PLT.16.3.3
+// * SPEC:132 Testable=true Section=PLT.16.3.3
+// * SPEC:133 Testable=true Section=PLT.16.3.3
+// * SPEC:134 Testable=true Section=PLT.16.3.3
+// * SPEC:137 Testable=true Section=PLT.16.3.3
+// * - RequestObjectPortlet
+// * - RequestObjectServlet
+// */
+// suite.addTest(new TestCase("RequestObject"));
+//
+// /**
+// * SPEC:135 Testable=true Section=PLT.16.3.3
+// * SPEC:136 Testable=true Section=PLT.16.3.3
+// * POSTPONED
+// */
+//
+// /**
+// * SPEC:138 Testable=true Section= PLT.16.3.3
+// * SPEC:141 Testable=true Section= PLT.16.3.3
+// */
+// suite.addTest(new TestCase("ResponseObject"));
+//
+// /**
+// * SPEC:139 Testable=true Section= PLT.16.3.3
+// * NOT DONE YET
+// */
+//
+// /**
+// * SPEC:140 Testable=false(impl) Section= PLT.16.3.3
+// * Testable=false(impl)!
+// */
+//
+// /**
+// * SPEC:142 Testable=true Section=PLT.16.3.4
+// * SPEC:143 Testable=true Section=PLT.16.3.4
+// * - ErrorHandlingPortlet
+// * - ErrorHandlingServlet
+// * - SampleException
+// */
+// suite.addTest(new TestCase("ErrorHandling"));
+//
+// return suite;
+ return null;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/dispatcher/DispatcherTestSuite.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletconfig/PortletConfigSequenceBuilder.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletconfig/PortletConfigSequenceBuilder.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletconfig/PortletConfigSequenceBuilder.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,109 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.portlet.jsr168.tck.portletconfig;
+
+import org.jboss.portal.test.framework.driver.response.EndTestResponse;
+import org.jboss.portal.test.framework.driver.DriverResponse;
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestDriver;
+import org.jboss.portal.test.framework.portlet.PortletTestSuite;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.framework.portlet.components.AbstractUniversalTestPortlet;
+import
org.jboss.portal.test.portlet.jsr168.tck.portletconfig.spec.InlineValuesNotInResourceBundlePortlet;
+import
org.jboss.portal.test.portlet.jsr168.tck.portletconfig.spec.InlineValuesWithNoResourceBundleDefinedPortlet;
+
+import javax.portlet.Portlet;
+import javax.portlet.PortletConfig;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import java.util.Locale;
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 7954 $
+ */
+public class PortletConfigSequenceBuilder extends PortletTestSuite
+{
+ public void createInlineValuesNotInResourceBundle(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("InlineValuesNotInResourceBundle", seq);
+
+ seq.addAction(0, InlineValuesNotInResourceBundlePortlet.RENDER_JOINPOINT, new
PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ PortletConfig cfg =
((AbstractUniversalTestPortlet)portlet).getPortletConfig();
+
+ ResourceBundle bundle_en = cfg.getResourceBundle(Locale.ENGLISH);
+
+ assertEquals(Locale.ENGLISH, bundle_en.getLocale());
+
+ assertEquals("bar", bundle_en.getString("foo"));
+
+ //These are not defined in bundle but inline in portelt.xml
+ assertEquals("title",
bundle_en.getString("javax.portlet.title"));
+ assertEquals("short-title",
bundle_en.getString("javax.portlet.short-title"));
+ assertEquals("keywords",
bundle_en.getString("javax.portlet.keywords"));
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ public void createInlineValuesWithNoResourceBundleDefined(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("InlineValuesWithNoResourceBundleDefined", seq);
+
+ seq.addAction(0, InlineValuesWithNoResourceBundleDefinedPortlet.RENDER_JOINPOINT,
new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ PortletConfig cfg =
((AbstractUniversalTestPortlet)portlet).getPortletConfig();
+
+ ResourceBundle bundle_en = cfg.getResourceBundle(Locale.ENGLISH);
+
+ //dummy assert that we don't have resouce bundle defined...
+ try
+ {
+ bundle_en.getString("foo");
+ fail();
+ }
+ catch (MissingResourceException expected)
+ {
+ }
+
+ //These defined inline in portelt.xml and there is no bundle defined there
+ assertEquals("title",
bundle_en.getString("javax.portlet.title"));
+ assertEquals("short-title",
bundle_en.getString("javax.portlet.short-title"));
+ assertEquals("keywords",
bundle_en.getString("javax.portlet.keywords"));
+ return new EndTestResponse();
+ }
+ });
+ }
+
+
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletconfig/PortletConfigSequenceBuilder.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletconfig/PortletConfigTestSuite.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletconfig/PortletConfigTestSuite.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletconfig/PortletConfigTestSuite.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,53 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.portlet.jsr168.tck.portletconfig;
+
+import junit.framework.Test;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.com">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 5510 $
+ */
+public class PortletConfigTestSuite
+{
+
+ public static Test suite()
+ {
+// TestSuite suite = new TestSuite("test-jsr168-portletconfig.war");
+//
+// /**
+// * SPEC:24 Testable= true Section=PLT.6.2
+// * - InlineValuesNotInResourcesBundlePortlet
+// */
+// suite.addTest(new TestCase("InlineValuesNotInResourceBundle"));
+//
+// /**
+// * SPEC:24 Testable= true Section=PLT.6.2
+// * - InlineValuesWithNoResourceBundleDefinedPortlet
+// */
+// suite.addTest(new
TestCase("InlineValuesWithNoResourceBundleDefined"));
+// return suite;
+ return null;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletconfig/PortletConfigTestSuite.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletconfig/spec/InlineValuesNotInResourceBundlePortlet.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletconfig/spec/InlineValuesNotInResourceBundlePortlet.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletconfig/spec/InlineValuesNotInResourceBundlePortlet.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,56 @@
+/******************************************************************************
+ * 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.jsr168.tck.portletconfig.spec;
+
+import org.jboss.portal.test.framework.portlet.Joinpoint;
+import org.jboss.portal.test.framework.portlet.components.AbstractUniversalTestPortlet;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.com">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 5448 $
+ * @portlet.specification assert="SPEC:24 - "If the portlet definition defines
a resource bundle, the portlet-container
+ * must look up these values in the ResourceBundle. If the root resource bundle does not
contain the resources for these
+ * values and the values are defined inline, the portlet container must add the inline
values as resources of the root
+ * resource bundle.(xxi)"
+ */
+public class InlineValuesNotInResourceBundlePortlet extends AbstractUniversalTestPortlet
+{
+ public static ThreadLocal local = new ThreadLocal();
+
+ public static String NAME = "InlineValuesNotInResourceBundlePortlet";
+
+ public final static Joinpoint RENDER_JOINPOINT = new Joinpoint(NAME,
Joinpoint.PORTLET_RENDER);
+
+ public final static Joinpoint ACTION_JOINPOINT = new Joinpoint(NAME,
Joinpoint.PORTLET_ACTION);
+
+ protected String createComponentId()
+ {
+ return NAME;
+ }
+
+ protected void reset()
+ {
+ local.set(null);
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletconfig/spec/InlineValuesNotInResourceBundlePortlet.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletconfig/spec/InlineValuesWithNoResourceBundleDefinedPortlet.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletconfig/spec/InlineValuesWithNoResourceBundleDefinedPortlet.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletconfig/spec/InlineValuesWithNoResourceBundleDefinedPortlet.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,56 @@
+/******************************************************************************
+ * 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.jsr168.tck.portletconfig.spec;
+
+import org.jboss.portal.test.framework.portlet.Joinpoint;
+import org.jboss.portal.test.framework.portlet.components.AbstractUniversalTestPortlet;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.com">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 5448 $
+ * @portlet.specification assert="SPEC:25 - "If the portlet definition does not
define a resource bundle and the
+ * information is defined inline in the deployment descriptor, the portlet container must
create a ResourceBundle and
+ * populate it, with the inline values, using the keys defined in the PLT.21.10 Resource
Bundles Section.(xxv)"
+ */
+public class InlineValuesWithNoResourceBundleDefinedPortlet extends
AbstractUniversalTestPortlet
+{
+
+ public static ThreadLocal local = new ThreadLocal();
+
+ public static String NAME =
"InlineValuesWithNoResourceBundleDefinedPortlet";
+
+ public final static Joinpoint RENDER_JOINPOINT = new Joinpoint(NAME,
Joinpoint.PORTLET_RENDER);
+
+ public final static Joinpoint ACTION_JOINPOINT = new Joinpoint(NAME,
Joinpoint.PORTLET_ACTION);
+
+ protected String createComponentId()
+ {
+ return NAME;
+ }
+
+ protected void reset()
+ {
+ local.set(null);
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletconfig/spec/InlineValuesWithNoResourceBundleDefinedPortlet.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletcontext/PortletContextSequenceBuilder.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletcontext/PortletContextSequenceBuilder.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletcontext/PortletContextSequenceBuilder.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,293 @@
+/******************************************************************************
+ * 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.jsr168.tck.portletcontext;
+
+import org.jboss.portal.test.framework.driver.response.EndTestResponse;
+import org.jboss.portal.test.framework.driver.DriverResponse;
+import org.jboss.portal.common.util.Tools;
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestDriver;
+import org.jboss.portal.test.framework.portlet.PortletTestSuite;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.framework.portlet.actions.ServletServiceTestAction;
+import org.jboss.portal.test.framework.portlet.components.AbstractUniversalTestPortlet;
+import org.jboss.portal.test.framework.portlet.components.AbstractUniversalTestServlet;
+import org.jboss.portal.test.portlet.framework.UTP1;
+import org.jboss.portal.test.portlet.framework.UTS1;
+
+import javax.portlet.Portlet;
+import javax.portlet.PortletException;
+import javax.portlet.PortletRequestDispatcher;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.servlet.Servlet;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.Arrays;
+import java.util.Enumeration;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 7954 $
+ */
+public class PortletContextSequenceBuilder extends PortletTestSuite
+{
+
+
+ /**
+ * @portlet.specification assert="SPEC:43 - The initialization parameters
accessible through the PortletContext must
+ * be the same that are accessible through the ServletContext of the portlet
application."
+ */
+ public void createInitializationParametersCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("InitializationParameters", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws IOException, PortletException
+ {
+ AbstractUniversalTestPortlet aport = (AbstractUniversalTestPortlet)portlet;
+ Enumeration enumeration = aport.getPortletContext().getInitParameterNames();
+ aport.getPortletContext().setAttribute("initParams", enumeration);
+
+ PortletRequestDispatcher dispatcher =
aport.getPortletContext().getNamedDispatcher("UniversalServletA");
+ assertNotNull(dispatcher);
+
+ dispatcher.include(request, response);
+ Object o = (Boolean)UTP1.local.get();
+ //assert that paths were compared successfully in Servlet
+ assertEquals(Boolean.TRUE, o);
+
+
+ return new EndTestResponse();
+ }
+ });
+
+ seq.addAction(0, UTS1.SERVICE_JOINPOINT, new ServletServiceTestAction()
+ {
+ protected DriverResponse run(Servlet servlet, HttpServletRequest request,
HttpServletResponse response, PortletTestContext context) throws ServletException,
IOException
+ {
+ return null;
+ }
+
+ public DriverResponse execute(Servlet servlet, HttpServletRequest request,
HttpServletResponse response, PortletTestContext context) throws ServletException,
IOException
+ {
+ AbstractUniversalTestServlet serv = ((AbstractUniversalTestServlet)servlet);
+ Enumeration portletEnumeration =
(Enumeration)serv.getServletContext().getAttribute("initParams");
+ Enumeration enumeration = serv.getServletContext().getInitParameterNames();
+
+ UTP1.local.set(compare(enumeration, portletEnumeration) ? Boolean.TRUE :
Boolean.FALSE);
+ return null;
+ }
+ });
+ }
+
+ /**
+ * @portlet.specification assert="SPEC:44 - Context attributes set using the
PortletContext must be stored in the
+ * ServletContext of the portlet application. A direct consequence of this is that
data stored in the ServletContext
+ * by servlets or JSPs is accessible to portlets through the PortletContext and vice
versa."
+ */
+ public void createContextAttributesCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("ContextAttributes", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws IOException, PortletException
+ {
+ AbstractUniversalTestPortlet aport = (AbstractUniversalTestPortlet)portlet;
+ aport.getPortletContext().setAttribute("sharedObject",
"sharedObjectValue");
+
+ PortletRequestDispatcher dispatcher =
aport.getPortletContext().getNamedDispatcher("UniversalServletA");
+ assertNotNull(dispatcher);
+
+
+ dispatcher.include(request, response);
+ Object o = (Boolean)UTP1.local.get();
+ //assert out object was accessible in ServletContext
+ assertEquals(Boolean.TRUE, o);
+
+ //assert we can access object which was set in ServletContext
+
assertTrue(aport.getPortletContext().getAttribute("sharedObject2").equals("sharedObjectValue2"));
+
+
+ return new EndTestResponse();
+ }
+ });
+
+ seq.addAction(0, UTS1.SERVICE_JOINPOINT, new ServletServiceTestAction()
+ {
+ public DriverResponse execute(Servlet servlet, HttpServletRequest request,
HttpServletResponse response, PortletTestContext context) throws ServletException,
IOException
+ {
+ AbstractUniversalTestServlet serv = ((AbstractUniversalTestServlet)servlet);
+
UTP1.local.set(serv.getServletContext().getAttribute("sharedObject").equals("sharedObjectValue")
? Boolean.TRUE : Boolean.FALSE);
+
((AbstractUniversalTestServlet)servlet).getServletContext().setAttribute("sharedObject2",
"sharedObjectValue2");
+ return null;
+ }
+
+ protected DriverResponse run(Servlet servlet, HttpServletRequest request,
HttpServletResponse response, PortletTestContext context) throws ServletException,
IOException
+ {
+ return null;
+ }
+ });
+ }
+
+ /**
+ * @portlet.specification assert="SPEC:45 - The PortletContext must offer access
to the same set of resources the
+ * ServletContext exposes."
+ */
+ public void createAccessSameSetOfResourcesCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("AccessSameSetOfResources", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws IOException, PortletException
+ {
+ AbstractUniversalTestPortlet aport = (AbstractUniversalTestPortlet)portlet;
+ //we get resource and pass it to servlet
+ URL url =
aport.getPortletContext().getResource("/simple_resource.txt");
+ assertNotNull(url);
+ aport.getPortletContext().setAttribute("resource", url);
+
+ //and we construct resource content and pass to servlet
+ InputStream is =
aport.getPortletContext().getResourceAsStream("/simple_resource.txt");
+ assertNotNull(is);
+ byte[] byteArray = new byte[is.available()];
+ is.read(byteArray);
+ aport.getPortletContext().setAttribute("content", byteArray);
+
+ //then we dispatch to servlet
+ PortletRequestDispatcher dispatcher =
aport.getPortletContext().getNamedDispatcher("UniversalServletA");
+ assertNotNull(dispatcher);
+
+ dispatcher.include(request, response);
+ Object o = (Boolean)UTP1.local.get();
+ //assert out assertion was correct in Servlet
+ assertEquals(Boolean.TRUE, o);
+
+
+ return new EndTestResponse();
+ }
+ });
+
+ seq.addAction(0, UTS1.SERVICE_JOINPOINT, new ServletServiceTestAction()
+ {
+ public DriverResponse execute(Servlet servlet, HttpServletRequest request,
HttpServletResponse response, PortletTestContext context) throws ServletException,
IOException
+ {
+ AbstractUniversalTestServlet serv = ((AbstractUniversalTestServlet)servlet);
+ URL portletUrl =
(URL)serv.getServletContext().getAttribute("resource");
+ URL url =
serv.getServletContext().getResource("/simple_resource.txt");
+
+ byte[] portletByteArray =
(byte[])serv.getServletContext().getAttribute("content");
+ InputStream is =
serv.getServletContext().getResourceAsStream("/simple_resource.txt");
+ byte[] byteArray = new byte[is.available()];
+ is.read(byteArray);
+
+ if (portletUrl.equals(url) &&
+ Arrays.equals(portletByteArray, byteArray))
+ {
+ UTP1.local.set(Boolean.TRUE);
+ }
+ else
+ {
+ UTP1.local.set(Boolean.FALSE);
+ }
+ return null;
+ }
+
+ protected DriverResponse run(Servlet servlet, HttpServletRequest request,
HttpServletResponse response, PortletTestContext context) throws ServletException,
IOException
+ {
+ return null;
+ }
+ });
+ }
+
+ /**
+ * @portlet.specification assert="SPEC:46 - The PortletContext must handle the
same temporary working directory the
+ * ServletContext handles. It must be accessible as a context attribute using the same
constant defined in the
+ * Servlet Specification 2.3 SVR 3 Servlet Context Chapter,
javax.servlet.context.tempdir."
+ */
+ public void createTempDirCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("TempDir", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws IOException, PortletException
+ {
+ AbstractUniversalTestPortlet aport = (AbstractUniversalTestPortlet)portlet;
+ File tempDir =
(File)aport.getPortletContext().getAttribute("javax.servlet.context.tempdir");
+ assertNotNull(tempDir);
+ aport.getPortletContext().setAttribute("tempDirPath",
tempDir.getAbsolutePath());
+ PortletRequestDispatcher dispatcher =
aport.getPortletContext().getNamedDispatcher("UniversalServletA");
+ assertNotNull(dispatcher);
+
+
+ dispatcher.include(request, response);
+ Object o = (Boolean)UTP1.local.get();
+ //assert that paths were compared successfully in Servlet
+ assertEquals(Boolean.TRUE, o);
+
+
+ return new EndTestResponse();
+ }
+ });
+
+ seq.addAction(0, UTS1.SERVICE_JOINPOINT, new ServletServiceTestAction()
+ {
+ public DriverResponse execute(Servlet servlet, HttpServletRequest request,
HttpServletResponse response, PortletTestContext context) throws ServletException,
IOException
+ {
+ AbstractUniversalTestServlet serv = ((AbstractUniversalTestServlet)servlet);
+ String path =
(String)serv.getServletContext().getAttribute("tempDirPath");
+ File tempDir =
(File)serv.getServletContext().getAttribute("javax.servlet.context.tempdir");
+ if (path != null && tempDir != null)
+ {
+ UTP1.local.set(path.equals(tempDir.getAbsolutePath()) ? Boolean.TRUE :
Boolean.FALSE);
+ }
+ return null;
+ }
+
+ protected DriverResponse run(Servlet servlet, HttpServletRequest request,
HttpServletResponse response, PortletTestContext context) throws ServletException,
IOException
+ {
+ return null;
+ }
+ });
+ }
+
+
+ /** Simple compare of two Enumerationss */
+ private boolean compare(Enumeration a, Enumeration b)
+ {
+ List al = Tools.toList(a);
+ List bl = Tools.toList(b);
+ return al.equals(bl);
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletcontext/PortletContextSequenceBuilder.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletcontext/PortletContextTestSuite.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletcontext/PortletContextTestSuite.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletcontext/PortletContextTestSuite.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,67 @@
+/******************************************************************************
+ * 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.jsr168.tck.portletcontext;
+
+import junit.framework.Test;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.com">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 5510 $
+ */
+public class PortletContextTestSuite
+{
+
+ public static Test suite()
+ {
+// TestSuite suite = new TestSuite("test-jsr168-portletcontext.war");
+//
+// /**
+// * SPEC:43 Testable=true Section=PLT.10.3
+// */
+// suite.addTest(new TestCase("InitializationParameters"));
+//
+// /**
+// * SPEC:44 Testable=true Section=PLT.10.3
+// */
+// suite.addTest(new TestCase("ContextAttributes"));
+//
+// /**
+// * SPEC:45 Testable=true Section=PLT.10.3
+// */
+// suite.addTest(new TestCase("AccessSameSetOfResources"));
+//
+// /**
+// * SPEC:46 Testable=true Section=PLT.10.3
+// */
+// suite.addTest(new TestCase("TempDir"));
+//
+// /**
+// * SPEC:47 Testable=true Section=PLT.10.3(servlet spec)
+// * NOT DONE - POSTPONED
+// */
+//
+// return suite;
+ return null;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletcontext/PortletContextTestSuite.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/PortletInterfaceSequenceBuilder.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/PortletInterfaceSequenceBuilder.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/PortletInterfaceSequenceBuilder.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,391 @@
+/******************************************************************************
+ * 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.jsr168.tck.portletinterface;
+
+import org.jboss.portal.test.framework.driver.response.EndTestResponse;
+import org.jboss.portal.test.framework.driver.response.FailureResponse;
+import org.jboss.portal.test.framework.driver.http.response.InvokeGetResponse;
+import org.jboss.portal.test.framework.driver.DriverResponse;
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestDriver;
+import org.jboss.portal.test.framework.portlet.PortletTestSuite;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.actions.PortletActionTestAction;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.framework.portlet.actions.ServletServiceTestAction;
+import org.jboss.portal.test.portlet.framework.UTP1;
+import org.jboss.portal.test.portlet.framework.UTP2;
+import org.jboss.portal.test.portlet.framework.UTS1;
+import
org.jboss.portal.test.portlet.jsr168.tck.portletinterface.spec.InitializeBeforeHandlePortlet;
+import
org.jboss.portal.test.portlet.jsr168.tck.portletinterface.spec.PortletExceptionDuringInitPortlet;
+import
org.jboss.portal.test.portlet.jsr168.tck.portletinterface.spec.RuntimeExceptionDuringInitPortlet;
+import
org.jboss.portal.test.portlet.jsr168.tck.portletinterface.spec.UnavailableExceptionDuringInitPortlet;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.Portlet;
+import javax.portlet.PortletException;
+import javax.portlet.PortletSecurityException;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.servlet.Servlet;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 7954 $
+ */
+public class PortletInterfaceSequenceBuilder extends PortletTestSuite
+{
+
+ /**
+ * @portlet.specification assert="SPEC:4 - After the portlet object is
instantiated, the portlet container must
+ * initialize the portlet before invoking it to handle requests"
+ */
+ public void createInitializeBeforeHandleCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("InitializeBeforeHandle", seq);
+ seq.addAction(0, InitializeBeforeHandlePortlet.RENDER_JOINPOINT, new
PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ assertTrue(InitializeBeforeHandlePortlet.init);
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ /**
+ * @portlet.specification assert="SPEC:5 - During initialization, the portlet
object may throw an
+ * UnavailableException or a PortletException. In this case, the portlet container
must not place the portlet object
+ * into active service and it must release the portlet object."
+ * @portlet.specification assert="SPEC:6 - The destroy method must not be called
because the initialization is
+ * considered unsuccessful."
+ * @portlet.specification assert="SPEC:8 - A RuntimeException thrown during
initialization must be handled as a
+ * PortletException."
+ */
+ public void createExceptionsOnInitCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("ExceptionsOnInit", seq);
+ //PortletExceptionDuringInitPortlet
+ seq.addAction(0, PortletExceptionDuringInitPortlet.RENDER_JOINPOINT, new
PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ PortletExceptionDuringInitPortlet.rendered = true;
+ return null;
+ }
+ });
+
+ //RuntimeExceptionDuringInitPortlet
+ seq.addAction(0, RuntimeExceptionDuringInitPortlet.RENDER_JOINPOINT, new
PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ RuntimeExceptionDuringInitPortlet.rendered = true;
+ return null;
+ }
+ });
+
+ //UnavailableExceptionDuringInitPortlet
+ seq.addAction(0, UnavailableExceptionDuringInitPortlet.RENDER_JOINPOINT, new
PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ UnavailableExceptionDuringInitPortlet.rendered = true;
+ return null;
+ }
+ });
+
+ //ControllerPortlet
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new InvokeGetResponse(response.createRenderURL().toString());
+ }
+ });
+
+ seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new InvokeGetResponse(response.createRenderURL().toString());
+ }
+ });
+
+ seq.addAction(2, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ //portlets shouldn't render itself
+ assertEquals(false, PortletExceptionDuringInitPortlet.rendered);
+ assertEquals(false, UnavailableExceptionDuringInitPortlet.rendered);
+ assertEquals(false, RuntimeExceptionDuringInitPortlet.rendered);
+
+ //and shouldn't be destroyed as Exceptions on init() were throwed
+ assertEquals(false, PortletExceptionDuringInitPortlet.destroyed);
+ assertEquals(false, UnavailableExceptionDuringInitPortlet.destroyed);
+ assertEquals(false, RuntimeExceptionDuringInitPortlet.destroyed);
+ return new EndTestResponse();
+ }
+ });
+
+ }
+
+ /**
+ * @portlet.specification assert="SPEC:9 - If the client request is triggered by
an action URL, the
+ * portal/portlet-container must first trigger the action request by invoking the
processAction method of the
+ * targeted portlet."
+ */
+ public void createInvokeActionFirstCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("InvokeActionFirst", seq);
+ final Boolean[] actionInvoked= new Boolean[1];
+
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new InvokeGetResponse(response.createActionURL().toString());
+ }
+ });
+
+ seq.addAction(1, UTP1.ACTION_JOINPOINT, new PortletActionTestAction()
+ {
+ protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context)
+ {
+ actionInvoked[0] = Boolean.TRUE;
+ }
+ });
+
+ seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ assertEquals(Boolean.TRUE, actionInvoked[0]);
+ return new EndTestResponse();
+ }
+ });
+ }
+
+
+ /**
+ * @portlet.specification assert="SPEC:10 - The portal/portlet-container must
wait until the action request finishes.
+ * Then, the portal/portlet-container must trigger the render request by invoking the
render method for all the
+ * portlets in the portal page with the possible exception of portlets for which their
content is being cached."
+ */
+ public void createInvokeRenderAfterActionURLCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("InvokeRenderAfterActionURL", seq);
+ final Boolean[] actionInvoked= new Boolean[1];
+
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new InvokeGetResponse(response.createRenderURL().toString());
+ }
+ });
+
+ seq.addAction(0, UTP2.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ //pass action url
+ UTP2.holder = response.createActionURL().toString();
+ return null;
+ }
+ });
+
+ seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ //get portlet b action url and invoke
+ assertNotNull(UTP2.holder);
+ return new InvokeGetResponse((String)UTP2.holder);
+ }
+ });
+
+ seq.addAction(2, UTP2.ACTION_JOINPOINT, new PortletActionTestAction()
+ {
+ protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context)
+ {
+ //mark action phase invokation
+ actionInvoked[0] = Boolean.TRUE;
+ }
+ });
+
+ seq.addAction(2, UTP2.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ //assert that render is after Portlet B action
+ assertEquals(Boolean.TRUE, actionInvoked[0]);
+ return null;
+ }
+ });
+
+ seq.addAction(2, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ //assert that render is after Portlet B action
+ assertEquals(Boolean.TRUE, actionInvoked[0]);
+ //and reinvoke itself
+ return new InvokeGetResponse(response.createRenderURL().toString());
+ }
+ });
+
+ seq.addAction(3, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ /**
+ * @portlet.specification assert="SPEC:11 - If the client request is triggered by
a render URL, the
+ * portal/portlet-container must invoke the render method for all the portlets in the
portal page with the possible
+ * exception of portlets for which their content is being cached."
+ */
+ public void createInvokeRenderAfterRenderURLCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("InvokeRenderAfterRenderURL", seq);
+
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new InvokeGetResponse(response.createRenderURL().toString());
+ }
+ });
+
+ seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new InvokeGetResponse(response.createRenderURL().toString());
+ }
+ });
+
+ seq.addAction(1, UTP2.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ //mark that Portlet B was invoked after portlet A render url
+ UTP2.holder = Boolean.TRUE;
+ return null;
+ }
+ });
+
+ seq.addAction(2, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ //assert Portlet B was invoked
+ assertEquals(Boolean.TRUE, (Object)UTP2.holder);
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ /**
+ * @portlet.specification assert="SPEC:12 - While processing an action request,
the portlet may instruct the
+ * portal/portlet-container to redirect the user to a specific URL. If the portlet
issues a redirection, when the
+ * processAction method concludes, the portal/portlet-container must send the
redirection back to the user agent"
+ */
+ public void createSendRedirectDuringActionCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("SendRedirectDuringAction", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new InvokeGetResponse(response.createActionURL().toString());
+ }
+ });
+
+ seq.addAction(1, UTP1.ACTION_JOINPOINT, new PortletActionTestAction()
+ {
+ protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context) throws PortletException, PortletSecurityException,
IOException
+ {
+ String path = request.getContextPath() + "/universalServletA";
+ response.sendRedirect(path);
+ }
+ });
+
+ seq.addAction(1, UTS1.SERVICE_JOINPOINT, new ServletServiceTestAction()
+ {
+ protected DriverResponse run(Servlet servlet, HttpServletRequest request,
HttpServletResponse response, PortletTestContext context) throws ServletException,
IOException
+ {
+ return new EndTestResponse();
+ }
+ });
+
+ seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ //We shouldn't be here
+ return new FailureResponse("Render wasn't expected to be
invoked");
+ }
+ });
+ }
+
+ public void createMinimizedStateDontRenderPortlet(PortletTestDriver registry)
+ {
+ registry.addSequence("MinimizedStateDontRenderPortlet", new
PortletTest());
+ }
+
+ /**
+ * SPEC:17 Testable=true Section=PLT.5.2.4.4
+ * SPEC:18 Testable=false Section=PLT.5.2.4.4
+ * SPEC:19 Testable=true Section=PLT.5.2.4.4
+ * This case is based on:
+ * - ExceptionsDuringRequestHandlingControllerPortlet
+ * - PortletExceptionDuringRequestHandlingPortlet
+ * - RuntimeExceptionDuringRequestHandlingPortlet
+ * - UnavailableExceptionDuringProcessActionPortlet
+ * - UnavailableExceptionDuringRenderPortlet
+ *
+ * This test is disabled. Specification doesn't defined strictly portal behaviour
when
+ * one of the portlets throws PortletException. Currently in JBoss Portal if one
portlet
+ * throws an PortletException than the rest of portlet of the page is not rendered -
code 500
+ * is returned. Tests are based on different behaviour where rest of portlets are
rendered.
+ */
+ /////suite.addTest(new
PortletTestCase("ExceptionsDuringRequestHandlingPortlet"));
+
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/PortletInterfaceSequenceBuilder.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/PortletInterfaceTestSuite.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/PortletInterfaceTestSuite.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/PortletInterfaceTestSuite.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,112 @@
+/******************************************************************************
+ * 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.jsr168.tck.portletinterface;
+
+import junit.framework.Test;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 5510 $
+ */
+public class PortletInterfaceTestSuite
+{
+ public static Test suite()
+ {
+// TestSuite suite = new TestSuite("test-jsr168-portletinterface.war");
+//
+// //SPEC:4 Testable=true Section=PLT.5.2.2
+// suite.addTest(new TestCase("InitializeBeforeHandle"));
+//
+// /**
+// * SPEC:5 Testable=true Section=PLT.5.2.2.1
+// * SPEC:6 Testable=true Section=PLT.5.2.2.1
+// * SPEC:8 Testable=true Section=PLT.5.2.2.1
+// * This case is based on:
+// * - PortletExceptionDuringInitPortlet
+// * - RuntimeExceptionDuringInitPortlet
+// * - UnavailableExceptionDuringInitPortlet
+// */
+// suite.addTest(new TestCase("ExceptionsOnInit"));
+//
+// /**
+// * SPEC:7 Testable=true Section=PLT.5.2.2.1
+// * POSTPONED
+// */
+//
+// /**
+// * SPEC:9 Testable=true Section=PLT 5.2.4
+// */
+// suite.addTest(new TestCase("InvokeActionFirst"));
+//
+// /**
+// * SPEC:10 Testable=true Section=PLT 5.2.4
+// */
+// suite.addTest(new TestCase("InvokeRenderAfterActionURL"));
+//
+// /**
+// * SPEC:11 Testable=true Section=PLT 5.2.4
+// */
+// suite.addTest(new TestCase("InvokeRenderAfterRenderURL"));
+//
+// /**
+// * SPEC:12 Testable= true Section=PLT.5.2.4.1
+// */
+// suite.addTest(new TestCase("SendRedirectDuringAction"));
+//
+// /**
+// * SPEC:13 Testable= true Section=PLT.5.2.4.2.1
+// * SPEC:14 Testable= true Section=PLT.5.2.4.2.1
+// * SPEC:15 Testable= true Section=PLT.5.2.4.2.1
+// * -----> Tested in SPEC:36
+// * - portletmode/spec/RequestDispatchingDependingOnModePortlet (SPEC:36)
+// */
+//
+// /**
+// * SPEC:16 Testable=true Section=PLT 5.2.4.2.1
+// * - MinimizedStateDontRenderPortlet
+// */
+// suite.addTest(new TestCase("MinimizedStateDontRenderPortlet"));
+//
+// /**
+// * SPEC:17 Testable=true Section=PLT.5.2.4.4
+// * SPEC:18 Testable=false Section=PLT.5.2.4.4
+// * SPEC:19 Testable=true Section=PLT.5.2.4.4
+// * This case is based on:
+// * - ExceptionsDuringRequestHandlingControllerPortlet
+// * - PortletExceptionDuringRequestHandlingPortlet
+// * - RuntimeExceptionDuringRequestHandlingPortlet
+// * - UnavailableExceptionDuringProcessActionPortlet
+// * - UnavailableExceptionDuringRenderPortlet
+// *
+// * This test is disabled. Specification doesn't defined strictly portal
behaviour when
+// * one of the portlets throws PortletException. Currently in JBoss Portal if one
portlet
+// * throws an PortletException than the rest of portlet of the page is not
rendered - code 500
+// * is returned. Tests are based on different behaviour where rest of portlets are
rendered.
+// */
+// /////suite.addTest(new
PortletTestCase("ExceptionsDuringRequestHandlingPortlet"));
+//
+//
+// return suite;
+ return null;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/PortletInterfaceTestSuite.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/spec/ExceptionsDuringRequestHandlingControllerPortlet.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/spec/ExceptionsDuringRequestHandlingControllerPortlet.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/spec/ExceptionsDuringRequestHandlingControllerPortlet.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,110 @@
+/******************************************************************************
+ * 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.jsr168.tck.portletinterface.spec;
+
+import org.jboss.portal.test.framework.driver.http.HttpTestContext;
+import org.jboss.portal.test.framework.driver.response.EndTestResponse;
+import org.jboss.portal.test.framework.driver.DriverResponse;
+import org.jboss.portal.common.junit.ExtendedAssert;
+import org.jboss.portal.test.framework.driver.http.response.InvokeGetResponse;
+import org.jboss.portal.test.framework.portlet.components.AbstractTestPortlet;
+
+import javax.portlet.PortletException;
+import javax.portlet.PortletSecurityException;
+import javax.portlet.PortletURL;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import java.io.IOException;
+
+/**
+ * DISABLED - NOT CURRENTLY USED TEST CASE
+ *
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 7954 $
+ * @portlet.specification assert="SPEC:17 -"A PortletException signals that an
error has occurred during the processing
+ * of the request and that the portlet container should take appropriate measures to
clean up the request. If a portlet
+ * throws an exception in the processAction method, all operations on the ActionResponse
must be ignored and the render
+ * method must not be invoked within the current client request"
+ * @portlet.specification assert="SPEC:18 - If a permanent unavailability is
indicated by the UnavailableException, the
+ * portlet container must remove the portlet from service immediately, call the portlet�s
destroy method, and release
+ * the portlet object."
+ * @portlet.specification assert="SPEC:19 - "A RuntimeException thrown during
the request handling must be handled as a
+ * PortletException"
+ */
+public class ExceptionsDuringRequestHandlingControllerPortlet extends
AbstractTestPortlet
+{
+ //we override this to force 3 Portlets to have same test id
+ protected String createTestName(Class clazz)
+ {
+ return "ExceptionsDuringRequestHandlingPortlet";
+ }
+
+ protected DriverResponse doRender(RenderRequest req, RenderResponse resp,
HttpTestContext context) throws PortletException, PortletSecurityException, IOException
+ {
+ if (context.getRequestCount() == 0)
+ {
+ //Just repaint
+ PortletURL url = resp.createRenderURL();
+ return new InvokeGetResponse(url.toString());
+ }
+ else if (context.getRequestCount() == 1)
+ {
+ //Invoke PortletExceptionDuringRequestHandlingPortlet action
+ return new
InvokeGetResponse(PortletExceptionDuringRequestHandlingPortlet.actionURL);
+ }
+ else if (context.getRequestCount() == 2)
+ {
+ //Invoke RuntimeExceptionDuringRequestHandlingPortlet action
+ return new
InvokeGetResponse(RuntimeExceptionDuringRequestHandlingPortlet.actionURL);
+ }
+ else if (context.getRequestCount() == 3)
+ {
+ //Invoke UnavailableExceptionDuringProcessActionPortlet action
+ return new
InvokeGetResponse(UnavailableExceptionDuringProcessActionPortlet.actionURL);
+ }
+ else if (context.getRequestCount() == 4)
+ {
+ //Just repaint
+ PortletURL url = resp.createRenderURL();
+ return new InvokeGetResponse(url.toString());
+ }
+ else if (HttpTestContext.isCurrentRequestCount(5))
+ {
+ //portlets that shouldn't render itself after Exception in Action Phase
+ ExtendedAssert.assertEquals(false,
PortletExceptionDuringRequestHandlingPortlet.rendered);
+ ExtendedAssert.assertEquals(false,
RuntimeExceptionDuringRequestHandlingPortlet.rendered);
+ ExtendedAssert.assertEquals(false,
UnavailableExceptionDuringProcessActionPortlet.rendered);
+
+ //and should be destroyed because of UnavailableException was throwed
+ ExtendedAssert.assertEquals(true,
UnavailableExceptionDuringProcessActionPortlet.destroyed);
+ ExtendedAssert.assertEquals(true,
UnavailableExceptionDuringRenderPortlet.destroyed);
+
+ //
+ return new EndTestResponse();
+ }
+ else
+ {
+ return null;
+ }
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/spec/ExceptionsDuringRequestHandlingControllerPortlet.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/spec/InitializeBeforeHandlePortlet.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/spec/InitializeBeforeHandlePortlet.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/spec/InitializeBeforeHandlePortlet.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,54 @@
+/******************************************************************************
+ * 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.jsr168.tck.portletinterface.spec;
+
+import org.jboss.portal.test.framework.portlet.Joinpoint;
+import org.jboss.portal.test.framework.portlet.components.AbstractUniversalTestPortlet;
+
+import javax.portlet.PortletConfig;
+import javax.portlet.PortletException;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 5572 $
+ * @portlet.specification assert="SPEC:4 - After the portlet object is instantiated,
the portlet container must
+ * initialize the portlet before invoking it to handle requests"
+ */
+public class InitializeBeforeHandlePortlet extends AbstractUniversalTestPortlet
+{
+ public static boolean init = false;
+
+ public static String NAME = "InitializeBeforeHandlePortlet";
+
+ public final static Joinpoint RENDER_JOINPOINT = new Joinpoint(NAME,
Joinpoint.PORTLET_RENDER);
+
+ public final static Joinpoint ACTION_JOINPOINT = new Joinpoint(NAME,
Joinpoint.PORTLET_ACTION);
+
+ public void init(PortletConfig config) throws PortletException
+ {
+ super.init(config);
+
+ //
+ init = true;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/spec/InitializeBeforeHandlePortlet.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/spec/MinimizedStateDontRenderPortlet.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/spec/MinimizedStateDontRenderPortlet.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/spec/MinimizedStateDontRenderPortlet.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,118 @@
+/******************************************************************************
+ * 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.jsr168.tck.portletinterface.spec;
+
+import org.jboss.portal.test.framework.driver.response.EndTestResponse;
+import org.jboss.portal.test.framework.driver.response.ErrorResponse;
+import org.jboss.portal.test.framework.driver.DriverResponse;
+import org.jboss.portal.common.junit.ExtendedAssert;
+import org.jboss.portal.test.framework.driver.http.response.InvokeGetResponse;
+import org.jboss.portal.test.framework.portlet.components.AbstractTestGenericPortlet;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+
+import javax.portlet.PortletException;
+import javax.portlet.PortletMode;
+import javax.portlet.PortletURL;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.WindowState;
+import java.io.IOException;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 7954 $
+ * @portlet.specification assert="SPEC:16 - If the window state of the portlet (see
PLT.9 Window States Chapter) is
+ * MINIMIZED, the render method of the GenericPortlet does not invoke any of the portlet
mode rendering methods"
+ */
+public class MinimizedStateDontRenderPortlet extends AbstractTestGenericPortlet
+{
+
+ private String rendered;
+
+ protected void doView(final RenderRequest request, RenderResponse response) throws
PortletException, IOException
+ {
+ // Shouldn't be here
+ rendered = "doView";
+ }
+
+ protected void doEdit(final RenderRequest request, RenderResponse response) throws
PortletException, IOException
+ {
+ // Shouldn't be here
+ rendered = "doEdit";
+ }
+
+ protected void doHelp(final RenderRequest request, RenderResponse response) throws
PortletException, IOException
+ {
+ // Shouldn't be here
+ rendered = "doHelp";
+ }
+
+ protected void preRender(RenderRequest req, RenderResponse resp, PortletTestContext
context) throws PortletException, IOException
+ {
+ rendered = null;
+ }
+
+ protected DriverResponse postRender(RenderRequest req, RenderResponse resp,
PortletTestContext context) throws PortletException, IOException
+ {
+ switch(context.getRequestCount())
+ {
+ case 0:
+ {
+ // Invoking VIEW mode
+ PortletURL url = resp.createRenderURL();
+ url.setPortletMode(PortletMode.VIEW);
+ url.setWindowState(WindowState.MINIMIZED);
+ return new InvokeGetResponse(url.toString());
+ }
+ case 1:
+ {
+ ExtendedAssert.assertNull(rendered);
+
+ // Invoking EDIT mode
+ PortletURL url = resp.createRenderURL();
+ url.setPortletMode(PortletMode.EDIT);
+ url.setWindowState(WindowState.MINIMIZED);
+ return new InvokeGetResponse(url.toString());
+ }
+ case 2:
+ {
+ ExtendedAssert.assertNull(rendered);
+
+ // Invoking HELP mode
+ PortletURL url = resp.createRenderURL();
+ url.setPortletMode(PortletMode.HELP);
+ url.setWindowState(WindowState.MINIMIZED);
+ return new InvokeGetResponse(url.toString());
+ }
+ case 3:
+ {
+ ExtendedAssert.assertNull(rendered);
+
+ //
+ return new EndTestResponse();
+ }
+ default:
+ return new ErrorResponse();
+ }
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/spec/MinimizedStateDontRenderPortlet.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/spec/PortletExceptionDuringInitPortlet.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/spec/PortletExceptionDuringInitPortlet.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/spec/PortletExceptionDuringInitPortlet.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,82 @@
+/******************************************************************************
+ * 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.jsr168.tck.portletinterface.spec;
+
+import org.jboss.portal.test.framework.portlet.Joinpoint;
+import org.jboss.portal.test.framework.portlet.components.AbstractUniversalTestPortlet;
+
+import javax.portlet.PortletConfig;
+import javax.portlet.PortletException;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 5572 $
+ * @portlet.specification assert="SPEC:5 - During initialization, the portlet object
may throw an UnavailableException
+ * or a PortletException. In this case, the portlet container must not place the portlet
object into active service and
+ * it must release the portlet object."
+ * @portlet.specification assert="SPEC:6 - The destroy method must not be called
because the initialization is
+ * considered unsuccessful."
+ */
+public class PortletExceptionDuringInitPortlet extends AbstractUniversalTestPortlet
+{
+
+ public static String NAME = "PortletExceptionDuringInitPortlet";
+
+ public final static Joinpoint RENDER_JOINPOINT = new Joinpoint(NAME,
Joinpoint.PORTLET_RENDER);
+
+ public final static Joinpoint ACTION_JOINPOINT = new Joinpoint(NAME,
Joinpoint.PORTLET_ACTION);
+
+ //This is static becouse value is shared beetween portlet instances
+ public static boolean rendered = false;
+ public static boolean destroyed = false;
+
+ //we override this to force 3 Portlets to have same test id
+ protected String createCaseTestId(Class clazz)
+ {
+ return "ExceptionsOnInitPortlet";
+ }
+
+ public void init(PortletConfig config) throws PortletException
+ {
+ super.init(config);
+
+ //
+ throw new PortletException();
+ }
+
+ /*protected void doRender(RenderRequest req, RenderResponse resp) throws
PortletException, PortletSecurityException, IOException
+ {
+ rendered = true;
+ }*/
+
+ public void destroy()
+ {
+ destroyed = true;
+ }
+
+ protected void reset()
+ {
+ rendered = false;
+ destroyed = false;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/spec/PortletExceptionDuringInitPortlet.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/spec/PortletExceptionDuringRequestHandlingPortlet.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/spec/PortletExceptionDuringRequestHandlingPortlet.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/spec/PortletExceptionDuringRequestHandlingPortlet.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,87 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.portlet.jsr168.tck.portletinterface.spec;
+
+import org.jboss.portal.test.framework.driver.http.HttpTestContext;
+import org.jboss.portal.test.framework.portlet.components.AbstractTestPortlet;
+import org.jboss.portal.test.framework.driver.DriverResponse;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.PortletException;
+import javax.portlet.PortletURL;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import java.io.IOException;
+
+/**
+ * DISABLED - NOT CURRENTLY USED TEST CASE
+ *
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 7954 $
+ * @portlet.specification assert="SPEC:17 -"A PortletException signals that an
error has occurred during the processing
+ * of the request and that the portlet container should take appropriate measures to
clean up the request. If a portlet
+ * throws an exception in the processAction method, all operations on the ActionResponse
must be ignored and the render
+ * method must not be invoked within the current client request"
+ */
+public class PortletExceptionDuringRequestHandlingPortlet extends AbstractTestPortlet
+{
+ // This is static becouse value is shared beetween portlet instances
+ public static boolean rendered;
+ public static boolean destroyed;
+ public static String actionURL = "";
+
+ // We override this to force 3 Portlets to have same test id
+ protected String createTestName(Class clazz)
+ {
+ return "ExceptionsDuringRequestHandlingPortlet";
+ }
+
+ protected DriverResponse doProcessAction(ActionRequest req, ActionResponse resp,
HttpTestContext context) throws PortletException, IOException
+ {
+ if (context.isRequestCount(2))
+ {
+ throw new PortletException();
+ }
+ return null;
+ }
+
+ protected DriverResponse doRender(RenderRequest req, RenderResponse resp,
HttpTestContext context) throws PortletException, IOException
+ {
+ if (context.isRequestCount(0))
+ {
+ PortletURL url = resp.createActionURL();
+ actionURL = url.toString();
+ }
+ else if (context.isRequestCount(2))
+ {
+ PortletExceptionDuringRequestHandlingPortlet.rendered = true;
+ }
+ return null;
+ }
+
+ public void destroy()
+ {
+ PortletExceptionDuringRequestHandlingPortlet.destroyed = true;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/spec/PortletExceptionDuringRequestHandlingPortlet.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/spec/RuntimeExceptionDuringInitPortlet.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/spec/RuntimeExceptionDuringInitPortlet.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/spec/RuntimeExceptionDuringInitPortlet.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,85 @@
+/******************************************************************************
+ * 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.jsr168.tck.portletinterface.spec;
+
+import org.jboss.portal.test.framework.portlet.Joinpoint;
+import org.jboss.portal.test.framework.portlet.components.AbstractUniversalTestPortlet;
+
+import javax.portlet.PortletConfig;
+import javax.portlet.PortletException;
+
+/**
+ * DISABLED - NOT CURRENTLY USED TEST CASE
+ *
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 5572 $
+ * @portlet.specification assert="SPEC:5 - During initialization, the portlet object
may throw an UnavailableException
+ * or a PortletException. In this case, the portlet container must not place the portlet
object into active service and
+ * it must release the portlet object."
+ * @portlet.specification assert="SPEC:6 - The destroy method must not be called
because the initialization is
+ * considered unsuccessful."
+ * @portlet.specification assert="SPEC:8 - A RuntimeException thrown during
initialization must be handled as a
+ * PortletException."
+ */
+public class RuntimeExceptionDuringInitPortlet extends AbstractUniversalTestPortlet
+{
+ public static String NAME = "RuntimeExceptionDuringInitPortlet";
+
+ public final static Joinpoint RENDER_JOINPOINT = new Joinpoint(NAME,
Joinpoint.PORTLET_RENDER);
+
+ public final static Joinpoint ACTION_JOINPOINT = new Joinpoint(NAME,
Joinpoint.PORTLET_ACTION);
+
+ //This is static becouse value is shared beetween portlet instances
+ public static boolean rendered;
+ public static boolean destroyed;
+
+ //we override this to force 3 Portlets to have same test id
+ /*protected String createCaseTestId(Class clazz)
+ {
+ return "ExceptionsOnInitPortlet";
+ }*/
+
+ public void init(PortletConfig config) throws PortletException
+ {
+ super.init(config);
+
+ //
+ throw new RuntimeException();
+ }
+
+ /*protected void doRender(RenderRequest req, RenderResponse resp) throws
PortletException, PortletSecurityException, IOException
+ {
+ RuntimeExceptionDuringInitPortlet.rendered = true;
+ }*/
+
+ public void destroy()
+ {
+ RuntimeExceptionDuringInitPortlet.destroyed = true;
+ }
+
+ protected void reset()
+ {
+ rendered = false;
+ destroyed = false;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/spec/RuntimeExceptionDuringInitPortlet.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/spec/RuntimeExceptionDuringRequestHandlingPortlet.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/spec/RuntimeExceptionDuringRequestHandlingPortlet.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/spec/RuntimeExceptionDuringRequestHandlingPortlet.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -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.test.portlet.jsr168.tck.portletinterface.spec;
+
+import org.jboss.portal.test.framework.driver.http.HttpTestContext;
+import org.jboss.portal.test.framework.portlet.components.AbstractTestPortlet;
+import org.jboss.portal.test.framework.driver.DriverResponse;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.PortletException;
+import javax.portlet.PortletURL;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import java.io.IOException;
+
+/**
+ * DISABLED - NOT CURRENTLY USED TEST CASE
+ *
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 7954 $
+ * @portlet.specification assert="SPEC:17 -"A PortletException signals that an
error has occurred during the processing
+ * of the request and that the portlet container should take appropriate measures to
clean up the request. If a portlet
+ * throws an exception in the processAction method, all operations on the ActionResponse
must be ignored and the render
+ * method must not be invoked within the current client request"
+ * @portlet.specification assert="SPEC:19 - "A RuntimeException thrown during
the request handling must be handled as a
+ * PortletException"
+ */
+public class RuntimeExceptionDuringRequestHandlingPortlet extends AbstractTestPortlet
+{
+ //This is static becouse value is shared beetween portlet instances
+ public static boolean rendered;
+ public static boolean destroyed;
+ public static String actionURL = "";
+
+ //we override this to force 3 Portlets to have same test id
+ protected String createTestName(Class clazz)
+ {
+ return "ExceptionsDuringRequestHandlingPortlet";
+ }
+
+ protected DriverResponse doProcessAction(ActionRequest req, ActionResponse resp,
HttpTestContext context) throws PortletException, IOException
+ {
+ if (context.isRequestCount(3))
+ {
+ //throw new RuntimeException();
+ }
+ return null;
+ }
+
+ protected DriverResponse doRender(RenderRequest req, RenderResponse resp,
HttpTestContext context) throws PortletException, IOException
+ {
+ if (context.isRequestCount(0))
+ {
+ PortletURL url = resp.createActionURL();
+ actionURL = url.toString();
+ }
+ if (context.isRequestCount(3))
+ {
+ RuntimeExceptionDuringRequestHandlingPortlet.rendered = true;
+ }
+ return null;
+ }
+
+ public void destroy()
+ {
+ RuntimeExceptionDuringRequestHandlingPortlet.destroyed = true;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/spec/RuntimeExceptionDuringRequestHandlingPortlet.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/spec/UnavailableExceptionDuringInitPortlet.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/spec/UnavailableExceptionDuringInitPortlet.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/spec/UnavailableExceptionDuringInitPortlet.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,78 @@
+/******************************************************************************
+ * 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.jsr168.tck.portletinterface.spec;
+
+import org.jboss.portal.test.framework.portlet.Joinpoint;
+import org.jboss.portal.test.framework.portlet.components.AbstractUniversalTestPortlet;
+
+import javax.portlet.PortletConfig;
+import javax.portlet.PortletException;
+import javax.portlet.UnavailableException;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 5572 $
+ * @portlet.specification assert="SPEC:5 - During initialization, the portlet object
may throw an UnavailableException
+ * or a PortletException. In this case, the portlet container must not place the portlet
object into active service and
+ * it must release the portlet object."
+ * @portlet.specification assert="SPEC:6 - The destroy method must not be called
because the initialization is
+ * considered unsuccessful."
+ */
+public class UnavailableExceptionDuringInitPortlet extends AbstractUniversalTestPortlet
+{
+
+ public static String NAME = "UnavailableExceptionDuringInitPortlet";
+
+ public final static Joinpoint RENDER_JOINPOINT = new Joinpoint(NAME,
Joinpoint.PORTLET_RENDER);
+
+ public final static Joinpoint ACTION_JOINPOINT = new Joinpoint(NAME,
Joinpoint.PORTLET_ACTION);
+
+ //This is static becouse value is shared beetween portlet instances
+ public static boolean rendered;
+ public static boolean destroyed;
+
+ //we override this to force 3 Portlets to have same test id
+ protected String createCaseTestId(Class clazz)
+ {
+ return "ExceptionsOnInitPortlet";
+ }
+
+ public void init(PortletConfig config) throws PortletException
+ {
+ super.init(config);
+
+ //
+ throw new UnavailableException("Unavailable for testing purposes");
+ }
+
+ public void destroy()
+ {
+ destroyed = true;
+ }
+
+ protected void reset()
+ {
+ rendered = false;
+ destroyed = false;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/spec/UnavailableExceptionDuringInitPortlet.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/spec/UnavailableExceptionDuringProcessActionPortlet.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/spec/UnavailableExceptionDuringProcessActionPortlet.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/spec/UnavailableExceptionDuringProcessActionPortlet.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,87 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.portlet.jsr168.tck.portletinterface.spec;
+
+import org.jboss.portal.test.framework.driver.http.HttpTestContext;
+import org.jboss.portal.test.framework.portlet.components.AbstractTestPortlet;
+import org.jboss.portal.test.framework.driver.DriverResponse;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.PortletException;
+import javax.portlet.PortletURL;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import java.io.IOException;
+
+/**
+ * DISABLED - NOT CURRENTLY USED TEST CASE
+ *
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 7954 $
+ * @portlet.specification assert="SPEC:18 - If a permanent unavailability is
indicated by the UnavailableException, the
+ * portlet container must remove the portlet from service immediately, call the portlet�s
destroy method, and release
+ * the portlet object."
+ */
+public class UnavailableExceptionDuringProcessActionPortlet extends AbstractTestPortlet
+{
+
+ // This is static becouse value is shared beetween portlet instances
+ public static boolean rendered;
+ public static boolean destroyed;
+ public static String actionURL = "";
+
+ // We override this to force 3 Portlets to have same test id
+ protected String createTestName(Class clazz)
+ {
+ return "ExceptionsDuringRequestHandlingPortlet";
+ }
+
+ protected DriverResponse doProcessAction(ActionRequest req, ActionResponse resp,
HttpTestContext context) throws PortletException, IOException
+ {
+ if (context.isRequestCount(4))
+ {
+ //throw new UnavailableException("UnavailableException thrown during action
phase for testing purposes");
+ }
+ return null;
+ }
+
+ protected DriverResponse doRender(RenderRequest req, RenderResponse resp,
HttpTestContext context) throws PortletException, IOException
+ {
+ if (context.isRequestCount(0))
+ {
+ PortletURL url = resp.createActionURL();
+ actionURL = url.toString();
+ }
+ if (context.isRequestCount(4))
+ {
+ UnavailableExceptionDuringProcessActionPortlet.rendered = true;
+ }
+ return null;
+ }
+
+ public void destroy()
+ {
+ UnavailableExceptionDuringProcessActionPortlet.destroyed = true;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/spec/UnavailableExceptionDuringProcessActionPortlet.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/spec/UnavailableExceptionDuringRenderPortlet.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/spec/UnavailableExceptionDuringRenderPortlet.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/spec/UnavailableExceptionDuringRenderPortlet.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -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.portlet.jsr168.tck.portletinterface.spec;
+
+import org.jboss.portal.test.framework.driver.http.HttpTestContext;
+import org.jboss.portal.test.framework.portlet.components.AbstractTestPortlet;
+import org.jboss.portal.test.framework.driver.DriverResponse;
+
+import javax.portlet.PortletException;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.UnavailableException;
+import java.io.IOException;
+
+/**
+ * DISABLED - NOT CURRENTLY USED TEST CASE
+ *
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 7954 $
+ * @portlet.specification assert="SPEC:18 - If a permanent unavailability is
indicated by the UnavailableException, the
+ * portlet container must remove the portlet from service immediately, call the portlet�s
destroy method, and release
+ * the portlet object."
+ */
+public class UnavailableExceptionDuringRenderPortlet extends AbstractTestPortlet
+{
+ //This is static becouse value is shared beetween portlet instances
+ public static boolean destroyed;
+
+ //we override this to force 3 Portlets to have same test id
+ protected String createTestName(Class clazz)
+ {
+ return "ExceptionsDuringRequestHandlingPortlet";
+ }
+
+ protected DriverResponse doRender(RenderRequest req, RenderResponse resp,
HttpTestContext context) throws PortletException, IOException
+ {
+ if (context.isRequestCount(0))
+ {
+ throw new UnavailableException("UnavailableException thrown during render
phase for testing purposes");
+ }
+ return null;
+ }
+
+ public void destroy()
+ {
+ UnavailableExceptionDuringRenderPortlet.destroyed = true;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletinterface/spec/UnavailableExceptionDuringRenderPortlet.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletmode/PortletModeSequenceBuilder.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletmode/PortletModeSequenceBuilder.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletmode/PortletModeSequenceBuilder.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,126 @@
+/******************************************************************************
+ * 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.jsr168.tck.portletmode;
+
+import org.jboss.portal.test.framework.driver.response.EndTestResponse;
+import org.jboss.portal.test.framework.driver.http.response.InvokeGetResponse;
+import org.jboss.portal.test.framework.driver.DriverResponse;
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestDriver;
+import org.jboss.portal.test.framework.portlet.PortletTestSuite;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.framework.UTP1;
+import
org.jboss.portal.test.portlet.jsr168.tck.portletmode.spec.NotInvokeModeDeclaredForNotSupportedMarkupHelperPortlet;
+
+import javax.portlet.Portlet;
+import javax.portlet.PortletMode;
+import javax.portlet.PortletModeException;
+import javax.portlet.PortletURL;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 7954 $
+ */
+public class PortletModeSequenceBuilder extends PortletTestSuite
+{
+ /**
+ * @portlet.specification assert="SPEC:38 - The portlet must not be invoked in a
portlet mode that has not been
+ * declared as supported for a given markup type"
+ */
+ public void createNotInvokeModeDeclaredForNotSupportedMarkupCase(PortletTestDriver
registry)
+ {
+ PortletTest seq = new PortletTest();
+
+ seq.addAction(0,
NotInvokeModeDeclaredForNotSupportedMarkupHelperPortlet.RENDER_JOINPOINT, new
PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws PortletModeException
+ {
+ NotInvokeModeDeclaredForNotSupportedMarkupHelperPortlet.url =
response.createRenderURL();
+
NotInvokeModeDeclaredForNotSupportedMarkupHelperPortlet.url.setPortletMode(PortletMode.EDIT);
+ return null;
+ }
+ });
+
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ //just repost so other portlet can create url in first render
+ PortletURL url = response.createRenderURL();
+ return new InvokeGetResponse(url.toString());
+
+ }
+ });
+
+ seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ //invoke render url from different portlet to be able to call specific mode
for it
+ //it has Mode set to EDIT
+ return new
InvokeGetResponse(NotInvokeModeDeclaredForNotSupportedMarkupHelperPortlet.url.toString());
+ }
+ });
+
+ seq.addAction(2,
NotInvokeModeDeclaredForNotSupportedMarkupHelperPortlet.RENDER_JOINPOINT, new
PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws PortletModeException
+ {
+ if (request.getPortletMode().equals(PortletMode.EDIT))
+ {
+ //mark that we were invoked
+ UTP1.holder = Boolean.TRUE;
+ }
+ return null;
+ }
+ });
+
+ seq.addAction(2, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new InvokeGetResponse(response.createRenderURL().toString());
+ }
+ });
+
+ seq.addAction(3, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ //check that other portlet wasn't invoked
+ assertNull(UTP1.holder);
+ return new EndTestResponse();
+ }
+ });
+
+// registry.addSequence("NotInvokeModeDeclaredForNotSupportedMarkup",
seq);
+ }
+
+ public void createRequestDispatchingDependingOnModePortlet(PortletTestDriver
registry)
+ {
+ registry.addSequence("RequestDispatchingDependingOnModePortlet", new
PortletTest());
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletmode/PortletModeSequenceBuilder.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletmode/PortletModeTestSuite.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletmode/PortletModeTestSuite.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletmode/PortletModeTestSuite.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,59 @@
+/******************************************************************************
+ * 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.jsr168.tck.portletmode;
+
+import junit.framework.Test;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.com">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 5510 $
+ */
+public class PortletModeTestSuite
+{
+ public static Test suite()
+ {
+// TestSuite suite = new TestSuite("test-jsr168-portletmode.war");
+//
+// /**
+// * SPEC:36 Testable=true Section=PLT.8.5
+// * - RequestDispatchingDependingOnModePortlet
+// */
+// suite.addTest(new
TestCase("RequestDispatchingDependingOnModePortlet"));
+//
+// /**
+// * SPEC:37 Testable=true Section=PLT.8.6
+// * Tested in SPEC:36 - RequestDispatchingDependingOnModePortlet as VIEW mode
isn't specified in descriptor
+// */
+//
+// /**
+// * SPEC:38 Testable=true Section=PLT.8.6
+// * - NotInvokeModeDeclaredForNotSupportedMarkupPortlet
+// * - NotInvokeModeDeclaredForNotSupportedMarkupHelperPortlet
+// */
+// //suite.addTest(new
TestCase("NotInvokeModeDeclaredForNotSupportedMarkup"));
+//
+// return suite;
+ return null;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletmode/PortletModeTestSuite.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletmode/spec/NotInvokeModeDeclaredForNotSupportedMarkupHelperPortlet.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletmode/spec/NotInvokeModeDeclaredForNotSupportedMarkupHelperPortlet.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletmode/spec/NotInvokeModeDeclaredForNotSupportedMarkupHelperPortlet.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,55 @@
+/******************************************************************************
+ * 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.jsr168.tck.portletmode.spec;
+
+import org.jboss.portal.test.framework.portlet.Joinpoint;
+import org.jboss.portal.test.framework.portlet.components.AbstractUniversalTestPortlet;
+
+import javax.portlet.PortletURL;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
+ * @version : 1.1 $
+ * @portlet.specification assert="SPEC:38 - The portlet must not be invoked in a
portlet mode that has not been declared
+ * as supported for a given markup type"
+ */
+public class NotInvokeModeDeclaredForNotSupportedMarkupHelperPortlet extends
AbstractUniversalTestPortlet
+{
+ public static PortletURL url;
+
+ public static String NAME =
"NotInvokeModeDeclaredForNotSupportedMarkupHelperPortlet";
+
+ public final static Joinpoint RENDER_JOINPOINT = new Joinpoint(NAME,
Joinpoint.PORTLET_RENDER);
+
+ public final static Joinpoint ACTION_JOINPOINT = new Joinpoint(NAME,
Joinpoint.PORTLET_ACTION);
+
+ protected String createComponentId()
+ {
+ return NAME;
+ }
+
+ protected void reset()
+ {
+ url = null;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletmode/spec/NotInvokeModeDeclaredForNotSupportedMarkupHelperPortlet.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletmode/spec/RequestDispatchingDependingOnModePortlet.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletmode/spec/RequestDispatchingDependingOnModePortlet.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletmode/spec/RequestDispatchingDependingOnModePortlet.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,134 @@
+/******************************************************************************
+ * 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.jsr168.tck.portletmode.spec;
+
+import org.jboss.portal.test.framework.portlet.components.AbstractTestGenericPortlet;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.driver.http.response.InvokeGetResponse;
+import org.jboss.portal.common.junit.ExtendedAssert;
+import org.jboss.portal.test.framework.driver.response.EndTestResponse;
+import org.jboss.portal.test.framework.driver.response.ErrorResponse;
+import org.jboss.portal.test.framework.driver.DriverResponse;
+
+import javax.portlet.PortletException;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.PortletMode;
+import javax.portlet.PortletURL;
+import java.io.IOException;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 7954 $
+ * @portlet.specification assert="SPEC:36 - The GenericPortlet class implementation
of the render method dispatches
+ * requests to the doView, doEdit or doHelp method depending on the portlet mode
indicated in the request using the
+ * doDispatch method."
+ */
+public class RequestDispatchingDependingOnModePortlet extends AbstractTestGenericPortlet
+{
+
+ /** . */
+ private String methodCall;
+
+ private PortletTestContext context;
+
+ protected void doView(final RenderRequest request, RenderResponse response) throws
PortletException, IOException
+ {
+ if (context.getRequestCount() == 1)
+ {
+ methodCall = "doView";
+ }
+ }
+
+ protected void doEdit(final RenderRequest request, RenderResponse response) throws
PortletException, IOException
+ {
+ if (context.getRequestCount() == 2)
+ {
+ methodCall = "doEdit";
+ }
+ }
+
+ protected void doHelp(final RenderRequest request, RenderResponse response) throws
PortletException, IOException
+ {
+ if (context.getRequestCount() == 3)
+ {
+ methodCall = "doHelp";
+ }
+ }
+
+ protected void preRender(RenderRequest req, RenderResponse resp, PortletTestContext
context) throws PortletException, IOException
+ {
+ this.context = context;
+ this.methodCall = null;
+ }
+
+ protected DriverResponse postRender(RenderRequest req, RenderResponse resp,
PortletTestContext context) throws PortletException, IOException
+ {
+ try
+ {
+ switch(context.getRequestCount())
+ {
+ case 0:
+ {
+ // Invoking VIEW mode
+ PortletURL url = resp.createRenderURL();
+ url.setPortletMode(PortletMode.VIEW);
+ return new InvokeGetResponse(url.toString());
+ }
+ case 1:
+ {
+ ExtendedAssert.assertEquals("doView", methodCall);
+
+ // Invoking EDIT mode
+ PortletURL url = resp.createRenderURL();
+ url.setPortletMode(PortletMode.EDIT);
+ return new InvokeGetResponse(url.toString());
+ }
+ case 2:
+ {
+ ExtendedAssert.assertEquals("doEdit", methodCall);
+
+ // Invoking HELP mode
+ PortletURL url = resp.createRenderURL();
+ url.setPortletMode(PortletMode.HELP);
+ return new InvokeGetResponse(url.toString());
+ }
+ case 3:
+ {
+ ExtendedAssert.assertEquals("doHelp", methodCall);
+
+ //
+ return new EndTestResponse();
+ }
+ default:
+ return new ErrorResponse();
+ }
+ }
+ finally
+ {
+ this.context = null;
+ this.methodCall = null;
+ }
+ }
+}
+
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletmode/spec/RequestDispatchingDependingOnModePortlet.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletrequests/PortletRequestTestSuite.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletrequests/PortletRequestTestSuite.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletrequests/PortletRequestTestSuite.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,108 @@
+/******************************************************************************
+ * 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.jsr168.tck.portletrequests;
+
+import junit.framework.Test;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5510 $
+ */
+public class PortletRequestTestSuite
+{
+ public static Test suite()
+ {
+// TestSuite suite = new TestSuite("test-jsr168-portletrequests.war");
+//
+// /**
+// * SPEC:48 Testable=true Section=PLT.11.1.1
+// * SPEC:49 Testable=true Section=PLT.11.1.1
+// * NOT TESTABLE - POSTPONED
+// */
+// /**
+// * SPEC:50 Testable= true Section=PLT.11.1.1
+// */
+// suite.addTest(new TestCase("ActionToRequestParametersNotPropagated"));
+//
+// /**
+// * SPEC:52 Testable=true Section=PLT.11.1.1
+// */
+// suite.addTest(new TestCase("ActionToRenderParameters"));
+//
+// /**
+// * SPEC:51 Testable=true Section=PLT.11.1.1
+// * SPEC:54 Testable=true Section=PLT.11.1.1
+// */
+// suite.addTest(new TestCase("ParametersDuringRenderNotTargeted"));
+//
+// /**
+// * SPEC:53 Testable= true Section=PLT.11.1.1
+// * NOT TESTABLE - Postponed
+// */
+//
+// /**
+// * SPEC:55 Testable=true Section=PLT.11.1.1
+// * SPEC:56 Testable=true Section=PLT.11.1.1
+// */
+// suite.addTest(new TestCase("ParameterAccessMethodst"));
+//
+// /**
+// * SPEC:57 Testable=false Section=PLT.11.1.2
+// * Testable=fale
+// */
+//
+// /**
+// * SPEC:58 Testable= true Section=PLT.11.1.5
+// * SPEC:59 Testable=true Section=PLT.11.1.5
+// */
+// suite.addTest(new TestCase("ContextPath"));
+//
+// /**
+// * SPEC:60 Testable=true Section=PLT.11.1.7
+// */
+// suite.addTest(new TestCase("AuthType"));
+//
+// /**
+// * SPEC:61 Testable=true Section=PLT.11.1.7
+// */
+// suite.addTest(new TestCase("ContentType"));
+//
+// /**
+// * SPEC:62 Testable=true Section=PLT.11.1.7
+// * NOT TESTABLE NOW AS PORTAL DOESN'T SUPPORT ADDITIONAL CONTENT TYPES
+// */
+//
+// /**
+// * SPEC:63 Testable=true Section=PLT.11.2.1
+// */
+// suite.addTest(new TestCase("ObtainingInputStreamAndReader"));
+//
+// /**
+// * SPEC:64 Testable=true Section=PLT.11.2.1
+// * NOT TESTABLE - Postponed
+// */
+//
+// return suite;
+ return null;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletrequests/PortletRequestTestSuite.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletrequests/PortletRequestsSequenceBuilder.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletrequests/PortletRequestsSequenceBuilder.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletrequests/PortletRequestsSequenceBuilder.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,478 @@
+/******************************************************************************
+ * 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.jsr168.tck.portletrequests;
+
+import org.jboss.portal.test.framework.driver.response.EndTestResponse;
+import org.jboss.portal.test.framework.driver.http.response.InvokeGetResponse;
+import org.jboss.portal.test.framework.driver.DriverResponse;
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestDriver;
+import org.jboss.portal.test.framework.portlet.PortletTestSuite;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.actions.PortletActionTestAction;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.framework.UTP1;
+import org.jboss.portal.test.portlet.framework.UTP2;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.Portlet;
+import javax.portlet.PortletURL;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import java.io.IOException;
+import java.util.Enumeration;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 7954 $
+ */
+public class PortletRequestsSequenceBuilder extends PortletTestSuite
+{
+
+ private final byte[] byteContent = {65, 66, 67, 68, 69, 70};
+
+ /**
+ * @portlet.specification assert="SPEC:50 - The portlet-container must not
propagate parameters received in an action
+ * request to subsequent render requests of the portlet."
+ */
+ public void createActionToRequestParametersNotPropagatedCase(PortletTestDriver
registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("ActionToRequestParametersNotPropagated", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ PortletURL url = response.createActionURL();
+ url.setParameter("key1", "k1value1");
+ url.setParameter("key2", new String[]{"k2value1",
"k2value2", "k2value3"});
+ return new InvokeGetResponse(url.toString());
+ }
+ });
+
+ seq.addAction(1, UTP1.ACTION_JOINPOINT, new PortletActionTestAction()
+ {
+ protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context)
+ {
+ //assert that we received parameters from render
+ assertEquals("k1value1", request.getParameter("key1"));
+ assertEquals(new String[]{"k2value1", "k2value2",
"k2value3"}, request.getParameterValues("key2"));
+ }
+ });
+
+ seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ //assert that parameters weren't propagated from Action phase
+ assertNull(request.getParameter("key1"));
+ assertNull(request.getParameter("key2"));
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ /**
+ * @portlet.specification assert="SPEC:52 - If a portlet receives a render
request following an action request as
+ * part of the same client request, the parameters received with render request must
be the render parameters set
+ * during the action request."
+ */
+ public void createActionToRenderParametersCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("ActionToRenderParameters", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ PortletURL url = response.createActionURL();
+ return new InvokeGetResponse(url.toString());
+ }
+ });
+
+ seq.addAction(1, UTP1.ACTION_JOINPOINT, new PortletActionTestAction()
+ {
+ protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context)
+ {
+ //set parameters for render phase
+ response.setRenderParameter("key1", "k1value1");
+ response.setRenderParameter("key2", new
String[]{"k2value1", "k2value2", "k2value3"});
+ }
+ });
+
+ seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ //assert that we received parameters from action phase
+ assertEquals("k1value1", request.getParameter("key1"));
+ assertEquals(new String[]{"k2value1", "k2value2",
"k2value3"}, request.getParameterValues("key2"));
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ /**
+ * @portlet.specification assert="SPEC:51 - If a portlet receives a render
request that is the result of a client
+ * request targeted to another portlet in the portal page, the parameters must be the
same parameters as of the
+ * previous render request."
+ * @portlet.specification assert="SPEC:54 - A portlet must not see any parameter
targeted to other portlets."
+ */
+ public void createParametersDuringRenderNotTargetedCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("ParametersDuringRenderNotTargeted", seq);
+ final String[] urls = new String[1];
+ seq.addAction(0, UTP2.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ PortletURL url = response.createRenderURL();
+ url.setParameter("portlet2key1", "p2k1value1");
+ url.setParameter("portlet2key2", new
String[]{"p2k2value1", "p2k2value2", "p2k2value3"});
+ urls[0] = url.toString();
+ return null;
+ }
+ });
+
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ //just repost so other portlet can create url in first render
+ PortletURL url = response.createRenderURL();
+
+ //we are setting params to ourselves to test if they will last while request
to another porltet
+ url.setParameter("portlet1key1", "p1k1value1");
+ url.setParameter("portlet1key2", new
String[]{"p1k2value1", "p1k2value2", "p1k2value3"});
+ return new InvokeGetResponse(url.toString());
+ }
+ });
+
+ seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ //invoke render url from different portlet to be able to pass some params to
it
+ return new InvokeGetResponse(urls[0]);
+ }
+ });
+
+ seq.addAction(2, UTP2.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ assertEquals("p2k1value1",
request.getParameter("portlet2key1"));
+ assertEquals(new String[]{"p2k2value1", "p2k2value2",
"p2k2value3"}, request.getParameterValues("portlet2key2"));
+ return null;
+ }
+ });
+
+ seq.addAction(2, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ //we test if we have params set during requestCount==0, becouse our portlet
+ //wasn't targeted in current render request
+
+ //assert that we didn't received params targeted to other portlet
+ assertNull(request.getParameter("portlet2key1"));
+ assertNull(request.getParameter("portlet2key2"));
+
+ assertEquals("p1k1value1",
request.getParameter("portlet1key1"));
+ assertEquals(new String[]{"p1k2value1", "p1k2value2",
"p1k2value3"}, request.getParameterValues("portlet1key2"));
+
+ //and just repost so other portlet render invokation can be finished
+ PortletURL url = response.createRenderURL();
+ return new InvokeGetResponse(url.toString());
+
+ }
+ });
+
+ seq.addAction(3, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ //second portlet asserted if it received correct parameters during render
request
+ //we simply end test
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ /**
+ * @portlet.specification assert="SPEC:55 - The getParameterValues method returns
an array of String objects
+ * containing all the parameter values associated with a parameter name. The value
returned from the getParameter
+ * method must be the first value in the array of String objects returned by
getParameterValues"
+ * @portlet.specification assert="SPEC:56 - If there is a single parameter value
associated with a parameter name the
+ * method returns must return an array of size one containing the parameter
value"
+ */
+ public void createParameterAccessMethodstCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("ParameterAccessMethodst", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ PortletURL url = response.createActionURL();
+ //set some parameters for testing
+ url.setParameter("key1", "k1value1");
+ url.setParameter("key2", new String[]{"k2value1",
"k2value2", "k2value3"});
+ return new InvokeGetResponse(url.toString());
+ }
+ });
+
+ seq.addAction(1, UTP1.ACTION_JOINPOINT, new PortletActionTestAction()
+ {
+ protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context)
+ {
+ assertEquals("k1value1", request.getParameter("key1"));
+ //assert it returns one element array
+ assertEquals(new String[]{"k1value1"},
request.getParameterValues("key1"));
+
+ assertEquals(new String[]{"k2value1", "k2value2",
"k2value3"}, request.getParameterValues("key2"));
+ //assert it returns first array element
+ assertEquals("k2value1", request.getParameter("key2"));
+ }
+ });
+
+ seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ /**
+ * @portlet.specification assert="SPEC:58 - The context path of a request is
exposed via the request object. The
+ * context path is the path prefix associated with the deployed portlet application.
If the portlet application is
+ * rooted at the base of the web server URL namespace (also known as
"default" context), this path must be an empty
+ * string"
+ * @portlet.specification assert="SPEC:59 - "Otherwise, it must be the path
the portlet application is rooted to, the
+ * path must start with a '/' and it must not end with a '/'
character."
+ */
+ public void createContextPathCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("ContextPath", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ PortletURL url = response.createActionURL();
+ return new InvokeGetResponse(url.toString());
+ }
+ });
+
+ seq.addAction(1, UTP1.ACTION_JOINPOINT, new PortletActionTestAction()
+ {
+ protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context)
+ {
+ String path = request.getContextPath();
+ //empty string is allowed by spec if portlet is based in server root
+ if (!path.equals(""))
+ {
+ //if not it should meet following constraints
+ assertTrue(!path.equals("/"));
+ assertTrue(path.subSequence(0, 1).equals("/"));
+ assertTrue(!path.subSequence(path.length() - 1,
path.length()).equals("/"));
+ }
+ }
+ });
+
+ seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ //and we test the same for RenderRequest
+
+ String path = request.getContextPath();
+ //empty string is allowed by spec if portlet is based in server root
+ if (!path.equals(""))
+ {
+ //if not it should meet following constraints
+ assertTrue(path.subSequence(0, 1).equals("/"));
+ assertTrue(!path.subSequence(path.length() - 1,
path.length()).equals("/"));
+ }
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ /**
+ * @portlet.specification assert="SPEC:60 - If the user is not authenticated the
getAuthType method must return
+ * null"
+ */
+ public void createAuthTypeCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("AuthType", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ PortletURL url = response.createActionURL();
+ return new InvokeGetResponse(url.toString());
+ }
+ });
+
+ seq.addAction(1, UTP1.ACTION_JOINPOINT, new PortletActionTestAction()
+ {
+ protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context)
+ {
+ //in current testsuite there is no user authentication
+ assertNull(request.getAuthType());
+ }
+ });
+
+ seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ //in current testsuite there is no user authentication
+ assertNull(request.getAuthType());
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ /**
+ * @portlet.specification assert="SPEC:61 - If the portlet container supports
additional content types for the
+ * portlet�s output, it must declare the additional content types through the
getResponseContentTypes method of the
+ * request object. The returned Enumeration of strings should contain the content
types the portlet container
+ * supports in order of preference. The first element of the enumeration must be the
same content type returned by
+ * the getResponseContentType method."
+ */
+ public void createContentTypeCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("ContentType", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ PortletURL url = response.createActionURL();
+ return new InvokeGetResponse(url.toString());
+ }
+ });
+
+ seq.addAction(1, UTP1.ACTION_JOINPOINT, new PortletActionTestAction()
+ {
+ protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context)
+ {
+ Enumeration types = request.getResponseContentTypes();
+
+ //assert that first element is retrieved as defined in spec
+ assertEquals((String)types.nextElement(), request.getResponseContentType());
+ }
+ });
+
+ seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new EndTestResponse();
+ }
+ });
+
+ }
+
+ /**
+ * @portlet.specification assert="SPEC:63 - Only one of the two methods,
getPortletInputStream or getReader, can be
+ * used during an action request. If the input stream is obtained, a call to the
getReader must throw an
+ * IllegalStateException. Similarly, if the reader is obtained, a call to the
getPortletInputStream must throw an
+ * IllegalStateException."
+ */
+ public void createObtainingInputStreamAndReaderCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("ObtainingInputStreamAndReader", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ PortletURL url = response.createActionURL();
+ return new InvokeGetResponse(url.toString());
+ }
+ });
+
+ seq.addAction(1, UTP1.ACTION_JOINPOINT, new PortletActionTestAction()
+ {
+ protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context) throws IOException
+ {
+ request.getPortletInputStream();
+ try
+ {
+ //obtaining Reader after InputStream should cause exception
+ request.getReader();
+ fail();
+ }
+ catch (IllegalStateException e)
+ {
+ //expected
+ }
+ }
+ });
+
+ seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ PortletURL url = response.createActionURL();
+ return new InvokeGetResponse(url.toString());
+ }
+ });
+
+ seq.addAction(2, UTP1.ACTION_JOINPOINT, new PortletActionTestAction()
+ {
+ protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context) throws IOException
+ {
+ request.getReader();
+ try
+ {
+ //obtaining InputStream after Reader should cause exception
+ request.getPortletInputStream();
+ fail();
+ }
+ catch (IllegalStateException e)
+ {
+ //expected
+ }
+ }
+ });
+
+ seq.addAction(2, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new EndTestResponse();
+ }
+ });
+
+
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletrequests/PortletRequestsSequenceBuilder.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletresponses/PortletResponsesSequenceBuilder.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletresponses/PortletResponsesSequenceBuilder.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletresponses/PortletResponsesSequenceBuilder.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,845 @@
+/******************************************************************************
+ * 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.jsr168.tck.portletresponses;
+
+import org.jboss.portal.test.framework.driver.response.EndTestResponse;
+import org.jboss.portal.test.framework.driver.response.FailureResponse;
+import org.jboss.portal.test.framework.driver.http.response.InvokeGetResponse;
+import org.jboss.portal.test.framework.driver.DriverResponse;
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestDriver;
+import org.jboss.portal.test.framework.portlet.PortletTestSuite;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.actions.PortletActionTestAction;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.framework.portlet.actions.ServletServiceTestAction;
+import org.jboss.portal.test.portlet.framework.UTP1;
+import org.jboss.portal.test.portlet.framework.UTS1;
+import org.jboss.portal.test.portlet.framework.UTS2;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.Portlet;
+import javax.portlet.PortletMode;
+import javax.portlet.PortletModeException;
+import javax.portlet.PortletURL;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.WindowState;
+import javax.portlet.WindowStateException;
+import javax.servlet.Servlet;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.PrintWriter;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Collections;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 7954 $
+ */
+public class PortletResponsesSequenceBuilder extends PortletTestSuite
+{
+ /**
+ * @portlet.specification assert="SPEC:65 - The sendRedirect method instructs the
portal/portlet-container to set the
+ * appropriate headers and content body to redirect the user to a different URL. A
fully qualified URL or a full path
+ * URL must be specified. If a relative path URL is given, an IllegalArgumentException
must be thrown."
+ */
+ public void createSendRedirectWithRelativeURLCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("SendRedirectWithRelativeURL", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ PortletURL url = response.createActionURL();
+ return new InvokeGetResponse(url.toString());
+ }
+ });
+
+ seq.addAction(1, UTP1.ACTION_JOINPOINT, new PortletActionTestAction()
+ {
+ protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context) throws IOException
+ {
+ try
+ {
+ response.sendRedirect("relative_url");
+ fail();
+ }
+ catch (IllegalArgumentException e)
+ {
+ //expected
+ }
+ }
+ });
+
+ seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ /**
+ * @portlet.specification assert="SPEC:66 - If the sendRedirect method is called
after the setPortletMode,
+ * setWindowState, setRenderParameter or setRenderParameters methods of the
ActionResponse interface, an
+ * IllegalStateException must be thrown and the redirection must not be
executed"
+ */
+ public void createSendRedirectAfterChangeStateMethodsCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("SendRedirectAfterChangeStateMethods", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ PortletURL url = response.createActionURL();
+ return new InvokeGetResponse(url.toString());
+ }
+ });
+
+ seq.addAction(1, UTP1.ACTION_JOINPOINT, new PortletActionTestAction()
+ {
+ protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context) throws PortletModeException, IOException
+ {
+ response.setPortletMode(PortletMode.VIEW);
+ try
+ {
+ response.sendRedirect(request.getContextPath());
+ fail();
+ }
+ catch (IllegalStateException e)
+ {
+ //expected
+ }
+ }
+ });
+
+ seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ PortletURL url = response.createActionURL();
+ return new InvokeGetResponse(url.toString());
+ }
+ });
+
+ seq.addAction(2, UTP1.ACTION_JOINPOINT, new PortletActionTestAction()
+ {
+ protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context) throws IOException, WindowStateException
+ {
+ response.setWindowState(WindowState.NORMAL);
+ try
+ {
+ response.sendRedirect(request.getContextPath());
+ fail();
+ }
+ catch (IllegalStateException e)
+ {
+ //expected
+ }
+ }
+ });
+
+ seq.addAction(2, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ PortletURL url = response.createActionURL();
+ return new InvokeGetResponse(url.toString());
+ }
+ });
+
+ seq.addAction(3, UTP1.ACTION_JOINPOINT, new PortletActionTestAction()
+ {
+ protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context) throws IOException
+ {
+ response.setRenderParameter("key", "value");
+ try
+ {
+ response.sendRedirect(request.getContextPath());
+ fail();
+ }
+ catch (IllegalStateException e)
+ {
+ //expected
+ }
+ }
+ });
+
+ seq.addAction(3, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ PortletURL url = response.createActionURL();
+ return new InvokeGetResponse(url.toString());
+ }
+ });
+
+ seq.addAction(4, UTP1.ACTION_JOINPOINT, new PortletActionTestAction()
+ {
+ protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context) throws IOException
+ {
+ Map map = new HashMap();
+ map.put("key", new String[]{"value"});
+ response.setRenderParameters(map);
+ try
+ {
+ response.sendRedirect(request.getContextPath());
+ fail();
+ }
+ catch (IllegalStateException e)
+ {
+ //expected
+ }
+ }
+ });
+
+ seq.addAction(4, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ /**
+ * @portlet.specification assert="SPEC:67 - The setPortletMode method allows a
portlet to change its current portlet
+ * mode. The new portlet mode would be effective in the following render request. If a
portlet attempts to set a
+ * portlet mode that is not allowed to switch to, a PortletModeException must be
thrown."
+ */
+ public void createNotAllowedModeCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("NotAllowedMode", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ PortletURL url = response.createActionURL();
+ return new InvokeGetResponse(url.toString());
+ }
+ });
+
+ seq.addAction(1, UTP1.ACTION_JOINPOINT, new PortletActionTestAction()
+ {
+ protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context)
+ {
+ try
+ {
+ response.setPortletMode(PortletMode.EDIT);
+ fail();
+ }
+ catch (PortletModeException e)
+ {
+ //expected
+ }
+ }
+ });
+
+ seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ /**
+ * @portlet.specification assert="SPEC:68 - The setWindowState method allows a
portlet to change its current window
+ * state. The new window state would be effective in the following render request. If
a portlet attempts to set a
+ * window state that it is not allowed to switch to, a WindowStateException must be
thrown."
+ */
+ public void createNotSupportedWindowStateCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("NotSupportedWindowState", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ PortletURL url = response.createActionURL();
+ return new InvokeGetResponse(url.toString());
+ }
+ });
+
+ seq.addAction(1, UTP1.ACTION_JOINPOINT, new PortletActionTestAction()
+ {
+ protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context)
+ {
+ try
+ {
+ response.setWindowState(new WindowState("UnsupportedState"));
+ fail();
+ }
+ catch (WindowStateException e)
+ {
+ //expected
+ }
+ }
+ });
+
+ seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ /**
+ * @portlet.specification assert="SPEC:69 - If the setPortletMode or
setWindowState methods are called after the
+ * sendRedirect method has been called an IllegalStateException must be thrown."
+ * @portlet.specification assert="SPEC:70 - If the exception is caught by the
portlet, the redirection must be
+ * executed."
+ */
+ public void createStateChangesAfterRedirectionSendCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("StateChangesAfterRedirectionSend", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ PortletURL url = response.createActionURL();
+ return new InvokeGetResponse(url.toString());
+ }
+ });
+
+ seq.addAction(1, UTP1.ACTION_JOINPOINT, new PortletActionTestAction()
+ {
+ protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context) throws IOException, PortletModeException,
WindowStateException
+ {
+ response.sendRedirect(request.getContextPath() +
"/universalServletA");
+
+ try
+ {
+ response.setPortletMode(PortletMode.VIEW);
+ fail();
+ }
+ catch (IllegalStateException e)
+ {
+ //expected
+ }
+
+ try
+ {
+ response.setWindowState(WindowState.NORMAL);
+ fail();
+ }
+ catch (IllegalStateException e)
+ {
+ //expected
+ }
+ }
+ });
+
+ seq.addAction(1, UTS1.SERVICE_JOINPOINT, new ServletServiceTestAction()
+ {
+ protected DriverResponse run(Servlet servlet, HttpServletRequest request,
HttpServletResponse response, PortletTestContext context) throws ServletException,
IOException
+ {
+ return new EndTestResponse();
+ }
+ });
+
+ seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new FailureResponse("Render wasn't expected to be
called");
+ }
+ });
+ }
+
+ /**
+ * @portlet.specification assert="SPEC:72 - Using the setRenderParameter and
setRenderParameters methods of the
+ * ActionResponse interface portlets may set render parameters during an action
request. A call to any of the
+ * setRenderParameter methods must replace any parameter with the same name previously
set."
+ * @portlet.specification assert="SPEC:73 - If no render parameters are set
during the processAction invocation, the
+ * render request must not contain any request parameters."
+ */
+ public void createRenderParametersCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("RenderParameters", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ PortletURL url = response.createActionURL();
+ return new InvokeGetResponse(url.toString());
+ }
+ });
+
+ seq.addAction(1, UTP1.ACTION_JOINPOINT, new PortletActionTestAction()
+ {
+ protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context)
+ {
+ response.setRenderParameter("key1", "some strange value to
overwrite");
+ response.setRenderParameter("key2", "some strange value to
overwrite 2");
+ response.setRenderParameter("key1", "k1value1");
+ response.setRenderParameter("key2", new
String[]{"k2value1", "k2value2", "k2value3"});
+ }
+ });
+
+ seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ //we should receive overwrite values
+ assertEquals("k1value1", request.getParameter("key1"));
+ assertEquals(new String[]{"k2value1", "k2value2",
"k2value3"}, request.getParameterValues("key2"));
+ return new InvokeGetResponse(response.createActionURL().toString());
+ }
+ });
+
+ seq.addAction(2, UTP1.ACTION_JOINPOINT, new PortletActionTestAction()
+ {
+ protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context)
+ {
+ // Don't set any parameter
+ }
+ });
+
+ seq.addAction(2, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ // We shouldn't receive anything as no parameters were set during action
phase
+ assertEquals(Collections.EMPTY_MAP, request.getParameterMap());
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ /**
+ * @portlet.specification assert="SPEC:74 - If the setRenderParameter or
setRenderParameters methods are called after
+ * the sendRedirect method has been called an IllegalStateException must be
thrown"
+ * @portlet.specification assert="SPEC:75 - If the exception is caught by the
portlet, the redirection must be
+ * executed. If the exception is propagated back to the portlet-container, the
redirection must not be executed."
+ */
+ public void createParametersSetAfterSendRedirectCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("ParametersSetAfterSendRedirect", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ PortletURL url = response.createActionURL();
+ return new InvokeGetResponse(url.toString());
+ }
+ });
+
+ seq.addAction(1, UTP1.ACTION_JOINPOINT, new PortletActionTestAction()
+ {
+ protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context) throws IOException
+ {
+ response.sendRedirect(request.getContextPath() +
"/universalServletA");
+
+ try
+ {
+ response.setRenderParameter("key", "value");
+ fail();
+ }
+ catch (IllegalStateException e)
+ {
+ //expected
+ }
+
+ try
+ {
+ Map map = new HashMap();
+ map.put("key", new String[]{"value"});
+ response.setRenderParameters(map);
+ fail();
+ }
+ catch (IllegalStateException e)
+ {
+ //expected
+ }
+ }
+ });
+
+ seq.addAction(1, UTS1.SERVICE_JOINPOINT, new ServletServiceTestAction()
+ {
+ protected DriverResponse run(Servlet servlet, HttpServletRequest request,
HttpServletResponse response, PortletTestContext context) throws ServletException,
IOException
+ {
+ return new EndTestResponse();
+ }
+ });
+
+ seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new FailureResponse("Render wasn't expected");
+ }
+ });
+ }
+
+ /**
+ * @portlet.specification assert="SPEC:76 - A portlet must set the content type
of the response using the
+ * setContentType method of the RenderResponse interface. The setContentType method
must throw an
+ * IllegalArgumentException if the content type set does not match (including wildcard
matching) any of the content
+ * types returned by the getResponseContentType method of the PortleRequest
object"
+ */
+ public void createSetNotSupportedContentTypeCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("SetNotSupportedContentType", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ try
+ {
+
response.setContentType("unsupported_content/unsupported_content");
+ fail();
+ }
+ catch (IllegalArgumentException e)
+ {
+ //expected
+ }
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ /**
+ * @portlet.specification assert="SPEC:77 - If the getWriter or
getPortletOutputStream methods are called before the
+ * setContentType method, they must throw an IllegalStateException."
+ */
+ public void createSetContentTypeBeforeOutputStreamOrWriterCase(PortletTestDriver
registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("SetContentTypeBeforeOutputStreamOrWriter", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws IOException
+ {
+ try
+ {
+ response.getWriter();
+ fail();
+ }
+ catch (IllegalStateException e)
+ {
+ //expected as no content type was set
+ }
+ return new InvokeGetResponse(response.createRenderURL().toString());
+ }
+ });
+
+ seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws IOException
+ {
+ try
+ {
+ response.getPortletOutputStream();
+ fail();
+ }
+ catch (IllegalStateException e)
+ {
+ //expected as no content type was set
+ }
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ /**
+ * @portlet.specification assert="SPEC:78 - If the portlet has set a content
type, the getContentType method must
+ * return it. Otherwise, the getContentType method must return null."
+ */
+ public void createGetContentTypeCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("GetContentType", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ try
+ {
+ //content type wasn't set
+ assertNull(response.getContentType());
+
+ response.setContentType("text/html");
+
+ assertEquals("text/html", response.getContentType());
+
+ }
+ catch (IllegalStateException e)
+ {
+ //expected as no content type was set
+ }
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ /**
+ * @portlet.specification assert="SPEC:79 - A portlet may generate its content by
writing to the OutputStream or to
+ * the Writer of the RenderResponse object. A portlet must use only one of these
objects. The portlet container must
+ * throw an IllegalStateException if a portlet attempts to use both."
+ */
+ public void createOutputStreamOrWriterCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("OutputStreamOrWriter", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws IOException
+ {
+ response.setContentType("text/html");
+ response.getWriter();
+ try
+ {
+ response.getPortletOutputStream();
+ fail();
+ }
+ catch (IllegalStateException e)
+ {
+ //expected
+ }
+ return new InvokeGetResponse(response.createRenderURL().toString());
+ }
+ });
+
+ seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws IOException
+ {
+ //we need this to be able to marshal the result
+ response.setContentType("text/html");
+ OutputStream os = response.getPortletOutputStream();
+
+ //and now the test
+ try
+ {
+ response.getWriter();
+ fail();
+ }
+ catch (IllegalStateException e)
+ {
+ //expected
+ }
+
+ //workaroud to correctly end this test:
+ //we can't use AbstractTestPortet.marshalle() because we cannot obtain
+ //writer from response as OutputStream was used.
+// Writer writer = new OutputStreamWriter(os);
+// ServerResultMarshaller.marshall(, writer,
TestCaseContext.getCurrentTestCaseId());
+// writer.close();
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ /**
+ * @portlet.specification assert="SPEC:86 - The getNamespace method must provide
the portlet with a mechanism that
+ * ensures the uniqueness of the returned string in the whole portal page"
+ * @portlet.specification assert="SPEC:87 - The getNamespace method must return
the same value if invoked multiple
+ * times within a render request."
+ * @portlet.specification assert="SPEC:88 - The getNamespace method must return a
valid identifier as defined in the
+ * 3.8 Identifier Section of the Java Language Specification Second Edition."
+ */
+ public void createNamespaceEncodingCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("NamespaceEncoding", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ String namespace = response.getNamespace();
+
+ //assert it is valid Java identifier
+ assertTrue(isJavaIdentifier(namespace));
+
+ //check if it always return same value in scope of render request
+ assertEquals(namespace, response.getNamespace());
+
+ assertEquals(namespace, response.getNamespace());
+
+ assertEquals(namespace, response.getNamespace());
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ /** Checks if string is valid java identifier as defined in 'Java Language
Specification' */
+ public static boolean isJavaIdentifier(String s)
+ {
+ if (s.length() == 0 || !Character.isJavaIdentifierStart(s.charAt(0)))
+ {
+ return false;
+ }
+ for (int i = 1; i < s.length(); i++)
+ {
+ if (!Character.isJavaIdentifierPart(s.charAt(i)))
+ {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ /**
+ * TEST CASES THAT ARE CURRENTLY DISABLED
+ */
+
+
+ /**
+ * todo : it cannot pass as of today
+ *
+ * @portlet.specification assert="SPEC:71 - If the setPortletMode or
setWindowState methods are called after the
+ * sendRedirect method has been called an IllegalStateException must be thrown. (...)
If the exception is propagated
+ * back to the portlet-container, the redirection must not be executed."
+ */
+ public void _createIllegalStateExceptionAfterSendRedirectCase(PortletTestDriver
registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("IllegalStateExceptionAfterSendRedirect", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ PortletURL url = response.createActionURL();
+ return new InvokeGetResponse(url.toString());
+ }
+ });
+
+ seq.addAction(1, UTP1.ACTION_JOINPOINT, new PortletActionTestAction()
+ {
+ protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context) throws IOException
+ {
+ response.sendRedirect(request.getContextPath() +
"/universalServletB");
+ //this should be propagated to the portlet to not invoke redirection
+ throw new IllegalStateException();
+ }
+ });
+
+ seq.addAction(1, UTS2.SERVICE_JOINPOINT, new ServletServiceTestAction()
+ {
+ protected DriverResponse run(Servlet servlet, HttpServletRequest request,
HttpServletResponse response, PortletTestContext context) throws ServletException,
IOException
+ {
+ return new FailureResponse("Redirection shouldn't be made");
+ }
+ });
+
+ seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ //if redirect wasn't called we should be here. Alternatively we should
use other portlet
+ //with same test id to render the response.
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ /**
+ * @portlet.specification assert="SPEC:80 - The getBufferSize method returns the
size of the underlying buffer being
+ * used. If no buffering is being used, this method must return the int value of 0
(zero)"
+ * @portlet.specification assert="SPEC:81 - The portlet can request a preferred
buffer size by using the
+ * setBufferSize method. The buffer assigned is not required to be the size requested
by the portlet, but must be at
+ * least as large as the size requested."
+ */
+ public void createBufferSizeCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("BufferSize", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ // No buffering is defined
+ assertEquals(0, response.getBufferSize());
+
+ // We define buffer size
+ response.setBufferSize(1000000);
+
+ // And assert that buffer size is at least what we set
+ assertTrue(response.getBufferSize() >= 1000000);
+
+ //
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ /**
+ * @portlet.specification assert="SPEC:83 - If the response is committed and the
reset or resetBuffer method is
+ * called, an IllegalStateException must be thrown."
+ */
+ public void createBufferResetCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("BufferReset", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ //here we should test if after resetBuffer() response properties were
cleared
+ //but it's rather hard to do this now as there is no getProperty()
method.
+ return new InvokeGetResponse(response.createRenderURL().toString());
+ }
+ });
+
+ seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws IOException
+ {
+ response.setContentType("text/html");
+ PrintWriter writer = response.getWriter();
+ writer.flush();
+ writer.close();
+ try
+ {
+ response.resetBuffer();
+ fail();
+ }
+ catch (IllegalStateException e)
+ {
+ //expected
+ }
+ return new EndTestResponse();
+ }
+ });
+ }
+
+
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletresponses/PortletResponsesSequenceBuilder.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletresponses/PortletResponsesTestSuite.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletresponses/PortletResponsesTestSuite.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletresponses/PortletResponsesTestSuite.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,143 @@
+/******************************************************************************
+ * 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.jsr168.tck.portletresponses;
+
+import junit.framework.Test;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.com">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 5510 $
+ */
+public class PortletResponsesTestSuite
+{
+ public static Test suite()
+ {
+// TestSuite suite = new TestSuite("test-jsr168-portletresponses.war");
+//
+// /**
+// * SPEC:65 Testable=true Section=PLT.12.2.1
+// */
+// suite.addTest(new TestCase("SendRedirectWithRelativeURL"));
+//
+// /**
+// * SPEC:66 Testable=true Section=PLT.12.2.1
+// */
+// suite.addTest(new TestCase("SendRedirectAfterChangeStateMethods"));
+//
+// /**
+// * SPEC:67 Testable=true Section=PLT.12.2.2
+// */
+// suite.addTest(new TestCase("NotAllowedMode"));
+//
+// /**
+// * SPEC:68 Testable=true Section=PLT.12.2.2
+// */
+// suite.addTest(new TestCase("NotSupportedWindowState"));
+//
+// /**
+// * SPEC:69 Testable= true Section=PLT.12.2.2
+// * SPEC:70 Testable= true Section=PLT.12.2.2
+// */
+// suite.addTest(new TestCase("StateChangesAfterRedirectionSend"));
+//
+// /**
+// * SPEC:71 Testable=true Section=PLT.12.2.2
+// *
+// * This is dissabled as after propagating IllegalStateException to
PortletContainer
+// * '500' code is returned which doesn't allow us to end test
properly
+// */
+// //suite.addTest(new
PortletTestCase("IllegalStateExceptionAfterSendRedirect"));
+//
+// /**
+// * SPEC:72 Testable= true Section=PLT.12.2.3
+// * SPEC:73 Testable= true Section=PLT.12.2.3
+// */
+// suite.addTest(new TestCase("RenderParameters"));
+//
+// /**
+// * SPEC:74 Testable= true Section=PLT.12.2.3
+// * SPEC:75 Testable= true Section=PLT.12.2.3
+// *
+// * SPEC:75 done only partially - see SPEC:71 comment for the reason
+// */
+// suite.addTest(new TestCase("ParametersSetAfterSendRedirect"));
+//
+// /**
+// * SPEC:76 Testable=true Section=PLT.12.3.1
+// */
+// suite.addTest(new TestCase("SetNotSupportedContentType"));
+//
+// /**
+// * SPEC:77 Testable= true Section=PLT.12.3.1
+// */
+// suite.addTest(new
TestCase("SetContentTypeBeforeOutputStreamOrWriter"));
+//
+// /**
+// * SPEC:78 Testable= true Section=PLT.12.3.1
+// */
+// suite.addTest(new TestCase("GetContentType"));
+//
+// /**
+// * SPEC:79 Testable= true Section=PLT.12.3.2
+// */
+// suite.addTest(new TestCase("OutputStreamOrWriter"));
+//
+// /**
+// * SPEC:80 Testable=true Section=PLT.12.3.3
+// * SPEC:81 Testable=true Section=PLT.12.3.3
+// *
+// * This is commented as no buffering is implemented yet
+// */
+// //suite.addTest(new TestCase("BufferSize"));
+//
+// /**
+// * SPEC:82 Testable=true Section=PLT.12.3.3
+// * NOT TESTABLE - Postponed
+// */
+//
+// /**
+// * SPEC:83 Testable=true Section=PLT.12.3.3
+// *
+// * This is commented as no buffering is implemented yet
+// */
+// //suite.addTest(new TestCase("BufferReset"));
+//
+// /**
+// * SPEC:84 Testable=true Section=PLT.12.3.3
+// * SPEC:85 Testable=true Section=PLT.12.3.3
+// * NOT TESTABLE - Postponed
+// */
+//
+// /**
+// * SPEC:86 Testable= true Section=PLT.12.3.4
+// * SPEC:87 Testable= true Section=PLT.12.3.4
+// * SPEC:88 Testable= true Section=PLT.12.3.4
+// */
+// suite.addTest(new TestCase("NamespaceEncoding"));
+// return suite;
+ return null;
+ }
+
+
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletresponses/PortletResponsesTestSuite.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletsession/HttpSessionEvents.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletsession/HttpSessionEvents.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletsession/HttpSessionEvents.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,105 @@
+/******************************************************************************
+ * 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.jsr168.tck.portletsession;
+
+import javax.servlet.http.HttpSession;
+import javax.servlet.http.HttpSessionEvent;
+import javax.servlet.http.HttpSessionListener;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public class HttpSessionEvents implements HttpSessionListener
+{
+
+ public static final ThreadLocal threadLocal = new ThreadLocal();
+
+ public void sessionCreated(HttpSessionEvent event)
+ {
+ HttpSession session = event.getSession();
+ List sessions = getEvents();
+ if (sessions != null)
+ {
+ String id = session.getId();
+ sessions.add(new Event(id, Event.CREATED));
+ }
+ }
+
+ public void sessionDestroyed(HttpSessionEvent event)
+ {
+ HttpSession session = event.getSession();
+ List sessions = getEvents();
+ if (sessions != null)
+ {
+ String id = session.getId();
+ sessions.add(new Event(id, Event.DESTROYED));
+ }
+ }
+
+ public static List getEvents()
+ {
+ return (List)threadLocal.get();
+ }
+
+ public static void activate()
+ {
+ if (threadLocal.get() != null)
+ {
+ throw new IllegalStateException("Already activated");
+ }
+ List sessions = new ArrayList();
+ threadLocal.set(sessions);
+ }
+
+ public static void desactivate()
+ {
+ threadLocal.set(null);
+ }
+
+ public static class Event
+ {
+ public static final int CREATED = 0;
+ public static final int DESTROYED = 1;
+ private final String sessionId;
+ private final int type;
+
+ public Event(String sessionId, int type)
+ {
+ this.sessionId = sessionId;
+ this.type = type;
+ }
+
+ public String getSessionId()
+ {
+ return sessionId;
+ }
+
+ public int getType()
+ {
+ return type;
+ }
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletsession/HttpSessionEvents.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletsession/HttpSessionInvalidatorServlet.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletsession/HttpSessionInvalidatorServlet.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletsession/HttpSessionInvalidatorServlet.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,54 @@
+/******************************************************************************
+ * 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.jsr168.tck.portletsession;
+
+import org.jboss.portal.common.junit.ExtendedAssert;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
+import java.io.IOException;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public class HttpSessionInvalidatorServlet extends HttpServlet
+{
+ protected void service(HttpServletRequest req, HttpServletResponse resp) throws
ServletException, IOException
+ {
+ HttpSession session = req.getSession(false);
+ session.getAttribute("doesnotexist");
+ session.invalidate();
+ try
+ {
+ session.getAttribute("doesnotexist");
+ ExtendedAssert.fail();
+ }
+ catch (IllegalStateException expected)
+ {
+ }
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletsession/HttpSessionInvalidatorServlet.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletsession/PortletSessionSequenceBuilder.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletsession/PortletSessionSequenceBuilder.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletsession/PortletSessionSequenceBuilder.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,413 @@
+/******************************************************************************
+ * 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.jsr168.tck.portletsession;
+
+import org.jboss.portal.test.framework.driver.response.EndTestResponse;
+import org.jboss.portal.test.framework.driver.http.response.InvokeGetResponse;
+import org.jboss.portal.test.framework.driver.DriverResponse;
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestDriver;
+import org.jboss.portal.test.framework.portlet.PortletTestSuite;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.actions.PortletActionTestAction;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.framework.portlet.actions.ServletServiceTestAction;
+import org.jboss.portal.test.framework.portlet.components.AbstractUniversalTestPortlet;
+import org.jboss.portal.test.portlet.framework.UTP1;
+import org.jboss.portal.test.portlet.framework.UTP2;
+import org.jboss.portal.test.portlet.framework.UTS1;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.Portlet;
+import javax.portlet.PortletException;
+import javax.portlet.PortletRequestDispatcher;
+import javax.portlet.PortletSession;
+import javax.portlet.PortletURL;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.servlet.Servlet;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.util.Enumeration;
+import java.util.List;
+import java.util.regex.Pattern;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 7954 $
+ */
+public class PortletSessionSequenceBuilder extends PortletTestSuite
+{
+
+ /**
+ * @portlet.specification assert="SPEC:106 - For portlets within the same portlet
application, a portlet container
+ * must ensure that every portlet request generated as result of a group of requests
originated from the portal to
+ * complete a single client request receive or acquire the same session"
+ * @portlet.specification assert="SPEC:107 - In addition, if within these portlet
requests more than one portlet
+ * creates a session, the session object must be the same for all the portlets in the
same portlet application"
+ */
+ public void createSessionCreateCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("SessionCreate", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ //we ensure that session is ceated
+ UTP1.holder = request.getPortletSession();
+ assertNotNull(UTP1.holder);
+ PortletURL url = response.createRenderURL();
+ return new InvokeGetResponse(url.toString());
+ }
+ });
+
+ seq.addAction(0, UTP2.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ UTP2.holder = request.getPortletSession();
+ return null;
+ }
+ });
+
+ seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ //assert that during same request it was the same object
+
assertTrue(((PortletSession)UTP1.holder).getId().equals(((PortletSession)UTP2.holder).getId()));
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ /**
+ * @portlet.specification assert="SPEC:110 - Any object stored in the session
using the APPLICATION_SCOPE is
+ * available to any other portlet that belongs to the same portlet application and
that handles a request identified
+ * as being a part of the same session."
+ * @portlet.specification assert="SPEC:111 - Objects stored in the session using
the PORTLET_SCOPE must be available
+ * to the portlet during requests for the same portlet window that the objects where
stored from."
+ * @portlet.specification assert="SPEC:112 - The object must be stored in the
APPLICATION_SCOPE with the following
+ * fabricated attribute name �javax.portlet.p.<ID>?<ATTRIBUTE_NAME>�.
<ID> is a unique identification for the portlet
+ * window (assigned by the portal/portlet-container) that must not contain a �?�
character."
+ * @portlet.specification assert="SPEC:117 - The attribute names must be the same
if APPLICATION_SCOPE scope is
+ * used."
+ * @portlet.specification assert="SPEC:118 - The attribute name has to conform
with the specified prefixing if
+ * PORTLET_SCOPE is used"
+ * @portlet.specification assert="SPEC:119 - The variant of these methods that
does not receive a scope must be
+ * treated as PORTLET_SCOPE."
+ */
+ public void createSessionAttributesCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("SessionAttributes", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ request.getPortletSession(true).setAttribute("key1",
"k1value1", PortletSession.APPLICATION_SCOPE);
+ request.getPortletSession().setAttribute("key2",
"k2value1", PortletSession.PORTLET_SCOPE);
+ PortletURL url = response.createActionURL();
+ return new InvokeGetResponse(url.toString());
+ }
+ });
+
+ seq.addAction(1, UTP1.ACTION_JOINPOINT, new PortletActionTestAction()
+ {
+ protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context)
+ {
+ assertEquals("k1value1",
request.getPortletSession().getAttribute("key1",
PortletSession.APPLICATION_SCOPE));
+ assertEquals("k2value1",
request.getPortletSession().getAttribute("key2"));
+ }
+ });
+
+ seq.addAction(1, UTP2.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ //assert that we have access to APLICATION_SCOPE and not to PORTLET_SCOPE
attributes
+ assertEquals("k1value1",
request.getPortletSession().getAttribute("key1",
PortletSession.APPLICATION_SCOPE));
+ assertNull(request.getPortletSession().getAttribute("key2"));
+ return null;
+ }
+ });
+
+ seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ //in this request count we do an assert in SessionAttributesHelperPortlet
+ //so just repaint to let it finish
+ PortletURL url = response.createRenderURL();
+ return new InvokeGetResponse(url.toString());
+ }
+ });
+
+ seq.addAction(2, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ //invoke servlet
+ String path = request.getContextPath();
+ return new InvokeGetResponse(path + "/universalServletA");
+ }
+ });
+
+ seq.addAction(3, UTS1.SERVICE_JOINPOINT, new ServletServiceTestAction()
+ {
+ protected DriverResponse run(Servlet servlet, HttpServletRequest request,
HttpServletResponse response, PortletTestContext context) throws ServletException,
IOException
+ {
+ //assert that we have access to APLICATION_SCOPE and not to PORTLET_SCOPE
attributes
+ assertEquals("k1value1",
request.getSession().getAttribute("key1"));
+ assertNull(request.getSession().getAttribute("key2"));
+
+ Enumeration names = request.getSession().getAttributeNames();
+
+ //first we must get our PORTLET_SCOPE name from APPLICATION_SCOPE names
+ //it should look like 'javax.portlet.p.<ID>?key2'
+ String name = null;
+ while (names.hasMoreElements())
+ {
+ String s = (String)names.nextElement();
+ if (s.endsWith("key2"))
+ {
+ name = s;
+ break;
+ }
+ }
+ //assert there was one
+ assertNotNull(name);
+ //and we access correct content using it
+ assertEquals("k2value1", request.getSession().getAttribute(name));
+ System.out.println("value: " + name);
+
+ //then we must assert it is namespaced correctly
+ assertTrue(Pattern.matches("javax.portlet.p.[^\\?]*\\?key2",
name));
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ /**
+ * @portlet.specification assert="SPEC:113 - The PortletSession must store all
attributes in the HttpSession of the
+ * portlet application. A direct consequence of this is that data stored in the
HttpSession by servlets or JSPs is
+ * accessible to portlets through the PortletSession in the portlet application
scope."
+ * @portlet.specification assert="SPEC:114 - Conversely, data stored by portlets
in the PortletSession in the portlet
+ * application scope is accessible to servlets and JSPs through the
HttpSession."
+ */
+ public void createHttpSessionRelationsCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("HttpSessionRelations", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ UTP1.holder = response.createRenderURL().toString();
+
+ request.getPortletSession().setAttribute("key1",
"k1value1", PortletSession.APPLICATION_SCOPE);
+
+ String path = request.getContextPath();
+ return new InvokeGetResponse(path + "/universalServletA");
+ }
+ });
+
+ seq.addAction(1, UTS1.SERVICE_JOINPOINT, new ServletServiceTestAction()
+ {
+ protected DriverResponse run(Servlet servlet, HttpServletRequest request,
HttpServletResponse response, PortletTestContext context) throws ServletException,
IOException
+ {
+ //assert that we can access attributest stored in PortletSession
+ assertEquals("k1value1",
request.getSession().getAttribute("key1"));
+
+ //set some attributes in HttpSession to assert them in Portlet
+ request.getSession().setAttribute("key2", "k2value1");
+
+ //invoke portlet
+ return new InvokeGetResponse((String)UTP1.holder);
+ }
+ });
+
+
+ seq.addAction(2, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ //assert that we can access attributest stored in HttpSession
+ assertEquals("k2value1",
request.getPortletSession().getAttribute("key2",
PortletSession.APPLICATION_SCOPE));
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ /**
+ * @portlet.specification assert="SPEC:115 - If the HttpSession object is
invalidated, the PortletSession object must
+ * also be invalidated by the portlet container."
+ */
+ public void createHttpSessionInvalidatesPortletSession(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("HttpSessionInvalidatesPortletSession", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws IOException, PortletException
+ {
+ PortletSession session = request.getPortletSession();
+ assertNotNull(session);
+ assertNull(session.getAttribute("doesnotexist"));
+
+ // Request dispatch to a servlet to invalidate the http session
+ PortletRequestDispatcher dispatcher =
((AbstractUniversalTestPortlet)portlet).getPortletContext().getNamedDispatcher("HttpSessionInvalidationServlet");
+ dispatcher.include(request, response);
+
+ //
+ try
+ {
+ session.getAttribute("doesnotexist");
+ fail();
+ }
+ catch (IllegalStateException expected)
+ {
+ }
+
+ //
+ session = request.getPortletSession(false);
+ assertNull(session);
+
+ // Test we have a new valid session
+ session = request.getPortletSession();
+ assertNotNull(session);
+ assertNull(session.getAttribute("doesnotexist"));
+
+ //
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ /**
+ * @portlet.specification assert="SPEC:116 - If the PortletSession object is
invalidated by a portlet, the portlet
+ * container must invalidate the associated HttpSession object."
+ */
+ public void createPortletSessionInvalidatesHttpSession(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("PortletSessionInvalidatesHttpSession", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws IOException, PortletException
+ {
+ try
+ {
+ HttpSessionEvents.activate();
+ PortletSession session = request.getPortletSession();
+ assertNotNull(session);
+ String sessionId = session.getId();
+ List events = HttpSessionEvents.getEvents();
+ assertEquals(1, events.size());
+ HttpSessionEvents.Event createdEvent =
(HttpSessionEvents.Event)events.get(0);
+ assertEquals(sessionId, createdEvent.getSessionId());
+ assertEquals(HttpSessionEvents.Event.CREATED, createdEvent.getType());
+ HttpSessionEvents.desactivate();
+
+ //
+ HttpSessionEvents.activate();
+ session.invalidate();
+ events = HttpSessionEvents.getEvents();
+ assertEquals(1, events.size());
+ HttpSessionEvents.Event destroyedEvent =
(HttpSessionEvents.Event)events.get(0);
+ assertEquals(sessionId, destroyedEvent.getSessionId());
+ assertEquals(HttpSessionEvents.Event.DESTROYED,
destroyedEvent.getType());
+ HttpSessionEvents.desactivate();
+ }
+ finally
+ {
+ // Cleanup
+ HttpSessionEvents.desactivate();
+ }
+
+ //
+ return new EndTestResponse();
+ }
+ });
+ }
+
+// public void createSessionInvalidationCase(SequenceRegistry registry)
+// {
+// Sequence seq = new Sequence();
+// registry.addSequence("SessionInvalidation", seq);
+// seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+// {
+// protected Result run(Portlet portlet, RenderRequest request, RenderResponse
response)
+// {
+// UTP1.holder = response.createRenderURL().toString();
+//
+// request.getPortletSession().setAttribute("key1",
"k1value1", PortletSession.APPLICATION_SCOPE);
+//
+// //invalidate session
+// request.getPortletSession().invalidate();
+//
+// request.getPortletSession().setAttribute("key2",
"k2value1", PortletSession.APPLICATION_SCOPE);
+//
+// String path = request.getContextPath();
+// return new InvokeGetResult(path + "/universalServletA");
+// }
+// });
+//
+// seq.addAction(1, UTS1.SERVICE_JOINPOINT, new ServletServiceTestAction()
+// {
+// protected Result run(Servlet servlet, HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException
+// {
+// //assert that we can't access attributest stored in PortletSession as
it was invalidated
+// assertNull(request.getSession().getAttribute("key1"));
+//
+// //set some attributes in HttpSession to assert them in Portlet
+// request.getSession().setAttribute("key3", "k2value1");
+//
+// request.getSession().invalidate();
+//
+// request.getSession().setAttribute("key4", "k4value1");
+//
+// //invoke portlet
+// return new InvokeGetResult((String)UTP1.holder);
+// }
+// });
+//
+// seq.addAction(2, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+// {
+// protected Result run(Portlet portlet, RenderRequest request, RenderResponse
response)
+// {
+// //assert that we can't access attributest stored in HttpSession as it
was invalidated
+// assertNull(request.getPortletSession().getAttribute("key1",
PortletSession.APPLICATION_SCOPE));
+// assertNull(request.getPortletSession().getAttribute("key2",
PortletSession.APPLICATION_SCOPE));
+// assertNull(request.getPortletSession().getAttribute("key3",
PortletSession.APPLICATION_SCOPE));
+// assertEquals("k4value1",
request.getPortletSession().getAttribute("key4",
PortletSession.APPLICATION_SCOPE));
+//
+// return new EndTestResult();
+// }
+// });
+// }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletsession/PortletSessionSequenceBuilder.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletsession/PortletSessionTestSuite.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletsession/PortletSessionTestSuite.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletsession/PortletSessionTestSuite.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,81 @@
+/******************************************************************************
+ * 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.jsr168.tck.portletsession;
+
+import junit.framework.Test;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5510 $
+ */
+public class PortletSessionTestSuite
+{
+ public static Test suite()
+ {
+// TestSuite suite = new TestSuite("test-jsr168-portletsession.war");
+//
+// /**
+// * SPEC:106 Testable=true Section=PLT.15.1
+// * SPEC:107 Testable=true Section=PLT.15.1
+// */
+// suite.addTest(new TestCase("SessionCreate"));
+//
+// /**
+// * SPEC:108 Testable=true Section=PLT.15.2
+// * SPEC:109 Testable=true Section=PLT.15.2
+// * NOT TESTABLE - Postponed
+// */
+//
+// /**
+// * SPEC:110 Testable=true Section=PLT.15.3
+// * SPEC:111 Testable=true Section=PLT.15.3
+// * SPEC:112 Testable=true Section=PLT.15.3
+// * SPEC:117 Testable=true Section=PLT.15.4.1
+// * SPEC:118 Testable=true Section=PLT.15.4.1
+// * SPEC:119 Testable=true Section=PLT.15.4.1
+// */
+// suite.addTest(new TestCase("SessionAttributes"));
+//
+// /**
+// * SPEC:113 Testable=true Section=PLT.15.4
+// * SPEC:114 Testable=true Section=PLT.15.4
+// */
+// suite.addTest(new TestCase("HttpSessionRelations"));
+//
+// /**
+// * SPEC:115 Testable=true Section=PLT.15.4
+// * SPEC:116 Testable=true Section=PLT.15.4
+// */
+//// suite.addTest(new TestCase("SessionInvalidation"));
+// suite.addTest(new TestCase("HttpSessionInvalidatesPortletSession"));
+// suite.addTest(new TestCase("PortletSessionInvalidatesHttpSession"));
+//
+// /**
+// * SPEC:120 Testable=true Section=PLT.15.8
+// * NOT TESTABLE - Postponed
+// */
+//
+// return suite;
+ return null;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletsession/PortletSessionTestSuite.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portleturl/PortletURLTestSuite.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portleturl/PortletURLTestSuite.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portleturl/PortletURLTestSuite.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,80 @@
+/******************************************************************************
+ * 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.jsr168.tck.portleturl;
+
+import junit.framework.Test;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5510 $
+ */
+public class PortletURLTestSuite
+{
+ public static Test suite()
+ {
+// TestSuite suite = new TestSuite("test-jsr168-portleturl.war");
+//
+// /**
+// * SPEC:26 Testable= true Section=PLT.7.1
+// */
+// suite.addTest(new TestCase("RenderURLNotInvokeAction"));
+//
+// /**
+// * SPEC:27 Testable= true Section=PLT.7.1
+// * SPEC:28 Testable= true Section=PLT.7.1
+// * SPEC:29 Testable= true Section=PLT.7.1
+// */
+// suite.addTest(new TestCase("PortletURLParameters"));
+//
+// /**
+// * SPEC:30 Testable= true Section=PLT.7.1
+// * SPEC:31 Testable= true Section=PLT.7.1
+// * NOTTESTABLE - POSTPONED
+// */
+//
+// /**
+// * SPEC:32 Testable= true Section=PLT.7.1.1
+// */
+// suite.addTest(new TestCase("PortletURLWithNotSupportedMode"));
+//
+// /**
+// * SPEC:33 Testable= true Section=PLT.7.1.1
+// *
+// * TESTED IN SPEC:36 - portletmode/RequestDispatchingDependingOnModePortlet
+// */
+//
+// /**
+// * SPEC:34 Testable= true Section=PLT.7.1.1
+// */
+// suite.addTest(new TestCase("PortletURLWithNotSupportedState"));
+//
+// /**
+// * SPEC:35 Testable= true Section=PLT.7.1.2
+// */
+// suite.addTest(new TestCase("SecurityLevel"));
+//
+//
+// return suite;
+ return null;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portleturl/PortletURLTestSuite.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portleturl/PortletUrlSequenceBuilder.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portleturl/PortletUrlSequenceBuilder.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portleturl/PortletUrlSequenceBuilder.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,295 @@
+/******************************************************************************
+ * 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.jsr168.tck.portleturl;
+
+import org.jboss.portal.test.framework.driver.response.EndTestResponse;
+import org.jboss.portal.test.framework.driver.http.response.InvokeGetResponse;
+import org.jboss.portal.test.framework.driver.DriverResponse;
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestDriver;
+import org.jboss.portal.test.framework.portlet.PortletTestSuite;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.actions.PortletActionTestAction;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.framework.UTP1;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.Portlet;
+import javax.portlet.PortletMode;
+import javax.portlet.PortletModeException;
+import javax.portlet.PortletURL;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.WindowState;
+import javax.portlet.WindowStateException;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 7954 $
+ */
+public class PortletUrlSequenceBuilder extends PortletTestSuite
+{
+ /**
+ * @portlet.specification assert="SPEC:26 - A render URL is an optimization for a
special type of action URLs. The
+ * portal/portletcontainer must not invoke the processAction method of the targeted
portlet."
+ */
+ public void createRenderURLNotInvokeActionCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("RenderURLNotInvokeAction", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ PortletURL url = response.createRenderURL();
+ return new InvokeGetResponse(url.toString());
+ }
+ });
+
+ seq.addAction(1, UTP1.ACTION_JOINPOINT, new PortletActionTestAction()
+ {
+ protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context)
+ {
+ //this shouldn't be invoked
+ UTP1.local.set(Boolean.TRUE);
+ }
+ });
+
+ seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ assertNull(UTP1.local.get());
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ /**
+ * @portlet.specification assert="SPEC:27 - The portal/portlet-container must
ensure that all the parameters set when
+ * constructing the render URL become render parameters of the subsequent render
requests for the portlet."
+ * @portlet.specification assert="SPEC:28 - Portlets can add application specific
parameters to the PortletURL
+ * objects using the setParameter and setParameters methods. A call to any of the
setParameter methods must replace
+ * any parameter with the same name previously set."
+ * @portlet.specification assert="SPEC:29 - All the parameters a portlet adds to
a PortletURL object must be made
+ * available to the portlet as request parameters"
+ */
+ public void createPortletURLParametersCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("PortletURLParameters", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ PortletURL url = response.createActionURL();
+
+ //set some render parameters to test
+ url.setParameter("key1", "some strange value to
overwrite");
+ url.setParameter("key2", "some strange value to overwrite
2");
+ url.setParameter("key1", "k1value1");
+ url.setParameter("key2", new String[]{"k2value1",
"k2value2", "k2value3"});
+
+
+ return new InvokeGetResponse(url.toString());
+ }
+ });
+
+ seq.addAction(1, UTP1.ACTION_JOINPOINT, new PortletActionTestAction()
+ {
+ protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context)
+ {
+ assertEquals("k1value1", request.getParameter("key1"));
+ assertEquals(new String[]{"k2value1", "k2value2",
"k2value3"}, request.getParameterValues("key2"));
+ }
+ });
+
+ seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ PortletURL url = response.createActionURL();
+
+ //
+ url.setParameter("key3", "some strange value to
overwrite");
+ url.setParameter("key4", "some strange value to overwrite
2");
+
+ //
+ Map map = new HashMap();
+ map.put("key3", new String[]{"k3value1"});
+ map.put("key4", new String[]{"k4value1",
"k4value2", "k4value3"});
+ url.setParameters(map);
+
+ return new InvokeGetResponse(url.toString());
+ }
+ });
+
+ seq.addAction(2, UTP1.ACTION_JOINPOINT, new PortletActionTestAction()
+ {
+ protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context)
+ {
+ //what was in previous request
+ assertNull(request.getParameter("key1"));
+ assertNull(request.getParameter("key2"));
+
+ //what is now
+ assertEquals("k3value1", request.getParameter("key3"));
+ assertEquals(new String[]{"k4value1", "k4value2",
"k4value3"}, request.getParameterValues("key4"));
+ }
+ });
+
+ seq.addAction(2, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ PortletURL url = response.createRenderURL();
+
+ Map map = new HashMap();
+ url.setParameter("key5", "some strange value to
overwrite");
+ url.setParameter("key6", "some strange value to overwrite
2");
+ map.put("key5", new String[]{"k5value1"});
+ map.put("key6", new String[]{"k6value1",
"k6value2", "k6value3"});
+ url.setParameters(map);
+ url.setParameter("key7", new String[]{"k7value1",
"k7value2"});
+
+ return new InvokeGetResponse(url.toString());
+ }
+ });
+
+ seq.addAction(3, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ //what was in previous request
+ assertNull(request.getParameter("key1"));
+ assertNull(request.getParameter("key2"));
+ assertNull(request.getParameter("key3"));
+ assertNull(request.getParameter("key4"));
+
+ //what is now
+ assertEquals("k5value1", request.getParameter("key5"));
+ assertEquals(new String[]{"k6value1", "k6value2",
"k6value3"}, request.getParameterValues("key6"));
+ assertEquals(new String[]{"k7value1", "k7value2"},
request.getParameterValues("key7"));
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ /**
+ * @portlet.specification assert="SPEC:32 - A portlet cannot create a portlet URL
using a portlet mode that is not
+ * defined as supported by the portlet or that the user it is not allowed to use. The
setPortletMode methods must
+ * throw a PortletModeException in that situation."
+ */
+ public void createPortletURLWithNotSupportedModeCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("PortletURLWithNotSupportedMode", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ PortletURL url = response.createRenderURL();
+ try
+ {
+ url.setPortletMode(new PortletMode("UNSUPORTED_ONE"));
+ fail();
+ }
+ catch (PortletModeException e)
+ {
+ //expected
+ }
+
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ /**
+ * @portlet.specification assert="SPEC:34 - A portlet cannot create a portlet URL
using a window state that is not
+ * supported by the portlet container. The setWindowState method must throw a
WindowStateException if that is the
+ * case"
+ */
+ public void createPortletURLWithNotSupportedStateCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("PortletURLWithNotSupportedState", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ PortletURL url = response.createRenderURL();
+ try
+ {
+ url.setWindowState(new WindowState("UNSUPORTED_ONE"));
+ fail();
+ }
+ catch (WindowStateException e)
+ {
+ //expected
+ }
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ /**
+ * @portlet.specification assert="SPEC:35 - The setSecure method of the
PortletURL interface allows a portlet to
+ * indicate if the portlet URL has to be a secure URL or not (i.e. HTTPS or HTTP). If
the setSecure method is not
+ * used, the portlet URL must be of the same security level of the current
request."
+ */
+ public void createSecurityLevelCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("SecurityLevel", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ UTP1.holder = new Boolean(request.isSecure());
+ PortletURL url = response.createActionURL();
+ return new InvokeGetResponse(url.toString());
+ }
+ });
+
+ seq.addAction(1, UTP1.ACTION_JOINPOINT, new PortletActionTestAction()
+ {
+ protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context)
+ {
+ assertEquals(((Boolean)UTP1.holder).booleanValue(), request.isSecure());
+ }
+ });
+
+ seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ assertEquals(((Boolean)UTP1.holder).booleanValue(), request.isSecure());
+ return new EndTestResponse();
+ }
+ });
+ }
+
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portleturl/PortletUrlSequenceBuilder.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/preferences/PreferencesSequenceBuilder.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/preferences/PreferencesSequenceBuilder.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/preferences/PreferencesSequenceBuilder.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,866 @@
+/******************************************************************************
+ * 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.jsr168.tck.preferences;
+
+import org.jboss.portal.test.framework.driver.response.EndTestResponse;
+import org.jboss.portal.test.framework.driver.http.response.InvokeGetResponse;
+import org.jboss.portal.test.framework.driver.DriverResponse;
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestDriver;
+import org.jboss.portal.test.framework.portlet.PortletTestSuite;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.actions.PortletActionTestAction;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.framework.UTP1;
+import org.jboss.portal.test.portlet.framework.UTP2;
+import org.jboss.portal.test.portlet.framework.UTP3;
+import org.jboss.portal.test.portlet.framework.UTP4;
+import org.jboss.portal.test.portlet.framework.UTP5;
+import org.jboss.portal.test.portlet.framework.UTP6;
+import org.jboss.portal.test.portlet.framework.UTP7;
+import org.jboss.portal.test.portlet.framework.UTP8;
+import
org.jboss.portal.test.portlet.jsr168.tck.preferences.spec.CreateASingleInstanceOfValidatorValidator;
+import
org.jboss.portal.test.portlet.jsr168.tck.preferences.spec.ValidationStoresValidator;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.Portlet;
+import javax.portlet.PortletPreferences;
+import javax.portlet.ReadOnlyException;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.ValidatorException;
+import java.io.IOException;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 7954 $
+ */
+public class PreferencesSequenceBuilder extends PortletTestSuite
+{
+
+
+ /**
+ * @portlet.specification assert="SPEC:90 Preference attributes are String array
objects. Preferences attributes can
+ * be set to null."
+ */
+ public void createPreferencesCanBeSetToNullCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("PreferencesCanBeSetToNull", seq);
+
+ seq.addAction(0, UTP2.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new InvokeGetResponse(response.createActionURL().toString());
+ }
+ });
+
+ seq.addAction(1, UTP2.ACTION_JOINPOINT, new PortletActionTestAction()
+ {
+ protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context) throws ReadOnlyException, IOException,
ValidatorException
+ {
+ // Get prefs
+ PortletPreferences prefs = request.getPreferences();
+
+ // Test the initial value is ok
+ assertEquals("action_single_pref_value",
prefs.getValue("action_single_pref", "other"));
+ assertEquals(new String[]{"action_multi_pref_value_1",
"action_multi_pref_value_2"},
+ prefs.getValues("action_multi_pref", new String[0]));
+
+ // Set the values to null
+ prefs.setValue("action_single_pref", null);
+ prefs.setValues("action_multi_pref", null);
+
+ // Test with new valus
+ assertEquals(null, prefs.getValue("action_single_pref",
"other"));
+ assertEquals(null, prefs.getValue("action_multi_pref",
"other"));
+
+ // Trigger store
+ prefs.store();
+
+ // Test with new value after store
+ assertEquals(null, prefs.getValue("action_single_pref",
"other"));
+ assertEquals(null, prefs.getValue("action_multi_pref",
"other"));
+ }
+ });
+
+ seq.addAction(1, UTP2.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new InvokeGetResponse(response.createActionURL().toString());
+ }
+ });
+
+ seq.addAction(2, UTP2.ACTION_JOINPOINT, new PortletActionTestAction()
+ {
+ protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context)
+ {
+ // Get prefs
+ PortletPreferences prefs = request.getPreferences();
+
+ // Test with new values
+ assertEquals(null, prefs.getValue("action_single_pref",
"other"));
+ assertEquals(null, prefs.getValue("action_multi_pref",
"other"));
+ }
+ });
+
+ seq.addAction(2, UTP2.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ /**
+ * @portlet.specification assert="SPEC:91 - The getMap method returns an
immutable Map of String keys and String[]
+ * values containing all current preference values. Preferences values must not be
modified if the values in the Map
+ * are altered."
+ */
+ public void
createPreferencesMapModificationDoesNotModifyPreferencesValuesCase(PortletTestDriver
registry)
+ {
+ PortletTest seq = new PortletTest();
+
registry.addSequence("PreferencesMapModificationDoesNotModifyPreferencesValues",
seq);
+
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new InvokeGetResponse(response.createActionURL().toString());
+ }
+ });
+
+ seq.addAction(1, UTP1.ACTION_JOINPOINT, new PortletActionTestAction()
+ {
+ protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context)
+ {
+ // Get prefs map
+ PortletPreferences prefs = request.getPreferences();
+ Map map = prefs.getMap();
+
+ //
+ String[] singlePref = (String[])map.get("single_pref");
+ String[] multiPref = (String[])map.get("multi_pref");
+ assertEquals(new String[]{"single_pref_value"}, singlePref);
+ assertEquals(new String[]{"multi_pref_value_1",
"multi_pref_value_2"}, multiPref);
+
+ // Modify prefs
+ singlePref[0] = "new_single_pref_value";
+ multiPref[0] = "new_multi_pref_value_1";
+ multiPref[1] = "new_multi_pref_value_2";
+
+ //
+ assertEquals("single_pref_value",
prefs.getValue("single_pref", "other"));
+ assertEquals(new String[]{"multi_pref_value_1",
"multi_pref_value_2"}, prefs.getValues("multi_pref", new
String[]{"other"}));
+ }
+ });
+
+ seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ /**
+ * @portlet.specification assert="SPEC:92 - The reset method must reset a
preference attribute to its default value.
+ * If there is no default value, the preference attribute must be deleted."
+ * <p/>
+ * Does not cover restore to default test yet.
+ */
+ public void createResetPreferenceHavingNoDefaultValueDeletesItCase(PortletTestDriver
registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("ResetPreferenceHavingNoDefaultValueDeletesIt",
seq);
+
+ seq.addAction(0, UTP4.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new InvokeGetResponse(response.createActionURL().toString());
+ }
+ });
+
+ seq.addAction(1, UTP4.ACTION_JOINPOINT, new PortletActionTestAction()
+ {
+ protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context) throws ReadOnlyException, IOException,
ValidatorException
+ {
+ // Get prefs
+ PortletPreferences prefs = request.getPreferences();
+
+ // Test the initial value does not exist
+ assertEquals("other", prefs.getValue("pref",
"other"));
+
+ // Set the value
+ prefs.setValue("pref", "dynamic");
+
+ // Store
+ prefs.store();
+
+ // Test with new value
+ assertEquals("dynamic", prefs.getValue("pref",
"other"));
+ }
+ });
+
+ seq.addAction(1, UTP4.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new InvokeGetResponse(response.createActionURL().toString());
+ }
+ });
+
+ seq.addAction(2, UTP4.ACTION_JOINPOINT, new PortletActionTestAction()
+ {
+ protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context) throws ReadOnlyException, IOException,
ValidatorException
+ {
+ // Get prefs
+ PortletPreferences prefs = request.getPreferences();
+
+ // Test with new value
+ assertEquals("dynamic", prefs.getValue("pref",
"other"));
+
+ // Reset the value and store
+ prefs.reset("pref");
+
+ // Test the value does not exist anymore
+ assertEquals("other", prefs.getValue("pref",
"other"));
+
+ // Store
+ prefs.store();
+
+ // Test the value does not exist anymore
+ assertEquals("other", prefs.getValue("pref",
"other"));
+ }
+ });
+
+ seq.addAction(2, UTP4.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new InvokeGetResponse(response.createActionURL().toString());
+ }
+ });
+
+ seq.addAction(3, UTP4.ACTION_JOINPOINT, new PortletActionTestAction()
+ {
+ protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context)
+ {
+ // Get prefs
+ PortletPreferences prefs = request.getPreferences();
+
+ // Test the value does not exist anymore
+ assertEquals("other", prefs.getValue("pref",
"other"));
+ }
+ });
+
+ seq.addAction(3, UTP4.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ /**
+ * @portlet.specification assert="SPEC:93 - If a preference attribute is read
only, the setValue, setValues and reset
+ * methods must throw a ReadOnlyException when the portlet is in any of the standard
modes"
+ */
+ public void createReadOnlyPreferenceCannotBeModifiedCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("ReadOnlyPreferenceCannotBeModified", seq);
+
+ seq.addAction(0, UTP5.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new InvokeGetResponse(response.createActionURL().toString());
+ }
+ });
+
+ seq.addAction(1, UTP5.ACTION_JOINPOINT, new PortletActionTestAction()
+ {
+ protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context)
+ {
+ // Get prefs
+ PortletPreferences prefs = request.getPreferences();
+
+ // Test the initial values are ok
+ assertEquals("single_pref_value",
prefs.getValue("single_pref", "other"));
+ assertEquals(new String[]{"multi_pref_value_1",
"multi_pref_value_2"}, prefs.getValues("multi_pref", new
String[]{"other"}));
+
+ // Try to modify
+ try
+ {
+ prefs.setValue("single_pref", "");
+ fail();
+ }
+ catch (ReadOnlyException e)
+ {
+ // expected
+ }
+ try
+ {
+ prefs.setValues("single_pref", new String[]{""});
+ fail();
+ }
+ catch (ReadOnlyException e)
+ {
+ // expected
+ }
+ try
+ {
+ prefs.reset("single_pref");
+ fail();
+ }
+ catch (ReadOnlyException e)
+ {
+ // expected
+ }
+ try
+ {
+ prefs.setValue("multi_pref", "");
+ fail();
+ }
+ catch (ReadOnlyException e)
+ {
+ // expected
+ }
+ try
+ {
+ prefs.setValues("multi_pref", new String[]{""});
+ fail();
+ }
+ catch (ReadOnlyException e)
+ {
+ // expected
+ }
+ try
+ {
+ prefs.reset("multi_pref");
+ fail();
+ }
+ catch (ReadOnlyException e)
+ {
+ // expected
+ }
+
+ // Test values have not changed
+ assertEquals("single_pref_value",
prefs.getValue("single_pref", "other"));
+ assertEquals(new String[]{"multi_pref_value_1",
"multi_pref_value_2"}, prefs.getValues("multi_pref", new
String[]{"other"}));
+ }
+ });
+
+ seq.addAction(1, UTP5.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ /**
+ * @portlet.specification assert="SPEC:96 - All changes made to
PortletPreferences object not followed by a call to
+ * the store method must be discarded when the portlet finishes the 20 processAction
method."
+ */
+ public void createChangesMadeButNotStoredAreDiscardedCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("ChangesMadeButNotStoredAreDiscarded", seq);
+
+ seq.addAction(0, UTP3.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new InvokeGetResponse(response.createActionURL().toString());
+ }
+ });
+
+ seq.addAction(1, UTP3.ACTION_JOINPOINT, new PortletActionTestAction()
+ {
+ protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context) throws ReadOnlyException
+ {
+ // Get prefs
+ PortletPreferences prefs = request.getPreferences();
+
+ // Check the initial value are good
+ assertEquals("static_single_pref_value",
prefs.getValue("static_single_pref", "other"));
+ assertEquals(new String[]{"static_multi_pref_value_1",
"static_multi_pref_value_2"}, prefs.getValues("static_multi_pref", new
String[]{"other"}));
+ assertEquals("other",
prefs.getValue("dynamic_single_pref", "other"));
+ assertEquals(new String[]{"other"},
prefs.getValues("dynamic_multi_pref", new String[]{"other"}));
+
+ // Set values
+ prefs.setValue("static_single_pref",
"new_static_single_pref_value");
+ prefs.setValues("static_multi_pref", new
String[]{"new_static_multi_pref_value_1",
"new_static_multi_pref_value_2"});
+ prefs.setValue("dynamic_single_pref",
"new_dynamic_single_pref_value");
+ prefs.setValues("dynamic_multi_pref", new
String[]{"new_dynamic_multi_pref_value_1",
"new_dynamic_multi_pref_value_2"});
+
+ // Check wit new values
+ assertEquals("new_static_single_pref_value",
prefs.getValue("static_single_pref", "other"));
+ assertEquals(new String[]{"new_static_multi_pref_value_1",
"new_static_multi_pref_value_2"}, prefs.getValues("static_multi_pref",
new String[]{"other"}));
+ assertEquals("new_dynamic_single_pref_value",
prefs.getValue("dynamic_single_pref", "other"));
+ assertEquals(new String[]{"new_dynamic_multi_pref_value_1",
"new_dynamic_multi_pref_value_2"},
prefs.getValues("dynamic_multi_pref", new String[]{"other"}));
+ }
+ });
+
+ seq.addAction(1, UTP3.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new InvokeGetResponse(response.createActionURL().toString());
+ }
+ });
+
+ seq.addAction(2, UTP3.ACTION_JOINPOINT, new PortletActionTestAction()
+ {
+ protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context)
+ {
+ // Get prefs
+ PortletPreferences prefs = request.getPreferences();
+
+ // Check we have the original values back
+ assertEquals("static_single_pref_value",
prefs.getValue("static_single_pref", "other"));
+ assertEquals(new String[]{"static_multi_pref_value_1",
"static_multi_pref_value_2"}, prefs.getValues("static_multi_pref", new
String[]{"other"}));
+ assertEquals("other",
prefs.getValue("dynamic_single_pref", "other"));
+ assertEquals(new String[]{"other"},
prefs.getValues("dynamic_multi_pref", new String[]{"other"}));
+ }
+ });
+
+ seq.addAction(2, UTP3.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ /**
+ * @portlet.specification assert="SPEC:97 - If the store method is invoked within
the scope of a render method
+ * invocation, it must throw an IllegalStateException."
+ */
+ public void
createStoreCalledDuringRenderThrowsIllegalArgumentExceptionCase(PortletTestDriver
registry)
+ {
+ PortletTest seq = new PortletTest();
+
registry.addSequence("StoreCalledDuringRenderThrowsIllegalArgumentException",
seq);
+ seq.addAction(0, UTP4.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws IOException,
ValidatorException
+ {
+ // Get prefs
+ PortletPreferences prefs = request.getPreferences();
+
+ // Test the store call throws IllegalArgumentException
+ try
+ {
+ prefs.store();
+ fail();
+ }
+ catch (IllegalStateException e)
+ {
+ }
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ /**
+ * @portlet.specification assert="SPEC:99 - If a preference attribute definition
does not contain the read-only
+ * element set to true, the preference attribute is modifiable when the portlet is
processing an action request in
+ * any of the standard portlet modes (VIEW, EDIT or HELP)."
+ */
+ public void createCanModifyNonReadOnlyPreferenceCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("CanModifyNonReadOnlyPreference", seq);
+
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new InvokeGetResponse(response.createActionURL().toString());
+ }
+ });
+
+ seq.addAction(1, UTP1.ACTION_JOINPOINT, new PortletActionTestAction()
+ {
+ protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context) throws ReadOnlyException, IOException,
ValidatorException
+ {
+ // Get prefs
+ PortletPreferences prefs = request.getPreferences();
+
+ // Test the initial value is ok
+ assertEquals("single_pref_value",
prefs.getValue("single_pref", "other"));
+ assertEquals(new String[]{"multi_pref_value_1",
"multi_pref_value_2"},
+ prefs.getValues("multi_pref", new
String[]{"other"}));
+
+ // Set with new values
+ prefs.setValue("single_pref", "new_single_pref");
+ prefs.setValues("multi_pref", new
String[]{"new_multi_pref_value_1", "new_multi_pref_value_2"});
+
+ // Test with new values
+ assertEquals("new_single_pref",
prefs.getValue("single_pref", "other"));
+ assertEquals(new String[]{"new_multi_pref_value_1",
"new_multi_pref_value_2"}, prefs.getValues("multi_pref", new
String[]{"other"}));
+
+ // Trigger store
+ prefs.store();
+
+ // Test with new values after store
+ assertEquals("new_single_pref",
prefs.getValue("single_pref", "other"));
+ assertEquals(new String[]{"new_multi_pref_value_1",
"new_multi_pref_value_2"}, prefs.getValues("multi_pref", new
String[]{"other"}));
+ }
+ });
+
+ seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new InvokeGetResponse(response.createActionURL().toString());
+ }
+ });
+
+ seq.addAction(2, UTP1.ACTION_JOINPOINT, new PortletActionTestAction()
+ {
+ protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context)
+ {
+ // Get prefs
+ PortletPreferences prefs = request.getPreferences();
+
+ // Test with new values
+ assertEquals("new_single_pref",
prefs.getValue("single_pref", "other"));
+ assertEquals(new String[]{"new_multi_pref_value_1",
"new_multi_pref_value_2"}, prefs.getValues("multi_pref", new
String[]{"other"}));
+ }
+ });
+
+ seq.addAction(2, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ /**
+ * @portlet.specification assert="SPEC:100 - Portlets are not restricted to use
preference attributes defined in the
+ * deployment descriptor. They can programmatically add preference attributes using
names not defined in the
+ * deployment descriptor. These preferences attributes must be treated as modifiable
attributes."
+ */
+ public void
createDynamicPreferenceTreatedLikeModifiablePreferenceCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("DynamicPreferenceTreatedLikeModifiablePreference",
seq);
+
+ seq.addAction(0, UTP4.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new InvokeGetResponse(response.createActionURL().toString());
+ }
+ });
+
+ seq.addAction(1, UTP4.ACTION_JOINPOINT, new PortletActionTestAction()
+ {
+ protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context) throws ReadOnlyException, IOException,
ValidatorException
+ {
+ // Get prefs
+ PortletPreferences prefs = request.getPreferences();
+
+ // Test the initial values does not exist
+ assertEquals("other", prefs.getValue("single_pref",
"other"));
+ assertEquals(new String[]{"other"},
prefs.getValues("multi_pref", new String[]{"other"}));
+
+ // Set with new values
+ prefs.setValue("single_pref", "new_single_pref");
+ prefs.setValues("multi_pref", new
String[]{"new_multi_pref_value_1", "new_multi_pref_value_2"});
+
+ // Test the values are good
+ assertEquals("new_single_pref",
prefs.getValue("single_pref", "other"));
+ assertEquals(new String[]{"new_multi_pref_value_1",
"new_multi_pref_value_2"}, prefs.getValues("multi_pref", new
String[]{"other"}));
+
+ // Trigger store
+ prefs.store();
+
+ // Test the value are good after store
+ assertEquals("new_single_pref",
prefs.getValue("single_pref", "other"));
+ assertEquals(new String[]{"new_multi_pref_value_1",
"new_multi_pref_value_2"}, prefs.getValues("multi_pref", new
String[]{"other"}));
+ }
+ });
+
+ seq.addAction(1, UTP4.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new InvokeGetResponse(response.createActionURL().toString());
+ }
+ });
+
+ seq.addAction(2, UTP4.ACTION_JOINPOINT, new PortletActionTestAction()
+ {
+ protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context) throws ReadOnlyException, IOException,
ValidatorException
+ {
+ // Get prefs
+ PortletPreferences prefs = request.getPreferences();
+
+ // Test the values have been store in the persistent store
+ assertEquals("new_single_pref",
prefs.getValue("single_pref", "other"));
+ assertEquals(new String[]{"new_multi_pref_value_1",
"new_multi_pref_value_2"}, prefs.getValues("multi_pref", new
String[]{"other"}));
+
+ // Reset
+ prefs.reset("single_pref");
+ prefs.reset("multi_pref");
+
+ // Test does not exist
+ assertEquals("other", prefs.getValue("single_pref",
"other"));
+ assertEquals(new String[]{"other"},
prefs.getValues("multi_pref", new String[]{"other"}));
+
+ // Trigger store
+ prefs.store();
+
+ // Test does not exist after store
+ assertEquals("other", prefs.getValue("single_pref",
"other"));
+ assertEquals(new String[]{"other"},
prefs.getValues("multi_pref", new String[]{"other"}));
+ }
+ });
+
+ seq.addAction(2, UTP4.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new InvokeGetResponse(response.createActionURL().toString());
+ }
+ });
+
+ seq.addAction(3, UTP4.ACTION_JOINPOINT, new PortletActionTestAction()
+ {
+ protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context)
+ {
+ // Get prefs
+ PortletPreferences prefs = request.getPreferences();
+
+ // Test the values does not exist
+ assertEquals("other", prefs.getValue("single_pref",
"other"));
+ assertEquals(new String[]{"other"},
prefs.getValues("multi_pref", new String[]{"other"}));
+ }
+ });
+
+ seq.addAction(3, UTP4.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ /**
+ * @portlet.specification assert="SPEC:101 - If a portlet definition includes a
validator, the portlet container must
+ * create a single validator instance per portlet definition. (according to spec:
Testable=false ;)"
+ */
+ public void createCreateASingleInstanceOfValidatorCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("CreateASingleInstanceOfValidator", seq);
+ seq.addAction(0, UTP6.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ assertEquals(1,
CreateASingleInstanceOfValidatorValidator.getCreatedCount());
+ return new EndTestResponse();
+ }
+ });
+ }
+
+
+ /**
+ * @portlet.specification assert="SPEC:103 - When a validator is associated with
the preferences of a portlet
+ * definition, the store method of the PortletPreferences implementation must invoke
the validate method of the
+ * validator before writing the changes to the persistent store."
+ * @portlet.specification assert="SPEC:105 - If the validation is successful, the
store operation must be completed"
+ */
+ public void createValidationStoresCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("ValidationStores", seq);
+
+ seq.addAction(0, UTP8.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new InvokeGetResponse(response.createActionURL().toString());
+ }
+ });
+
+ seq.addAction(1, UTP8.ACTION_JOINPOINT, new PortletActionTestAction()
+ {
+ protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context) throws ReadOnlyException, IOException,
ValidatorException
+ {
+ // Get prefs
+ PortletPreferences prefs = request.getPreferences();
+
+ // Test the initial value is ok
+ assertEquals("single_pref_value",
prefs.getValue("single_pref", "other"));
+ assertEquals(new String[]{"multi_pref_value_1",
"multi_pref_value_2"},
+ prefs.getValues("multi_pref", new
String[]{"other"}));
+
+ // Set with new values
+ prefs.setValue("single_pref", "new_single_pref");
+ prefs.setValues("multi_pref", new
String[]{"new_multi_pref_value_1", "new_multi_pref_value_2"});
+
+ // Test with new values
+ assertEquals("new_single_pref",
prefs.getValue("single_pref", "other"));
+ assertEquals(new String[]{"new_multi_pref_value_1",
"new_multi_pref_value_2"}, prefs.getValues("multi_pref", new
String[]{"other"}));
+
+ // Trigger store
+ prefs.store();
+
+ // Check the validator has been invoked
+ assertTrue(ValidationStoresValidator.isValidateInvoked());
+
+ // Test with new values after store
+ assertEquals("new_single_pref",
prefs.getValue("single_pref", "other"));
+ assertEquals(new String[]{"new_multi_pref_value_1",
"new_multi_pref_value_2"}, prefs.getValues("multi_pref", new
String[]{"other"}));
+ }
+ });
+
+ seq.addAction(1, UTP8.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new InvokeGetResponse(response.createActionURL().toString());
+ }
+ });
+
+ seq.addAction(2, UTP8.ACTION_JOINPOINT, new PortletActionTestAction()
+ {
+ protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context)
+ {
+ // Get prefs
+ PortletPreferences prefs = request.getPreferences();
+
+ // Test with new values
+ assertEquals("new_single_pref",
prefs.getValue("single_pref", "other"));
+ assertEquals(new String[]{"new_multi_pref_value_1",
"new_multi_pref_value_2"}, prefs.getValues("multi_pref", new
String[]{"other"}));
+ }
+ });
+
+ seq.addAction(2, UTP8.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new EndTestResponse();
+ }
+ });
+ }
+
+ /**
+ * @portlet.specification assert="SPEC:104 - If the validation fails, the
PreferencesValidator implementation must
+ * throw a ValidatorException. If a ValidatorException is thrown, the portlet
container must cancel the store
+ * operation and it must propagate the exception to the portlet"
+ */
+ public void createInvalidationCancelsStoreCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("InvalidationCancelsStore", seq);
+
+ seq.addAction(0, UTP7.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new InvokeGetResponse(response.createActionURL().toString());
+ }
+ });
+
+ seq.addAction(1, UTP7.ACTION_JOINPOINT, new PortletActionTestAction()
+ {
+ protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context) throws ReadOnlyException, IOException
+ {
+ // Get prefs
+ PortletPreferences prefs = request.getPreferences();
+
+ // Test the initial value is ok
+ assertEquals("single_pref_value",
prefs.getValue("single_pref", "other"));
+ assertEquals(new String[]{"multi_pref_value_1",
"multi_pref_value_2"},
+ prefs.getValues("multi_pref", new
String[]{"other"}));
+
+ // Set the value to something else
+ prefs.setValue("single_pref", "new_single_pref");
+ prefs.setValues("multi_pref", new
String[]{"new_multi_pref_value_1", "new_multi_pref_value_2"});
+
+ // Trigger store
+ try
+ {
+ prefs.store();
+ }
+ catch (ValidatorException e)
+ {
+ // Expected
+ assertEquals("message", e.getMessage());
+ assertFalse(e.getFailedKeys().hasMoreElements());
+ }
+ }
+ });
+
+ seq.addAction(1, UTP7.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new InvokeGetResponse(response.createActionURL().toString());
+ }
+ });
+
+ seq.addAction(2, UTP7.ACTION_JOINPOINT, new PortletActionTestAction()
+ {
+ protected void run(Portlet portlet, ActionRequest request, ActionResponse
response, PortletTestContext context)
+ {
+ // Get prefs
+ PortletPreferences prefs = request.getPreferences();
+
+ // Test the initial value is back
+ assertEquals("single_pref_value",
prefs.getValue("single_pref", "other"));
+ assertEquals(new String[]{"multi_pref_value_1",
"multi_pref_value_2"},
+ prefs.getValues("multi_pref", new
String[]{"other"}));
+ }
+ });
+
+ seq.addAction(2, UTP7.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new EndTestResponse();
+ }
+ });
+ }
+
+
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/preferences/PreferencesSequenceBuilder.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/preferences/PreferencesTestSuite.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/preferences/PreferencesTestSuite.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/preferences/PreferencesTestSuite.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,121 @@
+/******************************************************************************
+ * 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.jsr168.tck.preferences;
+
+import junit.framework.Test;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.com">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 5510 $
+ */
+public class PreferencesTestSuite
+{
+ public static Test suite()
+ {
+// TestSuite suite = new TestSuite("test-jsr168-preferences.war");
+//
+// /**
+// * SPEC:90 Testable= true Section=PLT.14.1
+// */
+// suite.addTest(new TestCase("PreferencesCanBeSetToNull"));
+//
+// /**
+// * SPEC:91 Testable= true Section=PLT.14.1
+// */
+// suite.addTest(new
TestCase("PreferencesMapModificationDoesNotModifyPreferencesValues"));
+//
+// /**
+// * SPEC:92 Testable=true Section=PLT.14.1
+// */
+// suite.addTest(new
TestCase("ResetPreferenceHavingNoDefaultValueDeletesIt"));
+//
+// /**
+// * SPEC:93 Testable=true Section=PLT.14.1
+// */
+// suite.addTest(new TestCase("ReadOnlyPreferenceCannotBeModified"));
+//
+// /**
+// * SPEC:94 Testable=true Section=PLT.14.1
+// * Tested in every over case in this chapter... DONE
+// */
+//
+// /**
+// * SPEC:95 Testable=true Section=PLT.14.1
+// * NOT TESTED - Postponed
+// */
+//
+// /**
+// * SPEC:96 Testable=true Section=PLT.14.1
+// */
+// suite.addTest(new TestCase("ChangesMadeButNotStoredAreDiscarded"));
+//
+// /**
+// * SPEC:97 Testable= true Section=PLT.14.1
+// */
+// suite.addTest(new
TestCase("StoreCalledDuringRenderThrowsIllegalArgumentException"));
+//
+// /**
+// * SPEC:98 Testable=true Section=PLT.14.1
+// * NOT TESTED - Postponed
+// */
+//
+// /**
+// * SPEC:99 Testable=true Section=PLT.14.3
+// */
+// suite.addTest(new TestCase("CanModifyNonReadOnlyPreference"));
+//
+// /**
+// * SPEC:100 Testable=true Section=PLT.14.3
+// */
+// suite.addTest(new
TestCase("DynamicPreferenceTreatedLikeModifiablePreference"));
+//
+// /**
+// * SPEC:101 Testable=false Section=PLT.14.4
+// * - CreateASingleInstanceOfValidatorValidator
+// */
+// suite.addTest(new TestCase("CreateASingleInstanceOfValidator"));
+//
+// /**
+// * SPEC:102 Testable=false Section=PLT.14.4
+// * Testable=fales
+// */
+//
+// /**
+// * SPEC:103 Testable=true Section=PLT.14.4
+// * SPEC:105 Testable=true Section=PLT.14.4
+// * - ValidationStoresValidator
+// */
+// suite.addTest(new TestCase("ValidationStores"));
+//
+// /**
+// * SPEC:104 Testable=true Section=PLT.14.4
+// * - InvalidationCancelsStoreValidator
+// */
+// suite.addTest(new TestCase("InvalidationCancelsStore"));
+//
+//
+// return suite;
+ return null;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/preferences/PreferencesTestSuite.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/preferences/spec/CreateASingleInstanceOfValidatorValidator.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/preferences/spec/CreateASingleInstanceOfValidatorValidator.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/preferences/spec/CreateASingleInstanceOfValidatorValidator.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -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.test.portlet.jsr168.tck.preferences.spec;
+
+import javax.portlet.PortletPreferences;
+import javax.portlet.PreferencesValidator;
+import javax.portlet.ValidatorException;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.com">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 5448 $
+ */
+public class CreateASingleInstanceOfValidatorValidator implements PreferencesValidator
+{
+
+
+ private static int createdCount = 0;
+
+ public static int getCreatedCount()
+ {
+ return createdCount;
+ }
+
+ public CreateASingleInstanceOfValidatorValidator()
+ {
+ synchronized (CreateASingleInstanceOfValidatorValidator.class)
+ {
+ createdCount++;
+ }
+ }
+
+ public void validate(PortletPreferences preferences) throws ValidatorException
+ {
+ }
+
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/preferences/spec/CreateASingleInstanceOfValidatorValidator.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/preferences/spec/InvalidationCancelsStoreValidator.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/preferences/spec/InvalidationCancelsStoreValidator.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/preferences/spec/InvalidationCancelsStoreValidator.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,43 @@
+/******************************************************************************
+ * 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.jsr168.tck.preferences.spec;
+
+import javax.portlet.PortletPreferences;
+import javax.portlet.PreferencesValidator;
+import javax.portlet.ValidatorException;
+import java.util.Collections;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.com">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 5448 $
+ */
+public class InvalidationCancelsStoreValidator implements PreferencesValidator
+{
+
+ public void validate(PortletPreferences preferences) throws ValidatorException
+ {
+ throw new ValidatorException("message", Collections.EMPTY_SET);
+ }
+
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/preferences/spec/InvalidationCancelsStoreValidator.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/preferences/spec/ValidationStoresValidator.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/preferences/spec/ValidationStoresValidator.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/preferences/spec/ValidationStoresValidator.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,51 @@
+/******************************************************************************
+ * 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.jsr168.tck.preferences.spec;
+
+import javax.portlet.PortletPreferences;
+import javax.portlet.PreferencesValidator;
+import javax.portlet.ValidatorException;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.com">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 5448 $
+ */
+public class ValidationStoresValidator implements PreferencesValidator
+{
+
+
+ private static final ThreadLocal validateInvoked = new ThreadLocal();
+
+ public static boolean isValidateInvoked()
+ {
+ return Boolean.TRUE.equals(validateInvoked.get());
+ }
+
+ public void validate(PortletPreferences preferences) throws ValidatorException
+ {
+ validateInvoked.set(Boolean.TRUE);
+ }
+
+
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/preferences/spec/ValidationStoresValidator.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/windowstates/WindowStatesSequenceBuilder.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/windowstates/WindowStatesSequenceBuilder.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/windowstates/WindowStatesSequenceBuilder.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,86 @@
+/******************************************************************************
+ * 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.jsr168.tck.windowstates;
+
+import org.jboss.portal.test.framework.driver.response.EndTestResponse;
+import org.jboss.portal.test.framework.driver.response.FailureResponse;
+import org.jboss.portal.test.framework.driver.http.response.InvokeGetResponse;
+import org.jboss.portal.test.framework.driver.DriverResponse;
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestDriver;
+import org.jboss.portal.test.framework.portlet.PortletTestSuite;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.framework.UTP1;
+import org.jboss.portal.test.portlet.framework.UTP2;
+
+import javax.portlet.Portlet;
+import javax.portlet.PortletURL;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.WindowState;
+import javax.portlet.WindowStateException;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 7954 $
+ */
+public class WindowStatesSequenceBuilder extends PortletTestSuite
+{
+
+ /**
+ * @portlet.specification assert="SPEC:40 - If a custom window state defined in
the deployment descriptor is not
+ * mapped to a custom window state provided by the portal, portlets must not be
invoked in that window state."
+ */
+ public void _createCustomStateNotMappedNotInvokedCase(PortletTestDriver registry)
+ {
+ PortletTest seq = new PortletTest();
+ registry.addSequence("CustomStateNotMappedNotInvoked", seq);
+ seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws WindowStateException
+ {
+ PortletURL url = response.createRenderURL();
+ url.setWindowState(new WindowState("UNMAPPED_STATE"));
+ return new InvokeGetResponse(url.toString());
+ }
+ });
+
+ seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ //if portlet was invoked we will have failure
+ return new FailureResponse("Render wasn't expected");
+ }
+ });
+
+ seq.addAction(1, UTP2.RENDER_JOINPOINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context)
+ {
+ return new EndTestResponse();
+ }
+ });
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/windowstates/WindowStatesSequenceBuilder.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/windowstates/WindowStatesTestSuite.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/windowstates/WindowStatesTestSuite.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/windowstates/WindowStatesTestSuite.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,49 @@
+/******************************************************************************
+ * 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.jsr168.tck.windowstates;
+
+import junit.framework.Test;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.com">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 5510 $
+ */
+public class WindowStatesTestSuite
+{
+ public static Test suite()
+ {
+// TestSuite suite = new TestSuite("test-jsr168-windowstates.war");
+//
+// /**
+// * SPEC:40 Testable=true Section=PLT.9.4
+// *
+// * Disabled as feature is not supported by portal yet
+// */
+// //suite.addTest(new
TestCase("CustomStateNotMappedNotInvokedPortlet"));
+//
+//
+// return suite;
+ return null;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/windowstates/WindowStatesTestSuite.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/navigation/StateStringTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/navigation/StateStringTestCase.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/navigation/StateStringTestCase.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,53 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+
+package org.jboss.portal.test.portlet.navigation;
+
+import junit.framework.TestCase;
+import org.jboss.portal.portlet.PortletParametersStateString;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
+ * @version $Revision: 5976 $
+ * @since 2.4 (Apr 30, 2006)
+ */
+public class StateStringTestCase extends TestCase
+{
+ public static final String NAME1 = "param1";
+ public static final String VALUE1 = "value1";
+ public static final String VALUE2 = "value2";
+
+ public void testNavigationalState() throws Exception
+ {
+ PortletParametersStateString ns = new PortletParametersStateString();
+ ns.setValue(NAME1, VALUE1);
+ assertEquals(VALUE1, ns.getValue(NAME1));
+
+ String opaqueValue = ns.getStringValue();
+ System.out.println("opaqueValue = " + opaqueValue);
+ assertNotNull(opaqueValue);
+
+ ns = new PortletParametersStateString(opaqueValue);
+ assertEquals(VALUE1, ns.getValue(NAME1));
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/navigation/StateStringTestCase.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/session/ReplicatedValue.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/session/ReplicatedValue.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/session/ReplicatedValue.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,75 @@
+/******************************************************************************
+ * 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.session;
+
+import java.io.Serializable;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public class ReplicatedValue implements Serializable
+{
+
+ /** . */
+ public final String state;
+
+ public ReplicatedValue(String state)
+ {
+ if (state == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ this.state = state;
+ }
+
+ public String getState()
+ {
+ return state;
+ }
+
+ public int hashCode()
+ {
+ return state.hashCode();
+ }
+
+ public boolean equals(Object obj)
+ {
+ return obj instanceof ReplicatedValue &&
((ReplicatedValue)obj).state.equals(state);
+ }
+
+
+ public String toString()
+ {
+ return "ReplicatedValue: [" + state + "]";
+ }
+
+ public static Object create(ClassLoader classLoader, String value) throws
ClassNotFoundException, NoSuchMethodException, IllegalAccessException,
InvocationTargetException, InstantiationException
+ {
+ Class clazz = classLoader.loadClass(ReplicatedValue.class.getName());
+ Constructor ctor = clazz.getConstructor(new Class[]{String.class});
+ return ctor.newInstance(new Object[]{value});
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/session/ReplicatedValue.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/session/SessionSynchronizationTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/session/SessionSynchronizationTestCase.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/session/SessionSynchronizationTestCase.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,522 @@
+/******************************************************************************
+ * 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.session;
+
+import junit.framework.TestCase;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public class SessionSynchronizationTestCase extends TestCase
+{
+
+ public SessionSynchronizationTestCase()
+ {
+ System.out.println("SessionSynchronizationTestCase");
+ }
+
+ public SessionSynchronizationTestCase(String string)
+ {
+ super(string);
+ System.out.println("SessionSynchronizationTestCase: " + string);
+ }
+
+ public void testA()
+ {
+
+ }
+
+// public void testListener() throws Exception
+// {
+// // Only PortletScope attributes are replicated
+// HashSet attributeNames = new
CollectionBuilder().add("javax.portlet.p.myportlet?a")
+// .add("javax.portlet.p.myportlet?b").toHashSet();
+//
+// //
+// HttpSessionImpl dispatchedSession1 = new HttpSessionImpl();
+// HttpServletRequest dispatchedReq1 = new
HttpServletRequestImpl(dispatchedSession1);
+// HttpSessionImpl portalSession1 = new HttpSessionImpl();
+// HttpServletRequest portalReq1 = new HttpServletRequestImpl(portalSession1);
+// SessionListener listener = new SessionListener();
+//
+// //
+// SubSession ss1 = new SubSession("myportlet");
+// ss1.synchronizeWithDispatchedSession(dispatchedReq1);
+//
+// //
+// SubSession.set(ss1);
+//
+// //
+// HttpSessionEvent event = new HttpSessionEvent(dispatchedSession1);
+// listener.sessionCreated(event);
+// ReplicatedValue replicatedValueA = new ReplicatedValue("a");
+// HttpSessionBindingEvent aEvent = new HttpSessionBindingEvent(dispatchedSession1,
"javax.portlet.p.myportlet?a", replicatedValueA);
+// listener.attributeAdded(aEvent);
+// ReplicatedValue replicatedValueB = new ReplicatedValue("b");
+// HttpSessionBindingEvent bEvent = new HttpSessionBindingEvent(dispatchedSession1,
"javax.portlet.p.myportlet?b", replicatedValueB);
+// listener.attributeAdded(bEvent);
+// ReplicatedValue replicatedValueC = new ReplicatedValue("c");
+// HttpSessionBindingEvent cEvent = new HttpSessionBindingEvent(dispatchedSession1,
"c", replicatedValueC);
+// listener.attributeAdded(cEvent);
+// ReplicatedValue replicatedValueD = new ReplicatedValue("d");
+// HttpSessionBindingEvent dEvent = new HttpSessionBindingEvent(dispatchedSession1,
"d", replicatedValueD);
+// listener.attributeAdded(dEvent);
+//
+// //
+// SubSession.set(null);
+//
+// //
+// assertTrue(ss1.isChanged());
+// assertFalse(ss1.isActivated());
+// assertEquals(attributeNames, ss1.getAttributeNames());
+//
+// //
+// ss1.synchronizeWithPortalSession(portalReq1, "myportlet");
+//
+// //
+// assertFalse(ss1.isChanged());
+// assertFalse(ss1.isActivated());
+// assertEquals(attributeNames, ss1.getAttributeNames());
+//
+// // check that attributes are marshalled after synchronizeWithPortalSession
+// assertEquals(new MarshalledValue(replicatedValueA),
ss1.getAttribute("javax.portlet.p.myportlet?a"));
+// assertEquals(new MarshalledValue(replicatedValueB),
ss1.getAttribute("javax.portlet.p.myportlet?b"));
+//
+// //
+// SubSession ss2 = (SubSession)Tools.clone(ss1);
+//
+// //
+// assertFalse(ss2.isChanged());
+// assertTrue(ss2.isActivated());
+// assertEquals(attributeNames, ss2.getAttributeNames());
+//
+// //
+// HttpSessionImpl dispatchedSession2 = new HttpSessionImpl();
+// dispatchedSession2.setAttribute("javax.portlet.p.myportlet?b", new
ReplicatedValue("_b"));
+// dispatchedSession2.setAttribute("javax.portlet.p.myportlet?other", new
ReplicatedValue("other"));
+// dispatchedSession2.setAttribute("d", new
ReplicatedValue("_d"));
+// dispatchedSession2.setAttribute("other", new
ReplicatedValue("other"));
+// HttpServletRequest dispatchedReq2 = new
HttpServletRequestImpl(dispatchedSession2);
+//
+// //
+//
+// //
+// TestClassLoader cl = new TestClassLoader();
+// ClassLoader tccl = Thread.currentThread().getContextClassLoader();
+// try
+// {
+// Thread.currentThread().setContextClassLoader(cl);
+// ss2.synchronizeWithDispatchedSession(dispatchedReq2);
+// }
+// finally
+// {
+// Thread.currentThread().setContextClassLoader(tccl);
+// }
+//
+// //
+// assertTrue(ss2.isChanged()); // SubSession is marked as changed after
synchronizeWithDispatchedSession
+// assertFalse(ss2.isActivated());
+// assertEquals(attributeNames, ss2.getAttributeNames());
+// assertEquals(attributeNames,
Tools.toSet(dispatchedSession2.getAttributeNames()));
+// assertEquals(ReplicatedValue.create(cl, "a"),
dispatchedSession2.getAttribute("javax.portlet.p.myportlet?a"));
+// assertEquals(ReplicatedValue.create(cl, "b"),
dispatchedSession2.getAttribute("javax.portlet.p.myportlet?b"));
+//
+// // Only PortletScope attributes are replicated
+// assertNull(dispatchedSession2.getAttribute("c"));
+// assertNull(dispatchedSession2.getAttribute("d"));
+// }
+//
+// private static class HttpSessionImpl implements HttpSession
+// {
+//
+// private final Map map = new HashMap();
+//
+// public void setAttribute(String name, Object object)
+// {
+// map.put(name, object);
+// }
+//
+// public void removeAttribute(String name)
+// {
+// map.remove(name);
+// }
+//
+// public Object getAttribute(String name)
+// {
+// return map.get(name);
+// }
+//
+// public Enumeration getAttributeNames()
+// {
+// return Tools.toEnumeration(map.keySet().iterator());
+// }
+//
+// public void putValue(String name, Object object)
+// {
+// throw new UnsupportedOperationException();
+// }
+//
+// public void removeValue(String name)
+// {
+// throw new UnsupportedOperationException();
+// }
+//
+// public long getCreationTime()
+// {
+// throw new UnsupportedOperationException();
+// }
+//
+// public String getId()
+// {
+// throw new UnsupportedOperationException();
+// }
+//
+// public long getLastAccessedTime()
+// {
+// throw new UnsupportedOperationException();
+// }
+//
+// public ServletContext getServletContext()
+// {
+// throw new UnsupportedOperationException();
+// }
+//
+// public void setMaxInactiveInterval(int i)
+// {
+// throw new UnsupportedOperationException();
+// }
+//
+// public int getMaxInactiveInterval()
+// {
+// throw new UnsupportedOperationException();
+// }
+//
+// public HttpSessionContext getSessionContext()
+// {
+// throw new UnsupportedOperationException();
+// }
+//
+// public Object getValue(String name)
+// {
+// throw new UnsupportedOperationException();
+// }
+//
+// public String[] getValueNames()
+// {
+// throw new UnsupportedOperationException();
+// }
+//
+// public void invalidate()
+// {
+// throw new UnsupportedOperationException();
+// }
+//
+// public boolean isNew()
+// {
+// return false;
+// }
+// }
+//
+// private static class HttpServletRequestImpl implements HttpServletRequest
+// {
+//
+// private HttpSession session;
+//
+// public HttpServletRequestImpl(HttpSession session)
+// {
+// this.session = session;
+// }
+//
+// public HttpSession getSession()
+// {
+// return session;
+// }
+//
+// public HttpSession getSession(boolean b)
+// {
+// throw new UnsupportedOperationException("Implement me");
+// }
+//
+// public String getAuthType()
+// {
+// throw new UnsupportedOperationException("Implement me");
+// }
+//
+// public Cookie[] getCookies()
+// {
+// throw new UnsupportedOperationException("Implement me");
+// }
+//
+// public long getDateHeader(String name)
+// {
+// throw new UnsupportedOperationException("Implement me");
+// }
+//
+// public String getHeader(String name)
+// {
+// throw new UnsupportedOperationException("Implement me");
+// }
+//
+// public Enumeration getHeaders(String name)
+// {
+// throw new UnsupportedOperationException("Implement me");
+// }
+//
+// public Enumeration getHeaderNames()
+// {
+// throw new UnsupportedOperationException("Implement me");
+// }
+//
+// public int getIntHeader(String name)
+// {
+// throw new UnsupportedOperationException("Implement me");
+// }
+//
+// public String getMethod()
+// {
+// throw new UnsupportedOperationException("Implement me");
+// }
+//
+// public String getPathInfo()
+// {
+// throw new UnsupportedOperationException("Implement me");
+// }
+//
+// public String getPathTranslated()
+// {
+// throw new UnsupportedOperationException("Implement me");
+// }
+//
+// public String getContextPath()
+// {
+// throw new UnsupportedOperationException("Implement me");
+// }
+//
+// public String getQueryString()
+// {
+// throw new UnsupportedOperationException("Implement me");
+// }
+//
+// public String getRemoteUser()
+// {
+// throw new UnsupportedOperationException("Implement me");
+// }
+//
+// public boolean isUserInRole(String name)
+// {
+// throw new UnsupportedOperationException("Implement me");
+// }
+//
+// public Principal getUserPrincipal()
+// {
+// throw new UnsupportedOperationException("Implement me");
+// }
+//
+// public String getRequestedSessionId()
+// {
+// throw new UnsupportedOperationException("Implement me");
+// }
+//
+// public String getRequestURI()
+// {
+// throw new UnsupportedOperationException("Implement me");
+// }
+//
+// public StringBuffer getRequestURL()
+// {
+// throw new UnsupportedOperationException("Implement me");
+// }
+//
+// public String getServletPath()
+// {
+// throw new UnsupportedOperationException("Implement me");
+// }
+//
+//
+// public boolean isRequestedSessionIdValid()
+// {
+// throw new UnsupportedOperationException("Implement me");
+// }
+//
+// public boolean isRequestedSessionIdFromCookie()
+// {
+// throw new UnsupportedOperationException("Implement me");
+// }
+//
+// public boolean isRequestedSessionIdFromURL()
+// {
+// throw new UnsupportedOperationException("Implement me");
+// }
+//
+// public boolean isRequestedSessionIdFromUrl()
+// {
+// throw new UnsupportedOperationException("Implement me");
+// }
+//
+// public Object getAttribute(String name)
+// {
+// throw new UnsupportedOperationException("Implement me");
+// }
+//
+// public Enumeration getAttributeNames()
+// {
+// throw new UnsupportedOperationException("Implement me");
+// }
+//
+// public String getCharacterEncoding()
+// {
+// throw new UnsupportedOperationException("Implement me");
+// }
+//
+// public void setCharacterEncoding(String name) throws
UnsupportedEncodingException
+// {
+// throw new UnsupportedOperationException("Implement me");
+// }
+//
+// public int getContentLength()
+// {
+// throw new UnsupportedOperationException("Implement me");
+// }
+//
+// public String getContentType()
+// {
+// throw new UnsupportedOperationException("Implement me");
+// }
+//
+// public ServletInputStream getInputStream() throws IOException
+// {
+// throw new UnsupportedOperationException("Implement me");
+// }
+//
+// public String getParameter(String name)
+// {
+// throw new UnsupportedOperationException("Implement me");
+// }
+//
+// public Enumeration getParameterNames()
+// {
+// throw new UnsupportedOperationException("Implement me");
+// }
+//
+// public String[] getParameterValues(String name)
+// {
+// throw new UnsupportedOperationException("Implement me");
+// }
+//
+// public Map getParameterMap()
+// {
+// throw new UnsupportedOperationException("Implement me");
+// }
+//
+// public String getProtocol()
+// {
+// throw new UnsupportedOperationException("Implement me");
+// }
+//
+// public String getScheme()
+// {
+// throw new UnsupportedOperationException("Implement me");
+// }
+//
+// public String getServerName()
+// {
+// throw new UnsupportedOperationException("Implement me");
+// }
+//
+// public int getServerPort()
+// {
+// throw new UnsupportedOperationException("Implement me");
+// }
+//
+// public BufferedReader getReader() throws IOException
+// {
+// throw new UnsupportedOperationException("Implement me");
+// }
+//
+// public String getRemoteAddr()
+// {
+// throw new UnsupportedOperationException("Implement me");
+// }
+//
+// public String getRemoteHost()
+// {
+// throw new UnsupportedOperationException("Implement me");
+// }
+//
+// public void setAttribute(String name, Object object)
+// {
+// throw new UnsupportedOperationException("Implement me");
+// }
+//
+// public void removeAttribute(String name)
+// {
+// throw new UnsupportedOperationException("Implement me");
+// }
+//
+// public Locale getLocale()
+// {
+// throw new UnsupportedOperationException("Implement me");
+// }
+//
+// public Enumeration getLocales()
+// {
+// throw new UnsupportedOperationException("Implement me");
+// }
+//
+// public boolean isSecure()
+// {
+// throw new UnsupportedOperationException("Implement me");
+// }
+//
+// public RequestDispatcher getRequestDispatcher(String name)
+// {
+// throw new UnsupportedOperationException("Implement me");
+// }
+//
+// public String getRealPath(String name)
+// {
+// throw new UnsupportedOperationException("Implement me");
+// }
+//
+// public int getRemotePort()
+// {
+// throw new UnsupportedOperationException("Implement me");
+// }
+//
+// public String getLocalName()
+// {
+// throw new UnsupportedOperationException("Implement me");
+// }
+//
+// public String getLocalAddr()
+// {
+// throw new UnsupportedOperationException("Implement me");
+// }
+//
+// public int getLocalPort()
+// {
+// throw new UnsupportedOperationException("Implement me");
+// }
+// }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/session/SessionSynchronizationTestCase.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/session/TestClassLoader.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/session/TestClassLoader.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/session/TestClassLoader.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,75 @@
+/******************************************************************************
+ * 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.session;
+
+import org.jboss.portal.common.io.IOTools;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 7374 $
+ */
+public class TestClassLoader extends ClassLoader
+{
+
+ /** . */
+ private Class replicatedValueClass;
+
+ public Class loadClass(String name) throws ClassNotFoundException
+ {
+ if (ReplicatedValue.class.getName().equals(name))
+ {
+ synchronized (this)
+ {
+ if (replicatedValueClass == null)
+ {
+ InputStream in = null;
+ try
+ {
+ in =
ReplicatedValue.class.getClassLoader().getResourceAsStream(ReplicatedValue.class.getName().replace('.',
'/') + ".class");
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ IOTools.copy(in, baos);
+ byte[] bytes = baos.toByteArray();
+ replicatedValueClass = defineClass(ReplicatedValue.class.getName(),
bytes, 0, bytes.length);
+ }
+ catch (IOException e)
+ {
+ throw new ClassNotFoundException("", e);
+ }
+ finally
+ {
+ IOTools.safeClose(in);
+ }
+ }
+ return replicatedValueClass;
+ }
+ }
+ else
+ {
+ return super.loadClass(name);
+ }
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/session/TestClassLoader.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/state/AbstractStatefulPortletInvokerTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/state/AbstractStatefulPortletInvokerTestCase.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/state/AbstractStatefulPortletInvokerTestCase.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,836 @@
+/******************************************************************************
+ * 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.state;
+
+import junit.framework.TestCase;
+import org.jboss.portal.common.util.CollectionBuilder;
+import org.jboss.portal.common.i18n.LocalizedString;
+import org.jboss.portal.common.value.StringValue;
+import org.jboss.portal.common.value.Value;
+import org.jboss.portal.portlet.InvalidPortletIdException;
+import org.jboss.portal.portlet.NoSuchPortletException;
+import org.jboss.portal.portlet.Portlet;
+import org.jboss.portal.portlet.PortletInvokerException;
+import org.jboss.portal.portlet.PortletContext;
+import org.jboss.portal.portlet.support.info.PortletInfoSupport;
+import org.jboss.portal.portlet.info.MetaInfo;
+import org.jboss.portal.portlet.invocation.ActionInvocation;
+import org.jboss.portal.portlet.invocation.PortletInvocation;
+import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
+import org.jboss.portal.portlet.state.AbstractPropertyContext;
+import org.jboss.portal.portlet.state.AccessMode;
+import org.jboss.portal.portlet.state.DestroyCloneFailure;
+import org.jboss.portal.portlet.state.PropertyChange;
+import org.jboss.portal.portlet.state.PropertyMap;
+import org.jboss.portal.portlet.state.SimplePropertyMap;
+import org.jboss.portal.portlet.state.PropertyContext;
+import org.jboss.portal.portlet.test.ValueMapAssert;
+import org.jboss.portal.portlet.test.support.PortletSupport;
+
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Locale;
+import java.util.Set;
+import java.util.Arrays;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public abstract class AbstractStatefulPortletInvokerTestCase extends TestCase
+{
+
+ /**
+ *
+ */
+ protected abstract Portlet getPortlet(PortletContext portletRef) throws
PortletInvokerException;
+
+ /**
+ *
+ */
+ protected abstract String getPortletId(PortletContext portletRef) throws
PortletInvokerException;
+
+ /**
+ *
+ */
+ protected abstract PortletContext createPOPRef(PortletSupport portletSupport) throws
PortletInvokerException;
+
+ /**
+ *
+ */
+ protected abstract PortletContext createNonExistingPOPRef() throws
PortletInvokerException;
+
+ /**
+ *
+ */
+ protected abstract PortletContext createInvalidPOPRef() throws
PortletInvokerException;
+
+ /**
+ *
+ */
+ protected abstract PortletContext createLocalClone(PortletContext portletRef) throws
Exception;
+
+ /**
+ *
+ */
+ protected abstract void destroyClone(PortletContext portletRef) throws Exception;
+
+ /**
+ *
+ */
+ protected abstract PortletContext createClone(PortletContext portletRef) throws
PortletInvokerException;
+
+ /**
+ *
+ */
+ protected abstract PortletContext setProperties(PortletContext portletRef,
PropertyChange[] changes) throws PortletInvokerException;
+
+ /**
+ *
+ */
+ protected abstract PropertyMap getProperties(PortletContext portletRef) throws
PortletInvokerException;
+
+ /**
+ *
+ */
+ protected abstract PropertyMap getProperties(PortletContext portletRef, Set keys)
throws PortletInvokerException;
+
+ /**
+ *
+ */
+ protected abstract List destroyClones(List portletRefs) throws
PortletInvokerException;
+
+ /**
+ *
+ */
+ protected abstract void assertNoExistingState();
+
+ /**
+ *
+ */
+ protected abstract void invoke(PortletInvocation invocation) throws
PortletInvokerException;
+
+ /**
+ *
+ */
+ protected abstract ActionInvocation createAction(PortletContext portletRef, AccessMode
accessMode);
+
+ /**
+ *
+ */
+ protected abstract PortletContext getImplicitClonedRef(ActionInvocation action);
+
+ /**
+ *
+ */
+ protected abstract PortletContext getModifiedPortletRef(ActionInvocation action);
+
+ /**
+ *
+ */
+ protected abstract void addPreference(PortletContext popRef, String key, Value
defaultValue);
+
+ /**
+ *
+ */
+ protected abstract void addPreference(PortletContext popRef, String key, Value
defaultValue, Boolean readOnly);
+
+ /**
+ *
+ */
+ protected final PortletContext createPOPRef(PortletInfoSupport portletInfo) throws
PortletInvokerException
+ {
+ PortletSupport portletSupport = new PortletSupport(portletInfo);
+ return createPOPRef(portletSupport);
+ }
+
+ /**
+ *
+ */
+ protected final PortletContext createLocalCCPRef() throws Exception
+ {
+ PortletContext popCtx = createPOPRef();
+ return createLocalClone(popCtx);
+ }
+
+ /**
+ *
+ */
+ protected final PortletContext createNonExistingLocalCCPRef() throws Exception
+ {
+ PortletContext popRef = createPOPRef();
+ PortletContext ccpRef = createLocalClone(popRef);
+ destroyClone(ccpRef);
+ return ccpRef;
+ }
+
+ /**
+ *
+ */
+ protected final PortletContext createPOPRef() throws PortletInvokerException
+ {
+ PortletInfoSupport info = new PortletInfoSupport();
+ return createPOPRef(info);
+ }
+
+ public void testCloneWithNullContext() throws Exception
+ {
+ try
+ {
+ createClone(null);
+ fail("was expecting an IllegalArgumentException");
+ }
+ catch (IllegalArgumentException expected)
+ {
+ }
+ assertNoExistingState();
+ }
+
+ public void testCloneNonExistingPOP() throws Exception
+ {
+ PortletContext popCtx = createNonExistingPOPRef();
+ try
+ {
+ createClone(popCtx);
+ fail("was expecting an NoSuchPortletException");
+ }
+ catch (NoSuchPortletException expected)
+ {
+ }
+ assertNoExistingState();
+ }
+
+ public void testCloneNonExistingCCP() throws Exception
+ {
+ PortletContext ccpCtx = createNonExistingLocalCCPRef();
+ try
+ {
+ createClone(ccpCtx);
+ fail("was expecting an NoSuchPortletException");
+ }
+ catch (NoSuchPortletException expected)
+ {
+ }
+ assertNoExistingState();
+ }
+
+// public void testCloneInvalidCCP() throws Exception
+// {
+// PortletContext ccpCtx = getProducer().wrapCCP("InvalidPortletId");
+// try
+// {
+// getProducer().createClone(ccpCtx);
+// fail("was expecting an InvalidPortletIdException");
+// }
+// catch (InvalidPortletIdException expected)
+// {
+// }
+// assertNoExistingState();
+// }
+
+ public void testCloneInvalidPOP() throws Exception
+ {
+ PortletContext popCtx = createInvalidPOPRef();
+ try
+ {
+ createClone(popCtx);
+ fail("was expecting an InvalidPortletIdException");
+ }
+ catch (InvalidPortletIdException expected)
+ {
+ }
+ assertNoExistingState();
+ }
+
+ public void testClonePortlet() throws Exception
+ {
+ PortletInfoSupport info = new PortletInfoSupport();
+ info.getMetaSupport().setDisplayName("MyPortlet");
+ PortletContext popCtx = createPOPRef(info);
+ addPreference(popCtx, "abc", new StringValue("def"));
+
+ //
+ PortletContext ccp1Ctx = createClone(popCtx);
+
+
+ // Check state
+ PropertyMap expected = new SimplePropertyMap();
+ expected.setProperty("abc", new StringValue("def"));
+ PropertyMap ccp1Props = getProperties(ccp1Ctx);
+ ValueMapAssert.assertEquals(expected, ccp1Props);
+
+ //
+ Portlet ccp1 = getPortlet(ccp1Ctx);
+ LocalizedString abc =
ccp1.getInfo().getMeta().getMetaValue(MetaInfo.DISPLAY_NAME);
+ assertEquals("MyPortlet", abc.getString(Locale.ENGLISH, true));
+ assertEquals(ccp1Ctx, ccp1.getContext());
+
+ // Update state
+ PropertyChange[] changes = new
PropertyChange[]{PropertyChange.newUpdate("ghi", new
StringValue("jkl"))};
+ ccp1Ctx = setProperties(ccp1Ctx, changes);
+
+ // Clone a CCP
+ PortletContext ccp2Ctx = createClone(ccp1Ctx);
+
+ // Check state
+ expected = new SimplePropertyMap();
+ expected.setProperty("abc", new StringValue("def"));
+ expected.setProperty("ghi", new StringValue("jkl"));
+ PropertyMap ccp2Props = getProperties(ccp2Ctx);
+ ValueMapAssert.assertEquals(expected, ccp2Props);
+
+ //
+ Portlet ccp2 = getPortlet(ccp2Ctx);
+ LocalizedString def =
ccp2.getInfo().getMeta().getMetaValue(MetaInfo.DISPLAY_NAME);
+ assertEquals("MyPortlet", def.getString(Locale.ENGLISH, true));
+ }
+
+ public void testGetWithNullId() throws Exception
+ {
+ try
+ {
+ getPortlet(null);
+ fail("was expecting an IllegalArgumentException");
+ }
+ catch (IllegalArgumentException expected)
+ {
+ }
+ }
+
+ public void testGetNonExistingPOP() throws Exception
+ {
+ PortletContext pop = createNonExistingPOPRef();
+ try
+ {
+ getPortlet(pop);
+ fail("was expecting a NoSuchPortletException");
+ }
+ catch (NoSuchPortletException expected)
+ {
+ }
+ }
+
+ public void testGetNonExistingCCP() throws Exception
+ {
+ PortletContext ccpCtx = createNonExistingLocalCCPRef();
+ try
+ {
+ getPortlet(ccpCtx);
+ fail("was expecting a NoSuchPortletException");
+ }
+ catch (NoSuchPortletException expected)
+ {
+ }
+ }
+
+ public void testGetInvalidPOP() throws Exception
+ {
+ PortletContext popCtx = createInvalidPOPRef();
+ try
+ {
+ getPortlet(popCtx);
+ fail("was expecting an InvalidPortletIdException");
+ }
+ catch (InvalidPortletIdException expected)
+ {
+ }
+ }
+
+// public void testGetInvalidCCP() throws Exception
+// {
+// PortletContext ccpId = getProducer().wrapCCP("InvalidPortletId");
+// try
+// {
+// getProducer().getPortlet(ccpId.getId());
+// fail("was expecting an InvalidPortletIdException");
+// }
+// catch (InvalidPortletIdException expected)
+// {
+// }
+// }
+
+ public void testDestroyWithNullId() throws Exception
+ {
+ try
+ {
+ destroyClones(null);
+ fail("was expecting an IllegalArgumentException");
+ }
+ catch (IllegalArgumentException expected)
+ {
+ }
+ }
+
+ public void testDestroyPOP() throws Exception
+ {
+ PortletContext popCtx = createPOPRef();
+ List failures = destroyClones(Collections.singletonList(popCtx));
+ assertEquals(1, failures.size());
+ DestroyCloneFailure failure = (DestroyCloneFailure)failures.get(0);
+ assertEquals(getPortletId(popCtx), failure.getPortletId());
+ }
+
+ public void testDestroyCCP() throws Exception
+ {
+ PortletContext popCtx = createPOPRef();
+ PortletContext ccpCtx = createClone(popCtx);
+ List failures = destroyClones(Collections.singletonList(ccpCtx));
+ assertEquals(0, failures.size());
+ assertNoExistingState();
+ }
+
+// public void testDestroyInvalidCCP() throws Exception
+// {
+// PortletContext ccpId = getProducer().wrapCCP("PortletId");
+// List failures = getProducer().destroyClones(Collections.singletonList(ccpId));
+// assertEquals(1, failures.size());
+// DestroyCloneFailure failure = (DestroyCloneFailure)failures.get(0);
+// assertEquals(ccpId.getId(), failure.getPortletId());
+// }
+
+ public void testDestroyNonExistingCCP() throws Exception
+ {
+ PortletContext ccpCtx = createNonExistingLocalCCPRef();
+ List failures = destroyClones(Collections.singletonList(ccpCtx));
+ assertEquals(1, failures.size());
+ DestroyCloneFailure failure = (DestroyCloneFailure)failures.get(0);
+ assertEquals(getPortletId(ccpCtx), failure.getPortletId());
+ }
+
+ public void testGetPropertiesWithNullPortlet() throws Exception
+ {
+ try
+ {
+ getProperties(null);
+ fail("was expecting an IllegalArgumentException");
+ }
+ catch (IllegalArgumentException e)
+ {
+ }
+ try
+ {
+ getProperties(null, new HashSet());
+ fail("was expecting an IllegalArgumentException");
+ }
+ catch (IllegalArgumentException e)
+ {
+ }
+ }
+
+ public void testGetNonExistingPOPProperties() throws Exception
+ {
+ PortletContext popCtx = createNonExistingPOPRef();
+ try
+ {
+ getProperties(popCtx);
+ fail("was expecting a NoSuchPortletException");
+ }
+ catch (NoSuchPortletException e)
+ {
+ }
+ try
+ {
+ getProperties(popCtx, new HashSet());
+ fail("was expecting a NoSuchPortletException");
+ }
+ catch (NoSuchPortletException e)
+ {
+ }
+ }
+
+ public void testGetInvalidPOPProperties() throws Exception
+ {
+ PortletContext popCtx = createInvalidPOPRef();
+ try
+ {
+ getProperties(popCtx);
+ fail("was expecting an InvalidPortletIdException");
+ }
+ catch (InvalidPortletIdException e)
+ {
+ }
+ try
+ {
+ getProperties(popCtx, new HashSet());
+ fail("was expecting an InvalidPortletIdException");
+ }
+ catch (InvalidPortletIdException e)
+ {
+ }
+ }
+
+ public void testGetNonExistingCCPProperties() throws Exception
+ {
+ PortletContext ccpCtx = createNonExistingLocalCCPRef();
+ try
+ {
+ getProperties(ccpCtx);
+ fail("was expecting a NoSuchPortletException");
+ }
+ catch (NoSuchPortletException e)
+ {
+ }
+ try
+ {
+ getProperties(ccpCtx, new HashSet());
+ fail("was expecting a NoSuchPortletException");
+ }
+ catch (NoSuchPortletException e)
+ {
+ }
+ }
+
+// public void testGetInvalidCCPProperties() throws Exception
+// {
+// PortletContext ccpId = getProducer().wrapCCP("InvalidPortletId");
+// try
+// {
+// getProducer().getProperties(ccpId);
+// fail("was expecting a nInvalidPortletIdException");
+// }
+// catch (InvalidPortletIdException e)
+// {
+// }
+// try
+// {
+// getProducer().getProperties(ccpId, new HashSet());
+// fail("was expecting a nInvalidPortletIdException");
+// }
+// catch (InvalidPortletIdException e)
+// {
+// }
+// }
+
+ public void testGetPOPWithNullKeys() throws Exception
+ {
+ PortletContext popCtx = createPOPRef();
+ try
+ {
+ getProperties(popCtx, null);
+ fail("was expecting an IllegalArgumentException");
+ }
+ catch (IllegalArgumentException e)
+ {
+ }
+ }
+
+ public void testGetCCPWithNullKeys() throws Exception
+ {
+ PortletContext ccpCtx = createLocalCCPRef();
+ try
+ {
+ getProperties(ccpCtx, null);
+ fail("was expecting an IllegalArgumentException");
+ }
+ catch (IllegalArgumentException e)
+ {
+ }
+ }
+
+ public void testGetPOPProperties() throws Exception
+ {
+ PortletInfoSupport info = new PortletInfoSupport();
+ PortletContext popCtx = createPOPRef(info);
+ addPreference(popCtx, "abc", new StringValue("def"));
+ addPreference(popCtx, "ghi", new StringValue("jkl"),
Boolean.TRUE);
+
+ //
+ PropertyMap props = getProperties(popCtx);
+ PropertyMap expectedProps = new SimplePropertyMap();
+ expectedProps.setProperty("abc", new StringValue("def"));
+ expectedProps.setProperty("ghi", new StringValue("jkl"));
+ ValueMapAssert.assertEquals(expectedProps, props);
+
+ //
+ props = getProperties(popCtx, new
CollectionBuilder().add("abc").add("mno").toHashSet());
+ expectedProps = new SimplePropertyMap();
+ expectedProps.setProperty("abc", new StringValue("def"));
+ ValueMapAssert.assertEquals(expectedProps, props);
+ }
+
+ public void testGetCCPProperties() throws Exception
+ {
+ PortletInfoSupport info = new PortletInfoSupport();
+ PortletContext popCtx = createPOPRef(info);
+ addPreference(popCtx, "abc", new StringValue("def"));
+ addPreference(popCtx, "ghi", new StringValue("jkl"));
+ addPreference(popCtx, "mno", new StringValue("pqr"),
Boolean.TRUE);
+ addPreference(popCtx, "stu", new StringValue("vwx"),
Boolean.TRUE);
+
+ //
+ PortletContext ccpCtx = createClone(popCtx);
+ ccpCtx = setProperties(ccpCtx, new PropertyChange[]{
+ PropertyChange.newUpdate("abc", new StringValue("_def")),
+ PropertyChange.newReset("gho"),
+ PropertyChange.newUpdate("mno", new StringValue("_pqr")),
+ PropertyChange.newReset("stu")});
+
+ //
+ PropertyMap props = getProperties(ccpCtx);
+ PropertyMap expectedProps = new SimplePropertyMap();
+ expectedProps.setProperty("abc", new StringValue("_def"));
+ expectedProps.setProperty("ghi", new StringValue("jkl"));
+ expectedProps.setProperty("mno", new StringValue("pqr"));
+ expectedProps.setProperty("stu", new StringValue("vwx"));
+ ValueMapAssert.assertEquals(expectedProps, props);
+
+ //
+ props = getProperties(ccpCtx, new
CollectionBuilder().add("abc").add("mno").add("yz").toHashSet());
+ expectedProps = new SimplePropertyMap();
+ expectedProps.setProperty("abc", new StringValue("_def"));
+ expectedProps.setProperty("mno", new StringValue("pqr"));
+ ValueMapAssert.assertEquals(expectedProps, props);
+ }
+
+ public void testSetPropertiesWithNullId() throws Exception
+ {
+ try
+ {
+ setProperties(null, new PropertyChange[0]);
+ fail("Was expecting an IllegalArgumentException");
+ }
+ catch (IllegalArgumentException expected)
+ {
+ }
+ }
+
+ public void testSetPropertiesWithNullProperties() throws Exception
+ {
+ PortletContext ccpCtx = createLocalCCPRef();
+ try
+ {
+ setProperties(ccpCtx, null);
+ fail("Was expecting an IllegalArgumentException");
+ }
+ catch (IllegalArgumentException expected)
+ {
+ }
+ }
+
+ public void testSetPOPProperties() throws Exception
+ {
+ PortletContext popCtx = createPOPRef();
+ try
+ {
+ setProperties(popCtx, new PropertyChange[0]);
+ fail("Was expecting an InvalidPortletIdException");
+ }
+ catch (InvalidPortletIdException expected)
+ {
+ }
+ }
+
+ public void testSetNonExistingCCPProperties() throws Exception
+ {
+ PortletContext ccpCtx = createNonExistingLocalCCPRef();
+ try
+ {
+ setProperties(ccpCtx, new PropertyChange[0]);
+ fail("Was expecting a NoSuchPortletException");
+ }
+ catch (NoSuchPortletException expected)
+ {
+ }
+ }
+
+ public void testSetCCPProperties() throws Exception
+ {
+ PortletInfoSupport info = new PortletInfoSupport();
+ PortletContext popCtx = createPOPRef(info);
+ addPreference(popCtx, "override_update", new
StringValue("override_update_portlet_value"));
+ addPreference(popCtx, "override_reset", new
StringValue("override_reset_portlet_value"));
+ addPreference(popCtx, "override_create", new
StringValue("override_create_portlet_value"));
+ addPreference(popCtx, "readonly_create", new
StringValue("readonly_create_portlet_value"), Boolean.TRUE);
+
+ //
+ PortletContext ccpCtx = createClone(popCtx);
+ ccpCtx = setProperties(ccpCtx, new PropertyChange[]{
+ PropertyChange.newUpdate("override_update", new
StringValue("override_update_clone_value")),
+ PropertyChange.newUpdate("override_reset", new
StringValue("override_reset_clone_value")),
+ PropertyChange.newUpdate("dynamic_update", new
StringValue("dynamic_update_clone_value")),
+ PropertyChange.newUpdate("dynamic_reset", new
StringValue("dynamic_reset_clone_value")),
+ });
+
+ //
+ PropertyMap expectedProps = new SimplePropertyMap();
+ expectedProps.setProperty("override_update", new
StringValue("override_update_clone_value"));
+ expectedProps.setProperty("override_reset", new
StringValue("override_reset_clone_value"));
+ expectedProps.setProperty("override_create", new
StringValue("override_create_portlet_value"));
+ expectedProps.setProperty("readonly_create", new
StringValue("readonly_create_portlet_value"));
+ expectedProps.setProperty("dynamic_update", new
StringValue("dynamic_update_clone_value"));
+ expectedProps.setProperty("dynamic_reset", new
StringValue("dynamic_reset_clone_value"));
+ PropertyMap ccpProps = getProperties(ccpCtx);
+ ValueMapAssert.assertEquals(expectedProps, ccpProps);
+
+ //
+ PropertyChange[] changes = new PropertyChange[]
+ {
+ PropertyChange.newUpdate("override_update", new
StringValue("override_update_clone_value_2")),
+ PropertyChange.newReset("override_reset"),
+ PropertyChange.newUpdate("override_create", new
StringValue("override_create_clone_value_2")),
+ PropertyChange.newUpdate("dynamic_update", new
StringValue("dynamic_update_clone_value_2")),
+ PropertyChange.newReset("dynamic_reset"),
+ PropertyChange.newUpdate("dynamic_create", new
StringValue("dynamic_create_clone_value_2")),
+ PropertyChange.newUpdate("readonly_create", new
StringValue("readonly_create_clone_value_2")),
+ };
+ ccpCtx = setProperties(ccpCtx, changes);
+
+ //
+ expectedProps.clear();
+ expectedProps.setProperty("override_update", new
StringValue("override_update_clone_value_2"));
+ expectedProps.setProperty("override_create", new
StringValue("override_create_clone_value_2"));
+ expectedProps.setProperty("override_reset", new
StringValue("override_reset_portlet_value"));
+ expectedProps.setProperty("dynamic_update", new
StringValue("dynamic_update_clone_value_2"));
+ expectedProps.setProperty("dynamic_create", new
StringValue("dynamic_create_clone_value_2"));
+ expectedProps.setProperty("readonly_create", new
StringValue("readonly_create_portlet_value"));
+ ccpProps = getProperties(ccpCtx);
+ ValueMapAssert.assertEquals(expectedProps, ccpProps);
+ }
+
+ public void testInvokeCloneBeforeWriteWithUpdate() throws Exception
+ {
+ PortletInfoSupport info = new PortletInfoSupport();
+ PortletSupport portletSupport = new PortletSupport(info)
+ {
+ public PortletInvocationResponse invoke(PortletInvocation invocation)
+ {
+ AbstractPropertyContext props =
(AbstractPropertyContext)invocation.getAttribute(PortletInvocation.INVOCATION_SCOPE,
PropertyContext.PREFERENCES_ATTRIBUTE);
+ props.update(new PropertyChange[]{PropertyChange.newUpdate("abc",
new StringValue("_def"))});
+ return null;
+ }
+ };
+ PortletContext popCtx = createPOPRef(portletSupport);
+ addPreference(popCtx, "abc", new StringValue("def"));
+
+ //
+ ActionInvocation invocation = createAction(popCtx, AccessMode.CLONE_BEFORE_WRITE);
+ invoke(invocation);
+
+ //
+ PortletContext cloneRef = getImplicitClonedRef(invocation);
+ assertNotNull(cloneRef);
+
+ //
+ PropertyMap blah = getProperties(cloneRef);
+ PropertyMap expectedProps = new SimplePropertyMap();
+ expectedProps.setProperty("abc", new StringValue("_def"));
+ ValueMapAssert.assertEquals(expectedProps, blah);
+ }
+
+ public void testInvokeReadOnlyWithUpdate() throws Exception
+ {
+ final Boolean[] ise = {Boolean.FALSE};
+
+ PortletInfoSupport info = new PortletInfoSupport();
+ PortletSupport portletSupport = new PortletSupport(info)
+ {
+ public PortletInvocationResponse invoke(PortletInvocation invocation)
+ {
+ try
+ {
+ AbstractPropertyContext props =
(AbstractPropertyContext)invocation.getAttribute(PortletInvocation.INVOCATION_SCOPE,
PropertyContext.PREFERENCES_ATTRIBUTE);
+ props.update(new
PropertyChange[]{PropertyChange.newUpdate("abc", new
StringValue("_def"))});
+ return null;
+ }
+ catch (IllegalStateException e)
+ {
+ ise[0] = Boolean.TRUE;
+ return null;
+ }
+ }
+ };
+ PortletContext popCtx = createPOPRef(portletSupport);
+ addPreference(popCtx, "abc", new StringValue("def"));
+
+ //
+ ActionInvocation invocation = createAction(popCtx, AccessMode.READ_ONLY);
+ invoke(invocation);
+
+ //
+// Object cloneRef = instanceCtx.getPortletRef();
+// assertNull(cloneRef);
+ assertEquals(Boolean.TRUE, ise[0]);
+ }
+
+ public void testInvokeReadWriteWithUpdate() throws Exception
+ {
+ PortletInfoSupport info = new PortletInfoSupport();
+ PortletSupport portletSupport = new PortletSupport(info)
+ {
+ public PortletInvocationResponse invoke(PortletInvocation invocation)
+ {
+ AbstractPropertyContext props =
(AbstractPropertyContext)invocation.getAttribute(PortletInvocation.INVOCATION_SCOPE,
PropertyContext.PREFERENCES_ATTRIBUTE);
+ props.update(new PropertyChange[]{PropertyChange.newUpdate("abc",
new StringValue("_def"))});
+ return null;
+ }
+ };
+ PortletContext popCtx = createPOPRef(portletSupport);
+ addPreference(popCtx, "abc", new StringValue("def"));
+
+ //
+ PortletContext ccpCtx = createClone(popCtx);
+
+ //
+ ActionInvocation invocation = createAction(ccpCtx, AccessMode.READ_WRITE);
+ invoke(invocation);
+
+ //
+ ccpCtx = getModifiedPortletRef(invocation);
+ assertNotNull(ccpCtx);
+
+ //
+ PropertyMap blah = getProperties(ccpCtx);
+ PropertyMap expectedProps = new SimplePropertyMap();
+ expectedProps.setProperty("abc", new StringValue("_def"));
+ ValueMapAssert.assertEquals(expectedProps, blah);
+ }
+
+ private void assertEquals(PortletContext expected, PortletContext actual)
+ {
+ if (expected == null)
+ {
+ assertNull("Portlet context should be null", actual);
+ }
+ else
+ {
+ assertNotNull("Portlet context should not be null but rather equals to
" + expected, actual);
+
+ // Test handle first
+ assertEquals(expected.getId(), actual.getId());
+
+ // Compare bytes
+ byte[] expectedState = expected.getState();
+ byte[] actualState = actual.getState();
+ if (expectedState == null)
+ {
+ assertNull("Actual state should be null", actualState);
+ }
+ else
+ {
+ assertNotNull("Actual state should be not null", actualState);
+ assertTrue(Arrays.equals(expectedState, actualState));
+ }
+ }
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/state/ConsumerStatefulPortletInvokerTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/state/ConsumerStatefulPortletInvokerTestCase.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/state/ConsumerStatefulPortletInvokerTestCase.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,233 @@
+/******************************************************************************
+ * 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.state;
+
+import org.jboss.portal.portlet.Portlet;
+import org.jboss.portal.portlet.PortletContext;
+import org.jboss.portal.portlet.PortletInvokerException;
+import org.jboss.portal.portlet.support.info.PortletInfoSupport;
+import org.jboss.portal.portlet.impl.state.StateManagementPolicyService;
+import org.jboss.portal.portlet.impl.state.StateConverterV0;
+import org.jboss.portal.portlet.impl.state.consumer.ConsumerPersistenceManagerService;
+import
org.jboss.portal.portlet.impl.state.producer.PortletStatePersistenceManagerService;
+import org.jboss.portal.portlet.invocation.ActionInvocation;
+import org.jboss.portal.portlet.invocation.PortletInvocation;
+import org.jboss.portal.portlet.state.AccessMode;
+import org.jboss.portal.portlet.state.PropertyChange;
+import org.jboss.portal.portlet.state.PropertyMap;
+import org.jboss.portal.portlet.state.StateConverter;
+import org.jboss.portal.portlet.state.consumer.ConsumerPortletInvoker;
+import org.jboss.portal.portlet.state.producer.ProducerPortletInvoker;
+import org.jboss.portal.portlet.test.ActionContextImpl;
+import org.jboss.portal.portlet.test.InstanceContextImpl;
+import org.jboss.portal.portlet.test.support.PortletInvokerSupport;
+import org.jboss.portal.portlet.test.support.PortletSupport;
+import org.jboss.portal.common.value.Value;
+
+import java.util.Collections;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class ConsumerStatefulPortletInvokerTestCase extends
AbstractStatefulPortletInvokerTestCase
+{
+
+ public ConsumerStatefulPortletInvokerTestCase(boolean persistLocally)
+ {
+ this.persistLocally = persistLocally;
+ }
+
+ /** . */
+ protected final boolean persistLocally;
+
+ /** . */
+ protected ConsumerPortletInvoker consumer;
+
+ /** . */
+ protected ConsumerPersistenceManagerService consumerPersistenceManager;
+
+ /** . */
+ protected ProducerPortletInvoker producer;
+
+ /** . */
+ protected PortletInvokerSupport container;
+
+ /** . */
+ protected PortletStatePersistenceManagerService portletStatePersistenceManager;
+
+ /** . */
+ protected StateManagementPolicyService stateManagementPolicy;
+
+ /** . */
+ protected StateConverter stateConverter;
+
+ protected void setUp() throws Exception
+ {
+ consumer = new ConsumerPortletInvoker();
+ consumerPersistenceManager = new ConsumerPersistenceManagerService();
+ producer = new ProducerPortletInvoker();
+ container = new PortletInvokerSupport();
+ portletStatePersistenceManager = new PortletStatePersistenceManagerService();
+ stateManagementPolicy = new StateManagementPolicyService();
+ stateConverter = new StateConverterV0();
+
+ //
+ stateManagementPolicy.setPersistLocally(persistLocally);
+
+ //
+ producer.setPortletInvoker(container);
+ producer.setPersistenceManager(portletStatePersistenceManager);
+ producer.setStateManagementPolicy(stateManagementPolicy);
+ producer.setStateConverter(stateConverter);
+
+ //
+ consumer.setPersistenceManager(consumerPersistenceManager);
+ consumer.setProducer(producer);
+ }
+
+ protected Portlet getPortlet(PortletContext portletRef) throws
PortletInvokerException
+ {
+ return consumer.getPortlet(portletRef);
+ }
+
+ protected PortletContext createPOPRef(PortletSupport portletSupport) throws
PortletInvokerException
+ {
+ container.addInternalPortlet("PortletId", portletSupport);
+ Portlet portlet = getSinglePOP();
+ return portlet.getContext();
+ }
+
+ protected PortletContext createNonExistingPOPRef() throws PortletInvokerException
+ {
+ container.addInternalPortlet("NonExistingPortletId", new
PortletInfoSupport());
+ PortletContext popContext = getSinglePOP().getContext();
+ container.removeInternalPortlet("NonExistingPortletId");
+ return popContext;
+ }
+
+ protected PortletContext createInvalidPOPRef() throws PortletInvokerException
+ {
+ container.addInternalPortlet("InvalidPortletId", new
PortletInfoSupport());
+ PortletContext popContext = getSinglePOP().getContext();
+ container.setValid("InvalidPortletId", false);
+ return popContext;
+ }
+
+ protected PortletContext createLocalClone(PortletContext portletRef) throws Exception
+ {
+ stateManagementPolicy.setPersistLocally(true);
+ PortletContext cloneRef = consumer.createClone(portletRef);
+ stateManagementPolicy.setPersistLocally(persistLocally);
+ return cloneRef;
+ }
+
+ protected void addPreference(PortletContext popRef, String key, Value defaultValue)
+ {
+ container.getInternalPortlet(popRef.getId()).addPreference(key, defaultValue);
+ }
+
+ protected void addPreference(PortletContext popRef, String key, Value defaultValue,
Boolean readOnly)
+ {
+ container.getInternalPortlet(popRef.getId()).addPreference(key, defaultValue,
readOnly);
+ }
+
+ protected void destroyClone(PortletContext portletRef) throws Exception
+ {
+ assertEquals(Collections.EMPTY_LIST,
consumer.destroyClones(Collections.singletonList(portletRef)));
+ }
+
+ protected void assertNoExistingState()
+ {
+ // todo
+ }
+
+ protected PortletContext createClone(PortletContext portletRef) throws
PortletInvokerException
+ {
+ return consumer.createClone(portletRef);
+ }
+
+ protected PortletContext setProperties(PortletContext portletRef, PropertyChange[]
changes) throws PortletInvokerException
+ {
+ consumer.setProperties(portletRef, changes);
+ return portletRef;
+ }
+
+ protected PropertyMap getProperties(PortletContext portletRef) throws
PortletInvokerException
+ {
+ return consumer.getProperties(portletRef);
+ }
+
+ protected PropertyMap getProperties(PortletContext portletRef, Set keys) throws
PortletInvokerException
+ {
+ return consumer.getProperties(portletRef, keys);
+ }
+
+ protected List destroyClones(List portletRefs) throws PortletInvokerException
+ {
+ return consumer.destroyClones(portletRefs);
+ }
+
+ protected String getPortletId(PortletContext portletRef) throws
PortletInvokerException
+ {
+ return (portletRef).getId();
+ }
+
+ protected void invoke(PortletInvocation invocation) throws PortletInvokerException
+ {
+ consumer.invoke(invocation);
+ }
+
+ protected ActionInvocation createAction(PortletContext portletRef, AccessMode
accessMode)
+ {
+ ActionContextImpl actionCtx = new ActionContextImpl();
+ InstanceContextImpl instanceCtx = new InstanceContextImpl("blah",
accessMode);
+
+ //
+ ActionInvocation action = new ActionInvocation(actionCtx);
+ action.setInstanceContext(instanceCtx);
+ action.setTarget(portletRef);
+ return action;
+ }
+
+ protected PortletContext getImplicitClonedRef(ActionInvocation action)
+ {
+ InstanceContextImpl instanceCtx =
(InstanceContextImpl)action.getInstanceContext();
+ return instanceCtx.getClonedContext();
+ }
+
+ protected PortletContext getModifiedPortletRef(ActionInvocation action)
+ {
+ return action.getTarget();
+ }
+
+ private Portlet getSinglePOP() throws PortletInvokerException
+ {
+ Set portlets = producer.getPortlets();
+ assertNotNull(portlets);
+ assertEquals(1, portlets.size());
+ return (Portlet)portlets.iterator().next();
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/state/LocalStoreConsumerStatefulPortletInvokerTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/state/LocalStoreConsumerStatefulPortletInvokerTestCase.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/state/LocalStoreConsumerStatefulPortletInvokerTestCase.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -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.test.portlet.state;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class LocalStoreConsumerStatefulPortletInvokerTestCase extends
ConsumerStatefulPortletInvokerTestCase
+{
+ public LocalStoreConsumerStatefulPortletInvokerTestCase()
+ {
+ super(true);
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/state/LocalStoreProducerStatefulPortletInvokerTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/state/LocalStoreProducerStatefulPortletInvokerTestCase.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/state/LocalStoreProducerStatefulPortletInvokerTestCase.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,43 @@
+/******************************************************************************
+ * 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.state;
+
+import org.jboss.portal.portlet.invocation.ActionInvocation;
+import org.jboss.portal.portlet.PortletContext;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class LocalStoreProducerStatefulPortletInvokerTestCase extends
ProducerStatefulPortletInvokerTestCase
+{
+ public LocalStoreProducerStatefulPortletInvokerTestCase()
+ {
+ super(true);
+ }
+
+ protected PortletContext getModifiedPortletRef(ActionInvocation action)
+ {
+ return action.getTarget();
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/state/ProducerStatefulPortletInvokerTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/state/ProducerStatefulPortletInvokerTestCase.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/state/ProducerStatefulPortletInvokerTestCase.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,220 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.portlet.state;
+
+import org.jboss.portal.portlet.Portlet;
+import org.jboss.portal.portlet.PortletContext;
+import org.jboss.portal.portlet.PortletInvokerException;
+import org.jboss.portal.portlet.impl.state.StateManagementPolicyService;
+import org.jboss.portal.portlet.impl.state.StateConverterV0;
+import
org.jboss.portal.portlet.impl.state.producer.PortletStatePersistenceManagerService;
+import org.jboss.portal.portlet.invocation.ActionInvocation;
+import org.jboss.portal.portlet.invocation.PortletInvocation;
+import org.jboss.portal.portlet.state.AccessMode;
+import org.jboss.portal.portlet.state.PropertyChange;
+import org.jboss.portal.portlet.state.PropertyMap;
+import org.jboss.portal.portlet.state.StateConverter;
+import org.jboss.portal.portlet.state.producer.ProducerPortletInvoker;
+import org.jboss.portal.portlet.test.ActionContextImpl;
+import org.jboss.portal.portlet.test.InstanceContextImpl;
+import org.jboss.portal.portlet.test.support.PortletInvokerSupport;
+import org.jboss.portal.portlet.test.support.PortletSupport;
+import org.jboss.portal.portlet.support.info.PortletInfoSupport;
+import org.jboss.portal.common.value.Value;
+
+import java.util.Collections;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 6691 $
+ */
+public abstract class ProducerStatefulPortletInvokerTestCase extends
AbstractStatefulPortletInvokerTestCase
+{
+
+ protected ProducerStatefulPortletInvokerTestCase(boolean persistLocally)
+ {
+ this.persistLocally = persistLocally;
+ }
+
+ /** . */
+ protected final boolean persistLocally;
+
+ /** . */
+ protected ProducerPortletInvoker producer;
+
+ /** . */
+ protected PortletInvokerSupport container;
+
+ /** . */
+ protected PortletStatePersistenceManagerService persistenceManager;
+
+ /** . */
+ protected StateManagementPolicyService stateManagementPolicy;
+
+ /** . */
+ protected StateConverter stateConverter;
+
+ protected void setUp() throws Exception
+ {
+ producer = new ProducerPortletInvoker();
+ container = new PortletInvokerSupport();
+ persistenceManager = new PortletStatePersistenceManagerService();
+ stateManagementPolicy = new StateManagementPolicyService();
+ stateConverter = new StateConverterV0();
+
+ //
+ stateManagementPolicy.setPersistLocally(persistLocally);
+
+ //
+ producer.setPortletInvoker(container);
+ producer.setPersistenceManager(persistenceManager);
+ producer.setStateManagementPolicy(stateManagementPolicy);
+ producer.setStateConverter(stateConverter);
+ }
+
+ protected void assertNoExistingState()
+ {
+ assertEquals(0, persistenceManager.getSize());
+ }
+
+ protected PortletContext createPOPRef(PortletSupport portletSupport) throws
PortletInvokerException
+ {
+ container.addInternalPortlet("PortletId", portletSupport);
+ Portlet portlet = getSinglePOP();
+ return portlet.getContext();
+ }
+
+ protected PortletContext createNonExistingPOPRef()
+ {
+ container.addInternalPortlet("NonExistingPortletId", new
PortletInfoSupport());
+ PortletContext popCtx = getSinglePOP().getContext();
+ container.removeInternalPortlet("NonExistingPortletId");
+ return popCtx;
+ }
+
+ protected PortletContext createInvalidPOPRef()
+ {
+ container.addInternalPortlet("InvalidPortletId", new
PortletInfoSupport());
+ PortletContext popCtx = getSinglePOP().getContext();
+ container.setValid("InvalidPortletId", false);
+ return popCtx;
+ }
+
+ protected PortletContext createLocalClone(PortletContext portletRef) throws Exception
+ {
+ stateManagementPolicy.setPersistLocally(true);
+ PortletContext cloneContext = producer.createClone(portletRef);
+ stateManagementPolicy.setPersistLocally(persistLocally);
+ return cloneContext;
+ }
+
+ protected void addPreference(PortletContext popRef, String key, Value defaultValue)
+ {
+ container.getInternalPortlet(popRef.getId()).addPreference(key, defaultValue);
+ }
+
+ protected void addPreference(PortletContext popRef, String key, Value defaultValue,
Boolean readOnly)
+ {
+ container.getInternalPortlet(popRef.getId()).addPreference(key, defaultValue,
readOnly);
+ }
+
+ protected void destroyClone(PortletContext portletRef) throws Exception
+ {
+ assertEquals(Collections.EMPTY_LIST,
producer.destroyClones(Collections.singletonList(portletRef)));
+ }
+
+ protected PortletContext createClone(PortletContext portletRef) throws
PortletInvokerException
+ {
+ return producer.createClone((PortletContext)portletRef);
+ }
+
+ protected PortletContext setProperties(PortletContext portletRef, PropertyChange[]
changes) throws PortletInvokerException
+ {
+ return producer.setProperties((PortletContext)portletRef, changes);
+ }
+
+ protected PropertyMap getProperties(PortletContext portletRef) throws
PortletInvokerException
+ {
+ return producer.getProperties((PortletContext)portletRef);
+ }
+
+ protected PropertyMap getProperties(PortletContext portletRef, Set keys) throws
PortletInvokerException
+ {
+ return producer.getProperties((PortletContext)portletRef, keys);
+ }
+
+ protected List destroyClones(List portletRefs) throws PortletInvokerException
+ {
+ return producer.destroyClones(portletRefs);
+ }
+
+ protected Portlet getPortlet(PortletContext portletRef) throws
PortletInvokerException
+ {
+ if (portletRef == null)
+ {
+ return producer.getPortlet(null);
+ }
+ else
+ {
+ return producer.getPortlet((PortletContext)portletRef);
+ }
+ }
+
+ protected String getPortletId(PortletContext portletRef) throws
PortletInvokerException
+ {
+ return ((PortletContext)portletRef).getId();
+ }
+
+ protected void invoke(PortletInvocation invocation) throws PortletInvokerException
+ {
+ producer.invoke(invocation);
+ }
+
+ protected ActionInvocation createAction(PortletContext portletRef, AccessMode
accessMode)
+ {
+ ActionContextImpl actionCtx = new ActionContextImpl();
+ InstanceContextImpl instanceCtx = new InstanceContextImpl("blah",
accessMode);
+
+ //
+ ActionInvocation action = new ActionInvocation(actionCtx);
+ action.setInstanceContext(instanceCtx);
+ action.setTarget(portletRef);
+ return action;
+ }
+
+ protected PortletContext getImplicitClonedRef(ActionInvocation action)
+ {
+ InstanceContextImpl instanceCtx =
(InstanceContextImpl)action.getInstanceContext();
+ return instanceCtx.getClonedContext();
+ }
+
+ private Portlet getSinglePOP()
+ {
+ Set portlets = container.getPortlets();
+ assertNotNull(portlets);
+ assertEquals(1, portlets.size());
+ return (Portlet)portlets.iterator().next();
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/state/ProducerStatefulPortletInvokerTestCase.java
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/state/RemoteStoreConsumerStatefulPortletInvokerTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/state/RemoteStoreConsumerStatefulPortletInvokerTestCase.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/state/RemoteStoreConsumerStatefulPortletInvokerTestCase.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -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.test.portlet.state;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class RemoteStoreConsumerStatefulPortletInvokerTestCase extends
ConsumerStatefulPortletInvokerTestCase
+{
+ public RemoteStoreConsumerStatefulPortletInvokerTestCase()
+ {
+ super(false);
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/state/RemoteStoreProducerStatefulPortletInvokerTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/state/RemoteStoreProducerStatefulPortletInvokerTestCase.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/state/RemoteStoreProducerStatefulPortletInvokerTestCase.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,45 @@
+/******************************************************************************
+ * 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.state;
+
+import org.jboss.portal.portlet.invocation.ActionInvocation;
+import org.jboss.portal.portlet.test.InstanceContextImpl;
+import org.jboss.portal.portlet.PortletContext;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class RemoteStoreProducerStatefulPortletInvokerTestCase extends
ProducerStatefulPortletInvokerTestCase
+{
+ public RemoteStoreProducerStatefulPortletInvokerTestCase()
+ {
+ super(false);
+ }
+
+ protected PortletContext getModifiedPortletRef(ActionInvocation action)
+ {
+ InstanceContextImpl instanceCtx =
(InstanceContextImpl)action.getInstanceContext();
+ return instanceCtx.getModifiedContext();
+ }
+}
Added:
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/state/StateConverterV0TestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/state/StateConverterV0TestCase.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/state/StateConverterV0TestCase.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,122 @@
+/******************************************************************************
+ * 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.state;
+
+import junit.framework.TestCase;
+import org.jboss.portal.common.value.StringValue;
+import org.jboss.portal.portlet.impl.state.StateConverterV0;
+import org.jboss.portal.portlet.state.PropertyMap;
+import org.jboss.portal.portlet.state.SimplePropertyMap;
+import org.jboss.portal.portlet.state.StateConversionException;
+import org.jboss.portal.portlet.state.StateConverter;
+import org.jboss.portal.portlet.state.producer.PortletState;
+import org.jboss.portal.portlet.test.ValueMapAssert;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class StateConverterV0TestCase extends TestCase
+{
+
+ private final StateConverter converter = new StateConverterV0();
+
+ public void testIAE() throws StateConversionException
+ {
+ try
+ {
+ converter.marshall(null);
+ fail("Was expecting an IAE");
+ }
+ catch (IllegalArgumentException expected)
+ {
+ }
+ try
+ {
+ converter.unmarshall(null);
+ fail("Was expecting an IAE");
+ }
+ catch (IllegalArgumentException expected)
+ {
+ }
+ }
+
+ public void testAlteredMagic() throws StateConversionException
+ {
+ byte[] bytes = converter.marshall(new PortletState("foo"));
+ bytes[0] = (byte)0xCA;
+ bytes[1] = (byte)0xFE;
+ bytes[2] = (byte)0xBA;
+ bytes[3] = (byte)0xBE;
+ try
+ {
+ converter.unmarshall(bytes);
+ fail("Was expecting a state conversion exception");
+ }
+ catch (StateConversionException expected)
+ {
+ }
+ }
+
+ public void testBadVersionNumber() throws StateConversionException
+ {
+ byte[] bytes = converter.marshall(new PortletState("foo"));
+ bytes[4] = (byte)0x01;
+ try
+ {
+ converter.unmarshall(bytes);
+ fail("Was expecting a state conversion exception");
+ }
+ catch (StateConversionException expected)
+ {
+ }
+ }
+
+ public void testWorks() throws Exception
+ {
+ assertWorks(new PortletState("foo"));
+
+ //
+ PropertyMap props = new SimplePropertyMap();
+ props.setProperty("ab", new StringValue("cd"));
+ props.setProperty("ef", new StringValue(new String[0]));
+ props.setProperty("gh", new StringValue(new String[]{""}));
+ props.setProperty("ij", new StringValue(new String[]{"kl"}));
+ props.setProperty("mn", new StringValue(new String[]{"op",
null}));
+ props.setProperty("qr", new StringValue(new String[]{null,
"st"}));
+ props.setProperty("uv", new StringValue(new String[]{"wx",
null, "yz"}));
+ assertWorks(new PortletState("bar", props));
+ }
+
+ private void assertWorks(PortletState expectedState) throws Exception
+ {
+ byte[] bytes = converter.marshall(expectedState);
+ assertNotNull(bytes);
+ PortletState state = converter.unmarshall(bytes);
+ assertNotNull(state);
+
+ //
+ assertEquals(expectedState.getPortletId(), state.getPortletId());
+ ValueMapAssert.assertEquals(expectedState.getProperties(), state.getProperties());
+ }
+}
Added:
modules/portlet/trunk/portlet/src/resources/portal-portlet-lib-jar/org/jboss/portal/portlet/portlet.tld
===================================================================
---
modules/portlet/trunk/portlet/src/resources/portal-portlet-lib-jar/org/jboss/portal/portlet/portlet.tld
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/portal-portlet-lib-jar/org/jboss/portal/portlet/portlet.tld 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,106 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library
1.2//EN" "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">
+<taglib>
+
+ <tlib-version>1.0</tlib-version>
+ <jsp-version>1.2</jsp-version>
+ <short-name>portlet</short-name>
+
+ <
uri>http://java.sun.com/portlet</uri>
+
+ <tag>
+
+ <name>param</name>
+
<tag-class>org.jboss.portal.portlet.impl.jsr168.taglib.URLParameterTag</tag-class>
+ <body-content>empty</body-content>
+
+ <attribute>
+ <name>name</name>
+ <required>true</required>
+ <rtexprvalue>true</rtexprvalue>
+
+ </attribute>
+ <attribute>
+ <name>value</name>
+ <required>true</required>
+ <rtexprvalue>true</rtexprvalue>
+
+ </attribute>
+
+ </tag>
+ <tag>
+
+ <name>renderURL</name>
+
<tag-class>org.jboss.portal.portlet.impl.jsr168.taglib.RenderURLTag</tag-class>
+
<tei-class>org.jboss.portal.portlet.impl.jsr168.taglib.GenerateURLTagTEI</tei-class>
+ <body-content>JSP</body-content>
+
+ <attribute>
+ <name>portletMode</name>
+ <rtexprvalue>true</rtexprvalue>
+
+ </attribute>
+ <attribute>
+ <name>secure</name>
+ <rtexprvalue>true</rtexprvalue>
+
+ </attribute>
+ <attribute>
+ <name>var</name>
+ <rtexprvalue>true</rtexprvalue>
+
+ </attribute>
+ <attribute>
+ <name>windowState</name>
+ <rtexprvalue>true</rtexprvalue>
+
+ </attribute>
+
+ </tag>
+ <tag>
+
+ <name>defineObjects</name>
+
<tag-class>org.jboss.portal.portlet.impl.jsr168.taglib.DefineObjectsTag</tag-class>
+
<tei-class>org.jboss.portal.portlet.impl.jsr168.taglib.DefineObjectsTagTEI</tei-class>
+ <body-content>empty</body-content>
+
+ </tag>
+ <tag>
+
+ <name>actionURL</name>
+
<tag-class>org.jboss.portal.portlet.impl.jsr168.taglib.ActionURLTag</tag-class>
+
<tei-class>org.jboss.portal.portlet.impl.jsr168.taglib.GenerateURLTagTEI</tei-class>
+ <body-content>JSP</body-content>
+
+ <attribute>
+ <name>portletMode</name>
+ <rtexprvalue>true</rtexprvalue>
+
+ </attribute>
+ <attribute>
+ <name>secure</name>
+ <rtexprvalue>true</rtexprvalue>
+
+ </attribute>
+ <attribute>
+ <name>var</name>
+ <rtexprvalue>true</rtexprvalue>
+
+ </attribute>
+ <attribute>
+ <name>windowState</name>
+ <rtexprvalue>true</rtexprvalue>
+
+ </attribute>
+
+ </tag>
+ <tag>
+
+ <name>namespace</name>
+
<tag-class>org.jboss.portal.portlet.impl.jsr168.taglib.NamespaceTag</tag-class>
+ <body-content>empty</body-content>
+
+ </tag>
+
+</taglib>
Added: modules/portlet/trunk/portlet/src/resources/portlet-app_1_0.xsd
===================================================================
--- modules/portlet/trunk/portlet/src/resources/portlet-app_1_0.xsd
(rev 0)
+++ modules/portlet/trunk/portlet/src/resources/portlet-app_1_0.xsd 2007-08-17 15:29:49
UTC (rev 7981)
@@ -0,0 +1,632 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema
targetNamespace="http://java.sun.com/xml/ns/portlet/portlet-app_1_0....
xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:portlet="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xs...
xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" attributeFormDefault="unqualified"
version="1.0" xml:lang="en">
+ <annotation>
+ <documentation>
+ This is the XML Schema for the Portlet 1.0 deployment descriptor.
+ </documentation>
+ </annotation>
+ <annotation>
+ <documentation>
+ The following conventions apply to all J2EE
+ deployment descriptor elements unless indicated otherwise.
+ - In elements that specify a pathname to a file within the
+ same JAR file, relative filenames (i.e., those not
+ starting with "/") are considered relative to the root of
+ the JAR file's namespace. Absolute filenames (i.e., those
+ starting with "/") also specify names in the root of the
+ JAR file's namespace. In general, relative names are
+ preferred. The exception is .war files where absolute
+ names are preferred for consistency with the Servlet API.
+ </documentation>
+ </annotation>
+ <!-- *********************************************************** -->
+ <import
namespace="http://www.w3.org/XML/1998/namespace"
schemaLocation="http://www.w3.org/2001/xml.xsd"/>
+ <element name="portlet-app" type="portlet:portlet-appType">
+ <annotation>
+ <documentation>
+ The portlet-app element is the root of the deployment descriptor
+ for a portlet application. This element has a required attribute version
+ to specify to which version of the schema the deployment descriptor
+ conforms.
+ </documentation>
+ </annotation>
+ <unique name="portlet-name-uniqueness">
+ <annotation>
+ <documentation>
+ The portlet element contains the name of a portlet.
+ This name must be unique within the portlet application.
+ </documentation>
+ </annotation>
+ <selector xpath="portlet:portlet"/>
+ <field xpath="portlet:portlet-name"/>
+ </unique>
+ <unique name="custom-portlet-mode-uniqueness">
+ <annotation>
+ <documentation>
+ The custom-portlet-mode element contains the portlet-mode.
+ This portlet mode must be unique within the portlet application.
+ </documentation>
+ </annotation>
+ <selector xpath="portlet:custom-portlet-mode"/>
+ <field xpath="portlet:portlet-mode"/>
+ </unique>
+ <unique name="custom-window-state-uniqueness">
+ <annotation>
+ <documentation>
+ The custom-window-state element contains the window-state.
+ This window state must be unique within the portlet application.
+ </documentation>
+ </annotation>
+ <selector xpath="portlet:custom-window-state"/>
+ <field xpath="portlet:window-state"/>
+ </unique>
+ <unique name="user-attribute-name-uniqueness">
+ <annotation>
+ <documentation>
+ The user-attribute element contains the name the attribute.
+ This name must be unique within the portlet application.
+ </documentation>
+ </annotation>
+ <selector xpath="portlet:user-attribute"/>
+ <field xpath="portlet:name"/>
+ </unique>
+ </element>
+ <complexType name="portlet-appType">
+ <sequence>
+ <element name="portlet" type="portlet:portletType"
minOccurs="0" maxOccurs="unbounded">
+ <unique name="init-param-name-uniqueness">
+ <annotation>
+ <documentation>
+ The init-param element contains the name the attribute.
+ This name must be unique within the portlet.
+ </documentation>
+ </annotation>
+ <selector xpath="portlet:init-param"/>
+ <field xpath="portlet:name"/>
+ </unique>
+ <unique name="supports-mime-type-uniqueness">
+ <annotation>
+ <documentation>
+ The supports element contains the supported mime-type.
+ This mime type must be unique within the portlet.
+ </documentation>
+ </annotation>
+ <selector xpath="portlet:supports"/>
+ <field xpath="mime-type"/>
+ </unique>
+ <unique name="preference-name-uniqueness">
+ <annotation>
+ <documentation>
+ The preference element contains the name the preference.
+ This name must be unique within the portlet.
+ </documentation>
+ </annotation>
+ <selector xpath="portlet:portlet-preferences/portlet:preference"/>
+ <field xpath="portlet:name"/>
+ </unique>
+ <unique name="security-role-ref-name-uniqueness">
+ <annotation>
+ <documentation>
+ The security-role-ref element contains the role-name.
+ This role name must be unique within the portlet.
+ </documentation>
+ </annotation>
+ <selector xpath="portlet:security-role-ref"/>
+ <field xpath="portlet:role-name"/>
+ </unique>
+ </element>
+ <element name="custom-portlet-mode"
type="portlet:custom-portlet-modeType" minOccurs="0"
maxOccurs="unbounded"/>
+ <element name="custom-window-state"
type="portlet:custom-window-stateType" minOccurs="0"
maxOccurs="unbounded"/>
+ <element name="user-attribute"
type="portlet:user-attributeType" minOccurs="0"
maxOccurs="unbounded"/>
+ <element name="security-constraint"
type="portlet:security-constraintType" minOccurs="0"
maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="version" type="string"
use="required"/>
+ <attribute name="id" type="string"
use="optional"/>
+ </complexType>
+ <complexType name="custom-portlet-modeType">
+ <annotation>
+ <documentation>
+ A custom portlet mode that one or more portlets in
+ this portlet application supports.
+ Used in: portlet-app
+ </documentation>
+ </annotation>
+ <sequence>
+ <element name="description" type="portlet:descriptionType"
minOccurs="0" maxOccurs="unbounded"/>
+ <element name="portlet-mode"
type="portlet:portlet-modeType"/>
+ </sequence>
+ <attribute name="id" type="string"
use="optional"/>
+ </complexType>
+ <complexType name="custom-window-stateType">
+ <annotation>
+ <documentation>
+ A custom window state that one or more portlets in this
+ portlet application supports.
+ Used in: portlet-app
+ </documentation>
+ </annotation>
+ <sequence>
+ <element name="description" type="portlet:descriptionType"
minOccurs="0" maxOccurs="unbounded"/>
+ <element name="window-state"
type="portlet:window-stateType"/>
+ </sequence>
+ <attribute name="id" type="string"
use="optional"/>
+ </complexType>
+ <complexType name="expiration-cacheType">
+ <annotation>
+ <documentation>
+ Expriation-cache defines expiration-based caching for this
+ portlet. The parameter indicates
+ the time in seconds after which the portlet output expires.
+ -1 indicates that the output never expires.
+ Used in: portlet
+ </documentation>
+ </annotation>
+ <simpleContent>
+ <extension base="int"/>
+ </simpleContent>
+ </complexType>
+ <complexType name="init-paramType">
+ <annotation>
+ <documentation>
+ The init-param element contains a name/value pair as an
+ initialization param of the portlet
+ Used in:portlet
+ </documentation>
+ </annotation>
+ <sequence>
+ <element name="description" type="portlet:descriptionType"
minOccurs="0" maxOccurs="unbounded"/>
+ <element name="name" type="portlet:nameType"/>
+ <element name="value" type="portlet:valueType"/>
+ </sequence>
+ <attribute name="id" type="string"
use="optional"/>
+ </complexType>
+ <complexType name="keywordsType">
+ <annotation>
+ <documentation>
+ Locale specific keywords associated with this portlet.
+ The kewords are separated by commas.
+ Used in: portlet-info
+ </documentation>
+ </annotation>
+ <simpleContent>
+ <extension base="string"/>
+ </simpleContent>
+ </complexType>
+ <complexType name="mime-typeType">
+ <annotation>
+ <documentation>
+ MIME type name, e.g. "text/html".
+ The MIME type may also contain the wildcard
+ character '*', like "text/*" or "*/*".
+ Used in: supports
+ </documentation>
+ </annotation>
+ <simpleContent>
+ <extension base="string"/>
+ </simpleContent>
+ </complexType>
+ <complexType name="nameType">
+ <annotation>
+ <documentation>
+ The name element contains the name of a parameter.
+ Used in: init-param, ...
+ </documentation>
+ </annotation>
+ <simpleContent>
+ <extension base="string"/>
+ </simpleContent>
+ </complexType>
+ <complexType name="portletType">
+ <annotation>
+ <documentation>
+ The portlet element contains the declarative data of a portlet.
+ Used in: portlet-app
+ </documentation>
+ </annotation>
+ <sequence>
+ <element name="description" type="portlet:descriptionType"
minOccurs="0" maxOccurs="unbounded"/>
+ <element name="portlet-name"
type="portlet:portlet-nameType"/>
+ <element name="display-name" type="portlet:display-nameType"
minOccurs="0" maxOccurs="unbounded"/>
+ <element name="portlet-class"
type="portlet:portlet-classType"/>
+ <element name="init-param" type="portlet:init-paramType"
minOccurs="0" maxOccurs="unbounded"/>
+ <element name="expiration-cache"
type="portlet:expiration-cacheType" minOccurs="0"/>
+ <element name="supports" type="portlet:supportsType"
maxOccurs="unbounded"/>
+ <element name="supported-locale"
type="portlet:supported-localeType" minOccurs="0"
maxOccurs="unbounded"/>
+ <choice>
+ <sequence>
+ <element name="resource-bundle"
type="portlet:resource-bundleType"/>
+ <element name="portlet-info" type="portlet:portlet-infoType"
minOccurs="0"/>
+ </sequence>
+ <element name="portlet-info"
type="portlet:portlet-infoType"/>
+ </choice>
+ <element name="portlet-preferences"
type="portlet:portlet-preferencesType" minOccurs="0"/>
+ <element name="security-role-ref"
type="portlet:security-role-refType" minOccurs="0"
maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="id" type="string"
use="optional"/>
+ </complexType>
+ <simpleType name="portlet-classType">
+ <annotation>
+ <documentation>
+ The portlet-class element contains the fully
+ qualified class name of the portlet.
+ Used in: portlet
+ </documentation>
+ </annotation>
+ <restriction base="portlet:fully-qualified-classType"/>
+ </simpleType>
+ <complexType name="portlet-collectionType">
+ <annotation>
+ <documentation>
+ The portlet-collectionType is used to identify a subset
+ of portlets within a portlet application to which a
+ security constraint applies.
+ Used in: security-constraint
+ </documentation>
+ </annotation>
+ <sequence>
+ <element name="portlet-name" type="portlet:portlet-nameType"
maxOccurs="unbounded"/>
+ </sequence>
+ </complexType>
+ <complexType name="portlet-infoType">
+ <sequence>
+ <element name="title" type="portlet:titleType"/>
+ <element name="short-title" type="portlet:short-titleType"
minOccurs="0"/>
+ <element name="keywords" type="portlet:keywordsType"
minOccurs="0"/>
+ </sequence>
+ <attribute name="id" type="string"
use="optional"/>
+ </complexType>
+ <complexType name="portlet-modeType">
+ <annotation>
+ <documentation>
+ Portlet modes. The specification pre-defines the following values
+ as valid portlet mode constants:
+ "edit", "help", "view".
+ Portlet mode names are not case sensitive.
+ Used in: custom-portlet-mode, supports
+ </documentation>
+ </annotation>
+ <simpleContent>
+ <extension base="string"/>
+ </simpleContent>
+ </complexType>
+ <complexType name="portlet-nameType">
+ <annotation>
+ <documentation>
+ The portlet-name element contains the canonical name of the
+ portlet. Each portlet name is unique within the portlet
+ application.
+ Used in: portlet, portlet-mapping
+ </documentation>
+ </annotation>
+ <simpleContent>
+ <extension base="string"/>
+ </simpleContent>
+ </complexType>
+ <complexType name="portlet-preferencesType">
+ <annotation>
+ <documentation>
+ Portlet persistent preference store.
+ Used in: portlet
+ </documentation>
+ </annotation>
+ <sequence>
+ <element name="preference" type="portlet:preferenceType"
minOccurs="0" maxOccurs="unbounded"/>
+ <element name="preferences-validator"
type="portlet:preferences-validatorType" minOccurs="0"/>
+ </sequence>
+ <attribute name="id" type="string"
use="optional"/>
+ </complexType>
+ <complexType name="preferenceType">
+ <annotation>
+ <documentation>
+ Persistent preference values that may be used for customization
+ and personalization by the portlet.
+ Used in: portlet-preferences
+ </documentation>
+ </annotation>
+ <sequence>
+ <element name="name" type="portlet:nameType"/>
+ <element name="value" type="portlet:valueType"
minOccurs="0" maxOccurs="unbounded"/>
+ <element name="read-only" type="portlet:read-onlyType"
minOccurs="0"/>
+ </sequence>
+ <attribute name="id" type="string"
use="optional"/>
+ </complexType>
+ <simpleType name="preferences-validatorType">
+ <annotation>
+ <documentation>
+ The class specified under preferences-validator implements
+ the PreferencesValidator interface to validate the
+ preferences settings.
+ Used in: portlet-preferences
+ </documentation>
+ </annotation>
+ <restriction base="portlet:fully-qualified-classType"/>
+ </simpleType>
+ <simpleType name="read-onlyType">
+ <annotation>
+ <documentation>
+ read-only indicates that a setting cannot
+ be changed in any of the standard portlet modes
+ ("view","edit" or "help").
+ Per default all preferences are modifiable.
+ Valid values are:
+ - true for read-only
+ - false for modifiable
+ Used in: preferences
+ </documentation>
+ </annotation>
+ <restriction base="portlet:string">
+ <enumeration value="true"/>
+ <enumeration value="false"/>
+ </restriction>
+ </simpleType>
+ <complexType name="resource-bundleType">
+ <annotation>
+ <documentation>
+ Filename of the resource bundle containing the language specific
+ portlet informations in different languages.
+ Used in: portlet-info
+ </documentation>
+ </annotation>
+ <simpleContent>
+ <extension base="string"/>
+ </simpleContent>
+ </complexType>
+ <complexType name="role-linkType">
+ <annotation>
+ <documentation>
+ The role-link element is a reference to a defined security role.
+ The role-link element must contain the name of one of the
+ security roles defined in the security-role elements.
+ Used in: security-role-ref
+ </documentation>
+ </annotation>
+ <simpleContent>
+ <extension base="string"/>
+ </simpleContent>
+ </complexType>
+ <complexType name="security-constraintType">
+ <annotation>
+ <documentation>
+ The security-constraintType is used to associate
+ intended security constraints with one or more portlets.
+ Used in: portlet-app
+ </documentation>
+ </annotation>
+ <sequence>
+ <element name="display-name" type="portlet:display-nameType"
minOccurs="0" maxOccurs="unbounded"/>
+ <element name="portlet-collection"
type="portlet:portlet-collectionType"/>
+ <element name="user-data-constraint"
type="portlet:user-data-constraintType"/>
+ </sequence>
+ <attribute name="id" type="string"
use="optional"/>
+ </complexType>
+ <complexType name="security-role-refType">
+ <annotation>
+ <documentation>
+ The security-role-ref element contains the declaration of a
+ security role reference in the code of the web application. The
+ declaration consists of an optional description, the security
+ role name used in the code, and an optional link to a security
+ role. If the security role is not specified, the Deployer must
+ choose an appropriate security role.
+ The value of the role name element must be the String used
+ as the parameter to the
+ EJBContext.isCallerInRole(String roleName) method
+ or the HttpServletRequest.isUserInRole(String role) method.
+ Used in: portlet
+ </documentation>
+ </annotation>
+ <sequence>
+ <element name="description" type="portlet:descriptionType"
minOccurs="0" maxOccurs="unbounded"/>
+ <element name="role-name" type="portlet:role-nameType"/>
+ <element name="role-link" type="portlet:role-linkType"
minOccurs="0"/>
+ </sequence>
+ <attribute name="id" type="string"
use="optional"/>
+ </complexType>
+ <complexType name="short-titleType">
+ <annotation>
+ <documentation>
+ Locale specific short version of the static title.
+ Used in: portlet-info
+ </documentation>
+ </annotation>
+ <simpleContent>
+ <extension base="string"/>
+ </simpleContent>
+ </complexType>
+ <complexType name="supportsType">
+ <annotation>
+ <documentation>
+ Supports indicates the portlet modes a
+ portlet supports for a specific content type. All portlets must
+ support the view mode.
+ Used in: portlet
+ </documentation>
+ </annotation>
+ <sequence>
+ <element name="mime-type" type="portlet:mime-typeType"/>
+ <element name="portlet-mode" type="portlet:portlet-modeType"
minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="id" type="string"
use="optional"/>
+ </complexType>
+ <complexType name="supported-localeType">
+ <annotation>
+ <documentation>
+ Indicated the locales the portlet supports.
+ Used in: portlet
+ </documentation>
+ </annotation>
+ <simpleContent>
+ <extension base="string"/>
+ </simpleContent>
+ </complexType>
+ <complexType name="titleType">
+ <annotation>
+ <documentation>
+ Locale specific static title for this portlet.
+ Used in: portlet-info
+ </documentation>
+ </annotation>
+ <simpleContent>
+ <extension base="string"/>
+ </simpleContent>
+ </complexType>
+ <simpleType name="transport-guaranteeType">
+ <annotation>
+ <documentation>
+ The transport-guaranteeType specifies that
+ the communication between client and portlet should
+ be NONE, INTEGRAL, or CONFIDENTIAL.
+ NONE means that the portlet does not
+ require any transport guarantees. A value of
+ INTEGRAL means that the portlet requires that the
+ data sent between the client and portlet be sent in
+ such a way that it can't be changed in transit.
+ CONFIDENTIAL means that the portlet requires
+ that the data be transmitted in a fashion that
+ prevents other entities from observing the contents
+ of the transmission.
+ In most cases, the presence of the INTEGRAL or
+ CONFIDENTIAL flag will indicate that the use
+ of SSL is required.
+ Used in: user-data-constraint
+ </documentation>
+ </annotation>
+ <restriction base="portlet:string">
+ <enumeration value="NONE"/>
+ <enumeration value="INTEGRAL"/>
+ <enumeration value="CONFIDENTIAL"/>
+ </restriction>
+ </simpleType>
+ <complexType name="user-attributeType">
+ <annotation>
+ <documentation>
+ User attribute defines a user specific attribute that the
+ portlet application needs. The portlet within this application
+ can access this attribute via the request parameter USER_INFO
+ map.
+ Used in: portlet-app
+ </documentation>
+ </annotation>
+ <sequence>
+ <element name="description" type="portlet:descriptionType"
minOccurs="0" maxOccurs="unbounded"/>
+ <element name="name" type="portlet:nameType"/>
+ </sequence>
+ <attribute name="id" type="string"
use="optional"/>
+ </complexType>
+ <complexType name="user-data-constraintType">
+ <annotation>
+ <documentation>
+ The user-data-constraintType is used to indicate how
+ data communicated between the client and portlet should be
+ protected.
+ Used in: security-constraint
+ </documentation>
+ </annotation>
+ <sequence>
+ <element name="description" type="portlet:descriptionType"
minOccurs="0" maxOccurs="unbounded"/>
+ <element name="transport-guarantee"
type="portlet:transport-guaranteeType"/>
+ </sequence>
+ <attribute name="id" type="string"
use="optional"/>
+ </complexType>
+ <complexType name="valueType">
+ <annotation>
+ <documentation>
+ The value element contains the value of a parameter.
+ Used in: init-param
+ </documentation>
+ </annotation>
+ <simpleContent>
+ <extension base="string"/>
+ </simpleContent>
+ </complexType>
+ <complexType name="window-stateType">
+ <annotation>
+ <documentation>
+ Portlet window state. Window state names are not case sensitive.
+ Used in: custom-window-state
+ </documentation>
+ </annotation>
+ <simpleContent>
+ <extension base="string"/>
+ </simpleContent>
+ </complexType>
+ <!--- everything below is copied from j2ee_1_4.xsd -->
+ <complexType name="descriptionType">
+ <annotation>
+ <documentation>
+ The description element is used to provide text describing the
+ parent element. The description element should include any
+ information that the portlet application war file producer wants
+ to provide to the consumer of the portlet application war file
+ (i.e., to the Deployer). Typically, the tools used by the
+ portlet application war file consumer will display the
+ description when processing the parent element that contains the
+ description. It has an optional attribute xml:lang to indicate
+ which language is used in the description according to
+ RFC 1766 (
http://www.ietf.org/rfc/rfc1766.txt). The default
+ value of this attribute is English(“en”).
+ Used in: init-param, portlet, portlet-app, security-role
+ </documentation>
+ </annotation>
+ <simpleContent>
+ <extension base="string">
+ <attribute ref="xml:lang"/>
+ </extension>
+ </simpleContent>
+ </complexType>
+ <complexType name="display-nameType">
+ <annotation>
+ <documentation>
+ The display-name type contains a short name that is intended
+ to be displayed by tools. It is used by display-name
+ elements. The display name need not be unique.
+ Example:
+ ...
+ <display-name xml:lang="en">Employee Self
Service</display-name>
+
+ It has an optional attribute xml:lang to indicate
+ which language is used in the description according to
+ RFC 1766 (
http://www.ietf.org/rfc/rfc1766.txt). The default
+ value of this attribute is English(“en”).
+ </documentation>
+ </annotation>
+ <simpleContent>
+ <extension base="portlet:string">
+ <attribute ref="xml:lang"/>
+ </extension>
+ </simpleContent>
+ </complexType>
+ <simpleType name="fully-qualified-classType">
+ <annotation>
+ <documentation>
+ The elements that use this type designate the name of a
+ Java class or interface.
+ </documentation>
+ </annotation>
+ <restriction base="portlet:string"/>
+ </simpleType>
+ <simpleType name="role-nameType">
+ <annotation>
+ <documentation>
+ The role-nameType designates the name of a security role.
+
+ The name must conform to the lexical rules for an NMTOKEN.
+ </documentation>
+ </annotation>
+ <restriction base="NMTOKEN"/>
+ </simpleType>
+ <simpleType name="string">
+ <annotation>
+ <documentation>
+ This is a special string datatype that is defined by J2EE
+ as a base type for defining collapsed strings. When
+ schemas require trailing/leading space elimination as
+ well as collapsing the existing whitespace, this base
+ type may be used.
+ </documentation>
+ </annotation>
+ <restriction base="string">
+ <whiteSpace value="collapse"/>
+ </restriction>
+ </simpleType>
+</schema>
Property changes on: modules/portlet/trunk/portlet/src/resources/portlet-app_1_0.xsd
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/portlet/src/resources/test/deployment/jboss-portlet.xml
===================================================================
--- modules/portlet/trunk/portlet/src/resources/test/deployment/jboss-portlet.xml
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/deployment/jboss-portlet.xml 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,56 @@
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ 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>
+ <remotable>true</remotable>
+ <portlet>
+ <portlet-name>Portlet1</portlet-name>
+ <remotable>false</remotable>
+ <transaction>
+ <trans-attribute>Required</trans-attribute>
+ </transaction>
+ <security-constraint>
+ <policy-permission>
+ <role-name>Admin</role-name>
+ <action-name>view</action-name>
+ <action-name>create</action-name>
+ </policy-permission>
+ <policy-permission>
+ <role-name>User</role-name>
+ <action-name>view</action-name>
+ </policy-permission>
+ <policy-permission>
+ <role-name>User</role-name>
+ <action-name>destroy</action-name>
+ </policy-permission>
+ </security-constraint>
+ </portlet>
+ <portlet>
+ <portlet-name>Portlet2</portlet-name>
+ </portlet>
+ <service>
+ <service-name>PortalObjectContainer</service-name>
+
<service-class>org.jboss.portal.core.model.portal.PortalObjectContainer</service-class>
+ <service-ref>:container=PortalObject</service-ref>
+ </service>
+</portlet-app>
Property changes on:
modules/portlet/trunk/portlet/src/resources/test/deployment/jboss-portlet.xml
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/portlet/src/resources/test/deployment/portlet.xml
===================================================================
--- modules/portlet/trunk/portlet/src/resources/test/deployment/portlet.xml
(rev 0)
+++ modules/portlet/trunk/portlet/src/resources/test/deployment/portlet.xml 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,313 @@
+<?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>
+ <display-name>display</display-name>
+ <display-name xml:lang="fr">affichage</display-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>
+ <resource-bundle>MyResourceBundle</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-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>
+ <preferences-validator>MyValidator</preferences-validator>
+ </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>
+ -->
+
+ <security-constraint>
+ <portlet-collection>
+ <portlet-name>Portlet1</portlet-name>
+ </portlet-collection>
+ <user-data-constraint>
+ <transport-guarantee>CONFIDENTIAL</transport-guarantee>
+ </user-data-constraint>
+ </security-constraint>
+ <security-constraint>
+ <portlet-collection>
+ <portlet-name>Portlet1</portlet-name>
+ <portlet-name>Portlet4</portlet-name>
+ </portlet-collection>
+ <user-data-constraint>
+ <transport-guarantee>INTEGRAL</transport-guarantee>
+ </user-data-constraint>
+ </security-constraint>
+
+ <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>
Property changes on:
modules/portlet/trunk/portlet/src/resources/test/deployment/portlet.xml
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/resources/test/ha/test-session-war/WEB-INF/jboss-portlet.xml
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/ha/test-session-war/WEB-INF/jboss-portlet.xml
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/ha/test-session-war/WEB-INF/jboss-portlet.xml 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,37 @@
+<?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>
+ <portlet-name>UniversalTestPortletA</portlet-name>
+ <session-config>
+ <distributed>true</distributed>
+ </session-config>
+ </portlet>
+
+</portlet-app>
Property changes on:
modules/portlet/trunk/portlet/src/resources/test/ha/test-session-war/WEB-INF/jboss-portlet.xml
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/resources/test/ha/test-session-war/WEB-INF/portlet.xml
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/ha/test-session-war/WEB-INF/portlet.xml
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/ha/test-session-war/WEB-INF/portlet.xml 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,41 @@
+<?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>
+ <portlet-name>UniversalTestPortletA</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.framework.UTP1</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title></title>
+ </portlet-info>
+ </portlet>
+
+</portlet-app>
Property changes on:
modules/portlet/trunk/portlet/src/resources/test/ha/test-session-war/WEB-INF/portlet.xml
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/resources/test/ha/test-session-war/WEB-INF/web.xml
===================================================================
--- modules/portlet/trunk/portlet/src/resources/test/ha/test-session-war/WEB-INF/web.xml
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/ha/test-session-war/WEB-INF/web.xml 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,35 @@
+<?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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<web-app version="2.4"
+
xmlns="http://java.sun.com/xml/ns/j2ee"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
+ <listener>
+
<listener-class>org.jboss.portal.test.portlet.ha.session.SessionSequenceBuilder</listener-class>
+ </listener>
+ <listener>
+
<listener-class>org.jboss.portal.portlet.session.SessionListener</listener-class>
+ </listener>
+</web-app>
Property changes on:
modules/portlet/trunk/portlet/src/resources/test/ha/test-session-war/WEB-INF/web.xml
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/resources/test/info/test-info-war/WEB-INF/classes/PrefsResource_en.properties
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/info/test-info-war/WEB-INF/classes/PrefsResource_en.properties
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/info/test-info-war/WEB-INF/classes/PrefsResource_en.properties 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,3 @@
+javax.portlet.preference.description.localized_pref=english localized description
+javax.portlet.preference.name.localized_pref=english_localized_name
+javax.portlet.preference.value.localized_pref.std_localized_value=english localized
value
Property changes on:
modules/portlet/trunk/portlet/src/resources/test/info/test-info-war/WEB-INF/classes/PrefsResource_en.properties
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/resources/test/info/test-info-war/WEB-INF/classes/PrefsResource_it.properties
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/info/test-info-war/WEB-INF/classes/PrefsResource_it.properties
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/info/test-info-war/WEB-INF/classes/PrefsResource_it.properties 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,3 @@
+javax.portlet.preference.description.localized_pref=descrizione locale italiana
+javax.portlet.preference.name.localized_pref=nome_locale_italiano
+javax.portlet.preference.value.localized_pref.std_localized_value=valore locale italiano
Added:
modules/portlet/trunk/portlet/src/resources/test/info/test-info-war/WEB-INF/classes/PrefsResource_pl.properties
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/info/test-info-war/WEB-INF/classes/PrefsResource_pl.properties
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/info/test-info-war/WEB-INF/classes/PrefsResource_pl.properties 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,3 @@
+javax.portlet.preference.description.localized_pref=polish localized description
+javax.portlet.preference.name.localized_pref=polish_localized_name
+javax.portlet.preference.value.localized_pref.std_localized_value=polish localized value
\ No newline at end of file
Property changes on:
modules/portlet/trunk/portlet/src/resources/test/info/test-info-war/WEB-INF/classes/PrefsResource_pl.properties
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/resources/test/info/test-info-war/WEB-INF/jboss-portlet.xml
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/info/test-info-war/WEB-INF/jboss-portlet.xml
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/info/test-info-war/WEB-INF/jboss-portlet.xml 2007-08-17
15:29:49 UTC (rev 7981)
@@ -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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<portlet-app>
+ <remotable>true</remotable>
+ <portlet>
+ <portlet-name>RemotablePortlet1</portlet-name>
+ </portlet>
+ <portlet>
+ <portlet-name>RemotablePortlet2</portlet-name>
+ <remotable>false</remotable>
+ </portlet>
+ <portlet>
+ <portlet-name>RemotablePortlet3</portlet-name>
+ <remotable>true</remotable>
+ </portlet>
+
+ <portlet>
+ <portlet-name>DistributedPortlet1</portlet-name>
+ <distributed>true</distributed>
+ </portlet>
+ <portlet>
+ <portlet-name>DistributedPortlet2</portlet-name>
+ <distributed>false</distributed>
+ </portlet>
+</portlet-app>
\ No newline at end of file
Property changes on:
modules/portlet/trunk/portlet/src/resources/test/info/test-info-war/WEB-INF/jboss-portlet.xml
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/resources/test/info/test-info-war/WEB-INF/portlet.xml
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/info/test-info-war/WEB-INF/portlet.xml
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/info/test-info-war/WEB-INF/portlet.xml 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,277 @@
+<?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>
+ <portlet-name>NoBundlePortlet</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.info.universal.SimplePortlet</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title>title</title>
+ <short-title>short-title</short-title>
+ <keywords>keywords</keywords>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>CapabilitiesPortlet</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.info.universal.SimplePortlet</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>HELP</portlet-mode>
+ </supports>
+ <supports>
+ <mime-type>text/vnd.wap.wml</mime-type>
+ <portlet-mode>EDIT</portlet-mode>
+ </supports>
+ <portlet-info>
+ <title>title</title>
+ <short-title>short-title</short-title>
+ <keywords>keywords</keywords>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>PreferenceInfoPortlet</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.info.universal.SimplePortlet</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <supported-locale>en</supported-locale>
+ <supported-locale>pl</supported-locale>
+ <resource-bundle>PrefsResource</resource-bundle>
+ <portlet-info>
+ <title>title</title>
+ <short-title>short-title</short-title>
+ <keywords>keywords</keywords>
+ </portlet-info>
+ <portlet-preference>
+ <preference>
+ <name>localized_pref</name>
+ <value>std_localized_value</value>
+ </preference>
+ <preference>
+ <name>single_pref</name>
+ <value>single_pref_value</value>
+ </preference>
+ <preference>
+ <name>multi_pref</name>
+ <value>multi_pref_value_1</value>
+ <value>multi_pref_value_2</value>
+ </preference>
+ <preference>
+ <name>single_pref_bis</name>
+ <value>single_pref_value</value>
+ <read-only>true</read-only>
+ </preference>
+ <preference>
+ <name>multi_pref_bis</name>
+ <value>multi_pref_value_1</value>
+ <value>multi_pref_value_2</value>
+ <read-only>true</read-only>
+ </preference>
+ </portlet-preference>
+ </portlet>
+
+ <portlet>
+ <portlet-name>CachePortlet</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.info.universal.SimplePortlet</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title>title</title>
+ <short-title>short-title</short-title>
+ <keywords>keywords</keywords>
+ </portlet-info>
+ <expiration-cache>65</expiration-cache>
+ </portlet>
+
+ <portlet>
+ <portlet-name>ModePortlet1</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.info.universal.SimplePortlet</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>EDIT</portlet-mode>
+ <portlet-mode>HELP</portlet-mode>
+ <portlet-mode>VIEW</portlet-mode>
+ </supports>
+ <portlet-info>
+ <title>title</title>
+ <short-title>short-title</short-title>
+ <keywords>keywords</keywords>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>ModePortlet2</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.info.universal.SimplePortlet</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>VIEW</portlet-mode>
+ </supports>
+ <portlet-info>
+ <title>title</title>
+ <short-title>short-title</short-title>
+ <keywords>keywords</keywords>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>RemotablePortlet1</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.info.universal.SimplePortlet</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>VIEW</portlet-mode>
+ </supports>
+ <portlet-info>
+ <title>title</title>
+ <short-title>short-title</short-title>
+ <keywords>keywords</keywords>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>RemotablePortlet2</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.info.universal.SimplePortlet</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>VIEW</portlet-mode>
+ </supports>
+ <portlet-info>
+ <title>title</title>
+ <short-title>short-title</short-title>
+ <keywords>keywords</keywords>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>RemotablePortlet3</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.info.universal.SimplePortlet</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>VIEW</portlet-mode>
+ </supports>
+ <portlet-info>
+ <title>title</title>
+ <short-title>short-title</short-title>
+ <keywords>keywords</keywords>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>DistributedPortlet1</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.info.universal.SimplePortlet</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>VIEW</portlet-mode>
+ </supports>
+ <portlet-info>
+ <title>title</title>
+ <short-title>short-title</short-title>
+ <keywords>keywords</keywords>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>DistributedPortlet2</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.info.universal.SimplePortlet</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>VIEW</portlet-mode>
+ </supports>
+ <portlet-info>
+ <title>title</title>
+ <short-title>short-title</short-title>
+ <keywords>keywords</keywords>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>SecuredPortlet1</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.info.universal.SimplePortlet</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>VIEW</portlet-mode>
+ </supports>
+ <portlet-info>
+ <title>title</title>
+ <short-title>short-title</short-title>
+ <keywords>keywords</keywords>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>SecuredPortlet2</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.info.universal.SimplePortlet</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>VIEW</portlet-mode>
+ </supports>
+ <portlet-info>
+ <title>title</title>
+ <short-title>short-title</short-title>
+ <keywords>keywords</keywords>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>SecuredPortlet3</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.info.universal.SimplePortlet</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>VIEW</portlet-mode>
+ </supports>
+ <portlet-info>
+ <title>title</title>
+ <short-title>short-title</short-title>
+ <keywords>keywords</keywords>
+ </portlet-info>
+ </portlet>
+
+ <security-constraint>
+ <portlet-collection>
+ <portlet-name>SecuredPortlet1</portlet-name>
+ <portlet-name>SecuredPortlet2</portlet-name>
+ </portlet-collection>
+ <user-data-constraint>
+ <transport-guarantee>CONFIDENTIAL</transport-guarantee>
+ </user-data-constraint>
+ </security-constraint>
+ <security-constraint>
+ <portlet-collection>
+ <portlet-name>SecuredPortlet2</portlet-name>
+ <portlet-name>SecuredPortlet3</portlet-name>
+ </portlet-collection>
+ <user-data-constraint>
+ <transport-guarantee>INTEGRAL</transport-guarantee>
+ </user-data-constraint>
+ </security-constraint>
+
+</portlet-app>
Property changes on:
modules/portlet/trunk/portlet/src/resources/test/info/test-info-war/WEB-INF/portlet.xml
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/resources/test/info/test-info-war/WEB-INF/web.xml
===================================================================
--- modules/portlet/trunk/portlet/src/resources/test/info/test-info-war/WEB-INF/web.xml
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/info/test-info-war/WEB-INF/web.xml 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,29 @@
+<?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>
+</web-app>
Property changes on:
modules/portlet/trunk/portlet/src/resources/test/info/test-info-war/WEB-INF/web.xml
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/actionrequest-war/WEB-INF/portlet.xml
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/actionrequest-war/WEB-INF/portlet.xml
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/actionrequest-war/WEB-INF/portlet.xml 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,41 @@
+<?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>
+ <portlet-name>TestUniversalPortletA</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.framework.UTP1</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title></title>
+ </portlet-info>
+ </portlet>
+
+</portlet-app>
Property changes on:
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/actionrequest-war/WEB-INF/portlet.xml
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/actionrequest-war/WEB-INF/web.xml
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/actionrequest-war/WEB-INF/web.xml
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/actionrequest-war/WEB-INF/web.xml 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,32 @@
+<?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>
+ <listener>
+
<listener-class>org.jboss.portal.test.portlet.jsr168.api.actionrequest.ActionRequestSequenceBuilder</listener-class>
+ </listener>
+</web-app>
Property changes on:
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/actionrequest-war/WEB-INF/web.xml
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/actionresponse-war/WEB-INF/portlet.xml
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/actionresponse-war/WEB-INF/portlet.xml
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/actionresponse-war/WEB-INF/portlet.xml 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,41 @@
+<?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>
+ <portlet-name>TestUniversalPortletA</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.framework.UTP1</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title></title>
+ </portlet-info>
+ </portlet>
+
+</portlet-app>
Property changes on:
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/actionresponse-war/WEB-INF/portlet.xml
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/actionresponse-war/WEB-INF/web.xml
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/actionresponse-war/WEB-INF/web.xml
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/actionresponse-war/WEB-INF/web.xml 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,32 @@
+<?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>
+ <listener>
+
<listener-class>org.jboss.portal.test.portlet.jsr168.api.actionresponse.ActionResponseSequenceBuilder</listener-class>
+ </listener>
+</web-app>
Property changes on:
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/actionresponse-war/WEB-INF/web.xml
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portalcontext-war/WEB-INF/portlet.xml
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portalcontext-war/WEB-INF/portlet.xml
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portalcontext-war/WEB-INF/portlet.xml 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,41 @@
+<?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>
+ <portlet-name>TestUniversalPortletA</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.framework.UTP1</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title></title>
+ </portlet-info>
+ </portlet>
+
+</portlet-app>
Property changes on:
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portalcontext-war/WEB-INF/portlet.xml
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portalcontext-war/WEB-INF/web.xml
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portalcontext-war/WEB-INF/web.xml
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portalcontext-war/WEB-INF/web.xml 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,32 @@
+<?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>
+ <listener>
+
<listener-class>org.jboss.portal.test.portlet.jsr168.api.portalcontext.PortalContextSequenceBuilder</listener-class>
+ </listener>
+</web-app>
Property changes on:
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portalcontext-war/WEB-INF/web.xml
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletconfig-war/WEB-INF/portlet.xml
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletconfig-war/WEB-INF/portlet.xml
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletconfig-war/WEB-INF/portlet.xml 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,60 @@
+<?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>
+ <portlet-name>TestUniversalPortletA</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.framework.UTP1</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title></title>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>TestUniversalPortletB</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.framework.UTP2</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <init-param>
+ <name>InitParamA</name>
+ <value>InitParamAValue</value>
+ </init-param>
+ <init-param>
+ <name>InitParamB</name>
+ <value>InitParamBValue</value>
+ </init-param>
+ <portlet-info>
+ <title></title>
+ </portlet-info>
+ </portlet>
+
+</portlet-app>
Property changes on:
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletconfig-war/WEB-INF/portlet.xml
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletconfig-war/WEB-INF/web.xml
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletconfig-war/WEB-INF/web.xml
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletconfig-war/WEB-INF/web.xml 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,32 @@
+<?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>
+ <listener>
+
<listener-class>org.jboss.portal.test.portlet.jsr168.api.portletconfig.PortletConfigSequenceBuilder</listener-class>
+ </listener>
+</web-app>
Property changes on:
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletconfig-war/WEB-INF/web.xml
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletcontext-war/WEB-INF/portlet.xml
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletcontext-war/WEB-INF/portlet.xml
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletcontext-war/WEB-INF/portlet.xml 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,41 @@
+<?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>
+ <portlet-name>TestUniversalPortletA</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.framework.UTP1</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title></title>
+ </portlet-info>
+ </portlet>
+
+</portlet-app>
Property changes on:
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletcontext-war/WEB-INF/portlet.xml
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletcontext-war/WEB-INF/web.xml
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletcontext-war/WEB-INF/web.xml
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletcontext-war/WEB-INF/web.xml 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,33 @@
+<?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>
+ <display-name>PortletContext WebApp</display-name>
+ <listener>
+
<listener-class>org.jboss.portal.test.portlet.jsr168.api.portletcontext.PortletContextSequenceBuilder</listener-class>
+ </listener>
+</web-app>
Property changes on:
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletcontext-war/WEB-INF/web.xml
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletcontext-war/simple_resource.txt
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletcontext-war/simple_resource.txt
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletcontext-war/simple_resource.txt 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1 @@
+Simple resource for testing purposes
\ No newline at end of file
Property changes on:
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletcontext-war/simple_resource.txt
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletmode-war/WEB-INF/portlet.xml
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletmode-war/WEB-INF/portlet.xml
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletmode-war/WEB-INF/portlet.xml 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,41 @@
+<?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>
+ <portlet-name>TestUniversalPortletA</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.framework.UTP1</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title></title>
+ </portlet-info>
+ </portlet>
+
+</portlet-app>
Property changes on:
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletmode-war/WEB-INF/portlet.xml
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletmode-war/WEB-INF/web.xml
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletmode-war/WEB-INF/web.xml
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletmode-war/WEB-INF/web.xml 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,32 @@
+<?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>
+ <listener>
+
<listener-class>org.jboss.portal.test.portlet.jsr168.api.portletmode.PortletModeSequenceBuilder</listener-class>
+ </listener>
+</web-app>
Property changes on:
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletmode-war/WEB-INF/web.xml
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletpreferences-war/WEB-INF/portlet.xml
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletpreferences-war/WEB-INF/portlet.xml
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletpreferences-war/WEB-INF/portlet.xml 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,57 @@
+<?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>
+ <portlet-name>TestUniversalPortletA</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.framework.UTP1</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title></title>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>TestUniversalPortletB</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.framework.UTP2</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title></title>
+ </portlet-info>
+ <portlet-preferences>
+ <preference>
+ <name>empty</name>
+ </preference>
+ </portlet-preferences>
+ </portlet>
+
+</portlet-app>
Property changes on:
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletpreferences-war/WEB-INF/portlet.xml
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletpreferences-war/WEB-INF/web.xml
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletpreferences-war/WEB-INF/web.xml
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletpreferences-war/WEB-INF/web.xml 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,32 @@
+<?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>
+ <listener>
+
<listener-class>org.jboss.portal.test.portlet.jsr168.api.portletpreferences.PortletPreferencesSequenceBuilder</listener-class>
+ </listener>
+</web-app>
Property changes on:
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletpreferences-war/WEB-INF/web.xml
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletsession-war/WEB-INF/portlet.xml
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletsession-war/WEB-INF/portlet.xml
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletsession-war/WEB-INF/portlet.xml 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,41 @@
+<?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>
+ <portlet-name>TestUniversalPortletA</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.framework.UTP1</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title></title>
+ </portlet-info>
+ </portlet>
+
+</portlet-app>
Property changes on:
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletsession-war/WEB-INF/portlet.xml
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletsession-war/WEB-INF/web.xml
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletsession-war/WEB-INF/web.xml
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletsession-war/WEB-INF/web.xml 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,32 @@
+<?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>
+ <listener>
+
<listener-class>org.jboss.portal.test.portlet.jsr168.api.portletsession.PortletSessionSequenceBuilder</listener-class>
+ </listener>
+</web-app>
Property changes on:
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletsession-war/WEB-INF/web.xml
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletsessionutil-war/WEB-INF/portlet.xml
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletsessionutil-war/WEB-INF/portlet.xml
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletsessionutil-war/WEB-INF/portlet.xml 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,41 @@
+<?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>
+ <portlet-name>TestUniversalPortletA</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.framework.UTP1</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title></title>
+ </portlet-info>
+ </portlet>
+
+</portlet-app>
Property changes on:
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletsessionutil-war/WEB-INF/portlet.xml
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletsessionutil-war/WEB-INF/web.xml
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletsessionutil-war/WEB-INF/web.xml
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletsessionutil-war/WEB-INF/web.xml 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,32 @@
+<?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>
+ <listener>
+
<listener-class>org.jboss.portal.test.portlet.jsr168.api.portletsessionutil.PortletSessionUtilSequenceBuilder</listener-class>
+ </listener>
+</web-app>
Property changes on:
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portletsessionutil-war/WEB-INF/web.xml
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portleturl-war/WEB-INF/portlet.xml
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portleturl-war/WEB-INF/portlet.xml
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portleturl-war/WEB-INF/portlet.xml 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,41 @@
+<?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>
+ <portlet-name>TestUniversalPortletA</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.framework.UTP1</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title></title>
+ </portlet-info>
+ </portlet>
+
+</portlet-app>
Property changes on:
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portleturl-war/WEB-INF/portlet.xml
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portleturl-war/WEB-INF/web.xml
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portleturl-war/WEB-INF/web.xml
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portleturl-war/WEB-INF/web.xml 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,32 @@
+<?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>
+ <listener>
+
<listener-class>org.jboss.portal.test.portlet.jsr168.api.portleturl.PortletURLSequenceBuilder</listener-class>
+ </listener>
+</web-app>
Property changes on:
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/portleturl-war/WEB-INF/web.xml
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/renderrequest-war/WEB-INF/portlet.xml
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/renderrequest-war/WEB-INF/portlet.xml
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/renderrequest-war/WEB-INF/portlet.xml 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,41 @@
+<?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>
+ <portlet-name>TestUniversalPortletA</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.framework.UTP1</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title></title>
+ </portlet-info>
+ </portlet>
+
+</portlet-app>
Property changes on:
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/renderrequest-war/WEB-INF/portlet.xml
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/renderrequest-war/WEB-INF/web.xml
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/renderrequest-war/WEB-INF/web.xml
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/renderrequest-war/WEB-INF/web.xml 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,32 @@
+<?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>
+ <listener>
+
<listener-class>org.jboss.portal.test.portlet.jsr168.api.renderrequest.RenderRequestSequenceBuilder</listener-class>
+ </listener>
+</web-app>
Property changes on:
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/renderrequest-war/WEB-INF/web.xml
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/renderresponse-war/WEB-INF/portlet.xml
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/renderresponse-war/WEB-INF/portlet.xml
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/renderresponse-war/WEB-INF/portlet.xml 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,41 @@
+<?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>
+ <portlet-name>TestUniversalPortletA</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.framework.UTP1</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title></title>
+ </portlet-info>
+ </portlet>
+
+</portlet-app>
Property changes on:
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/renderresponse-war/WEB-INF/portlet.xml
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/renderresponse-war/WEB-INF/web.xml
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/renderresponse-war/WEB-INF/web.xml
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/renderresponse-war/WEB-INF/web.xml 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,32 @@
+<?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>
+ <listener>
+
<listener-class>org.jboss.portal.test.portlet.jsr168.api.renderresponse.RenderResponseSequenceBuilder</listener-class>
+ </listener>
+</web-app>
Property changes on:
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/renderresponse-war/WEB-INF/web.xml
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/windowstate-war/WEB-INF/portlet.xml
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/windowstate-war/WEB-INF/portlet.xml
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/windowstate-war/WEB-INF/portlet.xml 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,41 @@
+<?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>
+ <portlet-name>TestUniversalPortletA</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.framework.UTP1</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title></title>
+ </portlet-info>
+ </portlet>
+
+</portlet-app>
Property changes on:
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/windowstate-war/WEB-INF/portlet.xml
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/windowstate-war/WEB-INF/web.xml
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/windowstate-war/WEB-INF/web.xml
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/windowstate-war/WEB-INF/web.xml 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,32 @@
+<?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>
+ <listener>
+
<listener-class>org.jboss.portal.test.portlet.jsr168.api.windowstate.WindowStateSequenceBuilder</listener-class>
+ </listener>
+</web-app>
Property changes on:
modules/portlet/trunk/portlet/src/resources/test/jsr168/api/windowstate-war/WEB-INF/web.xml
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/dispatcher-war/WEB-INF/portlet.xml
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/dispatcher-war/WEB-INF/portlet.xml
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/dispatcher-war/WEB-INF/portlet.xml 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,64 @@
+<?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>
+ <portlet-name>TestUniversalPortletA</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.framework.UTP1</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title></title>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>TestUniversalPortletB</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.framework.UTP2</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title></title>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>TestUniversalPortletC</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.framework.UTP3</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title></title>
+ </portlet-info>
+ </portlet>
+
+</portlet-app>
Property changes on:
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/dispatcher-war/WEB-INF/portlet.xml
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/dispatcher-war/WEB-INF/web.xml
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/dispatcher-war/WEB-INF/web.xml
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/dispatcher-war/WEB-INF/web.xml 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,190 @@
+<?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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<web-app
+
xmlns="http://java.sun.com/xml/ns/j2ee"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
+ version="2.4">
+
+ <filter>
+ <filter-name>IncludeURLPatternFilter</filter-name>
+
<filter-class>org.jboss.portal.test.portlet.jsr168.ext.dispatcher.ServletFilter</filter-class>
+ <init-param>
+ <param-name>id</param-name>
+ <param-value>INCLUDE_URL_PATTERN_FILTER</param-value>
+ </init-param>
+ </filter>
+
+ <filter>
+ <filter-name>IncludeNamedFilter</filter-name>
+
<filter-class>org.jboss.portal.test.portlet.jsr168.ext.dispatcher.ServletFilter</filter-class>
+ <init-param>
+ <param-name>id</param-name>
+ <param-value>INCLUDE_NAMED_FILTER</param-value>
+ </init-param>
+ </filter>
+
+ <filter>
+ <filter-name>RequestURLPatternFilter</filter-name>
+
<filter-class>org.jboss.portal.test.portlet.jsr168.ext.dispatcher.ServletFilter</filter-class>
+ <init-param>
+ <param-name>id</param-name>
+ <param-value>REQUEST_URL_PATTERN_FILTER</param-value>
+ </init-param>
+ </filter>
+
+ <filter>
+ <filter-name>RequestNamedFilter</filter-name>
+
<filter-class>org.jboss.portal.test.portlet.jsr168.ext.dispatcher.ServletFilter</filter-class>
+ <init-param>
+ <param-name>id</param-name>
+ <param-value>REQUEST_NAMED_FILTER</param-value>
+ </init-param>
+ </filter>
+
+ <filter>
+ <filter-name>ForwardURLPatternFilter</filter-name>
+
<filter-class>org.jboss.portal.test.portlet.jsr168.ext.dispatcher.ServletFilter</filter-class>
+ <init-param>
+ <param-name>id</param-name>
+ <param-value>FORWARD_URL_PATTERN_FILTER</param-value>
+ </init-param>
+ </filter>
+
+ <filter>
+ <filter-name>ForwardNamedFilter</filter-name>
+
<filter-class>org.jboss.portal.test.portlet.jsr168.ext.dispatcher.ServletFilter</filter-class>
+ <init-param>
+ <param-name>id</param-name>
+ <param-value>FORWARD_NAMED_FILTER</param-value>
+ </init-param>
+ </filter>
+
+ <filter>
+ <filter-name>IncludeNamedJSPDispatchingFilter</filter-name>
+
<filter-class>org.jboss.portal.test.portlet.jsr168.ext.dispatcher.DispatchingFilter</filter-class>
+ <init-param>
+ <param-name>id</param-name>
+ <param-value>INCLUDE_NAMED_FILTER</param-value>
+ </init-param>
+ </filter>
+
+ <filter>
+ <filter-name>IncludeURLPatternJSPDispatchingFilter</filter-name>
+
<filter-class>org.jboss.portal.test.portlet.jsr168.ext.dispatcher.DispatchingFilter</filter-class>
+ <init-param>
+ <param-name>id</param-name>
+ <param-value>INCLUDE_URL_PATTERN_FILTER</param-value>
+ </init-param>
+ </filter>
+
+ <filter-mapping>
+ <filter-name>IncludeURLPatternFilter</filter-name>
+ <url-pattern>/noop</url-pattern>
+ <dispatcher>INCLUDE</dispatcher>
+ </filter-mapping>
+
+ <filter-mapping>
+ <filter-name>IncludeNamedFilter</filter-name>
+ <servlet-name>NoopServlet</servlet-name>
+ <dispatcher>INCLUDE</dispatcher>
+ </filter-mapping>
+
+ <filter-mapping>
+ <filter-name>ForwardURLPatternFilter</filter-name>
+ <url-pattern>/noop</url-pattern>
+ <dispatcher>FORWARD</dispatcher>
+ </filter-mapping>
+
+ <filter-mapping>
+ <filter-name>ForwardNamedFilter</filter-name>
+ <servlet-name>NoopServlet</servlet-name>
+ <dispatcher>FORWARD</dispatcher>
+ </filter-mapping>
+
+ <filter-mapping>
+ <filter-name>RequestURLPatternFilter</filter-name>
+ <url-pattern>/noop</url-pattern>
+ <dispatcher>REQUEST</dispatcher>
+ </filter-mapping>
+
+ <filter-mapping>
+ <filter-name>RequestNamedFilter</filter-name>
+ <servlet-name>NoopServlet</servlet-name>
+ <dispatcher>REQUEST</dispatcher>
+ </filter-mapping>
+
+ <filter-mapping>
+ <filter-name>IncludeNamedJSPDispatchingFilter</filter-name>
+ <servlet-name>TargetForIncludeNamedDispatchingFilter</servlet-name>
+ <dispatcher>INCLUDE</dispatcher>
+ </filter-mapping>
+
+ <filter-mapping>
+ <filter-name>IncludeURLPatternJSPDispatchingFilter</filter-name>
+
<url-pattern>/TargetForIncludeURLPatternDispatchingFilter</url-pattern>
+ <dispatcher>INCLUDE</dispatcher>
+ </filter-mapping>
+
+ <listener>
+
<listener-class>org.jboss.portal.test.portlet.jsr168.ext.dispatcher.DispatcherSequenceBuilder</listener-class>
+ </listener>
+
+ <servlet>
+ <servlet-name>UniversalServletA</servlet-name>
+
<servlet-class>org.jboss.portal.test.portlet.framework.UTS1</servlet-class>
+ </servlet>
+
+ <servlet>
+ <servlet-name>NoopServlet</servlet-name>
+
<servlet-class>org.jboss.portal.test.portlet.framework.NoopServlet</servlet-class>
+ </servlet>
+
+ <servlet>
+ <servlet-name>TargetForIncludeNamedDispatchingFilter</servlet-name>
+
<servlet-class>org.jboss.portal.test.portlet.framework.NoopServlet</servlet-class>
+ </servlet>
+
+ <servlet>
+
<servlet-name>TargetForIncludeURLPatternDispatchingFilter</servlet-name>
+
<servlet-class>org.jboss.portal.test.portlet.framework.NoopServlet</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>UniversalServletA</servlet-name>
+ <url-pattern>/universalServletA</url-pattern>
+ </servlet-mapping>
+
+ <servlet-mapping>
+ <servlet-name>NoopServlet</servlet-name>
+ <url-pattern>/noop</url-pattern>
+ </servlet-mapping>
+
+ <servlet-mapping>
+
<servlet-name>TargetForIncludeURLPatternDispatchingFilter</servlet-name>
+
<url-pattern>/TargetForIncludeURLPatternDispatchingFilter</url-pattern>
+ </servlet-mapping>
+
+</web-app>
Property changes on:
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/dispatcher-war/WEB-INF/web.xml
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/dispatcher-war/dispatchedFromFilter.jsp
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/dispatcher-war/dispatchedFromFilter.jsp
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/dispatcher-war/dispatchedFromFilter.jsp 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,8 @@
+<%@ page language="java" %>
+
+<%
+ System.out.println("HELLO FROM JSP");
+ System.out.println("HELLO FROM JSP");
+ System.out.println("HELLO FROM JSP");
+ System.out.println("HELLO FROM JSP");
+%>
\ No newline at end of file
Added:
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/expiringcache-war/WEB-INF/portlet.xml
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/expiringcache-war/WEB-INF/portlet.xml
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/expiringcache-war/WEB-INF/portlet.xml 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,158 @@
+<?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>
+ <portlet-name>TestUniversalPortletA</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.framework.UTP1</portlet-class>
+ <expiration-cache>5</expiration-cache>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title></title>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>TestUniversalPortletB</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.framework.UTP2</portlet-class>
+ <expiration-cache>5</expiration-cache>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title></title>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>TestUniversalPortletC</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.framework.UTP3</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title></title>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>TestUniversalPortletD</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.framework.UTP4</portlet-class>
+ <expiration-cache>5</expiration-cache>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title></title>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>TestUniversalPortletE</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.framework.UTP5</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title></title>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>TestUniversalPortletF</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.framework.UTP6</portlet-class>
+ <expiration-cache>5</expiration-cache>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title></title>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>TestUniversalPortletG</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.framework.UTP7</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title></title>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>TestUniversalPortletH</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.framework.UTP8</portlet-class>
+ <expiration-cache>5</expiration-cache>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>edit</portlet-mode>
+ </supports>
+ <portlet-info>
+ <title></title>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>TestUniversalPortletI</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.framework.UTP9</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title></title>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>TestUniversalPortletJ</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.framework.UTP10</portlet-class>
+ <expiration-cache>5</expiration-cache>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title></title>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>TestUniversalPortletK</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.framework.UTP11</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title></title>
+ </portlet-info>
+ </portlet>
+
+</portlet-app>
Added:
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/expiringcache-war/WEB-INF/web.xml
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/expiringcache-war/WEB-INF/web.xml
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/expiringcache-war/WEB-INF/web.xml 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,34 @@
+<?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>
+
+ <listener>
+
<listener-class>org.jboss.portal.test.portlet.jsr168.ext.expiringcache.ExpiringCacheSequenceBuilder</listener-class>
+ </listener>
+
+</web-app>
Added:
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/neverexpiringcache-war/WEB-INF/portlet.xml
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/neverexpiringcache-war/WEB-INF/portlet.xml
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/neverexpiringcache-war/WEB-INF/portlet.xml 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,135 @@
+<?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>
+ <portlet-name>TestUniversalPortletA</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.framework.UTP1</portlet-class>
+ <expiration-cache>-1</expiration-cache>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title></title>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>TestUniversalPortletB</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.framework.UTP2</portlet-class>
+ <expiration-cache>-1</expiration-cache>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title></title>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>TestUniversalPortletC</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.framework.UTP3</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title></title>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>TestUniversalPortletD</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.framework.UTP4</portlet-class>
+ <expiration-cache>-1</expiration-cache>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title></title>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>TestUniversalPortletE</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.framework.UTP5</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title></title>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>TestUniversalPortletF</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.framework.UTP6</portlet-class>
+ <expiration-cache>-1</expiration-cache>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title></title>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>TestUniversalPortletG</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.framework.UTP7</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title></title>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>TestUniversalPortletH</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.framework.UTP8</portlet-class>
+ <expiration-cache>-1</expiration-cache>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>edit</portlet-mode>
+ </supports>
+ <portlet-info>
+ <title></title>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>TestUniversalPortletI</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.framework.UTP9</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title></title>
+ </portlet-info>
+ </portlet>
+
+</portlet-app>
Added:
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/neverexpiringcache-war/WEB-INF/web.xml
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/neverexpiringcache-war/WEB-INF/web.xml
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/neverexpiringcache-war/WEB-INF/web.xml 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,34 @@
+<?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>
+
+ <listener>
+
<listener-class>org.jboss.portal.test.portlet.jsr168.ext.neverexpiringcache.NeverExpiringCacheSequenceBuilder</listener-class>
+ </listener>
+
+</web-app>
Added:
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/nocache-war/WEB-INF/portlet.xml
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/nocache-war/WEB-INF/portlet.xml
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/nocache-war/WEB-INF/portlet.xml 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,75 @@
+<?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>
+ <portlet-name>TestUniversalPortletA</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.framework.UTP1</portlet-class>
+ <expiration-cache>0</expiration-cache>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title></title>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>TestUniversalPortletB</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.framework.UTP2</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title></title>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>TestUniversalPortletC</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.framework.UTP3</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title></title>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>TestUniversalPortletD</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.framework.UTP4</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title></title>
+ </portlet-info>
+ </portlet>
+
+</portlet-app>
Added:
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/nocache-war/WEB-INF/web.xml
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/nocache-war/WEB-INF/web.xml
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/nocache-war/WEB-INF/web.xml 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,34 @@
+<?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>
+
+ <listener>
+
<listener-class>org.jboss.portal.test.portlet.jsr168.ext.nocache.NoCacheSequenceBuilder</listener-class>
+ </listener>
+
+</web-app>
Added:
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletconfig-war/WEB-INF/classes/GetResourceBundleDuringInitPortlet_en.properties
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletconfig-war/WEB-INF/classes/GetResourceBundleDuringInitPortlet_en.properties
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletconfig-war/WEB-INF/classes/GetResourceBundleDuringInitPortlet_en.properties 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1 @@
+foo=bar
Property changes on:
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletconfig-war/WEB-INF/classes/GetResourceBundleDuringInitPortlet_en.properties
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletconfig-war/WEB-INF/classes/GetResourceBundleDuringInitPortlet_it.properties
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletconfig-war/WEB-INF/classes/GetResourceBundleDuringInitPortlet_it.properties
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletconfig-war/WEB-INF/classes/GetResourceBundleDuringInitPortlet_it.properties 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1 @@
+foo=bar
Added:
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletconfig-war/WEB-INF/classes/ResourceBundlePortlet_en.properties
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletconfig-war/WEB-INF/classes/ResourceBundlePortlet_en.properties
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletconfig-war/WEB-INF/classes/ResourceBundlePortlet_en.properties 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,4 @@
+javax.portlet.title=the title
+javax.portlet.short-title=the short title
+javax.portlet.description=the description
+example-key=example-value
Property changes on:
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletconfig-war/WEB-INF/classes/ResourceBundlePortlet_en.properties
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletconfig-war/WEB-INF/classes/ResourceBundlePortlet_it.properties
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletconfig-war/WEB-INF/classes/ResourceBundlePortlet_it.properties
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletconfig-war/WEB-INF/classes/ResourceBundlePortlet_it.properties 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,4 @@
+javax.portlet.title=il titolo
+javax.portlet.short-title=il titolo corto
+javax.portlet.description=la descrizione
+example-key=valore-di-esempio
Added:
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletconfig-war/WEB-INF/classes/org/jboss/portal/test/portlet/jsr168/ext/portletconfig/extended/ResourceBundleCascadePortlet_de.properties
===================================================================
Property changes on:
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletconfig-war/WEB-INF/classes/org/jboss/portal/test/portlet/jsr168/ext/portletconfig/extended/ResourceBundleCascadePortlet_de.properties
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletconfig-war/WEB-INF/classes/org/jboss/portal/test/portlet/jsr168/ext/portletconfig/extended/ResourceBundleCascadePortlet_de_DE.properties
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletconfig-war/WEB-INF/classes/org/jboss/portal/test/portlet/jsr168/ext/portletconfig/extended/ResourceBundleCascadePortlet_de_DE.properties
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletconfig-war/WEB-INF/classes/org/jboss/portal/test/portlet/jsr168/ext/portletconfig/extended/ResourceBundleCascadePortlet_de_DE.properties 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1 @@
+javax.portlet.short-title=short-title_de_DE
Property changes on:
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletconfig-war/WEB-INF/classes/org/jboss/portal/test/portlet/jsr168/ext/portletconfig/extended/ResourceBundleCascadePortlet_de_DE.properties
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletconfig-war/WEB-INF/classes/org/jboss/portal/test/portlet/jsr168/ext/portletconfig/extended/ResourceBundleCascadePortlet_en_GB.properties
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletconfig-war/WEB-INF/classes/org/jboss/portal/test/portlet/jsr168/ext/portletconfig/extended/ResourceBundleCascadePortlet_en_GB.properties
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletconfig-war/WEB-INF/classes/org/jboss/portal/test/portlet/jsr168/ext/portletconfig/extended/ResourceBundleCascadePortlet_en_GB.properties 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1 @@
+javax.portlet.short-title=short-title_en_EN
Property changes on:
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletconfig-war/WEB-INF/classes/org/jboss/portal/test/portlet/jsr168/ext/portletconfig/extended/ResourceBundleCascadePortlet_en_GB.properties
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletconfig-war/WEB-INF/classes/org/jboss/portal/test/portlet/jsr168/ext/portletconfig/extended/ResourceBundleCascadePortlet_fr.properties
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletconfig-war/WEB-INF/classes/org/jboss/portal/test/portlet/jsr168/ext/portletconfig/extended/ResourceBundleCascadePortlet_fr.properties
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletconfig-war/WEB-INF/classes/org/jboss/portal/test/portlet/jsr168/ext/portletconfig/extended/ResourceBundleCascadePortlet_fr.properties 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1 @@
+javax.portlet.short-title=short-title_fr
Property changes on:
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletconfig-war/WEB-INF/classes/org/jboss/portal/test/portlet/jsr168/ext/portletconfig/extended/ResourceBundleCascadePortlet_fr.properties
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletconfig-war/WEB-INF/classes/org/jboss/portal/test/portlet/jsr168/ext/portletconfig/extended/ResourceBundleCascadePortlet_fr_FR.properties
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletconfig-war/WEB-INF/classes/org/jboss/portal/test/portlet/jsr168/ext/portletconfig/extended/ResourceBundleCascadePortlet_fr_FR.properties
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletconfig-war/WEB-INF/classes/org/jboss/portal/test/portlet/jsr168/ext/portletconfig/extended/ResourceBundleCascadePortlet_fr_FR.properties 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1 @@
+javax.portlet.short-title=short-title_fr_FR
Property changes on:
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletconfig-war/WEB-INF/classes/org/jboss/portal/test/portlet/jsr168/ext/portletconfig/extended/ResourceBundleCascadePortlet_fr_FR.properties
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletconfig-war/WEB-INF/portlet.xml
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletconfig-war/WEB-INF/portlet.xml
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletconfig-war/WEB-INF/portlet.xml 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,73 @@
+<?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>
+ <portlet-name>ResourceBundlePortlet</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.jsr168.ext.portletconfig.extended.ResourceBundlePortlet</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <resource-bundle>ResourceBundlePortlet</resource-bundle>
+ <portlet-info>
+ <title></title>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>ResourceBundleCascadePortlet</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.jsr168.ext.portletconfig.extended.ResourceBundleCascadePortlet</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <supported-locale>en_GB</supported-locale>
+ <supported-locale>en</supported-locale>
+ <supported-locale>de_DE</supported-locale>
+ <supported-locale>de</supported-locale>
+ <supported-locale>fr_FR</supported-locale>
+ <supported-locale>fr</supported-locale>
+
<resource-bundle>org.jboss.portal.test.portlet.jsr168.ext.portletconfig.extended.ResourceBundleCascadePortlet</resource-bundle>
+ <portlet-info>
+ <title>title</title>
+ <short-title>short-title</short-title>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>GetResourceBundleDuringInitPortlet</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.jsr168.ext.portletconfig.extended.GetResourceBundleDuringInitPortlet</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <resource-bundle>GetResourceBundleDuringInitPortlet</resource-bundle>
+ <portlet-info>
+ <title></title>
+ </portlet-info>
+ </portlet>
+
+
+</portlet-app>
Property changes on:
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletconfig-war/WEB-INF/portlet.xml
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletconfig-war/WEB-INF/web.xml
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletconfig-war/WEB-INF/web.xml
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletconfig-war/WEB-INF/web.xml 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,32 @@
+<?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>
+ <listener>
+
<listener-class>org.jboss.portal.test.portlet.jsr168.ext.portletconfig.PortletConfigSequenceBuilder</listener-class>
+ </listener>
+</web-app>
Property changes on:
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletconfig-war/WEB-INF/web.xml
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletmode-war/WEB-INF/portlet.xml
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletmode-war/WEB-INF/portlet.xml
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletmode-war/WEB-INF/portlet.xml 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,56 @@
+<?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>
+ <portlet-name>UniversalTestPortletA</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.framework.UTP1</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title></title>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>TestActionWithPortletModePortlet</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.jsr168.ext.portletmode.extended.TestActionWithPortletModePortlet</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>edit</portlet-mode>
+ </supports>
+ <portlet-info>
+ <title></title>
+ </portlet-info>
+ </portlet>
+
+
+
+</portlet-app>
Property changes on:
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletmode-war/WEB-INF/portlet.xml
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletmode-war/WEB-INF/web.xml
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletmode-war/WEB-INF/web.xml
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletmode-war/WEB-INF/web.xml 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,32 @@
+<?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>
+ <listener>
+
<listener-class>org.jboss.portal.test.portlet.jsr168.ext.portletmode.PortletModeSequenceBuilder</listener-class>
+ </listener>
+</web-app>
Property changes on:
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletmode-war/WEB-INF/web.xml
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletrequests-war/WEB-INF/portlet.xml
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletrequests-war/WEB-INF/portlet.xml
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletrequests-war/WEB-INF/portlet.xml 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,43 @@
+<?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>
+ <portlet-name>UniversalTestPortletA</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.framework.UTP1</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title></title>
+ </portlet-info>
+ </portlet>
+
+
+</portlet-app>
Property changes on:
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletrequests-war/WEB-INF/portlet.xml
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletrequests-war/WEB-INF/web.xml
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletrequests-war/WEB-INF/web.xml
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletrequests-war/WEB-INF/web.xml 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,32 @@
+<?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>
+ <listener>
+
<listener-class>org.jboss.portal.test.portlet.jsr168.ext.portletrequests.PortletRequestsSequenceBuilder</listener-class>
+ </listener>
+</web-app>
Property changes on:
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletrequests-war/WEB-INF/web.xml
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletresponses-war/WEB-INF/portlet.xml
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletresponses-war/WEB-INF/portlet.xml
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletresponses-war/WEB-INF/portlet.xml 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,43 @@
+<?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>
+ <portlet-name>UniversalTestPortletA</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.framework.UTP1</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title></title>
+ </portlet-info>
+ </portlet>
+
+
+</portlet-app>
Property changes on:
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletresponses-war/WEB-INF/portlet.xml
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletresponses-war/WEB-INF/web.xml
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletresponses-war/WEB-INF/web.xml
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletresponses-war/WEB-INF/web.xml 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,34 @@
+<?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>
+
+ <listener>
+
<listener-class>org.jboss.portal.test.portlet.jsr168.ext.portletresponses.PortletResponsesSequenceBuilder</listener-class>
+ </listener>
+
+</web-app>
Property changes on:
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletresponses-war/WEB-INF/web.xml
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/preferences-war/WEB-INF/portlet.xml
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/preferences-war/WEB-INF/portlet.xml
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/preferences-war/WEB-INF/portlet.xml 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,96 @@
+<?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>
+ <portlet-name>UniversalTestPortletB</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.framework.UTP2</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title></title>
+ </portlet-info>
+ <portlet-preferences>
+ <preference>
+ <name>static_single_pref</name>
+ <value>static_single_pref_value</value>
+ <read-only>true</read-only>
+ </preference>
+ <preference>
+ <name>static_multi_pref</name>
+ <value>static_multi_pref_value_1</value>
+ <value>static_multi_pref_value_2</value>
+ </preference>
+ </portlet-preferences>
+ </portlet>
+
+ <portlet>
+ <portlet-name>UniversalTestPortlet3</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.framework.UTP3</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title></title>
+ </portlet-info>
+ <portlet-preferences>
+ <preference>
+ <name>single_pref</name>
+ <value>single_pref_value</value>
+ </preference>
+ <preference>
+ <name>multi_pref</name>
+ <value>multi_pref_value_1</value>
+ <value>multi_pref_value_2</value>
+ </preference>
+ </portlet-preferences>
+ </portlet>
+ <portlet>
+ <portlet-name>UniversalTestPortlet4</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.framework.UTP4</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title></title>
+ </portlet-info>
+ <portlet-preferences>
+ <preference>
+ <name>static_single_pref</name>
+ <value>static_single_pref_value</value>
+ </preference>
+ <preference>
+ <name>static_multi_pref</name>
+ <value>static_multi_pref_value_1</value>
+ <value>static_multi_pref_value_2</value>
+ </preference>
+ </portlet-preferences>
+ </portlet>
+
+</portlet-app>
Property changes on:
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/preferences-war/WEB-INF/portlet.xml
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/preferences-war/WEB-INF/web.xml
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/preferences-war/WEB-INF/web.xml
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/preferences-war/WEB-INF/web.xml 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,32 @@
+<?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>
+ <listener>
+
<listener-class>org.jboss.portal.test.portlet.jsr168.ext.preferences.PreferencesSequenceBuilder</listener-class>
+ </listener>
+</web-app>
Property changes on:
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/preferences-war/WEB-INF/web.xml
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/session-war/WEB-INF/portlet.xml
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/session-war/WEB-INF/portlet.xml
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/session-war/WEB-INF/portlet.xml 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,42 @@
+<?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>
+ <portlet-name>UniversalTestPortletA</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.framework.UTP1</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title></title>
+ </portlet-info>
+ </portlet>
+
+
+</portlet-app>
Property changes on:
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/session-war/WEB-INF/portlet.xml
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/session-war/WEB-INF/web.xml
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/session-war/WEB-INF/web.xml
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/session-war/WEB-INF/web.xml 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,44 @@
+<?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>
+
+ <listener>
+
<listener-class>org.jboss.portal.test.portlet.jsr168.ext.session.SessionSequenceBuilder</listener-class>
+ </listener>
+
+ <servlet>
+ <servlet-name>UniversalServletA</servlet-name>
+
<servlet-class>org.jboss.portal.test.portlet.framework.UTS1</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>UniversalServletA</servlet-name>
+ <url-pattern>/universalServletA</url-pattern>
+ </servlet-mapping>
+
+</web-app>
Property changes on:
modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/session-war/WEB-INF/web.xml
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/resources/test/jsr168/misc/log4j-war/WEB-INF/portlet.xml
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/misc/log4j-war/WEB-INF/portlet.xml
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/misc/log4j-war/WEB-INF/portlet.xml 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,41 @@
+<?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>
+ <portlet-name>UniversalTestPortletA</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.jsr168.misc.log4j.LoggingPortlet</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title></title>
+ </portlet-info>
+ </portlet>
+
+</portlet-app>
Added:
modules/portlet/trunk/portlet/src/resources/test/jsr168/misc/log4j-war/WEB-INF/web.xml
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/misc/log4j-war/WEB-INF/web.xml
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/misc/log4j-war/WEB-INF/web.xml 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,34 @@
+<?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>
+
+ <listener>
+
<listener-class>org.jboss.portal.test.portlet.jsr168.misc.log4j.Log4jSequenceBuilder</listener-class>
+ </listener>
+
+</web-app>
Added:
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/basic-war/WEB-INF/portlet.xml
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/basic-war/WEB-INF/portlet.xml
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/basic-war/WEB-INF/portlet.xml 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,55 @@
+<?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>
+ <portlet-name>PortletA</portlet-name>
+
<portlet-class>org.jboss.portal.test.framework.portlet.basictests.PortletA</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title></title>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>PortletB</portlet-name>
+
<portlet-class>org.jboss.portal.test.framework.portlet.basictests.PortletB</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title></title>
+ </portlet-info>
+ </portlet>
+
+
+
+
+</portlet-app>
Property changes on:
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/basic-war/WEB-INF/portlet.xml
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/basic-war/WEB-INF/web.xml
===================================================================
--- modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/basic-war/WEB-INF/web.xml
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/basic-war/WEB-INF/web.xml 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,32 @@
+<?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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<web-app version="2.4"
+
xmlns="http://java.sun.com/xml/ns/j2ee"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
+ <listener>
+
<listener-class>org.jboss.portal.test.framework.portlet.basictests.BasicTestSequenceBuilder</listener-class>
+ </listener>
+</web-app>
Property changes on:
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/basic-war/WEB-INF/web.xml
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/dispatcher-war/WEB-INF/portlet.xml
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/dispatcher-war/WEB-INF/portlet.xml
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/dispatcher-war/WEB-INF/portlet.xml 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,43 @@
+<?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>
+ <portlet-name>TestUniversalPortletA</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.framework.UTP1</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title></title>
+ </portlet-info>
+ </portlet>
+
+
+</portlet-app>
Property changes on:
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/dispatcher-war/WEB-INF/portlet.xml
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/dispatcher-war/WEB-INF/web.xml
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/dispatcher-war/WEB-INF/web.xml
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/dispatcher-war/WEB-INF/web.xml 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,44 @@
+<?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>
+
+ <listener>
+
<listener-class>org.jboss.portal.test.portlet.jsr168.tck.dispatcher.DispatcherSequenceBuilder</listener-class>
+ </listener>
+
+ <servlet>
+ <servlet-name>UniversalServletA</servlet-name>
+
<servlet-class>org.jboss.portal.test.portlet.framework.UTS1</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>UniversalServletA</servlet-name>
+ <url-pattern>/universalServletA/*</url-pattern>
+ </servlet-mapping>
+
+</web-app>
Property changes on:
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/dispatcher-war/WEB-INF/web.xml
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletconfig-war/WEB-INF/classes/InlineValuesNotInResourceBundlePortlet_en.properties
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletconfig-war/WEB-INF/classes/InlineValuesNotInResourceBundlePortlet_en.properties
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletconfig-war/WEB-INF/classes/InlineValuesNotInResourceBundlePortlet_en.properties 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1 @@
+foo=bar
\ No newline at end of file
Property changes on:
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletconfig-war/WEB-INF/classes/InlineValuesNotInResourceBundlePortlet_en.properties
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletconfig-war/WEB-INF/classes/InlineValuesNotInResourceBundlePortlet_it.properties
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletconfig-war/WEB-INF/classes/InlineValuesNotInResourceBundlePortlet_it.properties
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletconfig-war/WEB-INF/classes/InlineValuesNotInResourceBundlePortlet_it.properties 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1 @@
+foo=bar
\ No newline at end of file
Added:
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletconfig-war/WEB-INF/portlet.xml
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletconfig-war/WEB-INF/portlet.xml
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletconfig-war/WEB-INF/portlet.xml 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,57 @@
+<?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>
+ <portlet-name>InlineValuesNotInResourceBundlePortlet</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.jsr168.tck.portletconfig.spec.InlineValuesNotInResourceBundlePortlet</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <supported-locale>en</supported-locale>
+
<resource-bundle>InlineValuesNotInResourceBundlePortlet</resource-bundle>
+ <portlet-info>
+ <title>title</title>
+ <short-title>short-title</short-title>
+ <keywords>keywords</keywords>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+
<portlet-name>InlineValuesWithNoResourceBundleDefinedPortlet</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.jsr168.tck.portletconfig.spec.InlineValuesWithNoResourceBundleDefinedPortlet</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title>title</title>
+ <short-title>short-title</short-title>
+ <keywords>keywords</keywords>
+ </portlet-info>
+ </portlet>
+
+</portlet-app>
Property changes on:
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletconfig-war/WEB-INF/portlet.xml
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletconfig-war/WEB-INF/web.xml
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletconfig-war/WEB-INF/web.xml
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletconfig-war/WEB-INF/web.xml 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,32 @@
+<?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>
+ <listener>
+
<listener-class>org.jboss.portal.test.portlet.jsr168.tck.portletconfig.PortletConfigSequenceBuilder</listener-class>
+ </listener>
+</web-app>
Property changes on:
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletconfig-war/WEB-INF/web.xml
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletcontext-war/WEB-INF/portlet.xml
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletcontext-war/WEB-INF/portlet.xml
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletcontext-war/WEB-INF/portlet.xml 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,43 @@
+<?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>
+ <portlet-name>TestUniversalPortletA</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.framework.UTP1</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title></title>
+ </portlet-info>
+ </portlet>
+
+
+
+</portlet-app>
Property changes on:
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletcontext-war/WEB-INF/portlet.xml
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletcontext-war/WEB-INF/web.xml
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletcontext-war/WEB-INF/web.xml
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletcontext-war/WEB-INF/web.xml 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,44 @@
+<?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>
+
+ <listener>
+
<listener-class>org.jboss.portal.test.portlet.jsr168.tck.portletcontext.PortletContextSequenceBuilder</listener-class>
+ </listener>
+
+ <servlet>
+ <servlet-name>UniversalServletA</servlet-name>
+
<servlet-class>org.jboss.portal.test.portlet.framework.UTS1</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>UniversalServletA</servlet-name>
+ <url-pattern>/universalServletA</url-pattern>
+ </servlet-mapping>
+
+</web-app>
Property changes on:
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletcontext-war/WEB-INF/web.xml
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletcontext-war/simple_resource.txt
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletcontext-war/simple_resource.txt
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletcontext-war/simple_resource.txt 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1 @@
+Simple resource for testing purposes
\ No newline at end of file
Property changes on:
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletcontext-war/simple_resource.txt
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletinterface-war/WEB-INF/portlet.xml
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletinterface-war/WEB-INF/portlet.xml
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletinterface-war/WEB-INF/portlet.xml 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,169 @@
+<?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>
+ <portlet-name>UniversalTestPortletA</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.framework.UTP1</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title></title>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>UniversalTestPortletB</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.framework.UTP2</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title></title>
+ </portlet-info>
+ </portlet>
+
+
+
+ <portlet>
+ <portlet-name>InitializeBeforeHandlePortlet</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.jsr168.tck.portletinterface.spec.InitializeBeforeHandlePortlet</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title></title>
+ </portlet-info>
+ </portlet>
+
+
+
+ <portlet>
+ <portlet-name>PortletExceptionDuringInitPortlet</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.jsr168.tck.portletinterface.spec.PortletExceptionDuringInitPortlet</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title></title>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>UnavailableExceptionDuringInitPortlet</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.jsr168.tck.portletinterface.spec.UnavailableExceptionDuringInitPortlet</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title></title>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>RuntimeExceptionDuringInitPortlet</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.jsr168.tck.portletinterface.spec.RuntimeExceptionDuringInitPortlet</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title></title>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>MinimizedStateDontRenderPortlet</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.jsr168.tck.portletinterface.spec.MinimizedStateDontRenderPortlet</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>edit</portlet-mode>
+ <portlet-mode>help</portlet-mode>
+ </supports>
+ <portlet-info>
+ <title></title>
+ </portlet-info>
+ </portlet>
+
+ <!--<portlet>
+
<portlet-name>ExceptionsDuringRequestHandlingControllerPortlet</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.jsr168.tck.portletinterface.spec.ExceptionsDuringRequestHandlingControllerPortlet</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title></title>
+ </portlet-info>
+ </portlet>-->
+
+ <!--<portlet>
+
<portlet-name>PortletExceptionDuringRequestHandlingPortlet</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.jsr168.tck.portletinterface.spec.PortletExceptionDuringRequestHandlingPortlet</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title></title>
+ </portlet-info>
+ </portlet>-->
+
+ <!--<portlet>
+
<portlet-name>UnavailableExceptionDuringProcessActionPortlet</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.jsr168.tck.portletinterface.spec.UnavailableExceptionDuringProcessActionPortlet</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title></title>
+ </portlet-info>
+ </portlet>-->
+
+ <!--<portlet>
+ <portlet-name>UnavailableExceptionDuringRenderPortlet</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.jsr168.tck.portletinterface.spec.UnavailableExceptionDuringRenderPortlet</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title></title>
+ </portlet-info>
+ </portlet>-->
+
+ <!--<portlet>
+
<portlet-name>RuntimeExceptionDuringRequestHandlingPortlet</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.jsr168.tck.portletinterface.spec.RuntimeExceptionDuringRequestHandlingPortlet</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title></title>
+ </portlet-info>
+ </portlet>-->
+
+
+</portlet-app>
Property changes on:
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletinterface-war/WEB-INF/portlet.xml
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletinterface-war/WEB-INF/web.xml
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletinterface-war/WEB-INF/web.xml
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletinterface-war/WEB-INF/web.xml 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,43 @@
+<?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>
+
+ <listener>
+
<listener-class>org.jboss.portal.test.portlet.jsr168.tck.portletinterface.PortletInterfaceSequenceBuilder</listener-class>
+ </listener>
+
+ <servlet>
+ <servlet-name>universalServletA</servlet-name>
+
<servlet-class>org.jboss.portal.test.portlet.framework.UTS1</servlet-class>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>universalServletA</servlet-name>
+ <url-pattern>/universalServletA</url-pattern>
+ </servlet-mapping>
+
+</web-app>
Property changes on:
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletinterface-war/WEB-INF/web.xml
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletmode-war/WEB-INF/portlet.xml
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletmode-war/WEB-INF/portlet.xml
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletmode-war/WEB-INF/portlet.xml 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,61 @@
+<?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">
+
+
+ <!--Spec Assertions related portlets-->
+ <portlet>
+ <portlet-name>RequestDispatchingDependingOnModePortlet</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.jsr168.tck.portletmode.spec.RequestDispatchingDependingOnModePortlet</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>edit</portlet-mode>
+ <portlet-mode>help</portlet-mode>
+ </supports>
+ <portlet-info>
+ <title>Test during action portlet</title>
+ </portlet-info>
+ </portlet>
+
+
+ <portlet>
+
<portlet-name>NotInvokeModeDeclaredForNotSupportedMarkupHelperPortlet</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.jsr168.tck.portletmode.spec.NotInvokeModeDeclaredForNotSupportedMarkupHelperPortlet</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <supports>
+ <mime-type>text/vnd.wap.wml</mime-type>
+ <portlet-mode>edit</portlet-mode>
+ </supports>
+ <portlet-info>
+ <title>Test during action portlet</title>
+ </portlet-info>
+ </portlet>
+
+</portlet-app>
Property changes on:
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletmode-war/WEB-INF/portlet.xml
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletmode-war/WEB-INF/web.xml
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletmode-war/WEB-INF/web.xml
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletmode-war/WEB-INF/web.xml 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,32 @@
+<?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>
+ <listener>
+
<listener-class>org.jboss.portal.test.portlet.jsr168.tck.portletmode.PortletModeSequenceBuilder</listener-class>
+ </listener>
+</web-app>
Property changes on:
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletmode-war/WEB-INF/web.xml
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletrequests-war/WEB-INF/portlet.xml
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletrequests-war/WEB-INF/portlet.xml
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletrequests-war/WEB-INF/portlet.xml 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,56 @@
+<?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>
+ <portlet-name>UniversalTestPortletA</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.framework.UTP1</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title></title>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>UniversalTestPortletB</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.framework.UTP2</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title></title>
+ </portlet-info>
+ </portlet>
+
+
+
+
+</portlet-app>
Property changes on:
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletrequests-war/WEB-INF/portlet.xml
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletrequests-war/WEB-INF/web.xml
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletrequests-war/WEB-INF/web.xml
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletrequests-war/WEB-INF/web.xml 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,32 @@
+<?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>
+ <listener>
+
<listener-class>org.jboss.portal.test.portlet.jsr168.tck.portletrequests.PortletRequestsSequenceBuilder</listener-class>
+ </listener>
+</web-app>
Property changes on:
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletrequests-war/WEB-INF/web.xml
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletresponses-war/WEB-INF/portlet.xml
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletresponses-war/WEB-INF/portlet.xml
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletresponses-war/WEB-INF/portlet.xml 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,54 @@
+<?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>
+ <portlet-name>UniversalTestPortletA</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.framework.UTP1</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title></title>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>UniversalTestPortletB</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.framework.UTP2</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title></title>
+ </portlet-info>
+ </portlet>
+
+
+</portlet-app>
Property changes on:
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletresponses-war/WEB-INF/portlet.xml
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletresponses-war/WEB-INF/web.xml
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletresponses-war/WEB-INF/web.xml
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletresponses-war/WEB-INF/web.xml 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,55 @@
+<?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>
+
+ <listener>
+
<listener-class>org.jboss.portal.test.portlet.jsr168.tck.portletresponses.PortletResponsesSequenceBuilder</listener-class>
+ </listener>
+
+ <servlet>
+ <servlet-name>UniversalServletA</servlet-name>
+
<servlet-class>org.jboss.portal.test.portlet.framework.UTS1</servlet-class>
+ </servlet>
+
+ <servlet>
+ <servlet-name>UniversalServletB</servlet-name>
+
<servlet-class>org.jboss.portal.test.portlet.framework.UTS2</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>UniversalServletA</servlet-name>
+ <url-pattern>/universalServletA</url-pattern>
+ </servlet-mapping>
+
+ <servlet-mapping>
+ <servlet-name>UniversalServletB</servlet-name>
+ <url-pattern>/universalServletB</url-pattern>
+ </servlet-mapping>
+
+
+</web-app>
Property changes on:
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletresponses-war/WEB-INF/web.xml
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletsession-war/WEB-INF/portlet.xml
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletsession-war/WEB-INF/portlet.xml
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletsession-war/WEB-INF/portlet.xml 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,53 @@
+<?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>
+ <portlet-name>UniversalTestPortletA</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.framework.UTP1</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title></title>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>UniversalTestPortletB</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.framework.UTP2</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title></title>
+ </portlet-info>
+ </portlet>
+
+
+</portlet-app>
Property changes on:
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletsession-war/WEB-INF/portlet.xml
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletsession-war/WEB-INF/web.xml
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletsession-war/WEB-INF/web.xml
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletsession-war/WEB-INF/web.xml 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,53 @@
+<?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>
+
+ <listener>
+
<listener-class>org.jboss.portal.test.portlet.jsr168.tck.portletsession.PortletSessionSequenceBuilder</listener-class>
+ </listener>
+
+ <listener>
+
<listener-class>org.jboss.portal.test.portlet.jsr168.tck.portletsession.HttpSessionEvents</listener-class>
+ </listener>
+
+ <servlet>
+ <servlet-name>UniversalServletA</servlet-name>
+
<servlet-class>org.jboss.portal.test.portlet.framework.UTS1</servlet-class>
+ </servlet>
+
+ <servlet>
+ <servlet-name>HttpSessionInvalidationServlet</servlet-name>
+
<servlet-class>org.jboss.portal.test.portlet.jsr168.tck.portletsession.HttpSessionInvalidatorServlet</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>UniversalServletA</servlet-name>
+ <url-pattern>/universalServletA</url-pattern>
+ </servlet-mapping>
+
+</web-app>
Property changes on:
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portletsession-war/WEB-INF/web.xml
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portleturl-war/WEB-INF/portlet.xml
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portleturl-war/WEB-INF/portlet.xml
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portleturl-war/WEB-INF/portlet.xml 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,42 @@
+<?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>
+ <portlet-name>UniversalTestPortletA</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.framework.UTP1</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title></title>
+ </portlet-info>
+ </portlet>
+
+</portlet-app>
Property changes on:
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portleturl-war/WEB-INF/portlet.xml
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portleturl-war/WEB-INF/web.xml
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portleturl-war/WEB-INF/web.xml
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portleturl-war/WEB-INF/web.xml 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,32 @@
+<?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>
+ <listener>
+
<listener-class>org.jboss.portal.test.portlet.jsr168.tck.portleturl.PortletUrlSequenceBuilder</listener-class>
+ </listener>
+</web-app>
Property changes on:
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/portleturl-war/WEB-INF/web.xml
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/preferences-war/WEB-INF/portlet.xml
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/preferences-war/WEB-INF/portlet.xml
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/preferences-war/WEB-INF/portlet.xml 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,245 @@
+<?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>
+ <portlet-name>UniversalTestPortlet1</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.framework.UTP1</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title></title>
+ </portlet-info>
+ <portlet-preferences>
+ <preference>
+ <name>single_pref</name>
+ <value>single_pref_value</value>
+ </preference>
+ <preference>
+ <name>multi_pref</name>
+ <value>multi_pref_value_1</value>
+ <value>multi_pref_value_2</value>
+ </preference>
+ </portlet-preferences>
+ </portlet>
+
+ <portlet>
+ <portlet-name>UniversalTestPortlet2</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.framework.UTP2</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title></title>
+ </portlet-info>
+ <portlet-preferences>
+ <preference>
+ <name>action_single_pref</name>
+ <value>action_single_pref_value</value>
+ </preference>
+ <preference>
+ <name>action_multi_pref</name>
+ <value>action_multi_pref_value_1</value>
+ <value>action_multi_pref_value_2</value>
+ </preference>
+ <preference>
+ <name>render_single_pref</name>
+ <value>render_single_pref_value</value>
+ </preference>
+ <preference>
+ <name>render_multi_pref</name>
+ <value>render_multi_pref_value_1</value>
+ <value>render_multi_pref_value_2</value>
+ </preference>
+ </portlet-preferences>
+ </portlet>
+
+ <portlet>
+ <portlet-name>UniversalTestPortlet3</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.framework.UTP3</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title></title>
+ </portlet-info>
+ <portlet-preferences>
+ <preference>
+ <name>static_single_pref</name>
+ <value>static_single_pref_value</value>
+ </preference>
+ <preference>
+ <name>static_multi_pref</name>
+ <value>static_multi_pref_value_1</value>
+ <value>static_multi_pref_value_2</value>
+ </preference>
+ </portlet-preferences>
+ </portlet>
+
+ <portlet>
+ <portlet-name>UniversalTestPortlet4</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.framework.UTP4</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title></title>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>UniversalTestPortlet5</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.framework.UTP5</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title></title>
+ </portlet-info>
+ <portlet-preferences>
+ <preference>
+ <name>single_pref</name>
+ <value>single_pref_value</value>
+ <read-only>true</read-only>
+ </preference>
+ <preference>
+ <name>multi_pref</name>
+ <value>multi_pref_value_1</value>
+ <value>multi_pref_value_2</value>
+ <read-only>true</read-only>
+ </preference>
+ </portlet-preferences>
+ </portlet>
+
+ <portlet>
+ <portlet-name>UniversalTestPortlet6</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.framework.UTP6</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title></title>
+ </portlet-info>
+ <portlet-preferences>
+
<preferences-validator>org.jboss.portal.test.portlet.jsr168.tck.preferences.spec.CreateASingleInstanceOfValidatorValidator</preferences-validator>
+ </portlet-preferences>
+ </portlet>
+
+ <portlet>
+ <portlet-name>UniversalTestPortlet7</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.framework.UTP7</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title></title>
+ </portlet-info>
+ <portlet-preferences>
+ <preference>
+ <name>single_pref</name>
+ <value>single_pref_value</value>
+ </preference>
+ <preference>
+ <name>multi_pref</name>
+ <value>multi_pref_value_1</value>
+ <value>multi_pref_value_2</value>
+ </preference>
+
<preferences-validator>org.jboss.portal.test.portlet.jsr168.tck.preferences.spec.InvalidationCancelsStoreValidator</preferences-validator>
+ </portlet-preferences>
+ </portlet>
+
+ <portlet>
+ <portlet-name>UniversalTestPortlet8</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.framework.UTP8</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title></title>
+ </portlet-info>
+ <portlet-preferences>
+ <preference>
+ <name>single_pref</name>
+ <value>single_pref_value</value>
+ </preference>
+ <preference>
+ <name>multi_pref</name>
+ <value>multi_pref_value_1</value>
+ <value>multi_pref_value_2</value>
+ </preference>
+
<preferences-validator>org.jboss.portal.test.portlet.jsr168.tck.preferences.spec.ValidationStoresValidator</preferences-validator>
+ </portlet-preferences>
+ </portlet>
+
+ <!--<portlet>
+ <portlet-name>UniversalTestPortlet9</portlet-name>
+
<portlet-class>org.jboss.portal.test.framework.portlet.universal.UTP9</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title></title>
+ </portlet-info>
+ <portlet-preferences>
+ <preference>
+ <name>static_single_pref</name>
+ <value>static_single_pref_value</value>
+ </preference>
+ <preference>
+ <name>static_multi_pref</name>
+ <value>static_multi_pref_value_1</value>
+ <value>static_multi_pref_value_2</value>
+ </preference>
+ </portlet-preferences>
+ </portlet>-->
+
+ <!--<portlet>
+ <portlet-name>UniversalTestPortlet10</portlet-name>
+
<portlet-class>org.jboss.portal.test.framework.portlet.universal.UTP10</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title></title>
+ </portlet-info>
+ <portlet-preferences>
+ <preference>
+ <name>static_single_pref</name>
+ <value>static_single_pref_value</value>
+ <read-only>true</read-only>
+ </preference>
+ <preference>
+ <name>static_multi_pref</name>
+ <value>static_multi_pref_value_1</value>
+ <value>static_multi_pref_value_2</value>
+ </preference>
+ </portlet-preferences>
+ </portlet>-->
+</portlet-app>
Property changes on:
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/preferences-war/WEB-INF/portlet.xml
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/preferences-war/WEB-INF/web.xml
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/preferences-war/WEB-INF/web.xml
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/preferences-war/WEB-INF/web.xml 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,32 @@
+<?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>
+ <listener>
+
<listener-class>org.jboss.portal.test.portlet.jsr168.tck.preferences.PreferencesSequenceBuilder</listener-class>
+ </listener>
+</web-app>
Property changes on:
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/preferences-war/WEB-INF/web.xml
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/windowstates-war/WEB-INF/portlet.xml
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/windowstates-war/WEB-INF/portlet.xml
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/windowstates-war/WEB-INF/portlet.xml 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,59 @@
+<?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>
+ <portlet-name>UniversalTestPortletA</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.framework.UTP1</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <custom-window-state>
+ <description>Some unmapped by portal state</description>
+ <name>UNMAPPED_STATE</name>
+ </custom-window-state>
+ <portlet-info>
+ <title></title>
+ </portlet-info>
+ </portlet>
+
+ <portlet>
+ <portlet-name>UniversalTestPortletB</portlet-name>
+
<portlet-class>org.jboss.portal.test.portlet.framework.UTP2</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title></title>
+ </portlet-info>
+ </portlet>
+
+
+
+</portlet-app>
Property changes on:
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/windowstates-war/WEB-INF/portlet.xml
___________________________________________________________________
Name: svn:executable
+
Added:
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/windowstates-war/WEB-INF/web.xml
===================================================================
---
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/windowstates-war/WEB-INF/web.xml
(rev 0)
+++
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/windowstates-war/WEB-INF/web.xml 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,32 @@
+<?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>
+ <listener>
+
<listener-class>org.jboss.portal.test.portlet.jsr168.tck.windowstates.WindowStatesSequenceBuilder</listener-class>
+ </listener>
+</web-app>
Property changes on:
modules/portlet/trunk/portlet/src/resources/test/jsr168/tck/windowstates-war/WEB-INF/web.xml
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/testsuite/.project
===================================================================
--- modules/portlet/trunk/testsuite/.project (rev 0)
+++ modules/portlet/trunk/testsuite/.project 2007-08-17 15:29:49 UTC (rev 7981)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>testsuite</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ </buildSpec>
+ <natures>
+ </natures>
+</projectDescription>
Added: modules/portlet/trunk/testsuite/build.bat
===================================================================
--- modules/portlet/trunk/testsuite/build.bat (rev 0)
+++ modules/portlet/trunk/testsuite/build.bat 2007-08-17 15:29:49 UTC (rev 7981)
@@ -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: modules/portlet/trunk/testsuite/build.bat
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/testsuite/build.sh
===================================================================
--- modules/portlet/trunk/testsuite/build.sh (rev 0)
+++ modules/portlet/trunk/testsuite/build.sh 2007-08-17 15:29:49 UTC (rev 7981)
@@ -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: modules/portlet/trunk/testsuite/build.sh
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/testsuite/build.xml
===================================================================
--- modules/portlet/trunk/testsuite/build.xml (rev 0)
+++ modules/portlet/trunk/testsuite/build.xml 2007-08-17 15:29:49 UTC (rev 7981)
@@ -0,0 +1,143 @@
+<?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 defaults SYSTEM
"../tools/etc/buildfragments/defaults.ent">
+ <!ENTITY libraries SYSTEM "../thirdparty/libraries.ent">
+ ]>
+
+<project default="tests" name="JBoss Portal Testuite"
+
xmlns:server="http://jboss.org/ns/test/ant/server">
+
+ <import file="imports/server-config.xml"/>
+
+ <property environment="env"/>
+ <property name="junit.formatter.usefile" value="true"/>
+ <property name="jboss.junit.config" value=""/>
+ <property name="log.dir" value="output/logs"/>
+ <property name="reports.dir" value="output/reports"/>
+ <dirname property="project.root" file="${basedir}"/>
+ <property name="project.thirdparty"
value="${project.root}/thirdparty"/>
+
+ &defaults;
+ &libraries;
+
+ <path id="portal.task.classpath">
+ <pathelement location="${project.tools}/lib/ant.jar"/>
+ <pathelement location="${project.tools}/lib/explode.jar"/>
+ <pathelement
location="${project.tools}/lib/cargo-core-uberjar-0.8.jar"/>
+ </path>
+
+ <taskdef
+ name="deploy"
+ classname="org.jboss.portal.common.ant.Deploy"
+ classpathref="portal.task.classpath"/>
+ <taskdef
+ name="undeploy"
+ classname="org.jboss.portal.common.ant.Undeploy"
+ classpathref="portal.task.classpath"/>
+
+ <target name="init">
+ <mkdir dir="${log.dir}"/>
+ <mkdir dir="${reports.dir}"/>
+ <available classname="java.lang.Void"
property="HAVE_JDK_1.1"/>
+ <available classname="java.lang.ThreadLocal"
property="HAVE_JDK_1.2"/>
+ <available classname="java.lang.StrictMath"
property="HAVE_JDK_1.3"/>
+ <available classname="java.lang.StackTraceElement"
property="HAVE_JDK_1.4"/>
+ <available classname="java.lang.Enum"
property="HAVE_JDK_1.5"/>
+ </target>
+ <!-- copy all logs to testsuite/output/logs -->
+ <target name="copy-logs">
+ <copy todir="${log.dir}">
+ <fileset dir="../${module}/">
+ <include name="*.log"/>
+ </fileset>
+ <globmapper from="*" to="${module}-*"/>
+ </copy>
+ </target>
+
+ <!-- copy all reports to testsuite/output/reports -->
+ <target name="copy-reports">
+ <copy todir="${reports.dir}">
+ <fileset dir="../${module}/output/tests">
+ <include name="TEST-*.xml"/>
+ </fileset>
+ </copy>
+ </target>
+
+ <target name="run-tests">
+ <ant antfile="../${module}/build.xml" output="output.log"
dir="../${module}" target="package-tests"/>
+ <ant antfile="../${module}/build.xml" output="tests.log"
dir="../${module}" target="tests"/>
+ </target>
+
+ <target name="test-module" depends="clean,init">
+ <antcall target="internal-test-module"/>
+ <antcall target="reports"/>
+ </target>
+
+ <target name="internal-test-module">
+ <antcall target="run-tests">
+ <param name="module" value="${module}"/>
+ </antcall>
+ <antcall target="copy-logs">
+ <param name="module" value="${module}"/>
+ </antcall>
+ <antcall target="copy-reports">
+ <param name="module" value="${module}"/>
+ </antcall>
+ </target>
+
+ <!-- executes all modules' tests -->
+ <target name="tests" depends="init">
+ <antcall target="reports"/>
+ </target>
+
+ <target name="reports">
+ <junitreport todir="${reports.dir}">
+ <fileset dir="${reports.dir}">
+ <include name="TEST-*.xml"/>
+ </fileset>
+ <report format="frames"
+ todir="${reports.dir}"/>
+ </junitreport>
+ </target>
+
+ <target name="clean">
+ <!-- remove generated test xml files -->
+ <delete>
+ <fileset dir="../common" includes="*.log"/>
+ <fileset dir="../common"
includes="output/tests/TEST-*.xml,output/tests/TEST-*.txt"/>
+ </delete>
+ <!-- remove testsuite output dir -->
+ <delete includeEmptyDirs="true" quiet="true">
+ <fileset dir="output"/>
+ </delete>
+ </target>
+
+ <target name="help">
+ <echo message="To run individual module tests use the test-module target with
-Dmodule=the module you want to test,
+ e.g. ant -Dmodule=portlet test-module"/>
+ </target>
+
+</project>
Property changes on: modules/portlet/trunk/testsuite/build.xml
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/testsuite/imports/server-config.xml
===================================================================
--- modules/portlet/trunk/testsuite/imports/server-config.xml (rev
0)
+++ modules/portlet/trunk/testsuite/imports/server-config.xml 2007-08-17 15:29:49 UTC (rev
7981)
@@ -0,0 +1,109 @@
+<?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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<project name="server-config" default="help"
+
xmlns:server="http://jboss.org/ns/test/ant/server">
+
+ <!-- PROPERTIES -->
+ <property environment="env"/>
+ <property name="jboss.dist" value="${env.JBOSS_HOME}"/>
+ <property name="node0" value="localhost"/>
+ <property name="project.tools" value="../tools"/>
+ <property name="udpGroup" value="239.3.4.67"/>
+ <property name="node0.jndi.url"
value="jnp://${node0}:1099"/>
+ <!-- Override for non-Sun compatible JDK layouts -->
+ <property name="javac.jar"
value="${env.JAVA_HOME}/lib/tools.jar"/>
+ <!-- Override with the jpda settings for debugging start-jboss. An example
+ for connecting with a debugger via the socket protocol:
+ -Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y
+ An example of running with the -Xrunyjpagent
+ -->
+ <property name="jpda.cmdline" value=""/>
+ <!--<property name="jpda.cmdline" value="-Xdebug -Xnoagent
-Djava.compiler=NONE
-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=7878"/>-->
+
+ <path id="jboss.boot.classpath">
+ <pathelement location="${jboss.dist}/bin/run.jar"/>
+ <pathelement location="${javac.jar}"/>
+ </path>
+
+ <!-- Set a extension property -bat for win32, sh
+ otherwise
+ -->
+ <condition property="exten" value="bat">
+ <os family="windows"/>
+ </condition>
+ <condition property="exten" value="sh">
+ <not>
+ <os family="windows"/>
+ </not>
+ </condition>
+
+ <condition property="separator" value=";">
+ <os family="windows"/>
+ </condition>
+ <condition property="separator" value=":">
+ <not>
+ <os family="windows"/>
+ </not>
+ </condition>
+
+ <!-- Server Config Classpath, also used for JUnit formatting -->
+ <path id="jboss.test.classpath">
+ <filelist dir="${project.tools}/lib">
+ <file name="jboss-test.jar"/>
+ </filelist>
+ </path>
+
+ <taskdef name="config"
classname="org.jboss.ant.taskdefs.server.ConfigManagerTask"
+
uri="http://jboss.org/ns/test/ant/server"
loaderref="server.loader">
+ <classpath id="server.taskdef.classpath">
+ <path refid="jboss.test.classpath"/>
+ </classpath>
+ </taskdef>
+ <taskdef name="start"
classname="org.jboss.ant.taskdefs.server.StartServerTask"
+
uri="http://jboss.org/ns/test/ant/server"
loaderref="server.loader">
+ <classpath refid="server.taskdef.classpath"/>
+ </taskdef>
+ <taskdef name="stop"
classname="org.jboss.ant.taskdefs.server.StopServerTask"
+
uri="http://jboss.org/ns/test/ant/server"
loaderref="server.loader">
+ <classpath refid="server.taskdef.classpath"/>
+ </taskdef>
+
+ <server:config javaHome="${env.JAVA_HOME}"
jbossHome="${jboss.dist}"
+ udpGroup="${udpGroup}">
+ <server name="default" host="${node0}">
+ <jvmarg value="${jpda.cmdline}"/>
+ <jvmarg value="-Xmx128m"/>
+ <sysproperty key="java.endorsed.dirs"
value="${jboss.dist}/lib/endorsed"/>
+ </server>
+ </server:config>
+
+<target name="help">
+ <echo message="The project fragment which defines the jboss server
configs"/>
+ </target>
+
+
+</project>
Property changes on: modules/portlet/trunk/testsuite/imports/server-config.xml
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/tools/.donotremove
===================================================================
Property changes on: modules/portlet/trunk/tools/.donotremove
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/tools/.project
===================================================================
--- modules/portlet/trunk/tools/.project (rev 0)
+++ modules/portlet/trunk/tools/.project 2007-08-17 15:29:49 UTC (rev 7981)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>tools</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ </buildSpec>
+ <natures>
+ </natures>
+</projectDescription>
Property changes on: modules/portlet/trunk/tools/.project
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/tools/bin/ant
===================================================================
--- modules/portlet/trunk/tools/bin/ant (rev 0)
+++ modules/portlet/trunk/tools/bin/ant 2007-08-17 15:29:49 UTC (rev 7981)
@@ -0,0 +1,326 @@
+#! /bin/sh
+
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+#
http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Extract launch and ant arguments, (see details below).
+ant_exec_args=
+no_config=false
+use_jikes_default=false
+ant_exec_debug=false
+show_help=false
+for arg in "$@" ; do
+ if [ "$arg" = "--noconfig" ] ; then
+ no_config=true
+ elif [ "$arg" = "--usejikes" ] ; then
+ use_jikes_default=true
+ elif [ "$arg" = "--execdebug" ] ; then
+ ant_exec_debug=true
+ elif [ my"$arg" = my"--h" -o my"$arg" =
my"--help" ] ; then
+ show_help=true
+ ant_exec_args="$ant_exec_args -h"
+ else
+ if [ my"$arg" = my"-h" -o my"$arg" =
my"-help" ] ; then
+ show_help=true
+ fi
+ ant_exec_args="$ant_exec_args \"$arg\""
+ fi
+done
+
+# Source/default ant configuration
+if $no_config ; then
+ rpm_mode=false
+ usejikes=$use_jikes_default
+else
+ # load system-wide ant configuration (ONLY if ANT_HOME has NOT been set)
+ if [ -z "$ANT_HOME" -o "$ANT_HOME" = "/usr/share/ant" ];
then
+ if [ -f "/etc/ant.conf" ] ; then
+ . /etc/ant.conf
+ fi
+ fi
+
+ # load user ant configuration
+ if [ -f "$HOME/.ant/ant.conf" ] ; then
+ . $HOME/.ant/ant.conf
+ fi
+ if [ -f "$HOME/.antrc" ] ; then
+ . "$HOME/.antrc"
+ fi
+
+ # provide default configuration values
+ if [ -z "$rpm_mode" ] ; then
+ rpm_mode=false
+ fi
+ if [ -z "$usejikes" ] ; then
+ usejikes=$use_jikes_default
+ fi
+fi
+
+# Setup Java environment in rpm mode
+if $rpm_mode ; then
+ if [ -f /usr/share/java-utils/java-functions ] ; then
+ . /usr/share/java-utils/java-functions
+ set_jvm
+ set_javacmd
+ fi
+fi
+
+# OS specific support. $var _must_ be set to either true or false.
+cygwin=false;
+darwin=false;
+case "`uname`" in
+ CYGWIN*) cygwin=true ;;
+ Darwin*) darwin=true
+ if [ -z "$JAVA_HOME" ] ; then
+ JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Home
+ fi
+ ;;
+esac
+
+if [ -z "$ANT_HOME" -o ! -d "$ANT_HOME" ] ; then
+ ## resolve links - $0 may be a link to ant's home
+ PRG="$0"
+ progname=`basename "$0"`
+
+ # need this for relative symlinks
+ while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+ done
+
+ ANT_HOME=`dirname "$PRG"`/..
+
+ # make it fully qualified
+ ANT_HOME=`cd "$ANT_HOME" && pwd`
+fi
+
+# For Cygwin, ensure paths are in UNIX format before anything is touched
+if $cygwin ; then
+ [ -n "$ANT_HOME" ] &&
+ ANT_HOME=`cygpath --unix "$ANT_HOME"`
+ [ -n "$JAVA_HOME" ] &&
+ JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
+fi
+
+# set ANT_LIB location
+ANT_LIB="${ANT_HOME}/lib"
+
+if [ -z "$JAVACMD" ] ; then
+ if [ -n "$JAVA_HOME" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ elif [ -x "$JAVA_HOME/jre/bin/java" ] ; then
+ JAVACMD="$JAVA_HOME/jre/bin/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ else
+ JAVACMD=`which java 2> /dev/null `
+ if [ -z "$JAVACMD" ] ; then
+ JAVACMD=java
+ fi
+ fi
+fi
+
+if [ ! -x "$JAVACMD" ] ; then
+ echo "Error: JAVA_HOME is not defined correctly."
+ echo " We cannot execute $JAVACMD"
+ exit 1
+fi
+
+# Build local classpath using just the launcher in non-rpm mode or
+# use the Jpackage helper in rpm mode with basic and default jars
+# specified in the ant.conf configuration. Because the launcher is
+# used, libraries linked in ANT_HOME/lib will also be included, but this
+# is discouraged as it is not java-version safe. A user should
+# request optional jars and their dependencies via the OPT_JAR_LIST
+# variable
+if $rpm_mode && [ -x /usr/bin/build-classpath ] ; then
+ LOCALCLASSPATH="$(/usr/bin/build-classpath ant ant-launcher jaxp_parser_impl
xml-commons-apis)"
+
+ # If no optional jars have been specified then build the default list
+ if [ -z "$OPT_JAR_LIST" ] ; then
+ for file in /etc/ant.d/*; do
+ if [ -f "$file" ]; then
+ case "$file" in
+ *~) ;;
+ *#*) ;;
+ *.rpmsave) ;;
+ *.rpmnew) ;;
+ *)
+ for dep in `cat "$file"`; do
+ case "$OPT_JAR_LIST" in
+ *"$dep"*) ;;
+ *) OPT_JAR_LIST="$OPT_JAR_LIST${OPT_JAR_LIST:+ }$dep"
+ esac
+ done
+ esac
+ fi
+ done
+ fi
+
+ # If the user requested to try to add some other jars to the classpath
+ if [ -n "$OPT_JAR_LIST" ] ; then
+ _OPTCLASSPATH="$(/usr/bin/build-classpath $OPT_JAR_LIST 2> /dev/null)"
+ if [ -n "$_OPTCLASSPATH" ] ; then
+ LOCALCLASSPATH="$LOCALCLASSPATH:$_OPTCLASSPATH"
+ fi
+ fi
+
+ # Explicitly add javac path to classpath, assume JAVA_HOME set
+ # properly in rpm mode
+ if [ -f "$JAVA_HOME/lib/tools.jar" ] ; then
+ LOCALCLASSPATH="$LOCALCLASSPATH:$JAVA_HOME/lib/tools.jar"
+ fi
+ if [ -f "$JAVA_HOME/lib/classes.zip" ] ; then
+ LOCALCLASSPATH="$LOCALCLASSPATH:$JAVA_HOME/lib/classes.zip"
+ fi
+
+ # if CLASSPATH_OVERRIDE env var is set, LOCALCLASSPATH will be
+ # user CLASSPATH first and ant-found jars after.
+ # In that case, the user CLASSPATH will override ant-found jars
+ #
+ # if CLASSPATH_OVERRIDE is not set, we'll have the normal behaviour
+ # with ant-found jars first and user CLASSPATH after
+ if [ -n "$CLASSPATH" ] ; then
+ # merge local and specified classpath
+ if [ -z "$LOCALCLASSPATH" ] ; then
+ LOCALCLASSPATH="$CLASSPATH"
+ elif [ -n "$CLASSPATH_OVERRIDE" ] ; then
+ LOCALCLASSPATH="$CLASSPATH:$LOCALCLASSPATH"
+ else
+ LOCALCLASSPATH="$LOCALCLASSPATH:$CLASSPATH"
+ fi
+
+ # remove class path from launcher -cp option
+ CLASSPATH=""
+ fi
+else
+ # not using rpm_mode; use launcher to determine classpaths
+ if [ -z "$LOCALCLASSPATH" ] ; then
+ LOCALCLASSPATH=$ANT_LIB/ant-launcher.jar
+ else
+ LOCALCLASSPATH=$ANT_LIB/ant-launcher.jar:$LOCALCLASSPATH
+ fi
+fi
+
+if [ -n "$JAVA_HOME" ] ; then
+ # OSX hack to make Ant work with jikes
+ if $darwin ; then
+ OSXHACK="${JAVA_HOME}/../Classes"
+ if [ -d "${OSXHACK}" ] ; then
+ for i in "${OSXHACK}"/*.jar
+ do
+ JIKESPATH="$JIKESPATH:$i"
+ done
+ fi
+ fi
+fi
+
+# Allow Jikes support (off by default)
+if $usejikes; then
+ ANT_OPTS="$ANT_OPTS -Dbuild.compiler=jikes"
+fi
+
+# For Cygwin, switch paths to appropriate format before running java
+# For PATHs convert to unix format first, then to windows format to ensure
+# both formats are supported. Probably this will fail on directories with ;
+# in the name in the path. Let's assume that paths containing ; are more
+# rare than windows style paths on cygwin.
+if $cygwin; then
+ if [ "$OS" = "Windows_NT" ] && cygpath -m .>/dev/null
2>/dev/null ; then
+ format=mixed
+ else
+ format=windows
+ fi
+ ANT_HOME=`cygpath --$format "$ANT_HOME"`
+ ANT_LIB=`cygpath --$format "$ANT_LIB"`
+ JAVA_HOME=`cygpath --$format "$JAVA_HOME"`
+ LCP_TEMP=`cygpath --path --unix "$LOCALCLASSPATH"`
+ LOCALCLASSPATH=`cygpath --path --$format "$LCP_TEMP"`
+ if [ -n "$CLASSPATH" ] ; then
+ CP_TEMP=`cygpath --path --unix "$CLASSPATH"`
+ CLASSPATH=`cygpath --path --$format "$CP_TEMP"`
+ fi
+ CYGHOME=`cygpath --$format "$HOME"`
+fi
+
+# Show script help if requested
+if $show_help ; then
+ echo $0 '[script options] [options] [target [target2 [target3] ..]]'
+ echo 'Script Options:'
+ echo ' --help, --h print this message and ant help'
+ echo ' --noconfig suppress sourcing of /etc/ant.conf,'
+ echo ' $HOME/.ant/ant.conf, and $HOME/.antrc'
+ echo ' configuration files'
+ echo ' --usejikes enable use of jikes by default, unless'
+ echo ' set explicitly in configuration files'
+ echo ' --execdebug print ant exec line generated by this'
+ echo ' launch script'
+ echo ' '
+fi
+# add a second backslash to variables terminated by a backslash under cygwin
+if $cygwin; then
+ case "$ANT_HOME" in
+ *\\ )
+ ANT_HOME="$ANT_HOME\\"
+ ;;
+ esac
+ case "$CYGHOME" in
+ *\\ )
+ CYGHOME="$CYGHOME\\"
+ ;;
+ esac
+ case "$JIKESPATH" in
+ *\\ )
+ JIKESPATH="$JIKESPATH\\"
+ ;;
+ esac
+ case "$LOCALCLASSPATH" in
+ *\\ )
+ LOCALCLASSPATH="$LOCALCLASSPATH\\"
+ ;;
+ esac
+ case "$CLASSPATH" in
+ *\\ )
+ CLASSPATH="$CLASSPATH\\"
+ ;;
+ esac
+fi
+# Execute ant using eval/exec to preserve spaces in paths,
+# java options, and ant args
+ant_sys_opts=
+if [ -n "$CYGHOME" ]; then
+ if [ -n "$JIKESPATH" ]; then
+ ant_sys_opts="-Djikes.class.path=\"$JIKESPATH\"
-Dcygwin.user.home=\"$CYGHOME\""
+ else
+ ant_sys_opts="-Dcygwin.user.home=\"$CYGHOME\""
+ fi
+else
+ if [ -n "$JIKESPATH" ]; then
+ ant_sys_opts="-Djikes.class.path=\"$JIKESPATH\""
+ fi
+fi
+ant_exec_command="exec \"$JAVACMD\" $ANT_OPTS -classpath
\"$LOCALCLASSPATH\" -Dant.home=\"$ANT_HOME\"
-Dant.library.dir=\"$ANT_LIB\" $ant_sys_opts
org.apache.tools.ant.launch.Launcher $ANT_ARGS -cp \"$CLASSPATH\"
$ant_exec_args"
+if $ant_exec_debug ; then
+ echo $ant_exec_command
+fi
+eval $ant_exec_command
Property changes on: modules/portlet/trunk/tools/bin/ant
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/tools/bin/ant.bat
===================================================================
--- modules/portlet/trunk/tools/bin/ant.bat (rev 0)
+++ modules/portlet/trunk/tools/bin/ant.bat 2007-08-17 15:29:49 UTC (rev 7981)
@@ -0,0 +1,226 @@
+@echo off
+
+REM Licensed to the Apache Software Foundation (ASF) under one or more
+REM contributor license agreements. See the NOTICE file distributed with
+REM this work for additional information regarding copyright ownership.
+REM The ASF licenses this file to You under the Apache License, Version 2.0
+REM (the "License"); you may not use this file except in compliance with
+REM the License. You may obtain a copy of the License at
+REM
+REM
http://www.apache.org/licenses/LICENSE-2.0
+REM
+REM Unless required by applicable law or agreed to in writing, software
+REM distributed under the License is distributed on an "AS IS" BASIS,
+REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+REM See the License for the specific language governing permissions and
+REM limitations under the License.
+
+REM This is an inordinately troublesome piece of code, particularly because it
+REM tries to work on both Win9x and WinNT-based systems. If we could abandon '9x
+REM support, things would be much easier, but sadly, it is not yet time.
+REM Be cautious about editing this, and only add WinNT specific stuff in code that
+REM only runs on WinNT.
+
+if "%HOME%"=="" goto homeDrivePathPre
+if exist "%HOME%\antrc_pre.bat" call "%HOME%\antrc_pre.bat"
+
+:homeDrivePathPre
+if "%HOMEDRIVE%%HOMEPATH%"=="" goto userProfilePre
+if "%HOMEDRIVE%%HOMEPATH%"=="%HOME%" goto userProfilePre
+if exist "%HOMEDRIVE%%HOMEPATH%\antrc_pre.bat" call
"%HOMEDRIVE%%HOMEPATH%\antrc_pre.bat"
+
+:userProfilePre
+if "%USERPROFILE%"=="" goto alpha
+if "%USERPROFILE%"=="%HOME%" goto alpha
+if "%USERPROFILE%"=="%HOMEDRIVE%%HOMEPATH%" goto alpha
+if exist "%USERPROFILE%\antrc_pre.bat" call
"%USERPROFILE%\antrc_pre.bat"
+
+:alpha
+
+if "%OS%"=="Windows_NT" @setlocal
+if "%OS%"=="WINNT" @setlocal
+
+if "%ANT_HOME%"=="" goto setDefaultAntHome
+
+:stripAntHome
+if not _%ANT_HOME:~-1%==_\ goto checkClasspath
+set ANT_HOME=%ANT_HOME:~0,-1%
+goto stripAntHome
+
+:setDefaultAntHome
+rem %~dp0 is expanded pathname of the current script under NT
+set ANT_HOME=%~dp0..
+
+:checkClasspath
+set _USE_CLASSPATH=yes
+rem CLASSPATH must not be used if it is equal to ""
+if "%CLASSPATH%"=="""" set _USE_CLASSPATH=no
+if "%CLASSPATH%"=="" set _USE_CLASSPATH=no
+
+rem Slurp the command line arguments. This loop allows for an unlimited number
+rem of arguments (up to the command line limit, anyway).
+set ANT_CMD_LINE_ARGS=%1
+if ""%1""=="""" goto doneStart
+shift
+:setupArgs
+if ""%1""=="""" goto doneStart
+if ""%1""==""-noclasspath"" goto clearclasspath
+set ANT_CMD_LINE_ARGS=%ANT_CMD_LINE_ARGS% %1
+shift
+goto setupArgs
+
+rem here is there is a -noclasspath in the options
+:clearclasspath
+set _USE_CLASSPATH=no
+shift
+goto setupArgs
+
+rem This label provides a place for the argument list loop to break out
+rem and for NT handling to skip to.
+
+:doneStart
+
+if _USE_CLASSPATH==no goto findAntHome
+
+:stripClasspath
+if not _%CLASSPATH:~-1%==_\ goto findAntHome
+set CLASSPATH=%CLASSPATH:~0,-1%
+goto stripClasspath
+
+:findAntHome
+rem find ANT_HOME if it does not exist due to either an invalid value passed
+rem by the user or the %0 problem on Windows 9x
+if exist "%ANT_HOME%\lib\ant.jar" goto checkJava
+
+rem check for ant in Program Files
+if not exist "%ProgramFiles%\ant" goto checkSystemDrive
+set ANT_HOME=%ProgramFiles%\ant
+goto checkJava
+
+:checkSystemDrive
+rem check for ant in root directory of system drive
+if not exist %SystemDrive%\ant\lib\ant.jar goto checkCDrive
+set ANT_HOME=%SystemDrive%\ant
+goto checkJava
+
+:checkCDrive
+rem check for ant in C:\ant for Win9X users
+if not exist C:\ant\lib\ant.jar goto noAntHome
+set ANT_HOME=C:\ant
+goto checkJava
+
+:noAntHome
+echo ANT_HOME is set incorrectly or ant could not be located. Please set ANT_HOME.
+goto end
+
+:checkJava
+set _JAVACMD=%JAVACMD%
+
+if "%JAVA_HOME%" == "" goto noJavaHome
+if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome
+if "%_JAVACMD%" == "" set _JAVACMD=%JAVA_HOME%\bin\java.exe
+goto checkJikes
+
+:noJavaHome
+if "%_JAVACMD%" == "" set _JAVACMD=java.exe
+
+:checkJikes
+if not "%JIKESPATH%"=="" goto runAntWithJikes
+
+:runAnt
+if "%_USE_CLASSPATH%"=="no" goto runAntNoClasspath
+:runAntWithClasspath
+"%_JAVACMD%" %ANT_OPTS% -classpath "%ANT_HOME%\lib\ant-launcher.jar"
"-Dant.home=%ANT_HOME%" org.apache.tools.ant.launch.Launcher %ANT_ARGS% -cp
"%CLASSPATH%" %ANT_CMD_LINE_ARGS%
+rem Check the error code of the Ant build
+if not "%OS%"=="Windows_NT" goto onError
+set ANT_ERROR=%ERRORLEVEL%
+goto end
+
+:runAntNoClasspath
+"%_JAVACMD%" %ANT_OPTS% -classpath "%ANT_HOME%\lib\ant-launcher.jar"
"-Dant.home=%ANT_HOME%" org.apache.tools.ant.launch.Launcher %ANT_ARGS%
%ANT_CMD_LINE_ARGS%
+rem Check the error code of the Ant build
+if not "%OS%"=="Windows_NT" goto onError
+set ANT_ERROR=%ERRORLEVEL%
+goto end
+
+:runAntWithJikes
+
+if not _%JIKESPATH:~-1%==_\ goto checkJikesAndClasspath
+set JIKESPATH=%JIKESPATH:~0,-1%
+goto runAntWithJikes
+
+:checkJikesAndClasspath
+
+if "%_USE_CLASSPATH%"=="no" goto runAntWithJikesNoClasspath
+
+:runAntWithJikesAndClasspath
+"%_JAVACMD%" %ANT_OPTS% -classpath "%ANT_HOME%\lib\ant-launcher.jar"
"-Dant.home=%ANT_HOME%" "-Djikes.class.path=%JIKESPATH%"
org.apache.tools.ant.launch.Launcher %ANT_ARGS% -cp "%CLASSPATH%"
%ANT_CMD_LINE_ARGS%
+rem Check the error code of the Ant build
+if not "%OS%"=="Windows_NT" goto onError
+set ANT_ERROR=%ERRORLEVEL%
+goto end
+
+:runAntWithJikesNoClasspath
+"%_JAVACMD%" %ANT_OPTS% -classpath "%ANT_HOME%\lib\ant-launcher.jar"
"-Dant.home=%ANT_HOME%" "-Djikes.class.path=%JIKESPATH%"
org.apache.tools.ant.launch.Launcher %ANT_ARGS% %ANT_CMD_LINE_ARGS%
+rem Check the error code of the Ant build
+if not "%OS%"=="Windows_NT" goto onError
+set ANT_ERROR=%ERRORLEVEL%
+goto end
+
+:onError
+rem Windows 9x way of checking the error code. It matches via brute force.
+for %%i in (1 10 100) do set err%%i=
+for %%i in (0 1 2) do if errorlevel %%i00 set err100=%%i
+if %err100%==2 goto onError200
+if %err100%==0 set err100=
+for %%i in (0 1 2 3 4 5 6 7 8 9) do if errorlevel %err100%%%i0 set err10=%%i
+if "%err100%"=="" if %err10%==0 set err10=
+:onError1
+for %%i in (0 1 2 3 4 5 6 7 8 9) do if errorlevel %err100%%err10%%%i set err1=%%i
+goto onErrorEnd
+:onError200
+for %%i in (0 1 2 3 4 5) do if errorlevel 2%%i0 set err10=%%i
+if err10==5 for %%i in (0 1 2 3 4 5) do if errorlevel 25%%i set err1=%%i
+if not err10==5 goto onError1
+:onErrorEnd
+set ANT_ERROR=%err100%%err10%%err1%
+for %%i in (1 10 100) do set err%%i=
+
+:end
+rem bug ID 32069: resetting an undefined env variable changes the errorlevel.
+if not "%_JAVACMD%"=="" set _JAVACMD=
+if not "%_ANT_CMD_LINE_ARGS%"=="" set ANT_CMD_LINE_ARGS=
+
+if "%ANT_ERROR%"=="0" goto mainEnd
+
+rem Set the return code if we are not in NT. We can only set
+rem a value of 1, but it's better than nothing.
+if not "%OS%"=="Windows_NT" echo 1 > nul | choice /n /c:1
+
+rem Set the ERRORLEVEL if we are running NT.
+if "%OS%"=="Windows_NT" color 00
+
+goto omega
+
+:mainEnd
+
+rem If there were no errors, we run the post script.
+if "%OS%"=="Windows_NT" @endlocal
+if "%OS%"=="WINNT" @endlocal
+
+if "%HOME%"=="" goto homeDrivePathPost
+if exist "%HOME%\antrc_post.bat" call "%HOME%\antrc_post.bat"
+
+:homeDrivePathPost
+if "%HOMEDRIVE%%HOMEPATH%"=="" goto userProfilePost
+if "%HOMEDRIVE%%HOMEPATH%"=="%HOME%" goto userProfilePost
+if exist "%HOMEDRIVE%%HOMEPATH%\antrc_post.bat" call
"%HOMEDRIVE%%HOMEPATH%\antrc_post.bat"
+
+:userProfilePost
+if "%USERPROFILE%"=="" goto omega
+if "%USERPROFILE%"=="%HOME%" goto omega
+if "%USERPROFILE%"=="%HOMEDRIVE%%HOMEPATH%" goto omega
+if exist "%USERPROFILE%\antrc_post.bat" call
"%USERPROFILE%\antrc_post.bat"
+
+:omega
+
Property changes on: modules/portlet/trunk/tools/bin/ant.bat
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/tools/bin/antRun
===================================================================
--- modules/portlet/trunk/tools/bin/antRun (rev 0)
+++ modules/portlet/trunk/tools/bin/antRun 2007-08-17 15:29:49 UTC (rev 7981)
@@ -0,0 +1,24 @@
+#! /bin/sh
+
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+#
http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Args: DIR command
+cd "$1"
+CMD="$2"
+shift
+shift
+
+exec "$CMD" "$@"
Property changes on: modules/portlet/trunk/tools/bin/antRun
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/tools/bin/antRun.bat
===================================================================
--- modules/portlet/trunk/tools/bin/antRun.bat (rev 0)
+++ modules/portlet/trunk/tools/bin/antRun.bat 2007-08-17 15:29:49 UTC (rev 7981)
@@ -0,0 +1,50 @@
+@echo off
+
+REM Licensed to the Apache Software Foundation (ASF) under one or more
+REM contributor license agreements. See the NOTICE file distributed with
+REM this work for additional information regarding copyright ownership.
+REM The ASF licenses this file to You under the Apache License, Version 2.0
+REM (the "License"); you may not use this file except in compliance with
+REM the License. You may obtain a copy of the License at
+REM
+REM
http://www.apache.org/licenses/LICENSE-2.0
+REM
+REM Unless required by applicable law or agreed to in writing, software
+REM distributed under the License is distributed on an "AS IS" BASIS,
+REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+REM See the License for the specific language governing permissions and
+REM limitations under the License.
+
+if "%OS%"=="Windows_NT" @setlocal
+if "%OS%"=="WINNT" @setlocal
+
+if ""%1""=="""" goto runCommand
+
+rem Change drive and directory to %1
+if "%OS%"=="Windows_NT" goto nt_cd
+if "%OS%"=="WINNT" goto nt_cd
+cd ""%1""
+goto end_cd
+:nt_cd
+cd /d ""%1""
+:end_cd
+shift
+
+rem Slurp the command line arguments. This loop allows for an unlimited number
+rem of arguments (up to the command line limit, anyway).
+set ANT_RUN_CMD=%1
+if ""%1""=="""" goto runCommand
+shift
+:loop
+if ""%1""=="""" goto runCommand
+set ANT_RUN_CMD=%ANT_RUN_CMD% %1
+shift
+goto loop
+
+:runCommand
+rem echo %ANT_RUN_CMD%
+%ANT_RUN_CMD%
+
+if "%OS%"=="Windows_NT" @endlocal
+if "%OS%"=="WINNT" @endlocal
+
Property changes on: modules/portlet/trunk/tools/bin/antRun.bat
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/tools/bin/antRun.pl
===================================================================
--- modules/portlet/trunk/tools/bin/antRun.pl (rev 0)
+++ modules/portlet/trunk/tools/bin/antRun.pl 2007-08-17 15:29:49 UTC (rev 7981)
@@ -0,0 +1,66 @@
+#!/usr/bin/perl
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+#
http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+#######################################################################
+#
+# antRun.pl
+#
+# wrapper script for invoking commands on a platform with Perl installed
+# this is akin to antRun.bat, and antRun the SH script
+#
+# created: 2001-10-18
+# author: Jeff Tulley jtulley(a)novell.com
+#######################################################################
+#be fussy about variables
+use strict;
+
+#turn warnings on during dev; generates a few spurious uninitialised var access warnings
+#use warnings;
+
+#and set $debug to 1 to turn on trace info (currently unused)
+my $debug=1;
+
+#######################################################################
+# change drive and directory to "%1"
+my $ANT_RUN_CMD = @ARGV[0];
+
+# assign current run command to "%2"
+chdir (@ARGV[0]) || die "Can't cd to $ARGV[0]: $!\n";
+if ($^O eq "NetWare") {
+ # There is a bug in Perl 5 on NetWare, where chdir does not
+ # do anything. On NetWare, the following path-prefixed form should
+ # always work. (afaict)
+ $ANT_RUN_CMD .= "/".@ARGV[1];
+}
+else {
+ $ANT_RUN_CMD = @ARGV[1];
+}
+
+# dispose of the first two arguments, leaving only the command's args.
+shift;
+shift;
+
+# run the command
+my $returnValue = system $ANT_RUN_CMD, @ARGV;
+if ($returnValue eq 0) {
+ exit 0;
+}
+else {
+ # only 0 and 1 are widely recognized as exit values
+ # so change the exit value to 1
+ exit 1;
+}
Property changes on: modules/portlet/trunk/tools/bin/antRun.pl
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/tools/bin/antx.bat
===================================================================
--- modules/portlet/trunk/tools/bin/antx.bat (rev 0)
+++ modules/portlet/trunk/tools/bin/antx.bat 2007-08-17 15:29:49 UTC (rev 7981)
@@ -0,0 +1,6 @@
+@echo off
+@setlocal
+set CLASSPATH=%~dp0..\lib\ant.jar;%CLASSPATH%
+java org.apache.tools.ant.Launcher %*
+rem java -jar %ANT_HOME%\lib\ant.jar org.apache.tools.ant.Launcher
+@endlocal
Property changes on: modules/portlet/trunk/tools/bin/antx.bat
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/tools/bin/build.bat
===================================================================
--- modules/portlet/trunk/tools/bin/build.bat (rev 0)
+++ modules/portlet/trunk/tools/bin/build.bat 2007-08-17 15:29:49 UTC (rev 7981)
@@ -0,0 +1,83 @@
+@echo off
+rem
+rem Invokes the 'ant.bat' script from the 'tools' module.
+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=.\
+
+rem If not started by the loader script then setup some values
+if x%TOOLS_ROOT%==x set TOOLS_ROOT=%DIRNAME%..
+if x%MODULE_ROOT%==x set MODULE_ROOT=.
+
+rem Setup ant variables
+set ANT=%TOOLS_ROOT%\bin\ant.bat
+set ANT_HOME=%TOOLS_ROOT%
+if x%ANT_LOGGER%==x set ANT_LOGGER=org.apache.tools.ant.NoBannerLogger
+set ANT_OPTIONS=%ANT_OPTIONS% -logger %ANT_LOGGER%
+
+rem Set the minimum and maximum VM heap size
+if x%JVM_MS%==x set JVM_MS=32m
+if x%JVM_MX%==x set JVM_MX=640m
+if x%ANT_OPTS%==x set ANT_OPTS=-Xms%JVM_MS% -Xmx%JVM_MX%
+
+rem Save the arguments to the script
+set ARGS=%*
+
+rem Ignore the user's classpath
+set CLASSPATH=
+
+rem Start'er up yo
+goto main
+
+:debug
+if not x%DEBUG%==x echo %PROGNAME%: %*
+goto :EOF
+
+:set-jaxp
+set ANT_OPTS=%ANT_OPTS% -Djavax.xml.parsers.DocumentBuilderFactory=%1
+set ANT_OPTS=%ANT_OPTS% -Djavax.xml.parsers.SAXParserFactory=%2
+goto :EOF
+
+:main
+call :debug PROGNAME=%PROGNAME%
+call :debug DIRNAME=%DIRNAME%
+call :debug TOOLS_ROOT=%TOOLS_ROOT%
+call :debug MODULE_ROOT=%MODULE_ROOT%
+
+rem Setup JAXP impl
+if x%JAXP%==x set JAXP=crimson
+if %JAXP%==crimson call :set-jaxp org.apache.crimson.jaxp.DocumentBuilderFactoryImpl
org.apache.crimson.jaxp.SAXParserFactoryImpl
+if %JAXP%==xerces call :set-jaxp org.apache.xerces.jaxp.DocumentBuilderFactoryImpl
org.apache.xerces.jaxp.SAXParserFactoryImpl
+rem could complain if invalid JAXP here, but for now forget it
+
+rem Check if the script exits
+if exist %ANT% goto :execute-ant & goto :EOF
+
+echo %PROGNAME%: *ERROR* The ant script does not exist:
+echo %PROGNAME%:
+echo %PROGNAME%: %ANT%
+echo %PROGNAME%:
+echo %PROGNAME%: Please make sure you have checked out the 'tools'
+echo %PROGNAME%: module and make sure it is up to date.
+goto :EOF
+
+:execute-ant
+call :debug Ant JVM options: %ANT_OPTS%
+
+echo Executing %ANT% %ANT_OPTIONS% %ARGS%
+call %ANT% %ANT_OPTIONS% %ARGS%
+
+if x%NOPAUSE%==x pause
+
+goto :EOF
Property changes on: modules/portlet/trunk/tools/bin/build.bat
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/tools/bin/build.sh
===================================================================
--- modules/portlet/trunk/tools/bin/build.sh (rev 0)
+++ modules/portlet/trunk/tools/bin/build.sh 2007-08-17 15:29:49 UTC (rev 7981)
@@ -0,0 +1,145 @@
+#!/bin/sh
+##
+## Sets up the basic environment for Ant and then starts it.
+##
+## @author Jason Dillon <jason(a)planet57.com>
+##
+
+# $Id: build.sh 21 2005-01-14 23:14:21Z vietj $
+
+# If we are running under Cygwin do some translation
+if [ ! -z "$COMSPEC" ]; then
+ temp=`cygpath --unix $0`
+else
+ temp="$0"
+fi
+PROGNAME=`basename $temp`
+DIRNAME=`dirname $temp`
+
+# If we have not been included from the loader script setup some values
+if [ "x$TOOLS_ROOT" = "x" ]; then
+ TOOLS_ROOT=`cd $DIRNAME/.. && pwd`
+fi
+if [ "x$MODULE_ROOT" = "x" ]; then
+ MODULE_ROOT=`pwd`;
+fi
+if [ "$CYGWIN" = true ]; then
+ TOOLS_ROOT=`cygpath --unix $TOOLS_ROOT`
+fi
+
+# Include common /bin/sh functions
+. "$TOOLS_ROOT/bin/common.shlib"
+
+# The minimum and maximum VM heap size
+xset JVM_MS="32m"
+xset JVM_MX="640m"
+
+# Detect which OS we are on
+check_os
+
+TOOLS_ROOT=`convertpath --unix $TOOLS_ROOT`
+MODULE_ROOT=`convertpath --unix $MODULE_ROOT`
+debug "TOOLS_ROOT: $TOOLS_ROOT"
+debug "MODULE_ROOT: $MODULE_ROOT"
+
+# Setup defaults
+xset MAX_FD "maximum"
+xset JAXP "crimson"
+
+# Ignore user's ANT_HOME if it is set
+if [ "x$ANT_HOME" != "x" ]; then
+ warn "Ignoring environment value for \$ANT_HOME"
+fi
+ANT_HOME=`convertpath --unix $TOOLS_ROOT`
+debug "Ant home: $ANT_HOME"
+
+# Use the color logger if requested
+if [ "x$ANT_COLOR" != "x" ]; then
+ xset ANT_LOGGER "org.apache.tools.ant.listener.AnsiColorLogger"
+else
+ xset ANT_LOGGER "org.apache.tools.ant.NoBannerLogger"
+fi
+debug "Using Ant logger: $ANT_LOGGER"
+
+# The nitty gritty dirty fluffy fluff
+main() {
+ # if there is a build config file. then source it
+ maybe_source "$MODULE_ROOT/build.conf" "$HOME/.build.conf"
+
+ # Increase the maximum file descriptors if we can
+ if [ $WIN32 = "false" ]; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ]; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" =
"max" ]; then
+ # use the system max
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ]; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query system maximum file descriptor limit:
$MAX_FD_LIMIT"
+ fi
+ fi
+
+ # Make sure we have one
+ ANT="$ANT_HOME/bin/ant"
+ if [ ! -x "$ANT" ]; then
+ die "Ant script is not executable: $ANT"
+ fi
+
+ # Specify the jaxp parser impls to use
+ debug "JAXP type: $JAXP"
+ case "$JAXP" in
+ crimson)
+ JAXP_DOM_FACTORY="org.apache.crimson.jaxp.DocumentBuilderFactoryImpl"
+ JAXP_SAX_FACTORY="org.apache.crimson.jaxp.SAXParserFactoryImpl"
+ ;;
+
+ xerces)
+ JAXP_DOM_FACTORY="org.apache.xerces.jaxp.DocumentBuilderFactoryImpl"
+ JAXP_SAX_FACTORY="org.apache.xerces.jaxp.SAXParserFactoryImpl"
+ ;;
+
+ *)
+ die "Unknown JAXP impl: $JAXP; define \$JAXP_DOM_FACTORY and
\$JAXP_SAX_FACTORY"
+ ;;
+ esac
+
+ # Set the options which ant will pass to its JVM
+ xset ANT_OPTS "-Xms$JVM_MS -Xmx$JVM_MX"
+
+ if [ "x$JAXP_DOM_FACTORY" != "x" ]; then
+ ANT_OPTS="$ANT_OPTS
-Djavax.xml.parsers.DocumentBuilderFactory=$JAXP_DOM_FACTORY"
+ fi
+ if [ "x$JAXP_SAX_FACTORY" != "x" ]; then
+ ANT_OPTS="$ANT_OPTS -Djavax.xml.parsers.SAXParserFactory=$JAXP_SAX_FACTORY"
+ fi
+ debug "Ant JVM options: $ANT_OPTS"
+
+ # Add some options to Ant
+ xset ANT_OPTIONS "-logger $ANT_LOGGER"
+
+ # Unset the classpath so it will not interfear
+ CLASSPATH=""
+
+ # Export some stuff for Ant
+ export ANT ANT_HOME ANT_OPTS CLASSPATH
+
+ # Change to the directory where the script lives so users are not forced
+ # to be in the same directory as build.xml
+ debug "Entering $MODULE_ROOT"
+ cd $MODULE_ROOT
+
+ notice "Executing: $ANT $ANT_OPTIONS $@"
+ if [ "x$TRACE" != "x" ]; then
+ exec /bin/sh -x $ANT $ANT_OPTIONS "$@"
+ else
+ exec $ANT $ANT_OPTIONS "$@"
+ fi
+}
+
+# Lets get ready to rumble!
+main "$@"
Property changes on: modules/portlet/trunk/tools/bin/build.sh
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/tools/bin/common.shlib
===================================================================
--- modules/portlet/trunk/tools/bin/common.shlib (rev 0)
+++ modules/portlet/trunk/tools/bin/common.shlib 2007-08-17 15:29:49 UTC (rev 7981)
@@ -0,0 +1,189 @@
+#!/bin/sh
+##
+## Definitions of common /bin/sh functions.
+##
+## @author Jason Dillon <jason(a)planet57.com>
+##
+
+# $Id: common.shlib 21 2005-01-14 23:14:21Z vietj $
+
+xset() # <var_name> <value>
+{
+ id=$1; shift; eval "value=\${$id}"
+ if [ "$value" = "" ]; then
+ eval "${id}=\"$*\""
+ fi
+}
+
+xset UNAME "uname"
+xset GAWK "gawk"
+xset EGREP "egrep"
+
+die() {
+ echo "${PROGNAME}: *FATAL* $*"
+ exit 1
+}
+
+warn() {
+ echo "${PROGNAME}: *WARNING* $*"
+}
+
+notice() {
+ echo "${PROGNAME}: $*"
+}
+
+debug() {
+ if [ "x$DEBUG" != "x" ]; then
+ echo "${PROGNAME}: $*"
+ fi
+}
+
+search() {
+ mode="$1"; shift
+ suffix="$1"; shift
+ search="$*"
+
+ for d in $search; do
+ x="$d/$suffix"
+ if [ $mode "$x" ]; then
+ # found a match
+ echo $d
+ break
+ fi
+ done
+}
+
+call () # <func_name>
+{
+ if [ -r "$RC" ]; then
+ temp=`$EGREP "^${1} \(\)" $RC`
+ if [ "$temp" != "" ]; then
+ eval $1
+ fi
+ fi
+}
+
+push () # <var_name> <list>
+{
+ _id=$1; _value=; shift
+ while [ "$1" != "" ]; do
+ eval "_value=$`echo $_id`"
+ eval "${_id}='`echo $_value` $1'"
+ shift
+ done
+ unset _id _value
+}
+
+prepend () # <var_name> <value>
+{
+ _id=$1; _value=; shift
+ eval "_value=$`echo $_id`"
+ eval "${_id}='${1}`echo $_value`'"
+ unset _id _value
+}
+
+append () # <var_name> <value>
+{
+ _id=$1; _value=; shift
+ eval "_value=$`echo $_id`"
+ eval "${_id}='`echo $_value`$1'"
+ unset _id _value
+}
+
+source () # <file_list>
+{
+ for file in "$*"; do
+ . $file
+ done
+}
+
+dump_var () # <var_name>
+{
+ _id=$1; _value=
+ eval "_value=$`echo $_id`"
+ echo "${_id}: $_value"
+}
+
+math () # <expression>
+{
+ echo `$GAWK "BEGIN { print $* }"`
+}
+
+pick () # <index> <list>
+{
+ c=1; i="$1"; shift
+ while [ "$c" -lt "$i" ]; do
+ c=`math $c + 1`
+ shift
+ done
+ echo "$1"
+}
+
+random () # <list>
+{
+ c=`echo $* | $WC -w`
+ i=`$GAWK "BEGIN{ srand(); print int( 1 + ( 1000000 * rand() ) % $c ) }"`
+ echo "`pick $i $*`"
+}
+
+check_arg () # <option_name> <expected_value>
+{
+ if [ "$2" = "" ]; then
+ die "option '$1' requires an additional argument"
+ fi
+}
+
+check_os()
+{
+ # OS specific support (must be 'true' or 'false').
+ CYGWIN=false
+ DARWIN=false
+ WIN32=false
+ export CYGWIN DARWIN WIN32
+
+ systype=`$UNAME`
+ debug "System Type: $systype"
+ if [ -z "$systype" ]; then
+ die "Unable to determine system type; uname return null output."
+ fi
+
+ case "$systype" in
+ CYGWIN*)
+ CYGWIN=true
+ WIN32=true
+ debug "Detected CYGWIN"
+ ;;
+
+ Darwin*)
+ DARWIN=true
+ debug "Detected DARWIN (MacOS X)"
+ ;;
+
+ *)
+ if [ ! -z "$COMSPEC" ]; then
+ WIN32=true
+ debug "Detected generic win32 environemnt"
+ fi
+ ;;
+ esac
+}
+
+maybe_source() {
+ for file in $*; do
+ if [ -f "$file" ]; then
+ . $file
+ fi
+ done
+}
+
+convertpath()
+{
+ options=$1; shift
+ temp=$*
+ if [ "$CYGWIN" = true ]; then
+ temp=`cygpath $options $temp`
+ fi
+ echo $temp
+}
+
+debug "Common functions loaded"
Property changes on: modules/portlet/trunk/tools/bin/common.shlib
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/tools/bin/complete-ant-cmd.pl
===================================================================
--- modules/portlet/trunk/tools/bin/complete-ant-cmd.pl (rev 0)
+++ modules/portlet/trunk/tools/bin/complete-ant-cmd.pl 2007-08-17 15:29:49 UTC (rev
7981)
@@ -0,0 +1,114 @@
+#!/usr/bin/perl
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+#
http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# A script to allow Bash or Z-Shell to complete an Ant command-line.
+#
+# To install for Bash 2.0 or better, add the following to ~/.bashrc:
+#
+# $ complete -C complete-ant-cmd ant build.sh
+#
+# To install for Z-Shell 2.5 or better, add the following to ~/.zshrc:
+#
+# function ant_complete () {
+# local args_line args
+# read -l args_line
+# set -A args $args_line
+# set -A reply $(COMP_LINE=$args_line complete-ant-cmd ${args[1]} $1)
+# }
+# compctl -K ant_complete ant build.sh
+#
+# @author Mike Williams <mikew(a)cortexebusiness.com.au>
+
+my $cmdLine = $ENV{'COMP_LINE'};
+my $antCmd = $ARGV[0];
+my $word = $ARGV[1];
+
+my @completions;
+if ($word =~ /^-/) {
+ list( restrict( $word, getArguments() ));
+} elsif ($cmdLine =~ /-(f|buildfile)\s+\S*$/) {
+ list( getBuildFiles($word) );
+} else {
+ list( restrict( $word, getTargets() ));
+}
+
+exit(0);
+
+sub list {
+ for (@_) {
+ print "$_\n";
+ }
+}
+
+sub restrict {
+ my ($word, @completions) = @_;
+ grep( /^\Q$word\E/, @completions );
+}
+
+sub getArguments {
+ qw(-buildfile -debug -emacs -f -find -help -listener -logfile
+ -logger -projecthelp -quiet -verbose -version);
+}
+
+
+sub getBuildFiles {
+ my ($word) = @_;
+ grep( /\.xml$/, glob( "$word*" ));
+}
+
+sub getTargets {
+
+ # Look for build-file
+ my $buildFile = 'build.xml';
+ if ($cmdLine =~ /-(f|buildfile)\s+(\S+)/) {
+ $buildFile = $2;
+ }
+ return () unless (-f $buildFile);
+
+ # Run "ant -projecthelp" to list targets. Keep a cache of results in a
+ # cache-file.
+ my $cacheFile = $buildFile;
+ $cacheFile =~ s|(.*/)?(.*)|${1}.ant-targets-${2}|;
+ if ((!-e $cacheFile) || (-M $buildFile) < (-M $cacheFile)) {
+ open( CACHE, '>'.$cacheFile ) || die "can\'t write
$cacheFile: $!\n";
+ open( HELP, "$antCmd -projecthelp -f '$buildFile'|" ) ||
return();
+ my %targets;
+ while( <HELP> ) {
+ if (/^\s+(\S+)/) {
+ $targets{$1}++;
+ }
+ }
+ my @targets = sort keys %targets;
+ for (@targets) { print CACHE "$_\n"; }
+ return @targets;
+ }
+
+ # Read the target-cache
+ open( CACHE, $cacheFile ) || die "can\'t read $cacheFile: $!\n";
+ my @targets;
+ while (<CACHE>) {
+ chop;
+ s/\r$//; # for Cygwin
+ push( @targets, $_ );
+ }
+ close( CACHE );
+ @targets;
+
+}
+
+
+
Property changes on: modules/portlet/trunk/tools/bin/complete-ant-cmd.pl
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/tools/bin/lcp.bat
===================================================================
--- modules/portlet/trunk/tools/bin/lcp.bat (rev 0)
+++ modules/portlet/trunk/tools/bin/lcp.bat 2007-08-17 15:29:49 UTC (rev 7981)
@@ -0,0 +1,31 @@
+REM
+REM Licensed to the Apache Software Foundation (ASF) under one or more
+REM contributor license agreements. See the NOTICE file distributed with
+REM this work for additional information regarding copyright ownership.
+REM The ASF licenses this file to You under the Apache License, Version 2.0
+REM (the "License"); you may not use this file except in compliance with
+REM the License. You may obtain a copy of the License at
+REM
+REM
http://www.apache.org/licenses/LICENSE-2.0
+REM
+REM Unless required by applicable law or agreed to in writing, software
+REM distributed under the License is distributed on an "AS IS" BASIS,
+REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+REM See the License for the specific language governing permissions and
+REM limitations under the License.
+REM
+REM
+
+set _CLASSPATHCOMPONENT=%1
+if ""%1""=="""" goto gotAllArgs
+shift
+
+:argCheck
+if ""%1""=="""" goto gotAllArgs
+set _CLASSPATHCOMPONENT=%_CLASSPATHCOMPONENT% %1
+shift
+goto argCheck
+
+:gotAllArgs
+set LOCALCLASSPATH=%LOCALCLASSPATH%;%_CLASSPATHCOMPONENT%
+
Property changes on: modules/portlet/trunk/tools/bin/lcp.bat
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/tools/bin/runant.pl
===================================================================
--- modules/portlet/trunk/tools/bin/runant.pl (rev 0)
+++ modules/portlet/trunk/tools/bin/runant.pl 2007-08-17 15:29:49 UTC (rev 7981)
@@ -0,0 +1,153 @@
+#!/usr/bin/perl
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+#
http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+#######################################################################
+#
+# runant.pl
+#
+# wrapper script for invoking ant in a platform with Perl installed
+# this may include cgi-bin invocation, which is considered somewhat daft.
+# (slo: that should be a separate file which can be derived from this
+# and returns the XML formatted output)
+#
+# the code is not totally portable due to classpath and directory splitting
+# issues. oops. (NB, use File::Spec::Functions will help and the code is
+# structured for the catfile() call, but because of perl version funnies
+# the code is not included.
+#
+# created: 2000-8-24
+# author: Steve Loughran steve_l(a)sourceforge.net
+#######################################################################
+#
+# Assumptions:
+#
+# - the "java" executable/script is on the command path
+# - ANT_HOME has been set
+# - target platform uses ":" as classpath separator or perl indicates it is
dos/win32
+# - target platform uses "/" as directory separator.
+
+#be fussy about variables
+use strict;
+
+#platform specifics (disabled)
+#use File::Spec::Functions;
+
+#turn warnings on during dev; generates a few spurious uninitialised var access warnings
+#use warnings;
+
+#and set $debug to 1 to turn on trace info
+my $debug=1;
+
+#######################################################################
+#
+# check to make sure environment is setup
+#
+
+my $HOME = $ENV{ANT_HOME};
+if ($HOME eq "")
+ {
+ die "\n\nANT_HOME *MUST* be set!\n\n";
+ }
+
+my $JAVACMD = $ENV{JAVACMD};
+$JAVACMD = "java" if $JAVACMD eq "";
+
+my $onnetware = 0;
+if ($^O eq "NetWare")
+{
+ $onnetware = 1;
+}
+
+my $oncygwin = ($^O eq "cygwin");
+
+#ISSUE: what java wants to split up classpath varies from platform to platform
+#and perl is not too hot at hinting which box it is on.
+#here I assume ":" 'cept on win32, dos, and netware. Add extra tests here
as needed.
+my $s=":";
+if(($^O eq "MSWin32") || ($^O eq "dos") || ($^O eq
"cygwin") ||
+ ($onnetware == 1))
+ {
+ $s=";";
+ }
+
+#build up standard classpath
+my $localpath = "$HOME/lib/ant-launcher.jar";
+#set JVM options and Ant arguments, if any
+my @ANT_OPTS=split(" ", $ENV{ANT_OPTS});
+my @ANT_ARGS=split(" ", $ENV{ANT_ARGS});
+
+#jikes
+if($ENV{JIKESPATH} ne "")
+ {
+ push @ANT_OPTS, "-Djikes.class.path=$ENV{JIKESPATH}";
+ }
+
+#construct arguments to java
+my @ARGS;
+push @ARGS, @ANT_OPTS;
+
+my $CYGHOME = "";
+
+my $classpath=$ENV{CLASSPATH};
+if ($oncygwin == 1) {
+ $localpath = `cygpath --path --windows $localpath`;
+ chomp ($localpath);
+ if (! $classpath eq "")
+ {
+ $classpath = `cygpath --path --windows "$classpath"`;
+ chomp ($classpath);
+ }
+ $HOME = `cygpath --path --windows $HOME`;
+ chomp ($HOME);
+ $CYGHOME = `cygpath --path --windows $ENV{HOME}`;
+ chomp ($CYGHOME);
+}
+push @ARGS, "-classpath", "$localpath";
+push @ARGS, "-Dant.home=$HOME";
+if ( ! $CYGHOME eq "" )
+{
+ push @ARGS, "-Dcygwin.user.home=\"$CYGHOME\""
+}
+push @ARGS, "org.apache.tools.ant.launch.Launcher", @ANT_ARGS;
+push @ARGS, @ARGV;
+if (! $classpath eq "")
+{
+ if ($onnetware == 1)
+ {
+ # make classpath literally $CLASSPATH
+ # this is to avoid pushing us over the 512 character limit
+ # even skip the ; - that is already in $localpath
+ push @ARGS, "-lib", "\$CLASSPATH";
+ }
+ else
+ {
+ push @ARGS, "-lib", "$classpath";
+ }
+}
+print "\n $JAVACMD @ARGS\n\n" if ($debug);
+
+my $returnValue = system $JAVACMD, @ARGS;
+if ($returnValue eq 0)
+ {
+ exit 0;
+ }
+else
+ {
+ # only 0 and 1 are widely recognized as exit values
+ # so change the exit value to 1
+ exit 1;
+ }
Property changes on: modules/portlet/trunk/tools/bin/runant.pl
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/tools/bin/runant.py
===================================================================
--- modules/portlet/trunk/tools/bin/runant.py (rev 0)
+++ modules/portlet/trunk/tools/bin/runant.py 2007-08-17 15:29:49 UTC (rev 7981)
@@ -0,0 +1,102 @@
+#!/usr/bin/python
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+#
http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+"""
+
+ runant.py
+
+ This script is a translation of the runant.pl written by Steve Loughran.
+ It runs ant with/out arguments, it should be quite portable (thanks to
+ the python os library)
+ This script has been tested with Python2.0/Win2K
+
+ created: 2001-04-11
+ author: Pierre Dittgen pierre.dittgen(a)criltelecom.com
+
+ Assumptions:
+
+ - the "java" executable/script is on the command path
+"""
+import os, os.path, string, sys
+
+# Change it to 1 to get extra debug information
+debug = 0
+
+#######################################################################
+
+# If ANT_HOME is not set default to script's parent directory
+if os.environ.has_key('ANT_HOME'):
+ ANT_HOME = os.environ['ANT_HOME']
+else:
+ ANT_HOME = os.path.dirname(os.path.dirname(os.path.abspath(sys.argv[0])))
+
+# set ANT_LIB location
+ANT_LIB = os.path.join(ANT_HOME, 'lib')
+
+# set JAVACMD (check variables JAVACMD and JAVA_HOME)
+JAVACMD = None
+if not os.environ.has_key('JAVACMD'):
+ if os.environ.has_key('JAVA_HOME'):
+ if not os.path.exists(os.environ['JAVA_HOME']):
+ print "Warning: JAVA_HOME is not defined correctly."
+ else:
+ JAVACMD = os.path.join(os.environ['JAVA_HOME'], 'bin',
'java')
+ else:
+ print "Warning: JAVA_HOME not set."
+else:
+ JAVACMD = os.environ['JAVACMD']
+if not JAVACMD:
+ JAVACMD = 'java'
+
+launcher_jar = os.path.join(ANT_LIB, 'ant-launcher.jar')
+if not os.path.exists(launcher_jar):
+ print 'Unable to locate ant-launcher.jar. Expected to find it in %s' % \
+ ANT_LIB
+
+# Build up standard classpath (LOCALCLASSPATH)
+LOCALCLASSPATH = launcher_jar
+if os.environ.has_key('LOCALCLASSPATH'):
+ LOCALCLASSPATH += os.pathsep + os.environ['LOCALCLASSPATH']
+
+ANT_OPTS = ""
+if os.environ.has_key('ANT_OPTS'):
+ ANT_OPTS = os.environ['ANT_OPTS']
+
+OPTS = ""
+if os.environ.has_key('JIKESPATH'):
+ OPTS = '-Djikes.class.path=\"%s\"' %
os.environ['JIKESPATH']
+
+ANT_ARGS = ""
+if os.environ.has_key('ANT_ARGS'):
+ ANT_ARGS = os.environ['ANT_ARGS']
+
+CLASSPATH = ""
+if os.environ.has_key('CLASSPATH'):
+ CLASSPATH = os.environ['CLASSPATH']
+
+# Builds the commandline
+cmdline = ('%s %s -classpath %s -Dant.home=%s %s ' + \
+ 'org.apache.tools.ant.launch.Launcher %s -lib %s %s') \
+ % (JAVACMD, ANT_OPTS, LOCALCLASSPATH, ANT_HOME, OPTS, ANT_ARGS, \
+ CLASSPATH, string.join(sys.argv[1:], ' '))
+
+if debug:
+ print '\n%s\n\n' % (cmdline)
+sys.stdout.flush()
+
+# Run the biniou!
+os.system(cmdline)
Property changes on: modules/portlet/trunk/tools/bin/runant.py
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/tools/bin/ubuild.bat
===================================================================
--- modules/portlet/trunk/tools/bin/ubuild.bat (rev 0)
+++ modules/portlet/trunk/tools/bin/ubuild.bat 2007-08-17 15:29:49 UTC (rev 7981)
@@ -0,0 +1,81 @@
+@echo off
+rem
+rem Invokes the 'build.sh' script from the 'tools' module with
+rem the ASH shell provided by the 'tools-win32' module.
+rem
+rem @author Jason Dillon <jason(a)planet57.com>
+rem
+
+rem $Id: ubuild.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=.\
+
+rem If not started by the loader script then setup some values
+if x%TOOLS_ROOT%==x set TOOLS_ROOT=%DIRNAME%..
+if x%MODULE_ROOT%==x set MODULE_ROOT=.
+
+set SHELL=%TOOLS_ROOT%\win32\ash.exe
+set SHELL_OPTS=
+if not x%TRACE%==x set SHELL_OPTS=-x
+
+set BUILD_SH=%TOOLS_ROOT%\bin\build.sh
+set FALLBACK_BUILD_BAT=%TOOLS_ROOT%\bin\fb-build.bat
+set ARGS=%*
+
+rem Setup the command search path to include our binaries
+set PATH=%TOOLS_ROOT%\win32;%TOOLS_ROOT%\bin;%PATH%
+
+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 MODULE_ROOT=%MODULE_ROOT%
+call :debug SHELL=%SHELL%
+call :debug PATH=%PATH%
+
+if exist %SHELL% goto :check-script & goto :EOF
+rem else fail, we can not go on (might consider just calling ant here
+rem %FALLBACK_BUILD_BAT%)
+
+echo %PROGNAME%: *ERROR* The command shell does not exist:
+echo %PROGNAME%:
+echo %PROGNAME%: %SHELL%
+echo %PROGNAME%:
+echo %PROGNAME%: Please make sure you have checked out the 'tools-win32'
+echo %PROGNAME%: module and make sure it is up to date.
+goto :EOF
+
+:check-script
+call :debug BUILD_SH=%BUILD_SH%
+if exist %BUILD_SH% goto :execute-shell & goto :EOF
+rem else fail, we can not go on
+
+echo %PROGNAME%: *ERROR* The target script does not exist:
+echo %PROGNAME%:
+echo %PROGNAME%: %BUILD_SH%
+echo %PROGNAME%:
+echo %PROGNAME%: Please make sure you have checked out the 'tools'
+echo %PROGNAME%: module and make sure it is up to date.
+goto :EOF
+
+:execute-shell
+call :debug Executing %SHELL% %SHELL_OPTS% %BUILD_SH% %ARGS%
+%SHELL% %SHELL_OPTS% %BUILD_SH% %ARGS%
+
+if x%NOPAUSE%==x pause
+
+goto :EOF
Property changes on: modules/portlet/trunk/tools/bin/ubuild.bat
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/tools/build.xml
===================================================================
--- modules/portlet/trunk/tools/build.xml (rev 0)
+++ modules/portlet/trunk/tools/build.xml 2007-08-17 15:29:49 UTC (rev 7981)
@@ -0,0 +1,163 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE project [
+ <!ENTITY buildmagic SYSTEM
"../tools/etc/buildfragments/buildmagic.ent">
+ <!ENTITY tools SYSTEM "../tools/etc/buildfragments/tools.ent">
+ <!ENTITY libraries SYSTEM "../thirdparty/libraries.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 6206 2007-02-11 00:33:46Z 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 thirdparty libraries -->
+ &libraries;
+ <path id="library.classpath">
+ <path refid="wutka.dtdparser.classpath"/>
+ </path>
+
+ <!-- Configure modules -->
+ <call target="configure-modules"/>
+ <path id="dependentmodule.classpath">
+ </path>
+
+ <!--+=======================================+-->
+ <!--| Override any default properties here. |-->
+ <!--+=======================================+-->
+
+ <!-- Configure defaults & build tools -->
+ <call target="configure-defaults"/>
+ <call target="configure-tools"/>
+
+ <!--+=======================================+-->
+ <!--| 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">
+ <!-- Add module specific elements here. -->
+ </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}"/>
+
+ <jar jarfile="${build.lib}/portal-tools-lib.jar">
+ <fileset dir="${build.classes}">
+ </fileset>
+ </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"/>
+
+ <target name="test" depends="init">
+ <java classname="org.jboss.portal.tools.dtd.Test">
+ <classpath>
+ <pathelement location="${build.classes}"/>
+ <path refid="library.classpath"/>
+ </classpath>
+ </java>
+ </target>
+
+</project>
Property changes on: modules/portlet/trunk/tools/build.xml
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/tools/etc/buildfragments/autoload.properties
===================================================================
--- modules/portlet/trunk/tools/etc/buildfragments/autoload.properties
(rev 0)
+++ modules/portlet/trunk/tools/etc/buildfragments/autoload.properties 2007-08-17 15:29:49
UTC (rev 7981)
@@ -0,0 +1,20 @@
+### ====================================================================== ###
+## ##
+## BuildMagic tasks which will be autoloaded. ##
+## ##
+### ====================================================================== ###
+
+### $Id: autoload.properties 21 2005-01-14 23:14:21Z vietj $ ###
+
+### Stuff that glues things together ###
+
+resolveproperties=org.jboss.tools.buildmagic.task.ResolveProperties
+resolver=org.jboss.tools.buildmagic.task.ResolveProperties
+propertyfilter=org.jboss.tools.buildmagic.task.PropertyFilter
+require=org.jboss.tools.buildmagic.task.Require
+call=org.jboss.tools.buildmagic.task.CallTarget
+
+### Project/Module tasks ###
+
+execmodules=org.jboss.tools.buildmagic.task.module.ExecuteModules
+moduleconfig=org.jboss.tools.buildmagic.task.module.ModuleConfig
Property changes on: modules/portlet/trunk/tools/etc/buildfragments/autoload.properties
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/tools/etc/buildfragments/buildmagic.ent
===================================================================
--- modules/portlet/trunk/tools/etc/buildfragments/buildmagic.ent
(rev 0)
+++ modules/portlet/trunk/tools/etc/buildfragments/buildmagic.ent 2007-08-17 15:29:49 UTC
(rev 7981)
@@ -0,0 +1,1124 @@
+<!-- $Id: buildmagic.ent 7028 2007-04-23 12:58:04Z julien(a)jboss.com $ -->
+
+<!-- ================================================================== -->
+<!-- Initialization -->
+<!-- ================================================================== -->
+
+<!-- Initialize the build system. -->
+<target name="_buildmagic:init" unless="init.disable">
+
+ <!-- Make sure we have the right version of Ant -->
+ <property name="buildmagic.ant.baseversion" value="1.5"/>
+
+ <!--
+ | Add new conditions for other supported Ant versions when they
+ | become avaialble.
+ -->
+
+ <condition property="buildmagic.ant.compatible">
+ <and>
+ <contains string="${ant.version}"
+ substring="Ant version ${buildmagic.ant.baseversion}"/>
+ </and>
+ </condition>
+
+ <!--fail unless="buildmagic.ant.compatible">
+
+ Unsupported Ant version:
+
+ ${ant.version}
+
+ Please install a version which is compatible with Ant ${buildmagic.ant.baseversion}.
+
+ </fail-->
+
+ <!-- JDK Detection -->
+ <available classname="java.lang.Void"
property="HAVE_JDK_1.1"/>
+ <available classname="java.lang.ThreadLocal"
property="HAVE_JDK_1.2"/>
+ <available classname="java.lang.StrictMath"
property="HAVE_JDK_1.3"/>
+ <available classname="java.lang.StackTraceElement"
property="HAVE_JDK_1.4"/>
+ <available classname="java.lang.Enum"
property="HAVE_JDK_1.5"/>
+
+ <!-- Setup the project environment. -->
+ <dirname property="project.root" file="${basedir}"/>
+ <property name="project.build"
value="${project.root}/build"/>
+ <property name="project.tools"
value="${project.root}/tools"/>
+ <property name="project.thirdparty"
value="${project.root}/thirdparty"/>
+
+ <!-- Setup the module environment. -->
+ <property name="module.root" value="${basedir}"/>
+ <property name="module.source" value="${module.root}/src"/>
+ <property name="module.output"
value="${module.root}/output"/>
+ <property name="module.tools" value="${module.root}/tools"/>
+ <property name="module.thirdparty"
value="${module.root}/thirdparty"/>
+
+ <!-- Load Buildmagic extention tasks. -->
+ <property name="buildmagic.local.classpath" value="."/>
+ <path id="buildmagic.task.classpath">
+ <fileset dir="${project.tools}/lib">
+ <include name="*"/>
+ </fileset>
+ <pathelement location="${project.tools}/lib"/>
+ <pathelement location="${project.tools}/etc"/>
+ <pathelement location="${project.tools}"/>
+ <pathelement path="${buildmagic.local.classpath}"/>
+ </path>
+ <taskdef file="${project.tools}/etc/buildfragments/autoload.properties"
+ classpathref="buildmagic.task.classpath"/>
+ <taskdef name="property"
classname="org.jboss.tools.buildmagic.task.Property"
+ classpathref="buildmagic.task.classpath"/>
+
+ <!-- Include user and project property overrides. -->
+ <call target="_buildmagic:init:module-local-properties">
+ <available file="${module.root}/etc/local.properties-example"
property="init.have-local-properties"/>
+ </call>
+ <property file="${module.root}/local.properties"/>
+ <call target="_buildmagic:init:project-local-properties">
+ <available file="${project.build}/etc/local.properties-example"
property="init.have-local-properties"/>
+ </call>
+ <property file="${project.build}/local.properties"/>
+ <property file="${user.home}/.buildmagic.properties"/>
+ <property file="${user.home}/.ant.properties"/>
+
+ <!-- Setup the JBoss environment -->
+ <property environment="env"/>
+
+ <!-- Define jboss home -->
+ <condition property="jboss.home" value="${env.JBOSS_HOME}">
+ <not>
+ <isset property="jboss.home"/>
+ </not>
+ </condition>
+
+ <!-- Setup the build.log -->
+ <call target="_buildmagic:init:buildlog"
unless="init-buildlog.disable"/>
+
+ <!-- Load common properties -->
+ <property
file="${project.tools}/etc/buildfragments/common.properties"/>
+
+ <!-- Load db properties -->
+ <loadproperties srcFile="${project.root}/build/etc/hsqldb.properties">
+ <filterchain>
+ <prefixlines prefix="hsqldb."/>
+ </filterchain>
+ </loadproperties>
+ <loadproperties srcFile="${project.root}/build/etc/mysql.properties">
+ <filterchain>
+ <prefixlines prefix="mysql."/>
+ </filterchain>
+ </loadproperties>
+ <loadproperties srcFile="${project.root}/build/etc/mysql5.properties">
+ <filterchain>
+ <prefixlines prefix="mysql5."/>
+ </filterchain>
+ </loadproperties>
+ <loadproperties srcFile="${project.root}/build/etc/oracle.properties">
+ <filterchain>
+ <prefixlines prefix="oracle."/>
+ </filterchain>
+ </loadproperties>
+ <loadproperties
srcFile="${project.root}/build/etc/postgresql.properties">
+ <filterchain>
+ <prefixlines prefix="postgresql."/>
+ </filterchain>
+ </loadproperties>
+ <loadproperties
srcFile="${project.root}/build/etc/sqlserver.properties">
+ <filterchain>
+ <prefixlines prefix="sqlserver."/>
+ </filterchain>
+ </loadproperties>
+
+ <!-- Do not continue if the database properties file does not exist -->
+ <condition property="database.properties.is.here">
+ <and>
+ <available
file="${project.root}/build/etc/${portal.database}.properties"/>
+ </and>
+ </condition>
+ <fail unless="database.properties.is.here">
+The database properties file is not present
+ </fail>
+
+ <!-- Load database specific properties -->
+ <property
file="${project.root}/build/etc/${portal.database}.properties"/>
+ <property name="hibernate.properties"
value="${project.root}/build/etc/${portal.database}.properties"/>
+
+ <!-- Load the junit extension -->
+ <path id="junit_.task.classpath">
+ <pathelement location="${project.tools}/lib/explode.jar"/>
+ </path>
+ <taskdef
+ name="junit_"
+ classname="org.jboss.portal.common.junit.ant.ConfigurableJUnitTask"
+ classpathref="junit_.task.classpath"/>
+
+ <!-- Setup the build timestamp & build identifer properties -->
+ <tstamp>
+ <format property="build.number" pattern="yyyyMMddHHmm"/>
+ <format property="YEAR" pattern="yyyy"/>
+ </tstamp>
+ <property name="build.id" value="${build.number}"/>
+
+ <!-- Invoke the configure task -->
+ <call target="configure" unless="configure.disable"/>
+
+ <!-- Set up default value of classpath for test drivers -->
+ <condition property="driver.path"
value="${hsqldb.hsqldb.lib}/hsqldb.jar">
+ <not>
+ <isset property="driver.path"/>
+ </not>
+ </condition>
+
+ <!-- Load common task properties -->
+ <property file="${project.tools}/etc/buildfragments/task.properties"/>
+
+ <property name="build-bypass.marker"
value="${module.output}/build-marker"/>
+
+ <!-- Install filters -->
+ <propertyfilter all="${buildmagic.propertyfilter.all}"/>
+
+ <call target="_buildmagic:init:show-environment"
if="init.verbose"/>
+
+ <!-- Finish up -->
+ <property name="init.disable" value="true"/>
+</target>
+
+<!-- Install the local.properties for the module example if it is there -->
+<target name="_buildmagic:init:module-local-properties">
+ <!-- Setup the module local.properties file as needed -->
+ <copy file="${module.root}/etc/local.properties-example"
+ tofile="${module.root}/local.properties"
filtering="yes"/>
+</target>
+
+<!-- Install the local.properties for the project example if it is there -->
+<target name="_buildmagic:init:project-local-properties">
+ <!-- Setup the project local.properties file as needed -->
+ <copy file="${project.build}/etc/local.properties-example"
+ tofile="${project.build}/local.properties"
filtering="yes"/>
+</target>
+
+<!-- Initialize the build.log -->
+<target name="_buildmagic:init:buildlog">
+ <property name="buildlog.level" value="info"/>
+ <record name="${basedir}/build.log" append="no"
loglevel="${buildlog.level}"/>
+ <property name="init-buildlog.disable" value="true"
system="true"/>
+</target>
+
+<!-- Show the running environment if -Dinit.verbose=true -->
+<target name="_buildmagic:init:show-environment">
+ <echo><![CDATA[
+project.root: ${project.root}
+module.root: ${module.root}
+user.home: ${user.home}
+build.compiler: ${build.compiler}
+java.home: ${java.home}
+java.class.path: ${java.class.path}
+java.version: ${java.version}
+java.vendor: ${java.vendor}
+java.vm.version: ${java.vm.version}
+java.vm.name: ${java.vm.name}
+java.vm.info: ${java.vm.info}
+os.name: ${os.name}
+os.arch: ${os.arch}
+os.version: ${os.version}
+]]></echo>
+</target>
+
+<!-- ================================================================== -->
+<!-- Build Bypass -->
+<!-- ================================================================== -->
+
+<target name="_buildmagic:build-bypass-checker"
depends="_buildmagic:init" unless="build-bypass.disabled">
+
+ <uptodate property="build-bypass.on"
targetfile="${build-bypass.marker}">
+ <srcfiles dir="${module.source}" includes="**/*"/>
+ <srcfiles dir="${module.root}"
includes="build.xml,local.properties"/>
+ <srcfiles dir="${project.root}"
includes="build/build.xml,build/local.properties"/>
+ </uptodate>
+
+</target>
+
+<target name="_buildmagic:build-bypass-notice"
if="build-bypass.on">
+ <echo>
+Build disabled because module is already built. To force the module
+to build define build-bypass.disabled=true.
+ </echo>
+</target>
+
+<target name="_buildmagic:build-bypass-check"
depends="_buildmagic:build-bypass-checker,
_buildmagic:build-bypass-notice"/>
+
+
+<!-- ================================================================== -->
+<!-- Module Pass-through Targets -->
+<!-- ================================================================== -->
+
+<!-- Invoke the 'all' on all configured modules -->
+<target name="_buildmagic:modules:all"
depends="_buildmagic:init">
+ <execmodules target="all"
+ modules="${modules}"
+ root="${project.root}/@MODULE@"
+ exportproperties="${executemodules.exportproperties}">
+ <before target="_module-@MODULE@-@TARGET@-prepare"/>
+ <header message="${executemodules.header}"/>
+ <footer message="${executemodules.footer}"/>
+ <after target="_module-@MODULE@-@TARGET@"/>
+ <property name="init.have-parent" value="true"/>
+ </execmodules>
+</target>
+
+<!-- Invoke the 'most' on all configured modules -->
+<target name="_buildmagic:modules:most"
depends="_buildmagic:init">
+ <execmodules target="most"
+ modules="${modules}"
+ root="${project.root}/@MODULE@"
+ exportproperties="${executemodules.exportproperties}">
+ <header message="${executemodules.header}"/>
+ <footer message="${executemodules.footer}"/>
+ <before target="_module-@MODULE@-@TARGET@-prepare"/>
+ <after target="_module-@MODULE@-@TARGET@"/>
+ <property name="init.have-parent" value="true"/>
+ </execmodules>
+</target>
+
+<!-- Invoke the 'main' on all configured modules -->
+<target name="_buildmagic:modules:main"
depends="_buildmagic:init">
+ <execmodules target="main"
+ modules="${modules}"
+ root="${project.root}/@MODULE@"
+ exportproperties="${executemodules.exportproperties}">
+ <header message="${executemodules.header}"/>
+ <footer message="${executemodules.footer}"/>
+ <before target="_module-@MODULE@-@TARGET@-prepare"/>
+ <after target="_module-@MODULE@-@TARGET@"/>
+ <property name="init.have-parent" value="true"/>
+ </execmodules>
+</target>
+
+<!-- Invoke the 'main' on all configured modules -->
+<target name="_buildmagic:modules:package-tests"
depends="_buildmagic:init">
+ <execmodules target="package-tests"
+ modules="${modules}"
+ root="${project.root}/@MODULE@"
+ exportproperties="${executemodules.exportproperties}">
+ <header message="${executemodules.header}"/>
+ <footer message="${executemodules.footer}"/>
+ <before target="_module-@MODULE@-@TARGET@-prepare"/>
+ <after target="_module-@MODULE@-@TARGET@"/>
+ <property name="init.have-parent" value="true"/>
+ </execmodules>
+</target>
+
+<!-- Invoke the 'release' on all configured modules -->
+<target name="_buildmagic:modules:release"
depends="_buildmagic:init">
+ <execmodules target="release"
+ modules="${modules}"
+ root="${project.root}/@MODULE@"
+ exportproperties="${executemodules.exportproperties}">
+ <before target="_module-@MODULE@-@TARGET@-prepare"/>
+ <header message="${executemodules.header}"/>
+ <footer message="${executemodules.footer}"/>
+ <after target="_module-@MODULE@-@TARGET@"/>
+ <property name="init.have-parent" value="true"/>
+ </execmodules>
+</target>
+
+<!-- Invoke the 'tests' on all configured modules -->
+<target name="_buildmagic:modules:tests"
depends="_buildmagic:init">
+ <execmodules target="tests"
+ modules="${modules}"
+ root="${project.root}/@MODULE@"
+ exportproperties="${executemodules.exportproperties}">
+ <before target="_module-@MODULE@-@TARGET@-prepare"/>
+ <header message="${executemodules.header}"/>
+ <footer message="${executemodules.footer}"/>
+ <after target="_module-@MODULE@-@TARGET@"/>
+ <property name="init.have-parent" value="true"/>
+ <property name="build.reports"
value="${project.root}/testsuite/output/reports"/>
+ </execmodules>
+</target>
+
+<!-- Invoke the 'clean' on all configured modules -->
+<target name="_buildmagic:modules:clean"
depends="_buildmagic:init">
+ <execmodules target="clean"
+ modules="${modules}"
+ root="${project.root}/@MODULE@">
+ <before target="_module-@MODULE@-@TARGET@-prepare"/>
+ <header message="${executemodules.header}"/>
+ <footer message="${executemodules.footer}"/>
+ <after target="_module-@MODULE@-@TARGET@"/>
+ <property name="init.have-parent" value="true"/>
+ </execmodules>
+</target>
+
+<!-- Invoke the 'clobber' on all configured modules -->
+<target name="_buildmagic:modules:clobber"
depends="_buildmagic:init">
+ <execmodules target="clobber"
+ modules="${modules}"
+ root="${project.root}/@MODULE@">
+ <before target="_module-@MODULE@-@TARGET@-prepare"/>
+ <header message="${executemodules.header}"/>
+ <footer message="${executemodules.footer}"/>
+ <after target="_module-@MODULE@-@TARGET@"/>
+ <property name="init.have-parent" value="true"/>
+ </execmodules>
+</target>
+
+<!-- ================================================================== -->
+<!-- Compile -->
+<!-- ================================================================== -->
+
+<!-- Compile all class files -->
+<target name="_default:compile-classes" depends="_buildmagic:init"
unless="compile.disable">
+ <mkdir dir="${build.classes}"/>
+
+ <!-- Hack, required to avoid duplicate javac targets -->
+ <mkdir dir="${build.gen.classes}"/>
+
+ <!-- Remove classes which depend on changed files, so they will rebuild. -->
+ <depend srcdir="${source.java}:${build.gen.classes}"
+ destdir="${build.classes}"
+ dump="${javac.depend.dump}"
+ closure="${javac.depend.closure}">
+ <include name="${javac.includes}"/>
+ <exclude name="${javac.excludes}"/>
+ </depend>
+
+ <javac destdir="${build.classes}"
+ optimize="${javac.optimize}"
+ target="${javac.target}"
+ debug="${javac.debug}"
+ source="${javac.source}"
+ depend="${javac.depend}"
+ verbose="${javac.verbose}"
+ deprecation="${javac.deprecation}"
+ includeAntRuntime="${javac.include.ant.runtime}"
+ includeJavaRuntime="${javac.include.java.runtime}"
+ failonerror="${javac.fail.onerror}">
+ <src path="${source.java}:${build.gen.classes}"/>
+ <classpath refid="javac.classpath"/>
+
+ <include name="${javac.includes}"/>
+ <exclude name="${javac.excludes}"/>
+ </javac>
+</target>
+
+<!-- Compile all module test class files -->
+<target name="_default:compile-test-classes"
depends="_buildmagic:init" unless="compile.disable">
+
+ <mkdir dir="${build.test}"/>
+
+ <!-- Hack, required to avoid duplicate javac targets -->
+ <mkdir dir="${build.gen.test}"/>
+
+ <!-- Remove classes which depend on changed files, so they will rebuild. -->
+ <depend srcdir="${source.test}:${build.gen.test}"
+ destdir="${build.test}"
+ dump="${javac.depend.dump}"
+ closure="${javac.depend.closure}">
+ <include name="${javac.includes}"/>
+ <exclude name="${javac.excludes}"/>
+ </depend>
+
+ <javac destdir="${build.test}"
+ optimize="${javac.optimize}"
+ target="${javac.target}"
+ debug="${javac.debug}"
+ depend="${javac.depend}"
+ verbose="${javac.verbose}"
+ deprecation="${javac.deprecation}"
+ includeAntRuntime="${javac.include.ant.runtime}"
+ includeJavaRuntime="${javac.include.java.runtime}"
+ failonerror="${javac.fail.onerror}">
+ <src path="${source.test}:${build.gen.test}"/>
+ <classpath>
+ <path refid="javac.classpath"/>
+ <pathelement location="${build.classes}"/>
+ </classpath>
+ <include name="${javac.includes}"/>
+ <exclude name="${javac.excludes}"/>
+ </javac>
+</target>
+
+<target name="_default:check-exists-etc">
+ <condition property="source.etc.exists">
+ <available file="${source.etc}" type="dir"/>
+ </condition>
+</target>
+
+<!-- Compile manifests -->
+<target name="_default:compile-etc" depends="_buildmagic:init,
_default:check-exists-etc" unless="compile.disable"
if="source.etc.exists">
+ <mkdir dir="${build.etc}"/>
+ <copy todir="${build.etc}" filtering="yes">
+ <fileset dir="${source.etc}">
+ <include name="**"/>
+ </fileset>
+ </copy>
+</target>
+
+<target name="_default:check-exists-resources">
+ <condition property="source.resources.exists">
+ <available file="${source.resources}" type="dir"/>
+ </condition>
+</target>
+
+<!-- Compile resource files -->
+<target name="_default:compile-resources" depends="_buildmagic:init,
_default:check-exists-resources" unless="compile.disable"
if="source.resources.exists">
+ <mkdir dir="${build.resources}"/>
+ <copy todir="${build.resources}" filtering="yes">
+ <fileset dir="${source.resources}">
+ <patternset refid="compile-resources.filter.pattern"/>
+ </fileset>
+ </copy>
+ <copy todir="${build.resources}" filtering="no">
+ <fileset dir="${source.resources}">
+ <patternset refid="compile-resources.pattern"/>
+ </fileset>
+ </copy>
+</target>
+
+<patternset id="compile-resources.filter.pattern">
+ <include name="**/*"/>
+</patternset>
+
+<patternset id="compile-resources.pattern">
+ <exclude name="INVALID_FILE_DOES_NOT_EXISTS"/>
+</patternset>
+
+<!-- Compile stylesheets files -->
+<target name="_default:compile-stylesheets"
depends="_buildmagic:init" unless="compile.disable">
+ <mkdir dir="${build.stylesheets}"/>
+ <copy todir="${build.stylesheets}" filtering="yes">
+ <fileset dir="${source.stylesheets}">
+ <include name="**/*"/>
+ </fileset>
+ </copy>
+</target>
+
+<!-- Compile bin scripts -->
+<target name="_default:compile-bin" depends="_buildmagic:init"
unless="compile.disable">
+ <mkdir dir="${build.bin}"/>
+ <copy todir="${build.bin}" filtering="yes">
+ <fileset dir="${source.bin}">
+ <include name="**/*"/>
+ </fileset>
+ </copy>
+
+ <call target="_default:fix-bin"/>
+</target>
+
+<target name="_default:fix-bin" depends="_buildmagic:init">
+ <fixcrlf srcdir="${build.bin}"
+ eol="lf" eof="remove"
+ includes="**/*.sh"/>
+
+ <fixcrlf srcdir="${build.bin}"
+ eol="crlf" eof="remove"
+ includes="**/*.bat, **/*.cmd"/>
+
+ <chmod perm="+x">
+ <fileset dir="${build.bin}">
+ <include name="**/*.sh"/>
+ </fileset>
+ </chmod>
+</target>
+
+<target name="_default:compile-web" depends="_buildmagic:init"
unless="compile.disable">
+ <mkdir dir="${build.web}"/>
+ <copy todir="${build.web}" filtering="yes">
+ <fileset dir="${source.web}">
+ <patternset refid="compile-web.filter.pattern"/>
+ </fileset>
+ </copy>
+ <copy todir="${build.web}" filtering="no">
+ <fileset dir="${source.web}">
+ <patternset refid="compile-web.pattern"/>
+ </fileset>
+ </copy>
+</target>
+
+<patternset id="compile-web.pattern">
+ <exclude name="INVALID_FILE_DOES_NOT_EXISTS"/>
+</patternset>
+
+<patternset id="compile-web.filter.pattern">
+ <include name="**/*"/>
+</patternset>
+
+<target name="_default:compile-checksums"
depends="_buildmagic:init" unless="compile.disable">
+ <checksum>
+ <fileset dir="${build.lib}">
+ <include name="*.jar"/>
+ <include name="*.zip"/>
+ </fileset>
+ </checksum>
+</target>
+
+<!-- Compile RMI stubs -->
+<target name="_default:compile-rmi" depends="_buildmagic:init"
unless="compile.disable">
+ <rmic base="${build.classes}"
+ verify="${rmic.verify}"
+ iiop="${rmic.iiop}"
+ iiopopts="${rmic.iiopops}"
+ idl="${rmic.idl}"
+ idlopts="${rmic.idlops}"
+ debug="${rmic.debug}"
+ stubVersion="${rmic.stubVersion}">
+ <classpath refid="javac.classpath"/>
+ <patternset refid="compile-rmi.pattern"/>
+ </rmic>
+</target>
+
+<patternset id="compile-rmi.pattern">
+ <exclude name="INVALID_FILE_DOES_NOT_EXISTS"/>
+</patternset>
+
+<!-- Compile ddl files for each database -->
+<target name="_default:compile-ddl" depends="_buildmagic:init"
unless="compile.disable">
+ <xslt
+ basedir="${build.resources}"
+ destdir="${build.resources}"
+ includes="*/setup.xml"
+ style="${jboss.nukes.root}/resources/setup-xml2ddl.xsl"
+ extension=".ddl"/>
+</target>
+
+<!-- ================================================================== -->
+<!-- Tests -->
+<!-- ================================================================== -->
+<!-- default test target. To test a module, include
+ <target name="tests" depends="_default:tests"/>
+ in the module build file-->
+
+ <target name="_default:tests" unless="tests.disable">
+ <echo message="build.reports: ${build.reports}"/>
+ <echo message="build.test: ${build.test}"/>
+
+ <mkdir dir="${build.test}"/>
+
+ <!-- Hack, required to avoid duplicate javac targets -->
+ <mkdir dir="${build.gen.test}"/>
+
+ <path id="tests.classpath">
+ <pathelement path="${classpath}"/>
+ <pathelement path="${local.classpath}"/>
+ <pathelement path="${project.tools}/lib/ant.jar"/>
+ <pathelement path="${project.tools}/lib/junit.jar"/>
+ <pathelement path="${project.tools}/lib/optional.jar"/>
+ <path refid="thirdparty.classpath"/>
+<!-- FIXME: Need to add at least log4j here, what else? -->
+ <path refid="apache.log4j.classpath"/>
+ </path>
+
+ <!--default value, reset earlier if desired-->
+ <property name="log4j.configuration"
value="file:${project.root}/testsuite/src/resources/log4j.xml"/>
+ <property name="test.pattern" value="**/*TestCase.class"/>
+ <echo message="test.pattern: ${test.pattern}"/>
+
+ <property name="jbosstest.data.dir"
location="${module.output}/data"/>
+ <echo message="jbosstest.data.dir: ${jbosstest.data.dir}"/>
+
+ <mkdir dir="${build.reports}"/>
+ <mkdir dir="${build.log}"/>
+ <junit dir="${module.output}"
+ printsummary="${junit.printsummary}"
+ haltonerror="${junit.haltonerror}"
+ haltonfailure="${junit.haltonfailure}"
+ fork="${junit.fork}"
+ timeout="${junit.timeout}"
+ jvm="${junit.jvm}">
+
+ <jvmarg value="${junit.jvm.options}"/>
+ <sysproperty key="build.log" value="${build.log}"/>
+ <sysproperty key="log4j.configuration"
value="${log4j.configuration}"/>
+ <sysproperty key="jbosstest.data.dir"
value="${jbosstest.data.dir}"/>
+
+ <classpath>
+ <pathelement location="${build.classes}"/>
+ <pathelement location="${build.test}"/>
+ <pathelement location="${build.resources}"/>
+ <path refid="tests.classpath"/>
+ </classpath>
+
+ <formatter type="xml"
usefile="${junit.formatter.usefile}"/>
+
+ <batchtest todir="${build.reports}"
+ haltonerror="${junit.batchtest.haltonerror}"
+ haltonfailure="${junit.batchtest.haltonfailure}"
+ fork="${junit.batchtest.fork}">
+
+ <fileset dir="${build.test}">
+ <include name="${test.pattern}"/>
+ </fileset>
+ </batchtest>
+ </junit>
+ </target>
+ <!-- end _default:tests-->
+
+ <macrodef name="execute-tests">
+ <element name="x-sysproperty" optional="true"/>
+ <element name="x-test"/>
+ <element name="x-classpath"/>
+ <sequential>
+ <property name="test.reports"
value="${module.output}/tests"/>
+ <echo><![CDATA[
+ build.reports=${build.reports}
+ test.reports=${test.reports}
+ module.output=${module.output}
+ driver.path=${driver.path}
+ junit.printsummary=${junit.printsummary}
+ junit.batchtest.haltonerror=${junit.batchtest.haltonerror}
+ junit.batchtest.haltonfailure=${junit.batchtest.haltonfailure}
+ junit.batchtest.fork=${junit.batchtest.fork}
+ junit.timeout=${junit.timeout}
+ junit.jvm=${junit.jvm}
+ junit.jvm.options=${junit.jvm.options}
+ junit.formatter.usefile=${junit.formatter.usefile}
+ ]]></echo>
+ <mkdir dir="${build.reports}"/>
+ <mkdir dir="${test.reports}"/>
+ <junit_
+ dir="${module.output}"
+ printsummary="${junit.printsummary}"
+ haltonerror="${junit.haltonerror}"
+ haltonfailure="${junit.haltonfailure}"
+ fork="${junit.fork}"
+ timeout="${junit.timeout}"
+ jvm="${junit.jvm}">
+ <formatter type="plain" usefile="false"/>
+ <formatter
+
classname="org.jboss.ant.taskdefs.XMLJUnitMultipleResultFormatter"
+ usefile="${junit.formatter.usefile}"
+ extension="${jboss-junit-configuration}.xml"/>
+ <sysproperty key="build.resources"
value="${build.resources}"/>
+ <sysproperty key="build.lib"
value="${build.lib}"/>
+ <!-- definition of the property for keeping results between configuration
-->
+ <sysproperty key="jboss-junit-configuration"
value="${jboss-junit-configuration}"/>
+ <x-sysproperty/>
+ <jvmarg value="${junit.jvm.options}"/>
+ <x-test/>
+ <classpath>
+ <path refid="jboss.test.classpath"/>
+ <pathelement path="${driver.path}"/>
+ <x-classpath/>
+ </classpath>
+ </junit_>
+ </sequential>
+ </macrodef>
+
+<!-- ================================================================== -->
+<!-- Documents -->
+<!-- ================================================================== -->
+
+<target name="_default:docs" description="Builds all
documentation."
+ depends="docs-api,
+ docs-todo"/>
+
+<!-- ======== -->
+<!-- JavaDocs -->
+<!-- ======== -->
+
+
+
+<target name="docs-javadocs-check" depends="_buildmagic:init">
+
+ <!-- if index.html is newer than the sources we are up to date -->
+ <uptodate property="docs-javadocs.disable"
+ targetfile="${build.api}/index.html">
+ <srcfiles dir="${source.java}" includes="**/*.java"/>
+ </uptodate>
+</target>
+<target name="docs-javadocs" depends="_buildmagic:init">
+ <call target="docs-javadocs_1_4" if="HAVE_JDK_1.4" />
+ <call target="docs-javadocs_1_3" unless="HAVE_JDK_1.4" />
+</target>
+ <!-- Generate Javadoc if we are out of date -->
+<target name="docs-javadocs_1_4"
+ depends="docs-javadocs-check"
+ unless="docs-javadocs.disable">
+
+ <mkdir dir="${build.api}"/>
+ <javadoc packagenames="${javadoc.packages}"
+ sourcepath="${source.classes}:${build.gen.classes}"
+ destdir="${build.api}"
+ classpathref="javadoc.classpath"
+ windowtitle="${javadoc.windowtitle}"
+ splitindex="${javadoc.splitindex}"
+ author="${javadoc.author}"
+ version="${javadoc.version}"
+ public="${javadoc.public}"
+ package="${javadoc.package}"
+ protected="${javadoc.protected}"
+ private="${javadoc.private}"
+ use="${javadoc.use}"
+ verbose="${javadoc.verbose}">
+ <doctitle><![CDATA[<h1>${module.Name} API
Documentation</h1>]]></doctitle>
+ <bottom><![CDATA[
+ <i>
+ <div align="center">
+ <font size="-1">Copyright © 2002 JBoss Group, LLC. All
Rights Reserved.</font>
+ </div>
+ </i>
+ ]]></bottom>
+
+ <!--
+ <link
href="http://java.sun.com/j2se/1.3/docs/api"/>
+ -->
+
+ <!-- Added links and tags by Yanik Crepeau <yanik(a)exScriptis.com> 2003-05-13
-->
+ <!--Thes tag declarations will shut down the Unknown tag warning during the
javadoc process -->
+ <link
href="http://java.sun.com/j2se/1.4.1/docs/api/"/>
+ <tag name="ejb.interface-method" description="ejb interface method
delcaration" enabled="false" />
+ <tag name="ejb.persistence" description="ejb persistence
declaration" enabled="false" />
+ <tag name="ejb.pk-field" description="ejb primary-key field
declaration" enabled="false" />
+ <tag name="ejb.pk" description="ejb" enabled="false"
/>
+ <tag name="ejb.bean" description="ejb"
enabled="false" />
+ <tag name="ejb.transaction" description="ejb"
enabled="false" />
+ <tag name="ejb.finder" description="ejb"
enabled="false" />
+ <tag name="ejb.relation" description="ejb"
enabled="false" />
+ <tag name="ejb.create-method" description="ejb"
enabled="false" />
+
+ <tag name="jboss.query" description="jboss"
enabled="false" />
+ <tag name="jboss.lazy-load-group" description="jboss"
enabled="false" />
+ <tag name="jboss.load-group" description="jboss"
enabled="false" />
+ <tag name="jboss.persistence" description="jboss"
enabled="false" />
+ <tag name="jboss.entity-command" description="jboss"
enabled="false" />
+ <tag name="jboss.method-attribute" description="jboss"
enabled="false" />
+ <tag name="jboss.relation" description="jboss"
enabled="false" />
+ <tag name="jboss.method-attribute" description="jboss"
enabled="false" />
+ <tag name="jboss.relation-read-ahead" description="jboss"
enabled="false" />
+ <tag name="jboss.relation-table" description="jboss"
enabled="false" />
+ <tag name="jboss.table-attribute" description="jboss"
enabled="false" />
+
+ <tag name="jmx.managed-attribute" description="jmx"
enabled="false" />
+ <tag name="jmx.managed-constructor" description="jmx"
enabled="false" />
+ <tag name="jboss.method-attributes" description="jboss"
enabled="false" />
+
+ </javadoc>
+</target>
+
+<target name="docs-javadocs_1_3"
+ depends="docs-javadocs-check"
+ unless="docs-javadocs.disable">
+
+ <mkdir dir="${build.api}"/>
+ <javadoc packagenames="${javadoc.packages}"
+ sourcepath="${source.classes}:${build.gen.classes}"
+ destdir="${build.api}"
+ classpathref="javadoc.classpath"
+ windowtitle="${javadoc.windowtitle}"
+ splitindex="${javadoc.splitindex}"
+ author="${javadoc.author}"
+ version="${javadoc.version}"
+ public="${javadoc.public}"
+ package="${javadoc.package}"
+ protected="${javadoc.protected}"
+ private="${javadoc.private}"
+ use="${javadoc.use}"
+ verbose="${javadoc.verbose}">
+ <doctitle><![CDATA[<h1>${module.Name} API
Documentation</h1>]]></doctitle>
+ <bottom><![CDATA[
+ <i>
+ <div align="center">
+ <font size="-1">Copyright © 2002 JBoss Group, LLC. All
Rights Reserved.</font>
+ </div>
+ </i>
+ ]]></bottom>
+
+ <!--
+ <link
href="http://java.sun.com/j2se/1.3/docs/api"/>
+ -->
+
+ </javadoc>
+</target>
+
+<target name="docs-api" depends="docs-javadocs"/>
+
+<target name="javadocs" depends="docs-javadocs"/>
+
+<!-- ========= -->
+<!-- TODO Docs -->
+<!-- ========= -->
+
+<target name="docs-todo-check" depends="_buildmagic:init">
+
+ <!-- if index.html is newer than the sources we are up to date -->
+ <uptodate property="docs-todo.disable"
+ targetfile="${build.todo}/index.html">
+ <srcfiles dir="${source.java}" includes="**/*.java"/>
+ </uptodate>
+ </target>
+
+ <!-- Generate TODO list from @todo tags -->
+ <target name="docs-todo"
+ depends="docs-todo-check"
+ unless="docs-todo.disable">
+
+ <mkdir dir="${build.todo}"/>
+ <todo destdir="${build.todo}">
+ <fileset dir="${source.java}">
+ <include name="**/*.java"/>
+ </fileset>
+
+ <info/>
+ </todo>
+</target>
+
+<target name="todo" depends="docs-todo"/>
+
+<!-- ============== -->
+<!-- JMX MBean Docs -->
+<!-- ============== -->
+
+<target name="jmx-docs" depends="_buildmagic:init">
+
+ <mkdir dir="${build.jmx-doc}"/>
+ <jmxdoclet destdir="${build.jmx-doc}"
+ force="false"
+ excludedtags="@version,@author">
+ <fileset dir="${source.java}">
+ <include name="**/*.java"/>
+ </fileset>
+ <jbossXmlDoc/>
+ </jmxdoclet>
+
+</target>
+
+<!-- Generate the plain HTML jmx docs -->
+<target name="docs-jmx-html-plain" depends="jmx-docs">
+
+ <!-- Force the use of SAXON XSLT -->
+ <property system="true"
+ name="javax.xml.transform.TransformerFactory"
+ value="com.icl.saxon.TransformerFactoryImpl"/>
+
+ <mkdir dir="${build.jmx-api}"/>
+ <style style="${project.thirdparty}/oasis/docbook-xsl/html/docbook.xsl"
+ processor="trax"
+ extension=".html"
+ basedir="${build.jmx-doc}"
+ destdir="${build.jmx-api}">
+ <include name="**/*.xml"/>
+ <param name="quiet"
expression="${oasis.docbook.xsl.chunker.quiet}"/>
+ <param name="base.dir"
expression="${build.jmx-api}${file.separator}"/>
+ <xmlcatalog>
+ <dtd
+ publicId="-//OASIS//DTD DocBook XML V4.1.2//EN"
+ location="${project.thirdparty}/oasis/docbook-xml/docbookx.dtd"/>
+ </xmlcatalog>
+ </style>
+
+</target>
+
+
+<!-- ================================================================== -->
+<!-- Cleaning -->
+<!-- ================================================================== -->
+
+<!-- Clean up all build output -->
+<target name="_default:clean"
+ description="Cleans up most generated files."
+ depends="_buildmagic:clean">
+</target>
+
+<!-- Clean up all generated files -->
+<target name="_default:clobber"
+ description="Cleans up all generated files."
+ depends="_buildmagic:clobber, clean">
+</target>
+
+<target name="rebuild" depends="clean,most"/>
+
+
+<!-- ================================================================== -->
+<!-- Misc. -->
+<!-- ================================================================== -->
+
+<target name="_default:main"
+ description="Executes the default target (most)."
+ depends="most"/>
+
+<target name="_default:all"
+ description="Builds everything."
+ depends="most,docs"/>
+
+<target name="_default:most"
+ description="Builds almost everything."
+ depends="output"/>
+
+<target name="_default:help"
+ description="Show this help message."
+ depends="_buildmagic:help:standard"/>
+
+
+
+
+<!-- ================================================================== -->
+<!-- Cleaning -->
+<!-- ================================================================== -->
+
+<!-- Clean up all build output -->
+<target name="_buildmagic:clean" depends="_buildmagic:init">
+ <delete dir="${module.output}"/>
+</target>
+
+<!-- Clean up all generated files -->
+<target name="_buildmagic:clobber" depends="_buildmagic:init">
+ <delete file="${module.root}/local.properties"/>
+
+ <!-- Try to stop the build log before we delete the file. -->
+ <record name="${module.root}/build.log" action="stop"/>
+
+ <!--
+ | This file may be opened still due and fail to be removed on win32
+ | systems, so lets just ignore those errors for now.
+ -->
+ <delete file="${module.root}/build.log" quiet="true"
failonerror="false"/>
+</target>
+
+
+<!-- ================================================================== -->
+<!-- Help -->
+<!-- ================================================================== -->
+
+<target name="_buildmagic:help:standard"
depends="_buildmagic:init">
+ <projecthelp taskname="help">
+ <header><![CDATA[
+ The ${module.Name} module.
+]]></header>
+ <footer><![CDATA[
+ -projecthelp for all targets
+ -help for full options
+]]></footer>
+ </projecthelp>
+</target>
+
+<target name="_buildmagic:help:build"
depends="_buildmagic:init">
+ <projecthelp taskname="help">
+ <header><![CDATA[
+ The ${module.Name} module.
+]]></header>
+ <footer><![CDATA[
+ -Dgroups=<group>[(,<group>)*] Specify the module groups.
+ -Dmodules=<module>[(,<module>)*] Specify the modules.
+ (overrides groups).
+ -projecthelp for all targets
+ -help for full options
+]]></footer>
+ </projecthelp>
+</target>
+
+<target name="configure-project"
unless="configure-project.disable">
+
+ <!-- Bits for building source archives -->
+ <patternset id="source.ignore">
+ <exclude name="**/output/**"/>
+ </patternset>
+ <patternset id="source.free">
+ <exclude name="tools/**"/>
+ <exclude name="thirdparty/**"/>
+ <include name="**"/>
+ </patternset>
+ <patternset id="source.external">
+ <include name="tools/**"/>
+ <include name="thirdparty/**"/>
+ </patternset>
+
+ <!-- The header and footer displayed during each module execution -->
+ <property name="executemodules.header"><![CDATA[
+ ==============================================================
+ ==
+ == Executing '@TARGET@' in module '@MODULE@'...
+ ==
+ ==]]></property>
+
+ <property name="executemodules.footer"><![CDATA[
+ ==
+ ==
+ == Finished '@TARGET@' in module '@MODULE@'.
+ ==
+ ==============================================================
+ ]]></property>
+
+ <property name="executemodules.exportproperties">
+ version.major,
+ version.minor,
+ version.revision,
+ version.tag,
+ version.name,
+ version.cvstag,
+
+ specification.title,
+ specification.version,
+ specification.vendor,
+
+ implementation.title,
+ implementation.version,
+ implementation.vendor,
+ implementation.vendor.id,
+ implementation.url
+ </property>
+
+ <!-- Show the module configuration -->
+ <echo>groups: ${groups}</echo>
+ <echo>modules: ${modules}</echo>
+
+ <property name="configure-project.disable" value="true"
system="true"/>
+
+</target>
+
+
+<!-- ================================================================== -->
+<!-- Release -->
+<!-- ================================================================== -->
+
+<target name="_buildmagic:release:zip"
depends="_buildmagic:init">
+ <zip zipfile="${module.output}/${release.id}.zip">
+ <fileset dir="${module.output}">
+ <include name="${release.id}/**"/>
+ </fileset>
+ </zip>
+</target>
+
+<target name="_buildmagic:release:tar"
depends="_buildmagic:init">
+ <tar tarfile="${module.output}/${release.id}.tar"
longfile="gnu"
+ basedir="${module.output}"
+ includes="${release.id}/**">
+ </tar>
+</target>
+
+<target name="_buildmagic:release:tgz"
depends="_buildmagic:release:tar">
+ <gzip src="${module.output}/${release.id}.tar"
+ zipfile="${module.output}/${release.id}.tgz"/>
+</target>
+
+
+<!-- ================================================================== -->
+<!-- Install -->
+<!-- ================================================================== -->
+
+<target name="_buildmagic:install:default"
depends="_buildmagic:init">
+ <!-- Copy the output directory to the install directory -->
+ <mkdir dir="${install.root}"/>
+ <copy todir="${install.root}" filtering="no">
+ <fileset dir="${module.output}">
+ <include name="**/*"/>
+ <exclude name="${install.id}/**"/>
+ </fileset>
+ </copy>
+</target>
+
+<!-- Configure deployment tasks -->
+<target name="_buildmagic:configure:deployment">
+ <path id="portal.task.classpath">
+ <pathelement location="${project.tools}/lib/ant.jar"/>
+ <pathelement location="${project.tools}/lib/explode.jar"/>
+ <pathelement
location="${project.tools}/lib/cargo-core-uberjar-0.8.jar"/>
+ </path>
+ <taskdef
+ name="deploy"
+ classname="org.jboss.portal.common.ant.Deploy"
+ classpathref="portal.task.classpath"/>
+ <taskdef
+ name="undeploy"
+ classname="org.jboss.portal.common.ant.Undeploy"
+ classpathref="portal.task.classpath"/>
+</target>
Property changes on: modules/portlet/trunk/tools/etc/buildfragments/buildmagic.ent
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/tools/etc/buildfragments/common.properties
===================================================================
--- modules/portlet/trunk/tools/etc/buildfragments/common.properties
(rev 0)
+++ modules/portlet/trunk/tools/etc/buildfragments/common.properties 2007-08-17 15:29:49
UTC (rev 7981)
@@ -0,0 +1,36 @@
+### ====================================================================== ###
+## ##
+## Copyright (c) 1998-2000 by Jason Dillon <jason(a)planet57.com> ##
+## ##
+## This file is part of BuildMagic; an extension to Ant. ##
+## ##
+## This library 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 of the ##
+## License, or (at your option) any later version. ##
+## ##
+## This library 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. ##
+## ##
+### ====================================================================== ###
+## ##
+## Common Properties ##
+## ##
+### ====================================================================== ###
+
+### $Id: common.properties 21 2005-01-14 23:14:21Z vietj $ ###
+
+buildmagic.resolveproperties.force=false
+buildmagic.propertyfilter.all=true
+
+### Jython Support ###
+
+true=1
+false=0
+
+### Misc ###
+
+/=${file.separator}
+sun.boot.classpath=${sun.boot.class.path}
Property changes on: modules/portlet/trunk/tools/etc/buildfragments/common.properties
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/tools/etc/buildfragments/defaults.ent
===================================================================
--- modules/portlet/trunk/tools/etc/buildfragments/defaults.ent
(rev 0)
+++ modules/portlet/trunk/tools/etc/buildfragments/defaults.ent 2007-08-17 15:29:49 UTC
(rev 7981)
@@ -0,0 +1,150 @@
+<!-- $Id: defaults.ent 6209 2007-02-11 13:25:59Z bdaw $ -->
+
+<target name="configure-defaults"
unless="configure-defaults.disable">
+
+ <!-- =============== -->
+ <!-- Module defaults -->
+ <!-- =============== -->
+
+ <basename property="module.name" file="${basedir}"/>
+ <property name="module.Name" value="${ant.project.name}"/>
+
+ <property name="version.major" value="2"/>
+ <property name="version.minor" value="4"/>
+ <property name="version.revision" value="0"/>
+ <property name="version.tag" value="BETA2"/>
+ <property name="version.name" value="Devil"/>
+ <property name="module.version"
value="${version.major}.${version.minor}.${version.revision}${version.tag}"/>
+
+ <!-- This must be set to the CVS tag for any release -->
+ <property name="version.cvstag" value="JBoss_4_0_0_DR3"/>
+
+ <!-- Manifest version info -->
+ <property name="specification.title" value="JBoss"/>
+ <property name="specification.version"
value="${version.major}.${version.minor}"/>
+ <property name="specification.vendor" value="JBoss Group, LLC
(
http://jboss.org)"/>
+
+ <property name="implementation.title" value="JBoss
[${version.name}]"/>
+ <property name="implementation.url"
value="http://jboss.org"/>
+ <property name="implementation.version"
+
value="${version.major}.${version.minor}.${version.revision}${version.tag} (build:
CVSTag=${version.cvstag} date=${build.id})"/>
+ <property name="implementation.vendor" value="JBoss Group,
LLC"/>
+ <property name="implementation.vendor.id"
value="${implementation.url}"/>
+
+
+ <!-- ========= -->
+ <!-- Locations -->
+ <!-- ========= -->
+
+ <!-- Where source files live -->
+ <property name="source.classes"
value="${module.source}/main"/>
+ <property name="source.docs" value="${module.source}/docs"/>
+ <property name="source.etc" value="${module.source}/etc"/>
+ <property name="source.examples"
value="${module.source}/examples"/>
+ <property name="source.bin" value="${module.source}/bin"/>
+ <property name="source.resources"
value="${module.source}/resources"/>
+ <property name="source.stylesheets"
value="${module.source}/stylesheets"/>
+ <property name="source.web" value="${module.source}/web"/>
+ <property name="source.test" value="${module.source}/test"/>
+
+ <!-- Where build generated files will go -->
+ <property name="build.api" value="${module.output}/api"/>
+ <property name="build.bin" value="${module.output}/bin"/>
+ <property name="build.classes"
value="${module.output}/classes"/>
+ <property name="build.docs" value="${module.output}/docs"/>
+ <property name="build.stylesheets"
value="${module.output}/stylesheets"/>
+ <property name="build.etc" value="${module.output}/etc"/>
+ <property name="build.examples"
value="${module.output}/examples"/>
+ <property name="build.gen" value="${module.output}/gen"/>
+ <property name="build.gen.classes"
value="${build.gen}/classes"/>
+ <property name="build.jmx-api"
value="${module.output}/jmx-api"/>
+ <property name="build.jmx-doc"
value="${module.output}/jmx-doc"/>
+ <property name="build.lib" value="${module.output}/lib"/>
+ <property name="build.deploy"
value="${module.output}/deploy"/>
+ <property name="build.reports"
value="${module.output}/reports"/>
+ <property name="build.resources"
value="${module.output}/resources"/>
+ <property name="build.todo" value="${module.output}/todo"/>
+ <property name="build.web" value="${module.output}/web"/>
+ <property name="build.log" value="${module.output}/log"/>
+ <property name="build.cache"
value="${module.output}/cache"/>
+ <property name="build.test" value="${module.output}/test"/>
+ <property name="build.gen.test" value="${build.gen}/test"/>
+
+ <!-- Legacy -->
+ <property name="build.metadata"
value="${module.output}/metadata"/>
+ <property name="build.gen-src"
value="${build.gen.classes}"/>
+ <property name="source.java" value="${source.classes}"/>
+ <property name="source.metadata"
value="${module.source}/metadata"/>
+
+ <!-- Install/Release structure -->
+ <property name="install.id"
value="${module.name}-${module.version}"/>
+ <property name="release.id" value="${install.id}"/>
+ <property name="install.root"
value="${module.output}/${install.id}"/>
+
+ <property name="install.docs" value="${install.root}/docs"/>
+ <property name="install.api" value="${install.docs}/api"/>
+ <property name="install.jmx-api"
value="${install.docs}/jmx-api"/>
+ <property name="install.todo" value="${install.docs}/todo"/>
+ <property name="install.examples"
value="${install.docs}/examples"/>
+ <property name="install.dtd" value="${install.docs}/dtd"/>
+ <property name="install.bin" value="${install.root}/bin"/>
+ <property name="install.etc" value="${install.root}/etc"/>
+ <property name="install.client"
value="${install.root}/client"/>
+ <property name="install.lib" value="${install.root}/lib"/>
+ <property name="install.tools"
value="${install.root}/tools"/>
+ <property name="install.tools.xdoclet"
value="${install.tools}/xdoclet"/>
+
+
+ <!-- ============= -->
+ <!-- Task defaults -->
+ <!-- ============= -->
+
+ <property name="xdoclet.mergedir"
value="${project.tools}/etc/xdoclet/templates"/>
+
+ <!-- Access to environment variables -->
+ <property environment="env"/>
+
+ <!-- The combined thirdparty classpath -->
+ <path id="thirdparty.classpath">
+ <path refid="library.classpath"/>
+ <path refid="dependentmodule.classpath"/>
+ </path>
+
+ <property name="jar.update" value="true"/>
+ <property name="jar.index" value="true"/>
+
+ <property name="javac.depend.dump" value="true"/>
+ <property name="javac.depend.closure" value="false"/>
+ <property name="javac.depend.cachedir"
value="${build.cache}/depends"/>
+
+
+ <property name="javac.source" value="1.4"/>
+ <property name="javac.target" value="1.4"/>
+ <property name="rmic.stubVersion" value="1.2"/>
+
+ <!-- classpath and local.classpath must have a value using with a path -->
+ <property name="classpath" value=""/>
+ <property name="local.classpath" value=""/>
+
+ <!-- The classpath required to build classes. -->
+ <path id="javac.classpath">
+ <pathelement path="${classpath}"/>
+ <pathelement path="${local.classpath}"/>
+ <path refid="thirdparty.classpath"/>
+ </path>
+
+ <!-- The classpath required to build javadocs. -->
+ <path id="javadoc.classpath">
+ <path refid="javac.classpath"/>
+ </path>
+
+
+ <!-- Packages to include when generating api documentation -->
+ <property name="javadoc.packages" value="org.jboss.*"/>
+
+ <!-- Override JUnit defaults -->
+ <property name="junit.timeout" value="1800000"/> <!-- 30
minutes -->
+ <property name="junit.batchtest.todir"
value="${build.reports}"/>
+ <property name="junit.jvm.options" value="-Ddummy"/>
+
+</target>
Property changes on: modules/portlet/trunk/tools/etc/buildfragments/defaults.ent
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/tools/etc/buildfragments/modules.ent
===================================================================
--- modules/portlet/trunk/tools/etc/buildfragments/modules.ent
(rev 0)
+++ modules/portlet/trunk/tools/etc/buildfragments/modules.ent 2007-08-17 15:29:49 UTC
(rev 7981)
@@ -0,0 +1,37 @@
+<!-- $Id: modules.ent 7727 2007-07-11 21:52:16Z thomas.heute(a)jboss.com $ -->
+
+<target name="configure-modules"
unless="configure-modules.disabled">
+
+ <!-- api -->
+ <property name="jboss.portal-portlet-jsr168api.root"
value="${project.root}/jsr168api/output"/>
+ <property name="jboss.portal-portlet-jsr168api.lib"
value="${jboss.portal-portlet-jsr168api.root}/lib"/>
+ <path id="jboss.portal-portlet-jsr168api.classpath">
+ <pathelement
path="${jboss.portal-portlet-jsr168api.lib}/portal-portlet-jsr168api-lib.jar"/>
+ </path>
+
+ <!-- portlet -->
+ <property name="jboss.portal-portlet.root"
value="${project.root}/portlet/output"/>
+ <property name="jboss.portal-portlet.lib"
value="${jboss.portal-portlet.root}/lib"/>
+ <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-test-framework-lib.jar"/>
+ </path>
+
+ <!-- portlet-federation -->
+ <property name="jboss.portal-portlet-federation.root"
value="${project.root}/federation/output"/>
+ <property name="jboss.portal-portlet-federation.lib"
value="${jboss.portal-portlet-federation.root}/lib"/>
+ <path id="jboss.portal-portlet-federation.classpath">
+ <pathelement
path="${jboss.portlet-federation.lib}/portal-portlet-federation-lib.jar"/>
+ </path>
+
+ <!-- bridge -->
+<!--
+ <property name="jboss.portal-bridge.root"
value="${project.root}/bridge/output"/>
+ <property name="jboss.portal-bridge.lib"
value="${jboss.portal-bridge.root}/lib"/>
+ <path id="jboss.portal-bridge.classpath">
+ <pathelement
path="${jboss.portal-bridge.lib}/portal-bridge-lib.jar"/>
+ </path>
+-->
+
+</target>
Property changes on: modules/portlet/trunk/tools/etc/buildfragments/modules.ent
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/tools/etc/buildfragments/targets.ent
===================================================================
--- modules/portlet/trunk/tools/etc/buildfragments/targets.ent
(rev 0)
+++ modules/portlet/trunk/tools/etc/buildfragments/targets.ent 2007-08-17 15:29:49 UTC
(rev 7981)
@@ -0,0 +1,149 @@
+<!-- $Id: targets.ent 2946 2006-06-26 20:07:31Z rgenova $ -->
+
+<!-- ================================================================== -->
+<!-- Initialization -->
+<!-- ================================================================== -->
+
+<!--
+ | Initialize the build system. Must depend on '_buildmagic:init'.
+ | Other targets should depend on 'init' or things will mysteriously fail.
+ -->
+
+<target name="_default:init" unless="init.disable"
depends="_buildmagic:init">
+ <available property="source.resources.exists"
+ file="${source.resources}"
+ type="dir"
+ />
+ <available property="source.etc.exists"
+ file="${source.etc}"
+ type="dir"
+ />
+</target>
+
+
+
+
+
+
+<!-- ================================================================== -->
+<!-- Install & Release -->
+<!-- ================================================================== -->
+
+<!--
+ | These are almost never overriden, so no need to force module build.xml
+ | to define them.
+ -->
+
+<target name="release-zip"
+ description="Builds a ZIP distribution."
+ depends="_buildmagic:release:zip"/>
+
+<target name="release-tar"
+ description="Builds a TAR distribution."
+ depends="_buildmagic:release:tar"/>
+
+<target name="release-tgz"
+ description="Builds a TAR-GZ distribution."
+ depends="_buildmagic:release:tgz"/>
+
+<target name="release-all"
+ description="Builds a distribution for each archive type."
+ depends="release-zip, release-tgz"/>
+
+
+ <!-- ================================================================== -->
+ <!-- Project (build module) Targets -->
+ <!-- ================================================================== -->
+
+<!-- jason: this needs to be cleaned up -->
+
+ <!-- ================================================================== -->
+ <!-- Module Pass-through Targets -->
+ <!-- ================================================================== -->
+
+ <!--
+ | These targets will execute all configured modules with the specified
+ | target.
+ -->
+
+ <target name="modules-all"
depends="_buildmagic:modules:all"/>
+ <target name="modules-most"
depends="_buildmagic:modules:most"/>
+ <target name="modules-main"
depends="_buildmagic:modules:main"/>
+ <target name="modules-release"
depends="_buildmagic:modules:release"/>
+ <target name="modules-tests"
depends="_buildmagic:modules:tests"/>
+ <target name="modules-clean"
depends="_buildmagic:modules:clean"/>
+ <target name="modules-clobber"
depends="_buildmagic:modules:clobber"/>
+
+
+
+
+ <!-- ================================================================== -->
+ <!-- Source Archives -->
+ <!-- ================================================================== -->
+
+ <target name="source-free-zip" depends="_default:init"
+ description="Builds a ZIP free source distribution.">
+ <mkdir dir="${module.output}"/>
+ <zip zipfile="${module.output}/${release.id}-free-src.zip">
+ <fileset dir="${project.root}">
+ <patternset refid="source.ignore"/>
+ <patternset refid="source.free"/>
+ </fileset>
+ </zip>
+ </target>
+
+ <target name="source-external-zip" depends="_default:init"
+ description="Builds a ZIP external source distribution.">
+ <mkdir dir="${module.output}"/>
+ <zip zipfile="${module.output}/${release.id}-external-src.zip">
+ <fileset dir="${project.root}">
+ <patternset refid="source.ignore"/>
+ <patternset refid="source.external"/>
+ </fileset>
+ </zip>
+ </target>
+
+ <target name="source-zip" depends="source-free-zip,
source-external-zip"
+ description="Builds a ZIP source distribution."/>
+
+ <target name="source-free-tar" depends="_default:init"
+ description="Builds a TAR free source distribution.">
+ <mkdir dir="${module.output}"/>
+ <tar tarfile="${module.output}/${release.id}-free-src.tar"
longfile="gnu"
+ basedir="${project.root}">
+ <patternset refid="source.ignore"/>
+ <patternset refid="source.free"/>
+ </tar>
+ </target>
+
+ <target name="source-external-tar" depends="_default:init"
+ description="Builds a TAR external source distribution.">
+ <mkdir dir="${module.output}"/>
+ <tar tarfile="${module.output}/${release.id}-external-src.tar"
longfile="gnu"
+ basedir="${project.root}">
+ <patternset refid="source.ignore"/>
+ <patternset refid="source.external"/>
+ </tar>
+ </target>
+
+ <target name="source-tar" depends="source-free-tar,
source-external-tar"
+ description="Builds a TAR source distribution."/>
+
+ <target name="source-free-tgz" depends="source-free-tar"
+ description="Builds a TAR-GZIP free source distribution.">
+ <gzip src="${module.output}/${release.id}-free-src.tar"
+ zipfile="${module.output}/${release.id}-free-src.tgz"/>
+ </target>
+
+ <target name="source-external-tgz"
depends="source-external-tar"
+ description="Builds a TAR-GZIP external source distribution.">
+ <gzip src="${module.output}/${release.id}-external-src.tar"
+ zipfile="${module.output}/${release.id}-external-src.tgz"/>
+ </target>
+
+ <target name="source-tgz" depends="source-free-tgz,
source-external-tgz"
+ description="Builds a TAR-GZIP source distribution."/>
+
+ <target name="source-all"
+ depends="source-tar, source-tgz, source-zip"
+ description="Builds all source distributions."/>
Property changes on: modules/portlet/trunk/tools/etc/buildfragments/targets.ent
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/tools/etc/buildfragments/task.properties
===================================================================
--- modules/portlet/trunk/tools/etc/buildfragments/task.properties
(rev 0)
+++ modules/portlet/trunk/tools/etc/buildfragments/task.properties 2007-08-17 15:29:49 UTC
(rev 7981)
@@ -0,0 +1,83 @@
+### ====================================================================== ###
+## ##
+## Default Task Properties ##
+## ##
+### ====================================================================== ###
+
+### $Id: task.properties 21 2005-01-14 23:14:21Z vietj $ ###
+
+### Javac Defaults ###
+
+javac.includes=**/*.java
+javac.excludes=
+javac.defaultexcludes=yes
+
+javac.boot.classpath=${sun.boot.classpath}
+javac.classpath=${classpath}
+
+javac.debug=off
+javac.optimize=on
+javac.deprecation=on
+javac.target=1.2
+javac.verbose=off
+javac.depend=off
+javac.source=1.3
+
+javac.include.ant.runtime=no
+javac.include.java.runtime=no
+javac.fail.onerror=true
+
+classpath=
+classpath.local=
+classpath.thirdparty=
+
+### Javadoc Defaults ###
+
+javadoc.classpath=${javac.classpath}
+javadoc.sourcepath=
+javadoc.source.path=
+javadoc.source.files=
+
+javadoc.public=false
+javadoc.package=false
+javadoc.protected=true
+javadoc.private=false
+javadoc.version=true
+javadoc.author=true
+javadoc.use=true
+javadoc.verbose=false
+
+javadoc.windowtitle=${module.Name} API
+javadoc.doctitle=${module.Name}
+javadoc.splitindex=no
+
+### RMIC Defaults ###
+
+rmic.base=${build.classes}
+rmic.stubVersion=${javac.target}
+rmic.verify=true
+rmic.sourcebase=
+rmic.debug=false
+rmic.iiop=false
+rmic.iiopopts=
+rmic.idl=false
+rmic.idlopts=
+rmic.includes=
+rmic.excludes=
+
+### JUnit Defaults ###
+
+junit.printsummary=true
+junit.haltonerror=false
+junit.haltonfailure=false
+junit.fork=true
+junit.timeout=300000
+junit.jvm=java
+junit.jvm.options=
+
+junit.formatter.type=xml
+junit.formatter.usefile=true
+
+junit.batchtest.fork=${junit.fork}
+junit.batchtest.haltonerror=${junit.haltonerror}
+junit.batchtest.haltonfailure=${junit.haltonfailure}
Property changes on: modules/portlet/trunk/tools/etc/buildfragments/task.properties
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/tools/etc/buildfragments/tools.ent
===================================================================
--- modules/portlet/trunk/tools/etc/buildfragments/tools.ent (rev
0)
+++ modules/portlet/trunk/tools/etc/buildfragments/tools.ent 2007-08-17 15:29:49 UTC (rev
7981)
@@ -0,0 +1,133 @@
+<!-- $Id: tools.ent 2946 2006-06-26 20:07:31Z rgenova $ -->
+
+<target name="configure-tools"
unless="configure-tools.disable">
+
+ <!-- <call target="_configure:explode:task"
unless="_configure:explode:task.done">
+ <available file="${project.tools}/lib/explode.jar"/>
+ </call>-->
+
+ <!--<call target="_configure:jflex:task"
unless="_configure:jflex:task.done">
+ <available file="${jflex.jflex.lib}/jflex.jar"/>
+ </call>-->
+
+ <call target="_configure:jbossaop:task"
unless="_configure:jbossaop:task.done">
+ <available file="${jboss.aop.lib}/jboss-aop.jar"/>
+ </call>
+
+ <call target="_configure:xdoclet:task"
unless="_configure:xdoclet:task.done">
+ <available file="${xdoclet.xdoclet.lib}/xdoclet.jar"/>
+ <available file="${xdoclet.xdoclet.lib}/xdoclet-jmx-module.jar"/>
+ </call>
+
+ <call target="_configure:xdoclet:ejbdoclet"
unless="_configure:xdoclet:ejbdoclet.done">
+ <available file="${xdoclet.xdoclet.lib}/xdoclet.jar"/>
+ <available file="${xdoclet.xdoclet.lib}/xdoclet-ejb-module.jar"/>
+ </call>
+
+ <call target="_configure:xdoclet:jmxdoclet"
unless="_configure:xdoclet:jmxdoclet.done">
+ <available file="${xdoclet.xdoclet.lib}/xdoclet.jar"/>
+ <available file="${xdoclet.xdoclet.lib}/xdoclet-jmx-module.jar"/>
+ </call>
+
+ <!-- <call target="_configure:xdoclet:hibernatedoclet"
unless="_configure:xdoclet:hibernatedoclet.done">
+ <available file="${xdoclet.xdoclet.lib}/xdoclet.jar"/>
+ <available
file="${xdoclet.xdoclet.lib}/xdoclet-hibernate-module.jar"/>
+ </call>
+
+ <call target="_configure:xdoclet:webdoclet"
unless="_configure:xdoclet:webdoclet.done">
+ <available file="${xdoclet.xdoclet.lib}/xdoclet.jar"/>
+ <available file="${xdoclet.xdoclet.lib}/xdoclet-web-module.jar"/>
+ <available file="${sun.servlet.lib}/servlet-api.jar"/>
+ </call>-->
+
+</target>
+
+<!--<target name="_configure:explode:task">
+ <path id="explode.task.classpath">
+ <pathelement location="${project.tools}/lib/explode.jar"/>
+ <path refid="apache.ant.classpath"/>
+ </path>
+ <taskdef name="explode"
+ classname="org.jboss.portal.common.ant.Explode"
+ classpathref="explode.task.classpath"/>
+ <property name="_configure:explode:task.done" value="true"
system="true"/>
+</target>-->
+
+<!--<target name="_configure:jflex:task">
+ <taskdef name="jflex"
+ classname="JFlex.anttask.JFlexTask"
+ classpathref="jflex.jflex.classpath"/>
+ <property name="_configure:jflex:task.done" value="true"
system="true"/>
+</target>-->
+
+<target name="_configure:jbossaop:task">
+ <path id="jbossaop.task.classpath">
+ <path refid="jboss.aop.classpath"/>
+ <path refid="javassist.javassist.classpath"/>
+ <path refid="oswego.concurrent.classpath"/>
+ <path refid="trove.trove.classpath"/>
+ <path refid="qdox.qdox.classpath"/>
+ </path>
+ <taskdef name="annotationc"
+ classname="org.jboss.aop.ant.AnnotationC"
+ classpathref="jbossaop.task.classpath"/>
+ <taskdef name="aopc"
+ classname="org.jboss.aop.ant.AopC"
+ classpathref="jbossaop.task.classpath"/>
+</target>
+
+<target name="_configure:xdoclet:task">
+ <path id="xdoclet.base.task.classpath">
+ <path refid="xdoclet.xdoclet.classpath"/>
+ <path refid="apache.ant.classpath"/>
+ </path>
+ <taskdef name="jmxdoclet"
+ classname="xdoclet.modules.jmx.JMXDocletTask"
+ classpathref="xdoclet.task.classpath"/>
+ <taskdef name="todo"
+ classname="xdoclet.modules.doc.DocumentDocletTask"
+ classpathref="xdoclet.task.classpath"/>
+ <property name="_configure:xdoclet:task.done" value="true"
system="true"/>
+</target>
+
+<target name="_configure:xdoclet:ejbdoclet">
+ <path id="ejbdoclet.task.classpath">
+ <path refid="xdoclet.task.classpath"/>
+ <pathelement
location="${jboss.home}/server/default/lib/jboss-j2ee.jar"/>
+ </path>
+ <taskdef name="ejbdoclet"
+ classname="xdoclet.modules.ejb.EjbDocletTask"
+ classpathref="ejbdoclet.task.classpath"/>
+ <property name="_configure:xdoclet:ejbdoclet.done" value="true"
system="true"/>
+</target>
+
+<target name="_configure:xdoclet:jmxdoclet">
+ <path id="jmxdoclet.task.classpath">
+ <path refid="xdoclet.task.classpath"/>
+ </path>
+ <taskdef name="jmxdoclet"
+ classname="xdoclet.modules.jmx.JMXDocletTask"
+ classpathref="jmxdoclet.task.classpath"/>
+ <property name="_configure:xdoclet:jmxdoclet.done" value="true"
system="true"/>
+</target>
+
+<!--<target name="_configure:xdoclet:hibernatedoclet">
+ <path id="hibernatedoclet.task.classpath">
+ <path refid="xdoclet.xdoclet.classpath"/>
+ </path>
+ <taskdef name="hibernatedoclet"
+ classname="xdoclet.modules.hibernate.HibernateDocletTask"
+ classpathref="hibernatedoclet.task.classpath"/>
+ <property name="_configure:xdoclet:ejbdoclet.done" value="true"
system="true"/>
+</target>
+
+<target name="_configure:xdoclet:webdoclet">
+ <path id="webdoclet.task.classpath">
+ <path refid="xdoclet.task.classpath"/>
+ <pathelement location="${sun.servlet.lib}/servlet-api.jar"/>
+ </path>
+ <taskdef name="webdoclet"
+ classname="xdoclet.modules.web.WebDocletTask"
+ classpathref="webdoclet.task.classpath"/>
+ <property name="_configure:xdoclet:webdoclet.done" value="true"
system="true"/>
+</target>-->
Property changes on: modules/portlet/trunk/tools/etc/buildfragments/tools.ent
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/tools/etc/buildmagic/aliases.ent
===================================================================
--- modules/portlet/trunk/tools/etc/buildmagic/aliases.ent (rev
0)
+++ modules/portlet/trunk/tools/etc/buildmagic/aliases.ent 2007-08-17 15:29:49 UTC (rev
7981)
@@ -0,0 +1,54 @@
+<!-- list of aliases used to bridge gap between buildmagic defs and jbossbuild -->
+
+
+<path id="apache.commons.classpath">
+ <pathelement
path="${apache.collections.lib}/commons-collections.jar"/>
+ <pathelement path="${apache.logging.lib}/commons-logging.jar"/>
+ <pathelement path="${apache.httpclient.lib}/commons-httpclient.jar"/>
+ <pathelement path="${apache.fileupload.lib}/commons-fileupload.jar"/>
+ <pathelement path="${apache.lang.lib}/commons-lang-2.0.jar"/>
+</path>
+
+<property name="xdoclet-xdoclet.lib"
value="${xdoclet.xdoclet.lib}"/>
+<path id="xdoclet.task.classpath">
+ <path refid="xdoclet.xdoclet.classpath"/>
+</path>
+
+<property name="trove.lib" value="${trove.trove.lib}"/>
+<path id="trove.classpath">
+ <path refid="trove.trove.classpath"/>
+</path>
+
+<path id="qdox.classpath">
+ <path refid="qdox.qdox.classpath"/>
+</path>
+
+<property name="javassist.lib"
value="${javassist.javassist.lib}"/>
+<path id="javassist.classpath">
+ <path refid="javassist.javassist.classpath"/>
+</path>
+
+<property name="hibernate.lib"
value="${hibernate.hibernate.lib}"/>
+<path id="hibernate3.classpath">
+ <path refid="hibernate.hibernate.classpath"/>
+</path>
+
+<property name="odmg.lib" value="${odmg.odmg.lib}"/>
+<path id="odmg.classpath">
+ <path refid="odmg.odmg.classpath"/>
+</path>
+
+<property name="cglib.lib" value="${cglib.cglib.lib}"/>
+<path id="cglib.classpath">
+ <path refid="cglib.cglib.classpath"/>
+</path>
+
+
+
+<!-- Ant -->
+<property name="apache.ant.root" value="${project.tools}"/>
+<property name="apache.ant.lib"
value="${apache.ant.root}/lib"/>
+<path id="apache.ant.classpath">
+ <pathelement path="${apache.ant.lib}/ant.jar"/>
+</path>
+
\ No newline at end of file
Property changes on: modules/portlet/trunk/tools/etc/buildmagic/aliases.ent
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/tools/etc/changelog.xsl
===================================================================
--- modules/portlet/trunk/tools/etc/changelog.xsl (rev 0)
+++ modules/portlet/trunk/tools/etc/changelog.xsl 2007-08-17 15:29:49 UTC (rev 7981)
@@ -0,0 +1,148 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<xsl:stylesheet
+
xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
+ version='1.0'>
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+
http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+ <xsl:param name="title"/>
+ <xsl:param name="module"/>
+ <xsl:param name="cvsweb"/>
+
+ <xsl:output method="html" indent="yes"
encoding="US-ASCII"
+ doctype-public="-//W3C//DTD HTML 4.01//EN"
+
doctype-system="http://www.w3.org/TR/html401/strict.dtd"/>
+
+ <!-- Copy standard document elements. Elements that
+ should be ignored must be filtered by apply-templates
+ tags. -->
+ <xsl:template match="*">
+ <xsl:copy>
+ <xsl:copy-of select="attribute::*[. != '']"/>
+ <xsl:apply-templates/>
+ </xsl:copy>
+ </xsl:template>
+
+ <xsl:template match="changelog">
+ <html>
+ <head>
+ <title><xsl:value-of select="$title"/></title>
+ <style type="text/css">
+ body, p {
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 80%;
+ color: #000000;
+ background-color: #ffffff;
+ }
+ tr, td {
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ background: #eeeee0;
+ }
+ td {
+ padding-left: 20px;
+ }
+ .dateAndAuthor {
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-weight: bold;
+ text-align: left;
+ background: #a6caf0;
+ padding-left: 3px;
+ }
+ a {
+ color: #000000;
+ }
+ pre {
+ font-weight: bold;
+ }
+ </style>
+ </head>
+ <body>
+ <h1>
+ <a name="top"><xsl:value-of
select="$title"/></a>
+ </h1>
+ <p style="text-align: right">Designed for use with <a
href="http://ant.apache.org/">Apache Ant</a>.</p>
+ <hr/>
+ <table border="0" width="100%"
cellspacing="1">
+
+ <xsl:apply-templates select=".//entry">
+ <xsl:sort select="date" data-type="text"
order="descending"/>
+ <xsl:sort select="time" data-type="text"
order="descending"/>
+ </xsl:apply-templates>
+
+ </table>
+
+ </body>
+ </html>
+ </xsl:template>
+
+ <xsl:template match="entry">
+ <tr>
+ <td class="dateAndAuthor">
+ <xsl:value-of select="date"/><xsl:text>
</xsl:text><xsl:value-of select="time"/><xsl:text>
</xsl:text><xsl:value-of select="author"/>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <pre>
+<xsl:apply-templates select="msg"/></pre>
+ <ul>
+ <xsl:apply-templates select="file"/>
+ </ul>
+ </td>
+ </tr>
+ </xsl:template>
+
+ <xsl:template match="date">
+ <i><xsl:value-of select="."/></i>
+ </xsl:template>
+
+ <xsl:template match="time">
+ <i><xsl:value-of select="."/></i>
+ </xsl:template>
+
+ <xsl:template match="author">
+ <i>
+ <a>
+ <xsl:attribute name="href">mailto:<xsl:value-of
select="."/></xsl:attribute>
+ <xsl:value-of select="."/></a>
+ </i>
+ </xsl:template>
+
+ <xsl:template match="file">
+ <li>
+ <a>
+ <xsl:choose>
+ <xsl:when test="string-length(prevrevision) = 0 ">
+ <xsl:attribute name="href"><xsl:value-of
select="$cvsweb"/><xsl:value-of select="$module"
/>/<xsl:value-of select="name" />?rev=<xsl:value-of
select="revision"
/>&content-type=text/x-cvsweb-markup</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="href"><xsl:value-of
select="$cvsweb"/><xsl:value-of select="$module"
/>/<xsl:value-of select="name" />?r1=<xsl:value-of
select="revision" />&r2=<xsl:value-of
select="prevrevision"/></xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:value-of select="name" /> (<xsl:value-of
select="revision"/>)</a>
+ </li>
+ </xsl:template>
+
+ <!-- Any elements within a msg are processed,
+ so that we can preserve HTML tags. -->
+ <xsl:template match="msg">
+ <xsl:apply-templates/>
+ </xsl:template>
+
+</xsl:stylesheet>
Property changes on: modules/portlet/trunk/tools/etc/changelog.xsl
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/tools/etc/checkstyle/checkstyle-frames.xsl
===================================================================
--- modules/portlet/trunk/tools/etc/checkstyle/checkstyle-frames.xsl
(rev 0)
+++ modules/portlet/trunk/tools/etc/checkstyle/checkstyle-frames.xsl 2007-08-17 15:29:49
UTC (rev 7981)
@@ -0,0 +1,293 @@
+<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0"
+
xmlns:lxslt="http://xml.apache.org/xslt"
+ xmlns:redirect="org.apache.xalan.lib.Redirect"
+ extension-element-prefixes="redirect">
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+
http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+ <xsl:output method="html" indent="yes"
encoding="US-ASCII"/>
+ <xsl:decimal-format decimal-separator="."
grouping-separator="," />
+
+ <xsl:param name="output.dir" select="'.'"/>
+ <xsl:param name="basedir" select="'.'"/>
+
+ <xsl:template match="checkstyle">
+ <!-- create the index.html -->
+ <redirect:write file="{$output.dir}/index.html">
+ <xsl:call-template name="index.html"/>
+ </redirect:write>
+
+ <!-- create the stylesheet.css -->
+ <redirect:write file="{$output.dir}/stylesheet.css">
+ <xsl:call-template name="stylesheet.css"/>
+ </redirect:write>
+
+ <!-- create the overview-summary.html at the root -->
+ <redirect:write file="{$output.dir}/overview-frame.html">
+ <xsl:apply-templates select="." mode="overview"/>
+ </redirect:write>
+
+ <!-- create the all-classes.html at the root -->
+ <redirect:write file="{$output.dir}/allclasses-frame.html">
+ <xsl:apply-templates select="."
mode="all.classes"/>
+ </redirect:write>
+
+ <!-- process all files -->
+ <xsl:apply-templates select="file[count(error) != 0]"/>
+ </xsl:template>
+
+ <xsl:template name="index.html">
+ <html>
+ <head>
+ <title>CheckStyle Audit</title>
+ </head>
+ <frameset cols="20%,80%">
+ <frame src="allclasses-frame.html"
name="fileListFrame"/>
+ <frame src="overview-frame.html"
name="fileFrame"/>
+ </frameset>
+ <noframes>
+ <h2>Frame Alert</h2>
+ <p>
+ This document is designed to be viewed using the frames feature.
+ If you see this message, you are using a non-frame-capable web
client.
+ </p>
+ </noframes>
+ </html>
+ </xsl:template>
+
+ <xsl:template name="pageHeader">
+ <table border="0" cellpadding="0"
cellspacing="0" width="100%">
+ <tr>
+ <td class="text-align:right"><h2>CheckStyle
Audit</h2></td>
+ </tr>
+ <tr>
+ <td class="text-align:right">Designed for use with
+ <a
href='http://checkstyle.sourceforge.net/'>CheckStyle</a> and
+ <a
href='http://ant.apache.org/'>Ant</a>.</td>
+ </tr>
+ </table>
+ <hr size="1"/>
+ </xsl:template>
+
+ <xsl:template match="checkstyle" mode="overview">
+ <html>
+ <head>
+ <link rel="stylesheet" type="text/css"
href="stylesheet.css"/>
+ </head>
+ <body>
+ <!-- page header -->
+ <xsl:call-template name="pageHeader"/>
+
+ <!-- Summary part -->
+ <xsl:apply-templates select="."
mode="summary"/>
+ <hr size="1" width="100%"
align="left"/>
+
+ <!-- File list part -->
+ <xsl:apply-templates select="."
mode="filelist"/>
+ </body>
+ </html>
+ </xsl:template>
+
+ <xsl:template name="stylesheet.css">
+ .bannercell {
+ border: 0px;
+ padding: 0px;
+ }
+ body {
+ margin-left: 10;
+ margin-right: 10;
+ font:normal 80% arial,helvetica,sanserif;
+ background-color:#FFFFFF;
+ color:#000000;
+ }
+ .oddrow td {
+ background: #efefef;
+ }
+ .evenrow td {
+ background: #fff;
+ }
+ th, td {
+ text-align: left;
+ vertical-align: top;
+ }
+ th {
+ font-weight:bold;
+ background: #ccc;
+ color: black;
+ }
+ table, th, td {
+ font-size:100%;
+ border: none
+ }
+ table.log tr td, tr th {
+
+ }
+ h2 {
+ font-weight:bold;
+ font-size:140%;
+ margin-bottom: 5;
+ }
+ h3 {
+ font-size:100%;
+ font-weight:bold;
+ background: #525D76;
+ color: white;
+ text-decoration: none;
+ padding: 5px;
+ margin-right: 2px;
+ margin-left: 2px;
+ margin-bottom: 0;
+ }
+ </xsl:template>
+
+ <!--
+ Creates an all-classes.html file that contains a link to all files.
+ -->
+ <xsl:template match="checkstyle" mode="all.classes">
+ <html>
+ <head>
+ <link rel="stylesheet" type="text/css"
href="stylesheet.css"/>
+ </head>
+ <body>
+ <h2>Files</h2>
+ <p>
+ <table width="100%">
+ <!-- For each file create its part -->
+ <xsl:apply-templates select="file[count(error) !=
0]" mode="all.classes">
+ <xsl:sort select="substring-after(@name,
$basedir)"/>
+ </xsl:apply-templates>
+ </table>
+ </p>
+ </body>
+ </html>
+ </xsl:template>
+
+ <xsl:template match="checkstyle" mode="filelist">
+ <h3>Files</h3>
+ <table class="log" border="0" cellpadding="5"
cellspacing="2" width="100%">
+ <tr>
+ <th>Name</th>
+ <th>Errors</th>
+ </tr>
+ <xsl:apply-templates select="file[count(error) != 0]"
mode="filelist">
+ <xsl:sort select="count(error)" order="descending"
data-type="number"/>
+ </xsl:apply-templates>
+ </table>
+ </xsl:template>
+
+ <xsl:template match="file" mode="filelist">
+ <tr>
+ <xsl:call-template name="alternated-row"/>
+ <td nowrap="nowrap">
+ <a>
+ <xsl:attribute name="href">
+ <xsl:text>files/</xsl:text><xsl:value-of
select="substring-after(@name,
$basedir)"/><xsl:text>.html</xsl:text>
+ </xsl:attribute>
+ <xsl:value-of select="substring-after(@name,
$basedir)"/>
+ </a>
+ </td>
+ <td><xsl:value-of select="count(error)"/></td>
+ </tr>
+ </xsl:template>
+
+ <xsl:template match="file" mode="all.classes">
+ <tr>
+ <td nowrap="nowrap">
+ <a target="fileFrame">
+ <xsl:attribute name="href">
+ <xsl:text>files/</xsl:text><xsl:value-of
select="substring-after(@name,
$basedir)"/><xsl:text>.html</xsl:text>
+ </xsl:attribute>
+ <xsl:value-of select="substring-after(@name,
$basedir)"/>
+ </a>
+ </td>
+ </tr>
+ </xsl:template>
+
+ <!--
+ transform string like a/b/c to ../../../
+ @param path the path to transform into a descending directory path
+ -->
+ <xsl:template name="path">
+ <xsl:param name="path"/>
+ <xsl:if test="contains($path,'/')">
+ <xsl:text>../</xsl:text>
+ <xsl:call-template name="path">
+ <xsl:with-param name="path"><xsl:value-of
select="substring-after($path,'/')"/></xsl:with-param>
+ </xsl:call-template>
+ </xsl:if>
+ <xsl:if test="not(contains($path,'/')) and not($path =
'')">
+ <xsl:text>../</xsl:text>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template match="file">
+ <redirect:write file="{$output.dir}/files/{substring-after(@name,
$basedir)}.html">
+ <html>
+ <head>
+ <link rel="stylesheet" type="text/css">
+ <xsl:attribute name="href"><xsl:call-template
name="path"><xsl:with-param name="path"
select="substring-after(@name,
$basedir)"/></xsl:call-template><xsl:text>stylesheet.css</xsl:text></xsl:attribute>
+ </link>
+ </head>
+ <body>
+ <xsl:call-template name="pageHeader"/>
+ <h3>File <xsl:value-of select="substring-after(@name,
$basedir)"/></h3>
+ <table class="log" border="0"
cellpadding="5" cellspacing="2" width="100%">
+ <tr>
+ <th>Error Description</th>
+ <th>Line:Column</th>
+ </tr>
+ <xsl:for-each select="error">
+ <tr>
+ <xsl:call-template
name="alternated-row"/>
+ <td><a
title="{@source}"><xsl:value-of
select="@message"/></a></td>
+ <td align="center"><xsl:value-of
select="@line"/><xsl:if test="@column">:<xsl:value-of
select="@column"/></xsl:if></td>
+ </tr>
+ </xsl:for-each>
+ </table>
+ </body>
+ </html>
+ </redirect:write>
+ </xsl:template>
+
+ <xsl:template match="checkstyle" mode="summary">
+ <h3>Summary</h3>
+ <xsl:variable name="fileCount" select="count(file)"/>
+ <xsl:variable name="errorCount"
select="count(file/error)"/>
+ <xsl:variable name="fileErrorCount"
select="count(file[count(error) != 0])"/>
+ <table class="log" border="0" cellpadding="5"
cellspacing="2" width="100%">
+ <tr>
+ <th>Total Files</th>
+ <th>Files With Errors</th>
+ <th>Errors</th>
+ </tr>
+ <tr>
+ <xsl:call-template name="alternated-row"/>
+ <td><xsl:value-of select="$fileCount"/></td>
+ <td><xsl:value-of
select="$fileErrorCount"/></td>
+ <td><xsl:value-of
select="$errorCount"/></td>
+ </tr>
+ </table>
+ </xsl:template>
+
+ <xsl:template name="alternated-row">
+ <xsl:attribute name="class">
+ <xsl:if test="position() mod 2 = 1">oddrow</xsl:if>
+ <xsl:if test="position() mod 2 = 0">evenrow</xsl:if>
+ </xsl:attribute>
+ </xsl:template>
+</xsl:stylesheet>
\ No newline at end of file
Added: modules/portlet/trunk/tools/etc/checkstyle/checkstyle-text.xsl
===================================================================
--- modules/portlet/trunk/tools/etc/checkstyle/checkstyle-text.xsl
(rev 0)
+++ modules/portlet/trunk/tools/etc/checkstyle/checkstyle-text.xsl 2007-08-17 15:29:49 UTC
(rev 7981)
@@ -0,0 +1,33 @@
+<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+
http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+ <xsl:strip-space elements="checkstyle"/>
+ <xsl:preserve-space elements="file"/>
+ <xsl:output method="text"/>
+ <xsl:template match="checkstyle/file/error">
+ <xsl:value-of select="../@name"/>
+ <xsl:text>:</xsl:text>
+ <xsl:value-of select="@line"/>
+ <xsl:text>:</xsl:text>
+ <xsl:value-of select="@column"/>
+ <xsl:text> </xsl:text>
+ <xsl:value-of select="@message"/>
+ </xsl:template>
+</xsl:stylesheet>
+
Added: modules/portlet/trunk/tools/etc/checkstyle/checkstyle-xdoc.xsl
===================================================================
--- modules/portlet/trunk/tools/etc/checkstyle/checkstyle-xdoc.xsl
(rev 0)
+++ modules/portlet/trunk/tools/etc/checkstyle/checkstyle-xdoc.xsl 2007-08-17 15:29:49 UTC
(rev 7981)
@@ -0,0 +1,129 @@
+<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0"
+
xmlns:lxslt="http://xml.apache.org/xslt"
+ xmlns:redirect="org.apache.xalan.lib.Redirect"
+ extension-element-prefixes="redirect">
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+
http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+ <xsl:output method="xml" indent="yes"/>
+ <xsl:decimal-format decimal-separator="."
grouping-separator="," />
+
+ <xsl:param name="output.dir" select="'.'"/>
+ <xsl:param name="basedir" select="'.'"/>
+
+ <xsl:template match="checkstyle">
+ <document>
+ <properties>
+ <title>Checkstyle Audit</title>
+ </properties>
+
+ <body>
+ <xsl:apply-templates select="." mode="summary"/>
+ <!-- File list part -->
+ <xsl:apply-templates select="." mode="filelist"/>
+ <xsl:apply-templates select="file[count(error) != 0]"/>
+ </body>
+ </document>
+ </xsl:template>
+
+ <xsl:template match="checkstyle" mode="filelist">
+ <section name="Files">
+ <table>
+ <tr>
+ <th>Name</th>
+ <th>Errors</th>
+ </tr>
+ <xsl:apply-templates select="file[count(error) != 0]"
mode="filelist">
+ <xsl:sort select="count(error)" order="descending"
data-type="number"/>
+ </xsl:apply-templates>
+ </table>
+ </section>
+ </xsl:template>
+
+ <xsl:template match="file" mode="filelist">
+ <tr>
+ <xsl:call-template name="alternated-row"/>
+ <td nowrap="nowrap">
+ <a>
+ <xsl:attribute name="href">
+ <xsl:text>files</xsl:text><xsl:value-of
select="substring-after(@name,
$basedir)"/><xsl:text>.html</xsl:text>
+ </xsl:attribute>
+ <xsl:value-of select="substring-after(@name,
$basedir)"/>
+ </a>
+ </td>
+ <td><xsl:value-of select="count(error)"/></td>
+ </tr>
+ </xsl:template>
+
+ <xsl:template match="file">
+ <redirect:write file="{$output.dir}/files{substring-after(@name,
$basedir)}.xml">
+ <document>
+ <properties>
+ <title>Checkstyle Audit</title>
+ </properties>
+
+ <body>
+ <section name="Details for {substring-after(@name,
$basedir)}">
+ <table>
+ <tr>
+ <th>Error Description</th>
+ <th>Line</th>
+ </tr>
+ <xsl:for-each select="error">
+ <tr>
+ <xsl:call-template name="alternated-row"/>
+ <td><a title="{@source}"><xsl:value-of
select="@message"/></a></td>
+ <td><xsl:value-of
select="@line"/></td>
+ </tr>
+ </xsl:for-each>
+ </table>
+ </section>
+ </body>
+ </document>
+ </redirect:write>
+ </xsl:template>
+
+ <xsl:template match="checkstyle" mode="summary">
+ <section name="Summary">
+ <xsl:variable name="fileCount" select="count(file)"/>
+ <xsl:variable name="errorCount"
select="count(file/error)"/>
+ <xsl:variable name="fileErrorCount"
select="count(file[count(error) != 0])"/>
+ <table>
+ <tr>
+ <th>Files</th>
+ <th>Files With Errors</th>
+ <th>Errors</th>
+ </tr>
+ <tr>
+ <xsl:call-template name="alternated-row"/>
+ <td><xsl:value-of select="$fileCount"/></td>
+ <td><xsl:value-of
select="$fileErrorCount"/></td>
+ <td><xsl:value-of
select="$errorCount"/></td>
+ </tr>
+ </table>
+ </section>
+ </xsl:template>
+
+ <xsl:template name="alternated-row">
+ <xsl:attribute name="class">
+ <xsl:if test="position() mod 2 = 1">oddrow</xsl:if>
+ <xsl:if test="position() mod 2 = 0">evenrow</xsl:if>
+ </xsl:attribute>
+ </xsl:template>
+</xsl:stylesheet>
+
Added: modules/portlet/trunk/tools/etc/checkstyle-frames.xsl
===================================================================
--- modules/portlet/trunk/tools/etc/checkstyle-frames.xsl (rev 0)
+++ modules/portlet/trunk/tools/etc/checkstyle-frames.xsl 2007-08-17 15:29:49 UTC (rev
7981)
@@ -0,0 +1,324 @@
+<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0"
+
xmlns:lxslt="http://xml.apache.org/xslt"
+ xmlns:redirect="org.apache.xalan.xslt.extensions.Redirect"
+ extension-element-prefixes="redirect">
+
+<!--
+ The Apache Software License, Version 1.1
+
+ Copyright (c) 2002 The Apache Software Foundation. All rights
+ reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in
+ the documentation and/or other materials provided with the
+ distribution.
+
+ 3. The end-user documentation included with the redistribution, if
+ any, must include the following acknowlegement:
+ "This product includes software developed by the
+ Apache Software Foundation (
http://www.apache.org/)."
+ Alternately, this acknowlegement may appear in the software itself,
+ if and wherever such third-party acknowlegements normally appear.
+
+ 4. The names "The Jakarta Project", "Ant", and "Apache
Software
+ Foundation" must not be used to endorse or promote products derived
+ from this software without prior written permission. For written
+ permission, please contact apache(a)apache.org.
+
+ 5. Products derived from this software may not be called "Apache"
+ nor may "Apache" appear in their names without prior written
+ permission of the Apache Group.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ SUCH DAMAGE.
+ ====================================================================
+
+ This software consists of voluntary contributions made by many
+ individuals on behalf of the Apache Software Foundation. For more
+ information on the Apache Software Foundation, please see
+ <
http://www.apache.org/>.
+ -->
+
+ <xsl:output method="html" indent="yes"
encoding="US-ASCII"/>
+ <xsl:decimal-format decimal-separator="."
grouping-separator="," />
+
+ <xsl:param name="output.dir" select="'.'"/>
+
+ <xsl:template match="checkstyle">
+ <!-- create the index.html -->
+ <redirect:write file="{$output.dir}/index.html">
+ <xsl:call-template name="index.html"/>
+ </redirect:write>
+
+ <!-- create the stylesheet.css -->
+ <redirect:write file="{$output.dir}/stylesheet.css">
+ <xsl:call-template name="stylesheet.css"/>
+ </redirect:write>
+
+ <!-- create the overview-summary.html at the root -->
+ <redirect:write file="{$output.dir}/overview-frame.html">
+ <xsl:apply-templates select="." mode="overview"/>
+ </redirect:write>
+
+ <!-- create the all-classes.html at the root -->
+ <redirect:write file="{$output.dir}/allclasses-frame.html">
+ <xsl:apply-templates select="."
mode="all.classes"/>
+ </redirect:write>
+
+ <!-- process all files -->
+ <xsl:apply-templates select="file"/>
+ </xsl:template>
+
+ <xsl:template name="index.html">
+ <html>
+ <head>
+ <title>CheckStyle Audit</title>
+ </head>
+ <frameset cols="20%,80%">
+ <frame src="allclasses-frame.html"
name="fileListFrame"/>
+ <frame src="overview-frame.html"
name="fileFrame"/>
+ </frameset>
+ <noframes>
+ <h2>Frame Alert</h2>
+ <p>
+ This document is designed to be viewed using the frames feature. If
you see this message, you are using a non-frame-capable web client.
+ </p>
+ </noframes>
+ </html>
+ </xsl:template>
+
+ <xsl:template name="pageHeader">
+ <table border="0" cellpadding="0"
cellspacing="0" width="100%">
+ <tr>
+ <td class="text-align:right"><h2>CheckStyle
Audit</h2></td>
+ </tr>
+ <tr>
+ <td class="text-align:right">Designed for use with <a
href='http://checkstyle.sourceforge.net/'>CheckStyle</a> and <a
href='http://jakarta.apache.org'>Ant</a>.</td>
+ </tr>
+ </table>
+ <hr size="1"/>
+ </xsl:template>
+
+ <xsl:template match="checkstyle" mode="overview">
+ <html>
+ <head>
+ <link rel="stylesheet" type="text/css"
href="stylesheet.css"/>
+ </head>
+ <body>
+ <!-- page header -->
+ <xsl:call-template name="pageHeader"/>
+
+ <!-- Summary part -->
+ <xsl:apply-templates select="."
mode="summary"/>
+ <hr size="1" width="100%"
align="left"/>
+
+ <!-- File list part -->
+ <xsl:apply-templates select="."
mode="filelist"/>
+ </body>
+ </html>
+ </xsl:template>
+
+ <xsl:template name="stylesheet.css">
+ .bannercell {
+ border: 0px;
+ padding: 0px;
+ }
+ body {
+ margin-left: 10;
+ margin-right: 10;
+ font:normal 80% arial,helvetica,sanserif;
+ background-color:#FFFFFF;
+ color:#000000;
+ }
+ .a td {
+ background: #efefef;
+ }
+ .b td {
+ background: #fff;
+ }
+ th, td {
+ text-align: left;
+ vertical-align: top;
+ }
+ th {
+ font-weight:bold;
+ background: #ccc;
+ color: black;
+ }
+ table, th, td {
+ font-size:100%;
+ border: none
+ }
+ table.log tr td, tr th {
+
+ }
+ h2 {
+ font-weight:bold;
+ font-size:140%;
+ margin-bottom: 5;
+ }
+ h3 {
+ font-size:100%;
+ font-weight:bold;
+ background: #525D76;
+ color: white;
+ text-decoration: none;
+ padding: 5px;
+ margin-right: 2px;
+ margin-left: 2px;
+ margin-bottom: 0;
+ }
+ </xsl:template>
+
+ <!--
+ Creates an all-classes.html file that contains a link to all files.
+ -->
+ <xsl:template match="checkstyle" mode="all.classes">
+ <html>
+ <head>
+ <link rel="stylesheet" type="text/css"
href="stylesheet.css"/>
+ </head>
+ <body>
+ <h2>Files</h2>
+ <p>
+ <table width="100%">
+ <!-- For each file create its part -->
+ <xsl:apply-templates select="file"
mode="all.classes">
+ <xsl:sort select="@name"/>
+ </xsl:apply-templates>
+ </table>
+ </p>
+ </body>
+ </html>
+ </xsl:template>
+
+ <xsl:template match="checkstyle" mode="filelist">
+ <h3>Files</h3>
+ <table class="log" border="0" cellpadding="5"
cellspacing="2" width="100%">
+ <tr>
+ <th>Name</th>
+ <th>Errors</th>
+ </tr>
+ <xsl:apply-templates select="file"
mode="filelist">
+ <xsl:sort select="@name"/>
+ </xsl:apply-templates>
+ </table>
+ </xsl:template>
+
+ <xsl:template match="file" mode="filelist">
+ <tr>
+ <xsl:call-template name="alternated-row"/>
+ <td nowrap="nowrap">
+ <a>
+ <xsl:attribute name="href">
+ <xsl:text>files/</xsl:text><xsl:value-of
select="@name"/><xsl:text>.html</xsl:text>
+ </xsl:attribute>
+ <xsl:value-of select="@name"/>
+ </a>
+ </td>
+ <td><xsl:value-of select="count(error)"/></td>
+ </tr>
+ </xsl:template>
+
+ <xsl:template match="file" mode="all.classes">
+ <tr>
+ <td nowrap="nowrap">
+ <a target="fileFrame">
+ <xsl:attribute name="href">
+ <xsl:text>files/</xsl:text><xsl:value-of
select="@name"/><xsl:text>.html</xsl:text>
+ </xsl:attribute>
+ <xsl:value-of select="@name"/>
+ </a>
+ </td>
+ </tr>
+ </xsl:template>
+
+ <!--
+ transform string like a/b/c to ../../../
+ @param path the path to transform into a descending directory path
+ -->
+ <xsl:template name="path">
+ <xsl:param name="path"/>
+ <xsl:if test="contains($path,'/')">
+ <xsl:text>../</xsl:text>
+ <xsl:call-template name="path">
+ <xsl:with-param name="path"><xsl:value-of
select="substring-after($path,'/')"/></xsl:with-param>
+ </xsl:call-template>
+ </xsl:if>
+ <xsl:if test="not(contains($path,'/')) and not($path =
'')">
+ <xsl:text>../</xsl:text>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template match="file">
+ <redirect:write file="{$output.dir}/files/{(a)name}.html">
+ <html>
+ <head>
+ <link rel="stylesheet" type="text/css">
+ <xsl:attribute name="href"><xsl:call-template
name="path"><xsl:with-param name="path"
select="@name"/></xsl:call-template><xsl:text>stylesheet.css</xsl:text></xsl:attribute>
+ </link>
+ </head>
+ <body>
+ <xsl:call-template name="pageHeader"/>
+ <h3>File <xsl:value-of
select="@name"/></h3>
+ <table class="log" border="0"
cellpadding="5" cellspacing="2" width="100%">
+ <tr>
+ <th>Error Description</th>
+ <th>Line</th>
+ </tr>
+ <xsl:for-each select="error">
+ <tr>
+ <xsl:call-template
name="alternated-row"/>
+ <td><xsl:value-of
select="@message"/></td>
+ <td><xsl:value-of
select="@line"/></td>
+ </tr>
+ </xsl:for-each>
+ </table>
+ </body>
+ </html>
+ </redirect:write>
+ </xsl:template>
+
+ <xsl:template match="checkstyle" mode="summary">
+ <h3>Summary</h3>
+ <xsl:variable name="fileCount" select="count(file)"/>
+ <xsl:variable name="errorCount"
select="count(file/error)"/>
+ <table class="log" border="0" cellpadding="5"
cellspacing="2" width="100%">
+ <tr>
+ <th>Files</th>
+ <th>Errors</th>
+ </tr>
+ <tr>
+ <xsl:call-template name="alternated-row"/>
+ <td><xsl:value-of select="$fileCount"/></td>
+ <td><xsl:value-of
select="$errorCount"/></td>
+ </tr>
+ </table>
+ </xsl:template>
+
+ <xsl:template name="alternated-row">
+ <xsl:attribute name="class">
+ <xsl:if test="position() mod 2 = 1">a</xsl:if>
+ <xsl:if test="position() mod 2 = 0">b</xsl:if>
+ </xsl:attribute>
+ </xsl:template>
+</xsl:stylesheet>
+
Property changes on: modules/portlet/trunk/tools/etc/checkstyle-frames.xsl
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/tools/etc/coverage-frames.xsl
===================================================================
--- modules/portlet/trunk/tools/etc/coverage-frames.xsl (rev 0)
+++ modules/portlet/trunk/tools/etc/coverage-frames.xsl 2007-08-17 15:29:49 UTC (rev
7981)
@@ -0,0 +1,488 @@
+<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0"
+
xmlns:lxslt="http://xml.apache.org/xslt"
+ xmlns:redirect="org.apache.xalan.lib.Redirect"
+ extension-element-prefixes="redirect">
+<xsl:output method="html" indent="yes"/>
+<xsl:decimal-format decimal-separator="." grouping-separator=","
/>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+
http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<!--
+
+ Sample stylesheet to be used with JProbe 3.0 XML output.
+
+ It creates a set of HTML files a la javadoc where you can browse easily
+ through all packages and classes.
+
+ It is best used with JProbe Coverage Ant task that gives you the benefit
+ of a reference classpath so that you have the list of classes/methods
+ that are not used at all in a given classpath.
+
+ @author Stephane Bailliez <a href="mailto:sbailliez@apache.org"/>
+
+-->
+
+<!-- default output directory is current directory -->
+<xsl:param name="output.dir" select="'.'"/>
+
+<!-- ======================================================================
+ Root element
+ ======================================================================= -->
+<xsl:template match="/snapshot">
+ <!-- create the index.html -->
+ <redirect:write file="{$output.dir}/index.html">
+ <xsl:call-template name="index.html"/>
+ </redirect:write>
+
+ <!-- create the stylesheet.css -->
+ <redirect:write file="{$output.dir}/stylesheet.css">
+ <xsl:call-template name="stylesheet.css"/>
+ </redirect:write>
+
+ <!-- create the overview-packages.html at the root -->
+ <redirect:write file="{$output.dir}/overview-summary.html">
+ <xsl:apply-templates select="."
mode="overview.packages"/>
+ </redirect:write>
+
+ <!-- create the all-packages.html at the root -->
+ <redirect:write file="{$output.dir}/overview-frame.html">
+ <xsl:apply-templates select="." mode="all.packages"/>
+ </redirect:write>
+
+ <!-- create the all-classes.html at the root -->
+ <redirect:write file="{$output.dir}/allclasses-frame.html">
+ <xsl:apply-templates select="." mode="all.classes"/>
+ </redirect:write>
+
+ <!-- process all packages -->
+ <xsl:apply-templates select="./package" mode="write"/>
+</xsl:template>
+
+<!-- =======================================================================
+ Frameset definition. Entry point for the report.
+ 3 frames: packageListFrame, classListFrame, classFrame
+ ======================================================================= -->
+<xsl:template name="index.html">
+<html>
+ <head><title>Coverage Results.</title></head>
+ <frameset cols="20%,80%">
+ <frameset rows="30%,70%">
+ <frame src="overview-frame.html"
name="packageListFrame"/>
+ <frame src="allclasses-frame.html"
name="classListFrame"/>
+ </frameset>
+ <frame src="overview-summary.html" name="classFrame"/>
+ </frameset>
+ <noframes>
+ <h2>Frame Alert</h2>
+ <p>
+ This document is designed to be viewed using the frames feature. If you see this
message, you are using a non-frame-capable web client.
+ </p>
+ </noframes>
+</html>
+</xsl:template>
+
+<!-- =======================================================================
+ Stylesheet CSS used
+ ======================================================================= -->
+<!-- this is the stylesheet css to use for nearly everything -->
+<xsl:template name="stylesheet.css">
+ .bannercell {
+ border: 0px;
+ padding: 0px;
+ }
+ body {
+ margin-left: 10;
+ margin-right: 10;
+ font:normal 80% arial,helvetica,sanserif;
+ background-color:#FFFFFF;
+ color:#000000;
+ }
+ .a td {
+ background: #efefef;
+ }
+ .b td {
+ background: #fff;
+ }
+ th, td {
+ text-align: left;
+ vertical-align: top;
+ }
+ th {
+ font-weight:bold;
+ background: #ccc;
+ color: black;
+ }
+ table, th, td {
+ font-size:100%;
+ border: none
+ }
+ table.log tr td, tr th {
+
+ }
+ h2 {
+ font-weight:bold;
+ font-size:140%;
+ margin-bottom: 5;
+ }
+ h3 {
+ font-size:100%;
+ font-weight:bold;
+ background: #525D76;
+ color: white;
+ text-decoration: none;
+ padding: 5px;
+ margin-right: 2px;
+ margin-left: 2px;
+ margin-bottom: 0;
+ }
+</xsl:template>
+
+<!-- =======================================================================
+ List of all classes in all packages
+ This will be the first page in the classListFrame
+ ======================================================================= -->
+<xsl:template match="snapshot" mode="all.classes">
+ <html>
+ <head>
+ <xsl:call-template name="create.stylesheet.link"/>
+ </head>
+ <body>
+ <h2>Classes</h2>
+ <table width="100%">
+ <xsl:for-each select="package/class">
+ <xsl:sort select="@name"/>
+ <xsl:variable name="package.name"
select="(ancestor::package)[last()]/@name"/>
+ <xsl:variable name="link">
+ <xsl:if test="not($package.name='')">
+ <xsl:value-of
select="translate($package.name,'.','/')"/><xsl:text>/</xsl:text>
+ </xsl:if><xsl:value-of
select="@name"/><xsl:text>.html</xsl:text>
+ </xsl:variable>
+ <tr>
+ <td nowrap="nowrap">
+ <a target="classFrame"
href="{$link}"><xsl:value-of select="@name"/></a>
+ </td>
+ </tr>
+ </xsl:for-each>
+ </table>
+ </body>
+ </html>
+</xsl:template>
+
+<!-- list of all packages -->
+<xsl:template match="snapshot" mode="all.packages">
+ <html>
+ <head>
+ <xsl:call-template name="create.stylesheet.link"/>
+ </head>
+ <body>
+ <h2><a href="overview-summary.html"
target="classFrame">Home</a></h2>
+ <h2>Packages</h2>
+ <table width="100%">
+ <xsl:for-each select="package">
+ <xsl:sort select="@name"
order="ascending"/>
+ <tr>
+ <td nowrap="nowrap">
+ <a
href="{translate((a)name,'.','/')}/package-summary.html"
target="classFrame">
+ <xsl:value-of select="@name"/>
+ </a>
+ </td>
+ </tr>
+ </xsl:for-each>
+ </table>
+ </body>
+ </html>
+</xsl:template>
+
+<!-- overview of statistics in packages -->
+<xsl:template match="snapshot" mode="overview.packages">
+ <html>
+ <head>
+ <xsl:call-template name="create.stylesheet.link"/>
+ </head>
+ <body
onload="open('allclasses-frame.html','classListFrame')">
+ <xsl:call-template name="pageHeader"/>
+ <h3>Summary</h3>
+ <table class="log" cellpadding="5"
cellspacing="2" width="100%">
+ <tr>
+ <!--th width="10%"
nowrap="nowrap">Date</th>
+ <th width="10%" nowrap="nowrap">Elapsed
time</th-->
+ <th width="10%" nowrap="nowrap">Reported
Classes</th>
+ <th width="10%" nowrap="nowrap">Methods
Hit</th>
+ <th width="10%" nowrap="nowrap">Lines
Hit</th>
+ </tr>
+ <tr class="a">
+ <!--td nowrap="nowrap"><xsl:value-of
select="execution_log/@program_start"/></td>
+ <td><xsl:value-of
select="format-number(execution_log/@elapsed_time div
1000,'0.0')"/>secs</td-->
+ <td><xsl:value-of
select="count(package/class)"/></td>
+ <td><xsl:value-of
select="format-number(cov.data/@hit_methods div
cov.data/(a)total_methods,'0.0%')"/></td>
+ <td><xsl:value-of select="format-number(cov.data/@hit_lines
div cov.data/(a)total_lines,'0.0%')"/></td>
+ </tr>
+ </table>
+ <table border="0" width="100%">
+ <tr>
+ <td style="text-align: justify;">
+ To ensure accurate test runs on Java applications, developers need to know how
much of
+ the code has been tested, and where to find any untested code. Coverage helps
you
+ locate untested code, and measure precisely how much code has been exercised.
+ The result is a higher quality application in a shorter period of time.
+ <p/>
+ </td>
+ </tr>
+ </table>
+
+ <h3>Packages</h3>
+ <table class="log" cellpadding="5"
cellspacing="2" width="100%">
+ <xsl:apply-templates select="package[1]"
mode="stats.header"/>
+ <!-- display packages and sort them via their coverage rate -->
+ <xsl:for-each select="package">
+ <xsl:sort data-type="number"
select="cov.data/@hit_lines div cov.data/@total_lines"/>
+ <tr>
+ <xsl:call-template name="alternate-row"/>
+ <td><a
href="{translate(@name,'.','/')}/package-summary.html"><xsl:value-of
select="@name"/></a></td>
+ <td><xsl:value-of
select="format-number(cov.data/@hit_methods div
cov.data/(a)total_methods,'0.0%')"/></td>
+ <td><xsl:value-of
select="format-number(cov.data/@hit_lines div
cov.data/(a)total_lines,'0.0%')"/></td>
+ </tr>
+ </xsl:for-each>
+ </table>
+ <xsl:call-template name="pageFooter"/>
+ </body>
+ </html>
+</xsl:template>
+
+<!--
+ detailed info for a package. It will output the list of classes
+, the summary page, and the info for each class
+-->
+<xsl:template match="package" mode="write">
+ <xsl:variable name="package.dir">
+ <xsl:if test="not(@name = '')"><xsl:value-of
select="translate(@name,'.','/')"/></xsl:if>
+ <xsl:if test="@name = ''">.</xsl:if>
+ </xsl:variable>
+
+ <!-- create a classes-list.html in the package directory -->
+ <redirect:write
file="{$output.dir}/{$package.dir}/package-frame.html">
+ <xsl:apply-templates select="." mode="classes.list"/>
+ </redirect:write>
+
+ <!-- create a package-summary.html in the package directory -->
+ <redirect:write
file="{$output.dir}/{$package.dir}/package-summary.html">
+ <xsl:apply-templates select="."
mode="package.summary"/>
+ </redirect:write>
+
+ <!-- for each class, creates a @name.html -->
+ <xsl:for-each select="class">
+ <redirect:write
file="{$output.dir}/{$package.dir}/{(a)name}.html">
+ <xsl:apply-templates select="."
mode="class.details"/>
+ </redirect:write>
+ </xsl:for-each>
+</xsl:template>
+
+<!-- list of classes in a package -->
+<xsl:template match="package" mode="classes.list">
+ <html>
+ <HEAD>
+ <xsl:call-template name="create.stylesheet.link">
+ <xsl:with-param name="package.name"
select="@name"/>
+ </xsl:call-template>
+ </HEAD>
+ <BODY>
+ <table width="100%">
+ <tr>
+ <td nowrap="nowrap">
+ <H2><a href="package-summary.html"
target="classFrame"><xsl:value-of
select="@name"/></a></H2>
+ </td>
+ </tr>
+ </table>
+
+ <H2>Classes</H2>
+ <TABLE WIDTH="100%">
+ <xsl:for-each select="class">
+ <xsl:sort select="@name"/>
+ <tr>
+ <td nowrap="nowrap">
+ <a href="{(a)name}.html"
target="classFrame"><xsl:value-of select="@name"/></a>
+ </td>
+ </tr>
+ </xsl:for-each>
+ </TABLE>
+ </BODY>
+ </html>
+</xsl:template>
+
+<!-- summary of a package -->
+<xsl:template match="package" mode="package.summary">
+ <HTML>
+ <HEAD>
+ <xsl:call-template name="create.stylesheet.link">
+ <xsl:with-param name="package.name"
select="@name"/>
+ </xsl:call-template>
+ </HEAD>
+ <!-- when loading this package, it will open the classes into the frame
-->
+ <BODY
onload="open('package-frame.html','classListFrame')">
+ <xsl:call-template name="pageHeader"/>
+ <h3>Package <xsl:value-of select="@name"/></h3>
+ <table class="log" cellpadding="5"
cellspacing="2" width="100%">
+ <xsl:apply-templates select="."
mode="stats.header"/>
+ <xsl:apply-templates select="." mode="stats"/>
+ </table>
+
+ <xsl:if test="count(class) > 0">
+ <H3>Classes</H3>
+ <table class="log" cellpadding="5"
cellspacing="2" width="100%">
+ <xsl:apply-templates select="."
mode="stats.header"/>
+ <xsl:apply-templates select="class"
mode="stats">
+ <xsl:sort data-type="number"
select="cov.data/@hit_lines div cov.data/@total_lines"/>
+ </xsl:apply-templates>
+ </table>
+ </xsl:if>
+ <xsl:call-template name="pageFooter"/>
+ </BODY>
+ </HTML>
+</xsl:template>
+
+<!-- details of a class -->
+<xsl:template match="class" mode="class.details">
+ <xsl:variable name="package.name"
select="(ancestor::package)[last()]/@name"/>
+ <HTML>
+ <HEAD>
+ <xsl:call-template name="create.stylesheet.link">
+ <xsl:with-param name="package.name"
select="$package.name"/>
+ </xsl:call-template>
+ </HEAD>
+ <BODY>
+ <xsl:call-template name="pageHeader"/>
+ <H3>Class <xsl:if test="not($package.name =
'')"><xsl:value-of
select="$package.name"/>.</xsl:if><xsl:value-of
select="@name"/></H3>
+
+ <!-- class summary -->
+ <table class="log" cellpadding="5"
cellspacing="2" width="100%">
+ <xsl:apply-templates select="."
mode="stats.header"/>
+ <xsl:apply-templates select="." mode="stats"/>
+ </table>
+
+ <!-- details of methods -->
+ <H3>Methods</H3>
+ <table class="log" cellpadding="5"
cellspacing="2" width="100%">
+ <xsl:apply-templates select="method[1]"
mode="stats.header"/>
+ <xsl:apply-templates select="method"
mode="stats">
+ <xsl:sort data-type="number"
select="cov.data/@hit_lines div cov.data/@total_lines"/>
+ </xsl:apply-templates>
+ </table>
+ <xsl:call-template name="pageFooter"/>
+ </BODY>
+ </HTML>
+
+</xsl:template>
+
+<!-- Page Header -->
+<xsl:template name="pageHeader">
+ <!-- jakarta logo -->
+ <table border="0" cellpadding="0" cellspacing="0"
width="100%">
+ <tr>
+ <td class="bannercell" rowspan="2">
+ <a
href="http://jakarta.apache.org/">
+ <img
src="http://jakarta.apache.org/images/jakarta-logo.gif"
alt="http://jakarta.apache.org" align="left"
border="0"/>
+ </a>
+ </td>
+ <td style="text-align:right"><h2>Source Code
Coverage</h2></td>
+ </tr>
+ <tr>
+ <td style="text-align:right">Designed for use with <a
href='http://www.sitraka.com/jprobe'>Sitraka JProbe</a> and <a
href='http://jakarta.apache.org'>Ant</a>.</td>
+ </tr>
+ </table>
+ <hr size="1"/>
+</xsl:template>
+
+<!-- Page Footer -->
+<xsl:template name="pageFooter">
+</xsl:template>
+
+
+<xsl:template name="table.header">
+ <tr>
+ <th width="80%">Name</th>
+ <th width="10%" nowrap="nowrap">Methods Hit</th>
+ <th width="10%" nowrap="nowrap">Lines Hit</th>
+ </tr>
+</xsl:template>
+
+<xsl:template match="method" mode="stats.header">
+ <tr>
+ <th width="90%">Name</th>
+ <th width="10%" nowrap="nowrap">Lines Hit</th>
+ </tr>
+</xsl:template>
+<xsl:template match="method" mode="stats">
+ <tr>
+ <xsl:call-template name="alternate-row"/>
+ <td><xsl:value-of select="@name"/></td>
+ <td>
+ <xsl:value-of select="format-number(cov.data/@hit_lines div
cov.data/(a)total_lines,'0.0%')"/>
+ </td>
+ </tr>
+</xsl:template>
+
+<xsl:template match="package|class" mode="stats.header">
+ <tr>
+ <th width="80%">Name</th>
+ <th width="10%" nowrap="nowrap">Methods Hit</th>
+ <th width="10%" nowrap="nowrap">Lines Hit</th>
+ </tr>
+</xsl:template>
+<xsl:template match="package|class" mode="stats">
+ <tr>
+ <xsl:call-template name="alternate-row"/>
+ <td><xsl:value-of select="@name"/></td>
+ <td><xsl:value-of select="format-number(cov.data/@hit_methods div
cov.data/(a)total_methods,'0.0%')"/></td>
+ <td><xsl:value-of select="format-number(cov.data/@hit_lines div
cov.data/(a)total_lines,'0.0%')"/></td>
+ </tr>
+</xsl:template>
+
+<!--
+ transform string like a.b.c to ../../../
+ @param path the path to transform into a descending directory path
+-->
+<xsl:template name="path">
+ <xsl:param name="path"/>
+ <xsl:if test="contains($path,'.')">
+ <xsl:text>../</xsl:text>
+ <xsl:call-template name="path">
+ <xsl:with-param name="path"><xsl:value-of
select="substring-after($path,'.')"/></xsl:with-param>
+ </xsl:call-template>
+ </xsl:if>
+ <xsl:if test="not(contains($path,'.')) and not($path =
'')">
+ <xsl:text>../</xsl:text>
+ </xsl:if>
+</xsl:template>
+
+
+<!-- create the link to the stylesheet based on the package name -->
+<xsl:template name="create.stylesheet.link">
+ <xsl:param name="package.name"/>
+ <LINK REL ="stylesheet" TYPE="text/css"
TITLE="Style"><xsl:attribute name="href"><xsl:if
test="not($package.name = 'unnamed package')"><xsl:call-template
name="path"><xsl:with-param name="path"
select="$package.name"/></xsl:call-template></xsl:if>stylesheet.css</xsl:attribute></LINK>
+</xsl:template>
+
+<!-- alternated row style -->
+<xsl:template name="alternate-row">
+<xsl:attribute name="class">
+ <xsl:if test="position() mod 2 = 1">a</xsl:if>
+ <xsl:if test="position() mod 2 = 0">b</xsl:if>
+</xsl:attribute>
+</xsl:template>
+
+</xsl:stylesheet>
+
+
Property changes on: modules/portlet/trunk/tools/etc/coverage-frames.xsl
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/tools/etc/jbossbuild/tasks.xml
===================================================================
--- modules/portlet/trunk/tools/etc/jbossbuild/tasks.xml (rev 0)
+++ modules/portlet/trunk/tools/etc/jbossbuild/tasks.xml 2007-08-17 15:29:49 UTC (rev
7981)
@@ -0,0 +1,251 @@
+<?xml version="1.0"?>
+
+<!--
+ JBoss, the OpenSource J2EE webOS
+
+ Distributable under LGPL license.
+ See terms of license at
gnu.org.
+-->
+<project name="jboss.ant.tasks"
+ default="help-fragment"
+>
+<!-- ================================================================== -->
+<!-- Properties -->
+<!-- ================================================================== -->
+
+
+ <property name="cvs.prefix"
+ value=":pserver:anonymous@anoncvs.forge.jboss.com:/cvsroot/jboss"/>
+
+ <property name="jboss.tasks.path"
+ value="../tools/lib/jbossbuild.jar" />
+
+ <property name="jbossbuild.component.info"
+ value="component-info.xml"/>
+
+ <property name="jbossbuild.thirdparty.dir"
+ value="thirdparty"/>
+
+ <property name="jbossbuild.targetdefs.refid"
+ value="targets"/>
+
+
+
+<!-- ================================================================== -->
+<!-- Type Definitions -->
+<!-- ================================================================== -->
+
+ <!-- The generate type -->
+ <typedef name="generate"
+ classname="org.jboss.ant.types.Generate"
+ loaderRef="jboss.tasks.path"
+ classpath="${jboss.tasks.path}"
+ />
+
+ <!-- The build type -->
+ <typedef name="build"
+ classname="org.jboss.ant.types.build.Build"
+ loaderRef="jboss.tasks.path"
+ classpath="${jboss.tasks.path}"
+ />
+
+ <!-- The artifact type definition type -->
+ <typedef name="artifacttype"
+ classname="org.jboss.ant.types.build.ArtifactType"
+ loaderRef="jboss.tasks.path"
+ classpath="${jboss.tasks.path}"
+ />
+
+ <!-- The component definition type -->
+ <typedef name="componentdef"
+ classname="org.jboss.ant.types.component.ComponentDefinition"
+ loaderRef="jboss.tasks.path"
+ classpath="${jboss.tasks.path}"
+ />
+
+ <!-- The component type -->
+ <typedef name="component"
+ classname="org.jboss.ant.types.build.Component"
+ loaderRef="jboss.tasks.path"
+ classpath="${jboss.tasks.path}"
+ />
+
+ <!-- The includes type -->
+ <typedef name="includes"
+ classname="org.jboss.ant.types.Includes"
+ loaderRef="jboss.tasks.path"
+ classpath="${jboss.tasks.path}"
+ />
+
+ <!-- The build targets type -->
+ <typedef name="targets"
+ classname="org.jboss.ant.types.target.TargetDefinitions"
+ loaderRef="jboss.tasks.path"
+ classpath="${jboss.tasks.path}"
+ />
+
+
+<!-- ================================================================== -->
+<!-- Task Definitions -->
+<!-- ================================================================== -->
+
+
+ <!-- Generate a componentref graph and resolve the dependencies -->
+ <taskdef name="synchronizeinfo"
+ classname="org.jboss.ant.tasks.build.SynchronizeComponentsTask"
+ loaderRef="jboss.tasks.path"
+ classpath="${jboss.tasks.path}"
+ />
+
+ <!-- A task which allows a visitor to visit the graph -->
+ <taskdef name="visit-componentref-graph"
+ classname="org.jboss.ant.tasks.build.VisitComponentRefGraphTask"
+ loaderRef="jboss.tasks.path"
+ classpath="${jboss.tasks.path}"
+ />
+
+ <!-- Generate libraries.ent with version number in paths -->
+ <taskdef name="gen-lib-file"
+ classname="org.jboss.ant.tasks.build.GenerateLibrariesFile"
+ loaderRef="jboss.tasks.path"
+ classpath="${jboss.tasks.path}"
+ />
+
+
+
+ <!-- Executes a given target without reparsing the project file -->
+ <taskdef name="execute-target"
+ classname="org.jboss.ant.tasks.build.TargetExecutor"
+ loaderRef="jboss.tasks.path"
+ classpath="${jboss.tasks.path}"
+ />
+
+
+
+
+
+
+
+
+
+<!-- ================================================================== -->
+<!-- Artifact Definitions -->
+<!-- ================================================================== -->
+
+ <artifacttype type="jar" outputtype="lib"/>
+ <artifacttype type="zip" outputtype="lib"/>
+ <artifacttype type="sar" outputtype="lib"/>
+ <artifacttype type="rar" outputtype="lib"/>
+ <artifacttype type="war" outputtype="lib"/>
+ <artifacttype type="deployer" outputtype="lib"/>
+ <artifacttype type="api" outputtype="api"/>
+ <artifacttype type="xml" outputtype="resource"/>
+ <artifacttype type="policy" outputtype="resource"/>
+ <artifacttype type="properties" outputtype="resource"/>
+ <artifacttype type="sh" outputtype="bin"/>
+ <artifacttype type="bat" outputtype="bin"/>
+ <artifacttype type="conf" outputtype="bin"/>
+ <artifacttype type="dtd" outputtype="dtd"/>
+ <artifacttype type="xsd" outputtype="schema"/>
+ <artifacttype type="aop" outputtype="resource"/>
+ <artifacttype type="idl" outputtype="resource"/>
+ <artifacttype type="md5" outputtype="bin"/>
+ <artifacttype type="dir" outputtype="lib"/>
+ <artifacttype type="ddl" outputtype="resource"/>
+
+<!-- ================================================================== -->
+<!-- Target Definitions -->
+<!-- ================================================================== -->
+
+ <targets id="targets">
+
+ <!-- ============================================================ -->
+ <!-- Synchronize -->
+ <!-- Resynchronizes the project with cvs -->
+ <!-- ============================================================ -->
+
+ <targetdef target="synchronize"
description="Synchronize">
+
+ <!-- Update the main build folder and tools from cvs
+ then do the same for the components before running
+ the after synchronization processing
+ NOTE: Does not automatically invoke component builds
+ as the list of components maybe out-of-date at this point
+ and we need to conditionally do cvs co/update
+ -->
+ <main components="none">
+ <!-- cvs command="update -dP"
failonerror="true"/-->
+ <!--invoke target="synchronize" dir="../tools"/-->
+ <execute-target target="synchronize.components" />
+ <!-- execant target="synchronize.after.main"/-->
+ </main>
+
+ <componentmain unless="@{local}">
+ <mkdir dir="@{thirdpartyDir}"/>
+ <get src="(a){location}/${jbossbuild.component.info}"
+ dest="(a){thirdpartyDir}/${jbossbuild.component.info}"
+ useTimestamp="true"
+ verbose="true"
+ />
+ </componentmain>
+
+ <!-- If the component exists we just do a cvs update -->
+ <componentmain if="@{exists}">
+ <cvs dest="@{dir}" command="update"/>
+ <!-- NOTE: unable to delegate to component until JBBUILD-62 is resolved
-->
+ <!--invoke target="synchronize" dir="@{dir}"/-->
+ <!--execant target="synchronize.after"
dir="@{dir}"/-->
+ </componentmain>
+
+ <!-- If the component doesn't exist and we want to
+ get the source build check it out from cvs
+ -->
+ <componentmain unless="@{exists}" if="@{local}">
+ <cvs dest="(a){dir.parent}">
+ <commandline>
+ <argument value="-d"/>
+ <argument value="(a){build.cvsroot}"/>
+ <argument value="co"/>
+ <argument value="-d"/>
+ <argument value="@{id}"/>
+ <argument value="@{module}"/>
+ </commandline>
+ </cvs>
+ <!-- execant target="synchronize.after"
dir="@{dir}"/-->
+ </componentmain>
+
+ <!-- The component already exists do a cvs update
+ and run the after synchronization
+ -->
+ <component nomain="true">
+ <cvs command="update -dP" failonerror="true"/>
+ <!--execant target="synchronize.after"/-->
+ </component>
+
+ <!-- If we are not doing a source checkout of this
+ component, download the artifacts to thirdparty
+ -->
+ <artifact unless="(a){component.local}">
+ <mkdir dir="@{parentDir}"/>
+ <get src="@{location}"
+ dest="@{output}"
+ useTimestamp="true"
+ verbose="true"
+ />
+ </artifact>
+ </targetdef>
+
+
+ </targets>
+
+
+
+<!-- ================================================================== -->
+<!-- Targets -->
+<!-- ================================================================== -->
+
+ <target name="help-fragment">
+ <fail message="Do not execute this build fragment directly!"/>
+ </target>
+
+</project>
Property changes on: modules/portlet/trunk/tools/etc/jbossbuild/tasks.xml
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/tools/etc/jdepend-frames.xsl
===================================================================
--- modules/portlet/trunk/tools/etc/jdepend-frames.xsl (rev 0)
+++ modules/portlet/trunk/tools/etc/jdepend-frames.xsl 2007-08-17 15:29:49 UTC (rev 7981)
@@ -0,0 +1,486 @@
+<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0"
+
xmlns:lxslt="http://xml.apache.org/xslt"
+ xmlns:redirect="org.apache.xalan.lib.Redirect"
+ extension-element-prefixes="redirect">
+<xsl:output method="html" indent="yes"
encoding="US-ASCII"/>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+
http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+<!--
+
+ Sample stylesheet to be used with JDepend XML output.
+
+ It creates a set of HTML files a la javadoc where you can browse easily
+ through all packages and classes.
+
+ @author <a href="mailto:jtulley@novell.com">Jeff Tulley</a>
+
+ -->
+<xsl:param name="output.dir" select="'.'"/>
+
+<xsl:template match="JDepend">
+ <!-- create the index.html -->
+ <redirect:write file="{$output.dir}/index.html">
+ <xsl:call-template name="index.html"/>
+ </redirect:write>
+
+ <!-- create the stylesheet.css -->
+ <redirect:write file="{$output.dir}/stylesheet.css">
+ <xsl:call-template name="stylesheet.css"/>
+ </redirect:write>
+
+ <!-- create the overview-packages.html at the root -->
+ <redirect:write file="{$output.dir}/overview-summary.html">
+ <xsl:apply-templates select="." mode="overview.packages"/>
+ </redirect:write>
+
+ <!-- create the overview-packages.html at the root -->
+ <redirect:write file="{$output.dir}/overview-packages.html">
+ <xsl:apply-templates select="." mode="packages.details"/>
+ </redirect:write>
+
+ <!-- create the overview-cycles.html at the root -->
+ <redirect:write file="{$output.dir}/overview-cycles.html">
+ <xsl:apply-templates select="." mode="cycles.details"/>
+ </redirect:write>
+
+ <!-- create the overview-cycles.html at the root -->
+ <redirect:write file="{$output.dir}/overview-explanations.html">
+ <xsl:apply-templates select="." mode="explanations"/>
+ </redirect:write>
+
+ <!-- create the all-packages.html at the root -->
+ <redirect:write file="{$output.dir}/all-packages.html">
+ <xsl:apply-templates select="Packages"
mode="all.packages"/>
+ </redirect:write>
+
+ <!-- create the all-cycles.html at the root -->
+ <redirect:write file="{$output.dir}/all-cycles.html">
+ <xsl:apply-templates select="Cycles" mode="all.cycles"/>
+ </redirect:write>
+</xsl:template>
+
+
+<xsl:template name="index.html">
+<html>
+ <head>
+ <title>JDepend Analysis</title>
+ </head>
+ <frameset cols="20%,80%">
+ <frameset rows="30%,70%">
+ <frame src="all-packages.html"
name="packageListFrame"/>
+ <frame src="all-cycles.html"
name="classListFrame"/>
+ </frameset>
+ <frame src="overview-summary.html"
name="classFrame"/>
+ </frameset>
+ <noframes>
+ <h2>Frame Alert</h2>
+ <p>
+ This document is designed to be viewed using the frames feature. If you see
this message, you are using a non-frame-capable web client.
+ </p>
+ </noframes>
+</html>
+</xsl:template>
+
+<!-- this is the stylesheet css to use for nearly everything -->
+<xsl:template name="stylesheet.css">
+ <style type="text/css">
+ body {
+ font:normal 68% verdana,arial,helvetica;
+ color:#000000;
+ }
+ table tr td, tr th {
+ font-size: 68%;
+ }
+ table.details tr th{
+ font-weight: bold;
+ text-align:left;
+ background:#a6caf0;
+ }
+ table.details tr td{
+ background:#eeeee0;
+ }
+
+ p {
+ line-height:1.5em;
+ margin-top:0.5em; margin-bottom:1.0em;
+ margin-left:2em;
+ margin-right:2em;
+ }
+ h1 {
+ margin: 0px 0px 5px; font: 165% verdana,arial,helvetica
+ }
+ h2 {
+ margin-top: 1em; margin-bottom: 0.5em; font: bold 125% verdana,arial,helvetica
+ }
+ h3 {
+ margin-bottom: 0.5em; font: bold 115% verdana,arial,helvetica
+ }
+ h4 {
+ margin-bottom: 0.5em; font: bold 100% verdana,arial,helvetica
+ }
+ h5 {
+ margin-bottom: 0.5em; font: bold 100% verdana,arial,helvetica
+ }
+ h6 {
+ margin-bottom: 0.5em; font: bold 100% verdana,arial,helvetica
+ }
+ .Error {
+ font-weight:bold; color:red;
+ }
+ .Failure {
+ font-weight:bold; color:purple;
+ }
+ .Properties {
+ text-align:right;
+ }
+ </style>
+</xsl:template>
+
+<xsl:template match="JDepend" mode="overview.packages">
+ <html>
+ <head>
+ <link rel="stylesheet" type="text/css"
href="stylesheet.css"/>
+ </head>
+ <body>
+ <xsl:call-template name="pageHeader"/>
+ <table width="100%"><tr
align="left"><h2>Summary</h2><td>
+ </td><td align="right">
+ [summary]
+ [<a href="overview-packages.html">packages</a>]
+ [<a href="overview-cycles.html">cycles</a>]
+ [<a href="overview-explanations.html">explanations</a>]
+ </td></tr></table>
+ <table width="100%" class="details">
+ <tr>
+ <th>Package</th>
+ <th>Total Classes</th>
+ <th><a
href="overview-explanations.html#EXnumber">Abstract
Classes</a></th>
+ <th><a
href="overview-explanations.html#EXnumber">Concrete
Classes</a></th>
+ <th><a
href="overview-explanations.html#EXafferent">Afferent
Couplings</a></th>
+ <th><a
href="overview-explanations.html#EXefferent">Efferent
Couplings</a></th>
+ <th><a
href="overview-explanations.html#EXabstractness">Abstractness</a></th>
+ <th><a
href="overview-explanations.html#EXinstability">Instability</a></th>
+ <th><a
href="overview-explanations.html#EXdistance">Distance</a></th>
+
+ </tr>
+ <xsl:for-each select="./Packages/Package">
+ <xsl:if test="count(error) = 0">
+ <tr>
+ <td align="left">
+ <a>
+ <xsl:attribute
name="href">overview-packages.html#PK<xsl:value-of
select="@name"/>
+ </xsl:attribute>
+ <xsl:value-of select="@name"/>
+ </a>
+ </td>
+ <td align="right"><xsl:value-of
select="Stats/TotalClasses"/></td>
+ <td align="right"><xsl:value-of
select="Stats/AbstractClasses"/></td>
+ <td align="right"><xsl:value-of
select="Stats/ConcreteClasses"/></td>
+ <td align="right"><xsl:value-of
select="Stats/Ca"/></td>
+ <td align="right"><xsl:value-of
select="Stats/Ce"/></td>
+ <td align="right"><xsl:value-of
select="Stats/A"/></td>
+ <td align="right"><xsl:value-of
select="Stats/I"/></td>
+ <td align="right"><xsl:value-of
select="Stats/D"/></td>
+ </tr>
+ </xsl:if>
+ </xsl:for-each>
+ <xsl:for-each select="./Packages/Package">
+ <xsl:if test="count(error) > 0">
+ <tr>
+ <td align="left">
+ <xsl:value-of select="@name"/>
+ </td>
+ <td align="left"
colspan="8"><xsl:value-of select="error"/></td>
+ </tr>
+ </xsl:if>
+ </xsl:for-each>
+ </table>
+ </body>
+ </html>
+</xsl:template>
+
+<xsl:template match="JDepend" mode="packages.details">
+ <html>
+ <head>
+ <link rel="stylesheet" type="text/css"
href="stylesheet.css"/>
+ </head>
+ <body>
+ <xsl:call-template name="pageHeader"/>
+ <table width="100%"><tr
align="left"><h2>Packages</h2><td>
+ </td><td align="right">
+ [<a href="overview-summary.html">summary</a>]
+ [packages]
+ [<a href="overview-cycles.html">cycles</a>]
+ [<a href="overview-explanations.html">explanations</a>]
+ </td></tr></table>
+
+ <xsl:for-each select="./Packages/Package">
+ <xsl:if test="count(error) = 0">
+ <h3><a><xsl:attribute name="name">PK<xsl:value-of
select="@name"/></xsl:attribute>
+ <xsl:value-of select="@name"/></a></h3>
+
+ <table width="100%"><tr>
+ <td><a
href="overview-explanations.html#EXafferent">Afferent Couplings</a>:
<xsl:value-of select="Stats/Ca"/></td>
+ <td><a
href="overview-explanations.html#EXefferent">Efferent Couplings</a>:
<xsl:value-of select="Stats/Ce"/></td>
+ <td><a
href="overview-explanations.html#EXabstractness">Abstractness</a>:
<xsl:value-of select="Stats/A"/></td>
+ <td><a
href="overview-explanations.html#EXinstability">Instability</a>:
<xsl:value-of select="Stats/I"/></td>
+ <td><a
href="overview-explanations.html#EXdistance">Distance</a>:
<xsl:value-of select="Stats/D"/></td>
+ </tr></table>
+
+ <table width="100%" class="details">
+ <tr>
+ <th>Abstract Classes</th>
+ <th>Concrete Classes</th>
+ <th>Used by Packages</th>
+ <th>Uses Packages</th>
+ </tr>
+ <tr>
+ <td valign="top" width="25%">
+ <xsl:if test="count(AbstractClasses/Class)=0">
+ <i>None</i>
+ </xsl:if>
+ <xsl:for-each select="AbstractClasses/Class">
+ <xsl:value-of select="node()"/><br/>
+ </xsl:for-each>
+ </td>
+ <td valign="top" width="25%">
+ <xsl:if test="count(ConcreteClasses/Class)=0">
+ <i>None</i>
+ </xsl:if>
+ <xsl:for-each select="ConcreteClasses/Class">
+ <xsl:value-of select="node()"/><br/>
+ </xsl:for-each>
+ </td>
+ <td valign="top" width="25%">
+ <xsl:if test="count(UsedBy/Package)=0">
+ <i>None</i>
+ </xsl:if>
+ <xsl:for-each select="UsedBy/Package">
+ <a>
+ <xsl:attribute
name="href">overview-packages.html#PK<xsl:value-of
select="node()"/></xsl:attribute>
+ <xsl:value-of select="node()"/>
+ </a><br/>
+ </xsl:for-each>
+ </td>
+ <td valign="top" width="25%">
+ <xsl:if test="count(DependsUpon/Package)=0">
+ <i>None</i>
+ </xsl:if>
+ <xsl:for-each select="DependsUpon/Package">
+ <a>
+ <xsl:attribute
name="href">overview-packages.html#PK<xsl:value-of
select="node()"/></xsl:attribute>
+ <xsl:value-of select="node()"/>
+ </a><br/>
+ </xsl:for-each>
+ </td>
+ </tr>
+ </table>
+ </xsl:if>
+ </xsl:for-each>
+ <!-- this is often a long listing; provide a lower navigation table also -->
+ <table width="100%"><tr
align="left"><td></td><td align="right">
+ [<a href="overview-summary.html">summary</a>]
+ [packages]
+ [<a href="overview-cycles.html">cycles</a>]
+ [<a href="overview-explanations.html">explanations</a>]
+ </td></tr></table>
+ </body>
+ </html>
+</xsl:template>
+
+<xsl:template match="JDepend" mode="cycles.details">
+ <html>
+ <head>
+ <link rel="stylesheet" type="text/css"
href="stylesheet.css"/>
+ </head>
+ <body>
+ <xsl:call-template name="pageHeader"/>
+ <table width="100%"><tr
align="left"><h2>Cycles</h2><td>
+ </td><td align="right">
+ [<a href="overview-summary.html">summary</a>]
+ [<a href="overview-packages.html">packages</a>]
+ [cycles]
+ [<a href="overview-explanations.html">explanations</a>]
+ </td></tr></table>
+ <!--<table width="100%"><tr><td>
+ </td><td align="right">
+ [<a href="#NVsummary">summary</a>]
+ [<a href="#NVpackages">packages</a>]
+ [<a href="#NVcycles">cycles</a>]
+ [<a href="#NVexplanations">explanations</a>]
+ </td></tr></table> -->
+
+ <xsl:if test="count(Cycles/Package) = 0">
+ <p>There are no cyclic dependancies.</p>
+ </xsl:if>
+ <xsl:for-each select="Cycles/Package">
+ <h3><a><xsl:attribute name="name">#CY<xsl:value-of
select="@Name"/></xsl:attribute><xsl:value-of
select="@Name"/></a></h3><p>
+ <xsl:for-each select="Package">
+ <xsl:value-of select="."/><br/>
+ </xsl:for-each></p>
+ </xsl:for-each>
+ <!-- this is often a long listing; provide a lower navigation table also -->
+ <table width="100%"><tr
align="left"><td></td><td align="right">
+ [<a href="overview-summary.html">summary</a>]
+ [<a href="overview-packages.html">packages</a>]
+ [cycles]
+ [<a href="overview-explanations.html">explanations</a>]
+ </td></tr></table>
+ </body>
+ </html>
+</xsl:template>
+
+<xsl:template match="JDepend" mode="explanations">
+ <html>
+ <head>
+ <link rel="stylesheet" type="text/css"
href="stylesheet.css"/>
+ </head>
+ <body>
+ <xsl:call-template name="pageHeader"/>
+
+ <table width="100%"><tr
align="left"><h2>Explanations</h2><td>
+ </td><td align="right">
+ [<a href="overview-summary.html">summary</a>]
+ [<a href="overview-packages.html">packages</a>]
+ [<a href="overview-cycles.html">cycles</a>]
+ [explanations]
+ </td></tr></table>
+
+ <p>The following explanations are for quick reference and are lifted directly
from the original <a
href="http://www.clarkware.com/software/JDepend.html">JDepend
documentation</a>.</p>
+
+ <h3><a name="EXnumber">Number of Classes</a></h3>
+ <p>The number of concrete and abstract classes (and interfaces) in the package
is an indicator of the extensibility of the package.</p>
+ <h3><a name="EXafferent">Afferent Couplings</a></h3>
+ <p>The number of other packages that depend upon classes within the package is
an indicator of the package's responsibility. </p>
+ <h3><a name="EXefferent">Efferent Couplings</a></h3>
+ <p>The number of other packages that the classes in the package depend upon is
an indicator of the package's independence. </p>
+ <h3><a name="EXabstractness">Abstractness</a></h3>
+ <p>The ratio of the number of abstract classes (and interfaces) in the analyzed
package to the total number of classes in the analyzed package. </p>
+ <p>The range for this metric is 0 to 1, with A=0 indicating a completely
concrete package and A=1 indicating a completely abstract package. </p>
+ <h3><a name="EXinstability">Instability</a></h3>
+ <p>The ratio of efferent coupling (Ce) to total coupling (Ce / (Ce + Ca)). This
metric is an indicator of the package's resilience to change. </p>
+ <p>The range for this metric is 0 to 1, with I=0 indicating a completely stable
package and I=1 indicating a completely instable package. </p>
+ <h3><a name="EXdistance">Distance</a></h3>
+ <p>The perpendicular distance of a package from the idealized line A + I = 1.
This metric is an indicator of the package's balance between abstractness and
stability. </p>
+ <p>A package squarely on the main sequence is optimally balanced with respect
to its abstractness and stability. Ideal packages are either completely abstract and
stable (x=0, y=1) or completely concrete and instable (x=1, y=0). </p>
+ <p>The range for this metric is 0 to 1, with D=0 indicating a package that is
coincident with the main sequence and D=1 indicating a package that is as far from the
main sequence as possible. </p>
+
+ </body>
+ </html>
+</xsl:template>
+
+
+<!--
+Creates an html file that contains a link to all package links in
overview-packages.html.
+ @bug there will be a problem here, I don't know yet how to handle unnamed package
:(
+-->
+<xsl:template match="JDepend/Packages" mode="all.packages">
+ <html>
+ <head>
+ <link rel="stylesheet" type="text/css"
href="stylesheet.css"/>
+ </head>
+ <body>
+ <table width="100%"><tr
align="left"><td></td><td nowrap="nowrap"
align="right">
+ [<a href="overview-summary.html"
target="classFrame">summary</a>]
+ [<a href="overview-packages.html"
target="classFrame">packages</a>]
+ [<a href="overview-cycles.html"
target="classFrame">cycles</a>]
+ [<a href="overview-explanations.html"
target="classFrame">explanations</a>]
+ </td></tr></table>
+ <h2>Packages</h2>
+ <table width="100%">
+ <xsl:apply-templates select="Package[count(error)=0]"
mode="all.packages.link">
+ <xsl:sort select="@name"/>
+ </xsl:apply-templates>
+ <xsl:apply-templates select="Package[count(error) > 0]"
mode="all.packages.nolink">
+ <xsl:sort select="@name"/>
+ </xsl:apply-templates>
+ </table>
+ </body>
+ </html>
+</xsl:template>
+
+<xsl:template match="JDepend/Packages/Package"
mode="all.packages.link">
+ <tr>
+ <td nowrap="nowrap">
+ <a href="overview-packages.html#PK{@name}"
target="classFrame">
+ <xsl:value-of select="@name"/>
+ </a>
+ </td>
+ </tr>
+</xsl:template>
+
+<!--
+I do not know JDepend enough to know if every error results in a non-analyzed package,
+but that is how I am presenting it to the viewer. This may need to change.
+ @bug there will be a problem here, I don't know yet how to handle unnamed package
:(
+-->
+<xsl:template match="JDepend/Packages/Package"
mode="all.packages.nolink">
+ <tr>
+ <td nowrap="nowrap">
+ Not Analyzed: <xsl:value-of select="@name"/>
+ </td>
+ </tr>
+</xsl:template>
+
+<!--
+Creates an html file that contains a link to all package links in overview-cycles.html.
+ @bug there will be a problem here, I don't know yet how to handle unnamed package
:(
+-->
+<xsl:template match="JDepend/Cycles" mode="all.cycles">
+ <html>
+ <head>
+ <link rel="stylesheet" type="text/css"
href="stylesheet.css"/>
+ </head>
+ <body>
+ <table width="100%"><tr
align="left"><td></td><td nowrap="nowrap"
align="right">
+ [<a href="overview-summary.html"
target="classFrame">summary</a>]
+ [<a href="overview-packages.html"
target="classFrame">packages</a>]
+ [<a href="overview-cycles.html"
target="classFrame">cycles</a>]
+ [<a href="overview-explanations.html"
target="classFrame">explanations</a>]
+ </td></tr></table>
+ <h2>Cycles</h2>
+ <table width="100%">
+ <xsl:apply-templates select="Package"
mode="all.cycles">
+ <xsl:sort select="@Name"/>
+ </xsl:apply-templates>
+ </table>
+ </body>
+ </html>
+</xsl:template>
+
+<xsl:template match="JDepend/Cycles/Package"
mode="all.cycles">
+ <tr>
+ <td nowrap="nowrap">
+ <a href="overview-cycles.html#CY{@Name}"
target="classFrame"><xsl:value-of select="@Name"/></a>
+ </td>
+ </tr>
+</xsl:template>
+
+<!-- Page HEADER -->
+<xsl:template name="pageHeader">
+ <h1>JDepend Analysis</h1>
+ <table width="100%">
+ <tr>
+ <td align="left"></td>
+ <td align="right">Designed for use with <a
href="http://www.clarkware.com/software/JDepend.html">JDepen... and
<a href="http://jakarta.apache.org">Ant</a>.</td>
+ </tr>
+ </table>
+ <hr size="1"/>
+</xsl:template>
+
+</xsl:stylesheet>
Property changes on: modules/portlet/trunk/tools/etc/jdepend-frames.xsl
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/tools/etc/jdepend.xsl
===================================================================
--- modules/portlet/trunk/tools/etc/jdepend.xsl (rev 0)
+++ modules/portlet/trunk/tools/etc/jdepend.xsl 2007-08-17 15:29:49 UTC (rev 7981)
@@ -0,0 +1,275 @@
+<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+
http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<xsl:output method="html" indent="yes"
encoding="US-ASCII"/>
+
+<xsl:template match="JDepend">
+ <html>
+ <head>
+ <title>JDepend Analysis</title>
+
+ <style type="text/css">
+ body {
+ font:normal 68% verdana,arial,helvetica;
+ color:#000000;
+ }
+ table tr td, tr th {
+ font-size: 68%;
+ }
+ table.details tr th{
+ font-weight: bold;
+ text-align:left;
+ background:#a6caf0;
+ }
+ table.details tr td{
+ background:#eeeee0;
+ }
+
+ p {
+ line-height:1.5em;
+ margin-top:0.5em; margin-bottom:1.0em;
+ margin-left:2em;
+ margin-right:2em;
+ }
+ h1 {
+ margin: 0px 0px 5px; font: 165% verdana,arial,helvetica
+ }
+ h2 {
+ margin-top: 1em; margin-bottom: 0.5em; font: bold 125% verdana,arial,helvetica
+ }
+ h3 {
+ margin-bottom: 0.5em; font: bold 115% verdana,arial,helvetica
+ }
+ h4 {
+ margin-bottom: 0.5em; font: bold 100% verdana,arial,helvetica
+ }
+ h5 {
+ margin-bottom: 0.5em; font: bold 100% verdana,arial,helvetica
+ }
+ h6 {
+ margin-bottom: 0.5em; font: bold 100% verdana,arial,helvetica
+ }
+ .Error {
+ font-weight:bold; color:red;
+ }
+ .Failure {
+ font-weight:bold; color:purple;
+ }
+ .Properties {
+ text-align:right;
+ }
+ </style>
+
+
+ </head>
+ <body>
+ <!--h1>JDepend Report</h1>
+ <ul>
+ <xsl:for-each select="./Packages/Package">
+ <xsl:sort select="@name"/>
+ <li><xsl:value-of select="@name"/></li>
+ </xsl:for-each>
+ </ul-->
+
+ <h1><a name="top">JDepend Analysis</a></h1>
+ <p align="right">Designed for use with <a
href="http://www.clarkware.com/software/JDepend.html">JDepen... and
<a href="http://jakarta.apache.org">Ant</a>.</p>
+ <hr size="2" />
+
+ <table width="100%"><tr><td>
+ <a name="NVsummary"><h2>Summary</h2></a>
+ </td><td align="right">
+ [<a href="#NVsummary">summary</a>]
+ [<a href="#NVpackages">packages</a>]
+ [<a href="#NVcycles">cycles</a>]
+ [<a href="#NVexplanations">explanations</a>]
+ </td></tr></table>
+
+ <table width="100%" class="details">
+ <tr>
+ <th>Package</th>
+ <th>Total Classes</th>
+ <th><a href="#EXnumber">Abstract
Classes</a></th>
+ <th><a href="#EXnumber">Concrete
Classes</a></th>
+ <th><a href="#EXafferent">Afferent
Couplings</a></th>
+ <th><a href="#EXefferent">Efferent
Couplings</a></th>
+ <th><a
href="#EXabstractness">Abstractness</a></th>
+ <th><a
href="#EXinstability">Instability</a></th>
+ <th><a
href="#EXdistance">Distance</a></th>
+
+ </tr>
+ <xsl:for-each select="./Packages/Package">
+ <xsl:if test="count(error) = 0">
+ <tr>
+ <td align="left">
+ <a>
+ <xsl:attribute name="href">#PK<xsl:value-of
select="@name"/>
+ </xsl:attribute>
+ <xsl:value-of select="@name"/>
+ </a>
+ </td>
+ <td align="right"><xsl:value-of
select="Stats/TotalClasses"/></td>
+ <td align="right"><xsl:value-of
select="Stats/AbstractClasses"/></td>
+ <td align="right"><xsl:value-of
select="Stats/ConcreteClasses"/></td>
+ <td align="right"><xsl:value-of
select="Stats/Ca"/></td>
+ <td align="right"><xsl:value-of
select="Stats/Ce"/></td>
+ <td align="right"><xsl:value-of
select="Stats/A"/></td>
+ <td align="right"><xsl:value-of
select="Stats/I"/></td>
+ <td align="right"><xsl:value-of
select="Stats/D"/></td>
+
+
+ </tr>
+ </xsl:if>
+ </xsl:for-each>
+ <xsl:for-each select="./Packages/Package">
+ <xsl:if test="count(error) > 0">
+ <tr>
+ <td align="left">
+ <xsl:value-of select="@name"/>
+ </td>
+ <td align="left" colspan="8"><xsl:value-of
select="error"/></td>
+ </tr>
+ </xsl:if>
+ </xsl:for-each>
+ </table>
+
+ <table width="100%"><tr><td>
+ <a name="NVpackages"><h2>Packages</h2></a>
+ </td><td align="right">
+ [<a href="#NVsummary">summary</a>]
+ [<a href="#NVpackages">packages</a>]
+ [<a href="#NVcycles">cycles</a>]
+ [<a href="#NVexplanations">explanations</a>]
+ </td></tr></table>
+
+ <xsl:for-each select="./Packages/Package">
+ <xsl:if test="count(error) = 0">
+ <h3><a><xsl:attribute
name="name">PK<xsl:value-of
select="@name"/></xsl:attribute>
+ <xsl:value-of select="@name"/></a></h3>
+
+ <table width="100%"><tr>
+ <td><a href="#EXafferent">Afferent
Couplings</a>: <xsl:value-of select="Stats/Ca"/></td>
+ <td><a href="#EXefferent">Efferent
Couplings</a>: <xsl:value-of select="Stats/Ce"/></td>
+ <td><a
href="#EXabstractness">Abstractness</a>: <xsl:value-of
select="Stats/A"/></td>
+ <td><a href="#EXinstability">Instability</a>:
<xsl:value-of select="Stats/I"/></td>
+ <td><a href="#EXdistance">Distance</a>:
<xsl:value-of select="Stats/D"/></td>
+ </tr></table>
+
+ <table width="100%" class="details">
+ <tr>
+ <th>Abstract Classes</th>
+ <th>Concrete Classes</th>
+ <th>Used by Packages</th>
+ <th>Uses Packages</th>
+ </tr>
+ <tr>
+ <td valign="top" width="25%">
+ <xsl:if test="count(AbstractClasses/Class)=0">
+ <i>None</i>
+ </xsl:if>
+ <xsl:for-each select="AbstractClasses/Class">
+ <xsl:value-of select="node()"/><br/>
+ </xsl:for-each>
+ </td>
+ <td valign="top" width="25%">
+ <xsl:if test="count(ConcreteClasses/Class)=0">
+ <i>None</i>
+ </xsl:if>
+ <xsl:for-each select="ConcreteClasses/Class">
+ <xsl:value-of select="node()"/><br/>
+ </xsl:for-each>
+ </td>
+ <td valign="top" width="25%">
+ <xsl:if test="count(UsedBy/Package)=0">
+ <i>None</i>
+ </xsl:if>
+ <xsl:for-each select="UsedBy/Package">
+ <a>
+ <xsl:attribute
name="href">#PK<xsl:value-of
select="node()"/></xsl:attribute>
+ <xsl:value-of select="node()"/>
+ </a><br/>
+ </xsl:for-each>
+ </td>
+ <td valign="top" width="25%">
+ <xsl:if test="count(DependsUpon/Package)=0">
+ <i>None</i>
+ </xsl:if>
+ <xsl:for-each select="DependsUpon/Package">
+ <a>
+ <xsl:attribute
name="href">#PK<xsl:value-of
select="node()"/></xsl:attribute>
+ <xsl:value-of select="node()"/>
+ </a><br/>
+ </xsl:for-each>
+ </td>
+ </tr>
+ </table>
+ </xsl:if>
+ </xsl:for-each>
+
+ <table width="100%"><tr><td>
+ <a name="NVcycles"><h2>Cycles</h2></a>
+ </td><td align="right">
+ [<a href="#NVsummary">summary</a>]
+ [<a href="#NVpackages">packages</a>]
+ [<a href="#NVcycles">cycles</a>]
+ [<a href="#NVexplanations">explanations</a>]
+ </td></tr></table>
+
+ <xsl:if test="count(Cycles/Package) = 0">
+ <p>There are no cyclic dependancies.</p>
+ </xsl:if>
+ <xsl:for-each select="Cycles/Package">
+ <h3><xsl:value-of select="@Name"/></h3><p>
+ <xsl:for-each select="Package">
+ <xsl:value-of select="."/><br/>
+ </xsl:for-each></p>
+ </xsl:for-each>
+
+ <table width="100%"><tr><td>
+ <a name="NVexplanations"><h2>Explanations</h2></a>
+ </td><td align="right">
+ [<a href="#NVsummary">summary</a>]
+ [<a href="#NVpackages">packages</a>]
+ [<a href="#NVcycles">cycles</a>]
+ [<a href="#NVexplanations">explanations</a>]
+ </td></tr></table>
+
+ <p>The following explanations are for quick reference and are lifted directly
from the original <a
href="http://www.clarkware.com/software/JDepend.html">JDepend
documentation</a>.</p>
+
+ <h3><a name="EXnumber">Number of Classes</a></h3>
+ <p>The number of concrete and abstract classes (and interfaces) in the
package is an indicator of the extensibility of the package.</p>
+ <h3><a name="EXafferent">Afferent
Couplings</a></h3>
+ <p>The number of other packages that depend upon classes within the package
is an indicator of the package's responsibility. </p>
+ <h3><a name="EXefferent">Efferent
Couplings</a></h3>
+ <p>The number of other packages that the classes in the package depend upon
is an indicator of the package's independence. </p>
+ <h3><a name="EXabstractness">Abstractness</a></h3>
+ <p>The ratio of the number of abstract classes (and interfaces) in the
analyzed package to the total number of classes in the analyzed package. </p>
+ <p>The range for this metric is 0 to 1, with A=0 indicating a completely
concrete package and A=1 indicating a completely abstract package. </p>
+ <h3><a name="EXinstability">Instability</a></h3>
+ <p>The ratio of efferent coupling (Ce) to total coupling (Ce / (Ce + Ca)).
This metric is an indicator of the package's resilience to change. </p>
+ <p>The range for this metric is 0 to 1, with I=0 indicating a completely
stable package and I=1 indicating a completely instable package. </p>
+ <h3><a name="EXdistance">Distance</a></h3>
+ <p>The perpendicular distance of a package from the idealized line A + I =
1. This metric is an indicator of the package's balance between abstractness and
stability. </p>
+ <p>A package squarely on the main sequence is optimally balanced with
respect to its abstractness and stability. Ideal packages are either completely abstract
and stable (x=0, y=1) or completely concrete and instable (x=1, y=0). </p>
+ <p>The range for this metric is 0 to 1, with D=0 indicating a package that
is coincident with the main sequence and D=1 indicating a package that is as far from the
main sequence as possible. </p>
+
+ </body>
+ </html>
+</xsl:template>
+
+</xsl:stylesheet>
Property changes on: modules/portlet/trunk/tools/etc/jdepend.xsl
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/tools/etc/junit-frames.xsl
===================================================================
--- modules/portlet/trunk/tools/etc/junit-frames.xsl (rev 0)
+++ modules/portlet/trunk/tools/etc/junit-frames.xsl 2007-08-17 15:29:49 UTC (rev 7981)
@@ -0,0 +1,875 @@
+<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0"
+
xmlns:lxslt="http://xml.apache.org/xslt"
+
xmlns:redirect="http://xml.apache.org/xalan/redirect"
+ xmlns:stringutils="xalan://org.apache.tools.ant.util.StringUtils"
+ extension-element-prefixes="redirect">
+<xsl:output method="html" indent="yes"
encoding="US-ASCII"/>
+<xsl:decimal-format decimal-separator="."
grouping-separator=","/>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+
http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+
+<!--
+
+ Sample stylesheet to be used with Ant JUnitReport output.
+
+ It creates a set of HTML files a la javadoc where you can browse easily
+ through all packages and classes.
+
+-->
+<xsl:param name="output.dir" select="'.'"/>
+
+
+<xsl:template match="testsuites">
+ <!-- create the index.html -->
+ <redirect:write file="{$output.dir}/index.html">
+ <xsl:call-template name="index.html"/>
+ </redirect:write>
+
+ <!-- create the stylesheet.css -->
+ <redirect:write file="{$output.dir}/stylesheet.css">
+ <xsl:call-template name="stylesheet.css"/>
+ </redirect:write>
+
+ <!-- create the overview-packages.html at the root -->
+ <redirect:write file="{$output.dir}/overview-summary.html">
+ <xsl:apply-templates select="."
mode="overview.packages"/>
+ </redirect:write>
+
+ <!-- create the all-packages.html at the root -->
+ <redirect:write file="{$output.dir}/overview-frame.html">
+ <xsl:apply-templates select="." mode="all.packages"/>
+ </redirect:write>
+
+ <!-- create the all-classes.html at the root -->
+ <redirect:write file="{$output.dir}/allclasses-frame.html">
+ <xsl:apply-templates select="." mode="all.classes"/>
+ </redirect:write>
+
+ <!-- create the all-tests.html at the root -->
+ <redirect:write file="{$output.dir}/all-tests.html">
+ <xsl:apply-templates select="." mode="all.tests"/>
+ </redirect:write>
+
+ <!-- create the alltests-fails.html at the root -->
+ <redirect:write file="{$output.dir}/alltests-fails.html">
+ <xsl:apply-templates select="." mode="all.tests">
+ <xsl:with-param name="type" select="'fails'"/>
+ </xsl:apply-templates>
+ </redirect:write>
+
+ <!-- create the alltests-errors.html at the root -->
+ <redirect:write file="{$output.dir}/alltests-errors.html">
+ <xsl:apply-templates select="." mode="all.tests">
+ <xsl:with-param name="type"
select="'errors'"/>
+ </xsl:apply-templates>
+ </redirect:write>
+
+ <!-- process all packages -->
+ <xsl:for-each select="./testsuite[not(./@package =
preceding-sibling::testsuite/@package)]">
+ <xsl:call-template name="package">
+ <xsl:with-param name="name" select="@package"/>
+ </xsl:call-template>
+ </xsl:for-each>
+</xsl:template>
+
+
+<xsl:template name="package">
+ <xsl:param name="name"/>
+ <xsl:variable name="package.dir">
+ <xsl:if test="not($name = '')"><xsl:value-of
select="translate($name,'.','/')"/></xsl:if>
+ <xsl:if test="$name = ''">.</xsl:if>
+ </xsl:variable>
+ <!--Processing package <xsl:value-of select="@name"/> in
<xsl:value-of select="$output.dir"/> -->
+ <!-- create a classes-list.html in the package directory -->
+ <redirect:write
file="{$output.dir}/{$package.dir}/package-frame.html">
+ <xsl:call-template name="classes.list">
+ <xsl:with-param name="name" select="$name"/>
+ </xsl:call-template>
+ </redirect:write>
+
+ <!-- create a package-summary.html in the package directory -->
+ <redirect:write
file="{$output.dir}/{$package.dir}/package-summary.html">
+ <xsl:call-template name="package.summary">
+ <xsl:with-param name="name" select="$name"/>
+ </xsl:call-template>
+ </redirect:write>
+
+ <!-- for each class, creates a @name.html -->
+ <!-- @bug there will be a problem with inner classes having the same name, it will
be overwritten -->
+ <xsl:for-each select="/testsuites/testsuite[@package = $name]">
+ <redirect:write
file="{$output.dir}/{$package.dir}/{@id}_{(a)name}.html">
+ <xsl:apply-templates select="." mode="class.details"/>
+ </redirect:write>
+ <xsl:if test="string-length(./system-out)!=0">
+ <redirect:write
file="{$output.dir}/{$package.dir}/{@id}_{(a)name}-out.txt">
+ <xsl:value-of disable-output-escaping="yes"
select="./system-out"/>
+ </redirect:write>
+ </xsl:if>
+ <xsl:if test="string-length(./system-err)!=0">
+ <redirect:write
file="{$output.dir}/{$package.dir}/{@id}_{(a)name}-err.txt">
+ <xsl:value-of disable-output-escaping="yes"
select="./system-err"/>
+ </redirect:write>
+ </xsl:if>
+ <xsl:if test="@failures != 0">
+ <redirect:write
file="{$output.dir}/{$package.dir}/{@id}_{(a)name}-fails.html">
+ <xsl:apply-templates select="." mode="class.details">
+ <xsl:with-param name="type"
select="'fails'"/>
+ </xsl:apply-templates>
+ </redirect:write>
+ </xsl:if>
+ <xsl:if test="@errors != 0">
+ <redirect:write
file="{$output.dir}/{$package.dir}/{@id}_{(a)name}-errors.html">
+ <xsl:apply-templates select="." mode="class.details">
+ <xsl:with-param name="type"
select="'errors'"/>
+ </xsl:apply-templates>
+ </redirect:write>
+ </xsl:if>
+ </xsl:for-each>
+</xsl:template>
+
+<xsl:template name="index.html">
+<html>
+ <head>
+ <title>Unit Test Results.</title>
+ </head>
+ <frameset cols="20%,80%">
+ <frameset rows="30%,70%">
+ <frame src="overview-frame.html"
name="packageListFrame"/>
+ <frame src="allclasses-frame.html"
name="classListFrame"/>
+ </frameset>
+ <frame src="overview-summary.html" name="classFrame"/>
+ <noframes>
+ <h2>Frame Alert</h2>
+ <p>
+ This document is designed to be viewed using the frames feature. If you
see this message, you are using a non-frame-capable web client.
+ </p>
+ </noframes>
+ </frameset>
+</html>
+</xsl:template>
+
+<!-- this is the stylesheet css to use for nearly everything -->
+<xsl:template name="stylesheet.css">
+body {
+ font:normal 68% verdana,arial,helvetica;
+ color:#000000;
+}
+table tr td, table tr th {
+ font-size: 68%;
+}
+table.details tr th{
+ font-weight: bold;
+ text-align:left;
+ background:#a6caf0;
+}
+table.details tr td{
+ background:#eeeee0;
+}
+
+p {
+ line-height:1.5em;
+ margin-top:0.5em; margin-bottom:1.0em;
+}
+h1 {
+ margin: 0px 0px 5px; font: 165% verdana,arial,helvetica
+}
+h2 {
+ margin-top: 1em; margin-bottom: 0.5em; font: bold 125% verdana,arial,helvetica
+}
+h3 {
+ margin-bottom: 0.5em; font: bold 115% verdana,arial,helvetica
+}
+h4 {
+ margin-bottom: 0.5em; font: bold 100% verdana,arial,helvetica
+}
+h5 {
+ margin-bottom: 0.5em; font: bold 100% verdana,arial,helvetica
+}
+h6 {
+ margin-bottom: 0.5em; font: bold 100% verdana,arial,helvetica
+}
+.Error {
+ font-weight:bold; color:red;
+}
+.Failure {
+ font-weight:bold; color:purple;
+}
+.Properties {
+ text-align:right;
+}
+</xsl:template>
+
+<!-- Create list of all/failed/errored tests -->
+<xsl:template match="testsuites" mode="all.tests">
+ <xsl:param name="type" select="'all'"/>
+ <html>
+ <xsl:variable name="title">
+ <xsl:choose>
+ <xsl:when test="$type = 'fails'">
+ <xsl:text>All Failures</xsl:text>
+ </xsl:when>
+ <xsl:when test="$type = 'errors'">
+ <xsl:text>All Errors</xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>All Tests</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <head>
+ <title>Unit Test Results: <xsl:value-of
select="$title"/></title>
+ <xsl:call-template name="create.stylesheet.link">
+ <xsl:with-param name="package.name"/>
+ </xsl:call-template>
+ </head>
+ <body>
+ <xsl:attribute
name="onload">open('allclasses-frame.html','classListFrame')</xsl:attribute>
+ <xsl:call-template name="pageHeader"/>
+ <h2><xsl:value-of select="$title"/></h2>
+
+ <table class="details" border="0"
cellpadding="5" cellspacing="2" width="95%">
+ <xsl:call-template name="testcase.test.header">
+ <xsl:with-param name="show.class"
select="'yes'"/>
+ </xsl:call-template>
+ <!--
+ test can even not be started at all (failure to load the class)
+ so report the error directly
+ -->
+ <xsl:if test="./error">
+ <tr class="Error">
+ <td colspan="4">
+ <xsl:apply-templates select="./error"/>
+ </td>
+ </tr>
+ </xsl:if>
+ <xsl:choose>
+ <xsl:when test="$type = 'fails'">
+ <xsl:apply-templates select=".//testcase[failure]"
mode="print.test">
+ <xsl:with-param name="show.class"
select="'yes'"/>
+ </xsl:apply-templates>
+ </xsl:when>
+ <xsl:when test="$type = 'errors'">
+ <xsl:apply-templates select=".//testcase[error]"
mode="print.test">
+ <xsl:with-param name="show.class"
select="'yes'"/>
+ </xsl:apply-templates>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates select=".//testcase"
mode="print.test">
+ <xsl:with-param name="show.class"
select="'yes'"/>
+ </xsl:apply-templates>
+ </xsl:otherwise>
+ </xsl:choose>
+ </table>
+ </body>
+ </html>
+</xsl:template>
+
+
+<!-- ======================================================================
+ This page is created for every testsuite class.
+ It prints a summary of the testsuite and detailed information about
+ testcase methods.
+ ====================================================================== -->
+<xsl:template match="testsuite" mode="class.details">
+ <xsl:param name="type" select="'all'"/>
+ <xsl:variable name="package.name" select="@package"/>
+ <xsl:variable name="class.name"><xsl:if
test="not($package.name = '')"><xsl:value-of
select="$package.name"/>.</xsl:if><xsl:value-of
select="@name"/></xsl:variable>
+ <html>
+ <head>
+ <title>Unit Test Results: <xsl:value-of
select="$class.name"/></title>
+ <xsl:call-template name="create.stylesheet.link">
+ <xsl:with-param name="package.name"
select="$package.name"/>
+ </xsl:call-template>
+ <script type="text/javascript" language="JavaScript">
+ var TestCases = new Array();
+ var cur;
+ <xsl:apply-templates select="properties"/>
+ </script>
+ <script type="text/javascript"
language="JavaScript"><![CDATA[
+ function displayProperties (name) {
+ var win =
window.open('','JUnitSystemProperties','scrollbars=1,resizable=1');
+ var doc = win.document;
+ doc.open();
+ doc.write("<html><head><title>Properties of " +
name + "</title>");
+ doc.write("<style type=\"text/css\">");
+ doc.write("body {font:normal 68% verdana,arial,helvetica; color:#000000;
}");
+ doc.write("table tr td, table tr th { font-size: 68%; }");
+ doc.write("table.properties { border-collapse:collapse; border-left:solid
1 #cccccc; border-top:solid 1 #cccccc; padding:5px; }");
+ doc.write("table.properties th { text-align:left; border-right:solid 1
#cccccc; border-bottom:solid 1 #cccccc; background-color:#eeeeee; }");
+ doc.write("table.properties td { font:normal; text-align:left;
border-right:solid 1 #cccccc; border-bottom:solid 1 #cccccc; background-color:#fffffff;
}");
+ doc.write("h3 { margin-bottom: 0.5em; font: bold 115%
verdana,arial,helvetica }");
+ doc.write("</style>");
+ doc.write("</head><body>");
+ doc.write("<h3>Properties of " + name +
"</h3>");
+ doc.write("<div align=\"right\"><a
href=\"javascript:window.close();\">Close</a></div>");
+ doc.write("<table class='properties'>");
+
doc.write("<tr><th>Name</th><th>Value</th></tr>");
+ for (prop in TestCases[name]) {
+ doc.write("<tr><th>" + prop +
"</th><td>" + TestCases[name][prop] +
"</td></tr>");
+ }
+ doc.write("</table>");
+ doc.write("</body></html>");
+ doc.close();
+ win.focus();
+ }
+ ]]>
+ </script>
+ </head>
+ <body>
+ <xsl:call-template name="pageHeader"/>
+ <h3>Class <xsl:value-of
select="$class.name"/></h3>
+
+
+ <table class="details" border="0"
cellpadding="5" cellspacing="2" width="95%">
+ <xsl:call-template name="testsuite.test.header"/>
+ <xsl:apply-templates select="."
mode="print.test"/>
+ </table>
+
+ <xsl:choose>
+ <xsl:when test="$type = 'fails'">
+ <h2>Failures</h2>
+ </xsl:when>
+ <xsl:when test="$type = 'errors'">
+ <h2>Errors</h2>
+ </xsl:when>
+ <xsl:otherwise>
+ <h2>Tests</h2>
+ </xsl:otherwise>
+ </xsl:choose>
+ <table class="details" border="0"
cellpadding="5" cellspacing="2" width="95%">
+ <xsl:call-template name="testcase.test.header"/>
+ <!--
+ test can even not be started at all (failure to load the class)
+ so report the error directly
+ -->
+ <xsl:if test="./error">
+ <tr class="Error">
+ <td colspan="4"><xsl:apply-templates
select="./error"/></td>
+ </tr>
+ </xsl:if>
+ <xsl:choose>
+ <xsl:when test="$type = 'fails'">
+ <xsl:apply-templates select="./testcase[failure]"
mode="print.test"/>
+ </xsl:when>
+ <xsl:when test="$type = 'errors'">
+ <xsl:apply-templates select="./testcase[error]"
mode="print.test"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates select="./testcase"
mode="print.test"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </table>
+ <div class="Properties">
+ <a>
+ <xsl:attribute
name="href">javascript:displayProperties('<xsl:value-of
select="@package"/>.<xsl:value-of
select="@name"/>');</xsl:attribute>
+ Properties »
+ </a>
+ </div>
+ <xsl:if test="string-length(./system-out)!=0">
+ <div class="Properties">
+ <a>
+ <xsl:attribute name="href">./<xsl:value-of
select="@id"/>_<xsl:value-of
select="@name"/>-out.txt</xsl:attribute>
+ System.out »
+ </a>
+ </div>
+ </xsl:if>
+ <xsl:if test="string-length(./system-err)!=0">
+ <div class="Properties">
+ <a>
+ <xsl:attribute name="href">./<xsl:value-of
select="@id"/>_<xsl:value-of
select="@name"/>-err.txt</xsl:attribute>
+ System.err »
+ </a>
+ </div>
+ </xsl:if>
+ </body>
+ </html>
+</xsl:template>
+
+ <!--
+ Write properties into a JavaScript data structure.
+ This is based on the original idea by Erik Hatcher (ehatcher(a)apache.org)
+ -->
+ <xsl:template match="properties">
+ cur = TestCases['<xsl:value-of
select="../@package"/>.<xsl:value-of
select="../@name"/>'] = new Array();
+ <xsl:for-each select="property">
+ <xsl:sort select="@name"/>
+ cur['<xsl:value-of select="@name"/>'] =
'<xsl:call-template name="JS-escape"><xsl:with-param
name="string" select="@value"/></xsl:call-template>';
+ </xsl:for-each>
+ </xsl:template>
+
+
+<!-- ======================================================================
+ This page is created for every package.
+ It prints the name of all classes that belongs to this package.
+ @param name the package name to print classes.
+ ====================================================================== -->
+<!-- list of classes in a package -->
+<xsl:template name="classes.list">
+ <xsl:param name="name"/>
+ <html>
+ <head>
+ <title>Unit Test Classes: <xsl:value-of
select="$name"/></title>
+ <xsl:call-template name="create.stylesheet.link">
+ <xsl:with-param name="package.name"
select="$name"/>
+ </xsl:call-template>
+ </head>
+ <body>
+ <table width="100%">
+ <tr>
+ <td nowrap="nowrap">
+ <h2><a href="package-summary.html"
target="classFrame">
+ <xsl:value-of select="$name"/>
+ <xsl:if test="$name =
''"><none></xsl:if>
+ </a></h2>
+ </td>
+ </tr>
+ </table>
+
+ <h2>Classes</h2>
+ <table width="100%">
+ <xsl:for-each select="/testsuites/testsuite[./@package =
$name]">
+ <xsl:sort select="@name"/>
+ <tr>
+ <td nowrap="nowrap">
+ <a href="{@id}_{(a)name}.html"
target="classFrame"><xsl:value-of select="@name"/></a>
+ </td>
+ </tr>
+ </xsl:for-each>
+ </table>
+ </body>
+ </html>
+</xsl:template>
+
+
+<!--
+ Creates an all-classes.html file that contains a link to all package-summary.html
+ on each class.
+-->
+<xsl:template match="testsuites" mode="all.classes">
+ <html>
+ <head>
+ <title>All Unit Test Classes</title>
+ <xsl:call-template name="create.stylesheet.link">
+ <xsl:with-param name="package.name"/>
+ </xsl:call-template>
+ </head>
+ <body>
+ <h2>Classes</h2>
+ <table width="100%">
+ <xsl:apply-templates select="testsuite"
mode="all.classes">
+ <xsl:sort select="@name"/>
+ </xsl:apply-templates>
+ </table>
+ </body>
+ </html>
+</xsl:template>
+
+<xsl:template match="testsuite" mode="all.classes">
+ <xsl:variable name="package.name" select="@package"/>
+ <tr>
+ <td nowrap="nowrap">
+ <a target="classFrame">
+ <xsl:attribute name="href">
+ <xsl:if test="not($package.name='')">
+ <xsl:value-of
select="translate($package.name,'.','/')"/><xsl:text>/</xsl:text>
+ </xsl:if><xsl:value-of
select="@id"/>_<xsl:value-of
select="@name"/><xsl:text>.html</xsl:text>
+ </xsl:attribute>
+ <xsl:value-of select="@name"/>
+ </a>
+ </td>
+ </tr>
+</xsl:template>
+
+
+<!--
+ Creates an html file that contains a link to all package-summary.html files on
+ each package existing on testsuites.
+ @bug there will be a problem here, I don't know yet how to handle unnamed package
:(
+-->
+<xsl:template match="testsuites" mode="all.packages">
+ <html>
+ <head>
+ <title>All Unit Test Packages</title>
+ <xsl:call-template name="create.stylesheet.link">
+ <xsl:with-param name="package.name"/>
+ </xsl:call-template>
+ </head>
+ <body>
+ <h2><a href="overview-summary.html"
target="classFrame">Home</a></h2>
+ <h2>Packages</h2>
+ <table width="100%">
+ <xsl:apply-templates select="testsuite[not(./@package =
preceding-sibling::testsuite/@package)]" mode="all.packages">
+ <xsl:sort select="@package"/>
+ </xsl:apply-templates>
+ </table>
+ </body>
+ </html>
+</xsl:template>
+
+<xsl:template match="testsuite" mode="all.packages">
+ <tr>
+ <td nowrap="nowrap">
+ <a
href="./{translate((a)package,'.','/')}/package-summary.html"
target="classFrame">
+ <xsl:value-of select="@package"/>
+ <xsl:if test="@package =
''"><none></xsl:if>
+ </a>
+ </td>
+ </tr>
+</xsl:template>
+
+
+<xsl:template match="testsuites" mode="overview.packages">
+ <html>
+ <head>
+ <title>Unit Test Results: Summary</title>
+ <xsl:call-template name="create.stylesheet.link">
+ <xsl:with-param name="package.name"/>
+ </xsl:call-template>
+ </head>
+ <body>
+ <xsl:attribute
name="onload">open('allclasses-frame.html','classListFrame')</xsl:attribute>
+ <xsl:call-template name="pageHeader"/>
+ <h2>Summary</h2>
+ <xsl:variable name="testCount"
select="sum(testsuite/@tests)"/>
+ <xsl:variable name="errorCount"
select="sum(testsuite/@errors)"/>
+ <xsl:variable name="failureCount"
select="sum(testsuite/@failures)"/>
+ <xsl:variable name="timeCount"
select="sum(testsuite/@time)"/>
+ <xsl:variable name="successRate" select="($testCount -
$failureCount - $errorCount) div $testCount"/>
+ <table class="details" border="0"
cellpadding="5" cellspacing="2" width="95%">
+ <tr valign="top">
+ <th>Tests</th>
+ <th>Failures</th>
+ <th>Errors</th>
+ <th>Success rate</th>
+ <th>Time</th>
+ </tr>
+ <tr valign="top">
+ <xsl:attribute name="class">
+ <xsl:choose>
+ <xsl:when test="$errorCount >
0">Error</xsl:when>
+ <xsl:when test="$failureCount >
0">Failure</xsl:when>
+ <xsl:otherwise>Pass</xsl:otherwise>
+ </xsl:choose>
+ </xsl:attribute>
+ <td><a title="Display all tests"
href="all-tests.html"><xsl:value-of
select="$testCount"/></a></td>
+ <td><a title="Display all failures"
href="alltests-fails.html"><xsl:value-of
select="$failureCount"/></a></td>
+ <td><a title="Display all errors"
href="alltests-errors.html"><xsl:value-of
select="$errorCount"/></a></td>
+ <td>
+ <xsl:call-template name="display-percent">
+ <xsl:with-param name="value"
select="$successRate"/>
+ </xsl:call-template>
+ </td>
+ <td>
+ <xsl:call-template name="display-time">
+ <xsl:with-param name="value"
select="$timeCount"/>
+ </xsl:call-template>
+ </td>
+ </tr>
+ </table>
+ <table border="0" width="95%">
+ <tr>
+ <td style="text-align: justify;">
+ Note: <em>failures</em> are anticipated and checked for with
assertions while <em>errors</em> are unanticipated.
+ </td>
+ </tr>
+ </table>
+
+ <h2>Packages</h2>
+ <table class="details" border="0"
cellpadding="5" cellspacing="2" width="95%">
+ <xsl:call-template name="testsuite.test.header"/>
+ <xsl:for-each select="testsuite[not(./@package =
preceding-sibling::testsuite/@package)]">
+ <xsl:sort select="@package"
order="ascending"/>
+ <!-- get the node set containing all testsuites that have the same
package -->
+ <xsl:variable name="insamepackage"
select="/testsuites/testsuite[./@package = current()/@package]"/>
+ <tr valign="top">
+ <!-- display a failure if there is any failure/error in the
package -->
+ <xsl:attribute name="class">
+ <xsl:choose>
+ <xsl:when test="sum($insamepackage/@errors) >
0">Error</xsl:when>
+ <xsl:when test="sum($insamepackage/@failures)
> 0">Failure</xsl:when>
+ <xsl:otherwise>Pass</xsl:otherwise>
+ </xsl:choose>
+ </xsl:attribute>
+ <td><a
href="./{translate((a)package,'.','/')}/package-summary.html">
+ <xsl:value-of select="@package"/>
+ <xsl:if test="@package =
''"><none></xsl:if>
+ </a></td>
+ <td><xsl:value-of
select="sum($insamepackage/@tests)"/></td>
+ <td><xsl:value-of
select="sum($insamepackage/@errors)"/></td>
+ <td><xsl:value-of
select="sum($insamepackage/@failures)"/></td>
+ <td>
+ <xsl:call-template name="display-time">
+ <xsl:with-param name="value"
select="sum($insamepackage/@time)"/>
+ </xsl:call-template>
+ </td>
+ <td><xsl:value-of
select="$insamepackage/@timestamp"/></td>
+ <td><xsl:value-of
select="$insamepackage/@hostname"/></td>
+ </tr>
+ </xsl:for-each>
+ </table>
+ </body>
+ </html>
+</xsl:template>
+
+
+<xsl:template name="package.summary">
+ <xsl:param name="name"/>
+ <html>
+ <head>
+ <xsl:call-template name="create.stylesheet.link">
+ <xsl:with-param name="package.name"
select="$name"/>
+ </xsl:call-template>
+ </head>
+ <body>
+ <xsl:attribute
name="onload">open('package-frame.html','classListFrame')</xsl:attribute>
+ <xsl:call-template name="pageHeader"/>
+ <h3>Package <xsl:value-of select="$name"/></h3>
+
+ <!--table border="0" cellpadding="5"
cellspacing="2" width="95%">
+ <xsl:call-template name="class.metrics.header"/>
+ <xsl:apply-templates select="."
mode="print.metrics"/>
+ </table-->
+
+ <xsl:variable name="insamepackage"
select="/testsuites/testsuite[./@package = $name]"/>
+ <xsl:if test="count($insamepackage) > 0">
+ <h2>Classes</h2>
+ <p>
+ <table class="details" border="0"
cellpadding="5" cellspacing="2" width="95%">
+ <xsl:call-template name="testsuite.test.header"/>
+ <xsl:apply-templates select="$insamepackage"
mode="print.test">
+ <xsl:sort select="@name"/>
+ </xsl:apply-templates>
+ </table>
+ </p>
+ </xsl:if>
+ </body>
+ </html>
+</xsl:template>
+
+
+<!--
+ transform string like a.b.c to ../../../
+ @param path the path to transform into a descending directory path
+-->
+<xsl:template name="path">
+ <xsl:param name="path"/>
+ <xsl:if test="contains($path,'.')">
+ <xsl:text>../</xsl:text>
+ <xsl:call-template name="path">
+ <xsl:with-param name="path"><xsl:value-of
select="substring-after($path,'.')"/></xsl:with-param>
+ </xsl:call-template>
+ </xsl:if>
+ <xsl:if test="not(contains($path,'.')) and not($path =
'')">
+ <xsl:text>../</xsl:text>
+ </xsl:if>
+</xsl:template>
+
+
+<!-- create the link to the stylesheet based on the package name -->
+<xsl:template name="create.stylesheet.link">
+ <xsl:param name="package.name"/>
+ <link rel="stylesheet" type="text/css"
title="Style"><xsl:attribute name="href"><xsl:if
test="not($package.name = 'unnamed package')"><xsl:call-template
name="path"><xsl:with-param name="path"
select="$package.name"/></xsl:call-template></xsl:if>stylesheet.css</xsl:attribute></link>
+</xsl:template>
+
+
+<!-- Page HEADER -->
+<xsl:template name="pageHeader">
+ <h1>Unit Test Results</h1>
+ <table width="100%">
+ <tr>
+ <td align="left"></td>
+ <td align="right">Designed for use with <a
href="http://www.junit.org/">JUnit</a> and <a
href="http://ant.apache.org/">Ant</a>.</td>
+ </tr>
+ </table>
+ <hr size="1"/>
+</xsl:template>
+
+<!-- class header -->
+<xsl:template name="testsuite.test.header">
+ <tr valign="top">
+ <th width="80%">Name</th>
+ <th>Tests</th>
+ <th>Errors</th>
+ <th>Failures</th>
+ <th nowrap="nowrap">Time(s)</th>
+ <th nowrap="nowrap">Time Stamp</th>
+ <th>Host</th>
+ </tr>
+</xsl:template>
+
+<!-- method header -->
+<xsl:template name="testcase.test.header">
+ <xsl:param name="show.class" select="''"/>
+ <tr valign="top">
+ <xsl:if test="boolean($show.class)">
+ <th>Class</th>
+ </xsl:if>
+ <th>Name</th>
+ <th>Status</th>
+ <th width="80%">Type</th>
+ <th nowrap="nowrap">Time(s)</th>
+ </tr>
+</xsl:template>
+
+
+<!-- class information -->
+<xsl:template match="testsuite" mode="print.test">
+ <tr valign="top">
+ <xsl:attribute name="class">
+ <xsl:choose>
+ <xsl:when test="(a)errors[.&gt;
0]">Error</xsl:when>
+ <xsl:when test="(a)failures[.&gt;
0]">Failure</xsl:when>
+ <xsl:otherwise>Pass</xsl:otherwise>
+ </xsl:choose>
+ </xsl:attribute>
+ <td><a title="Display all tests"
href="{@id}_{@name}.html"><xsl:value-of
select="@name"/></a></td>
+ <td><a title="Display all tests"
href="{@id}_{@name}.html"><xsl:apply-templates
select="@tests"/></a></td>
+ <td>
+ <xsl:choose>
+ <xsl:when test="@errors != 0">
+ <a title="Display only errors"
href="{@id}_{@name}-errors.html"><xsl:apply-templates
select="@errors"/></a>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates select="@errors"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </td>
+ <td>
+ <xsl:choose>
+ <xsl:when test="@failures != 0">
+ <a title="Display only failures"
href="{@id}_{@name}-fails.html"><xsl:apply-templates
select="@failures"/></a>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates select="@failures"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </td>
+ <td><xsl:call-template name="display-time">
+ <xsl:with-param name="value" select="@time"/>
+ </xsl:call-template>
+ </td>
+ <td><xsl:apply-templates select="@timestamp"/></td>
+ <td><xsl:apply-templates select="@hostname"/></td>
+ </tr>
+</xsl:template>
+
+<xsl:template match="testcase" mode="print.test">
+ <xsl:param name="show.class" select="''"/>
+ <tr valign="top">
+ <xsl:attribute name="class">
+ <xsl:choose>
+ <xsl:when test="error">Error</xsl:when>
+ <xsl:when test="failure">Failure</xsl:when>
+ <xsl:otherwise>TableRowColor</xsl:otherwise>
+ </xsl:choose>
+ </xsl:attribute>
+ <xsl:variable name="class.href">
+ <xsl:value-of select="concat(translate(../(a)package,'.','/'),
'/', ../@id, '_', ../@name, '.html')"/>
+ </xsl:variable>
+ <xsl:if test="boolean($show.class)">
+ <td><a href="{$class.href}"><xsl:value-of
select="../@name"/></a></td>
+ </xsl:if>
+ <td>
+ <a name="{@name}"/>
+ <xsl:choose>
+ <xsl:when test="boolean($show.class)">
+ <a href="{concat($class.href, '#',
@name)}"><xsl:value-of select="@name"/></a>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="@name"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </td>
+ <xsl:choose>
+ <xsl:when test="failure">
+ <td>Failure</td>
+ <td><xsl:apply-templates
select="failure"/></td>
+ </xsl:when>
+ <xsl:when test="error">
+ <td>Error</td>
+ <td><xsl:apply-templates
select="error"/></td>
+ </xsl:when>
+ <xsl:otherwise>
+ <td>Success</td>
+ <td></td>
+ </xsl:otherwise>
+ </xsl:choose>
+ <td>
+ <xsl:call-template name="display-time">
+ <xsl:with-param name="value" select="@time"/>
+ </xsl:call-template>
+ </td>
+ </tr>
+</xsl:template>
+
+
+<!-- Note : the below template error and failure are the same style
+ so just call the same style store in the toolkit template -->
+<xsl:template match="failure">
+ <xsl:call-template name="display-failures"/>
+</xsl:template>
+
+<xsl:template match="error">
+ <xsl:call-template name="display-failures"/>
+</xsl:template>
+
+<!-- Style for the error and failure in the testcase template -->
+<xsl:template name="display-failures">
+ <xsl:choose>
+ <xsl:when test="not(@message)">N/A</xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="@message"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ <!-- display the stacktrace -->
+ <br/><br/>
+ <code>
+ <xsl:call-template name="br-replace">
+ <xsl:with-param name="word" select="."/>
+ </xsl:call-template>
+ </code>
+ <!-- the latter is better but might be problematic for non-21" monitors...
-->
+ <!--pre><xsl:value-of select="."/></pre-->
+</xsl:template>
+
+<xsl:template name="JS-escape">
+ <xsl:param name="string"/>
+ <xsl:param name="tmp1"
select="stringutils:replace(string($string),'\','\\')"/>
+ <xsl:param name="tmp2"
select="stringutils:replace(string($tmp1),"'","\'")"/>
+ <xsl:value-of select="$tmp2"/>
+</xsl:template>
+
+
+<!--
+ template that will convert a carriage return into a br tag
+ @param word the text from which to convert CR to BR tag
+-->
+<xsl:template name="br-replace">
+ <xsl:param name="word"/>
+ <xsl:value-of disable-output-escaping="yes"
select='stringutils:replace(string($word),"
","<br/>")'/>
+</xsl:template>
+
+<xsl:template name="display-time">
+ <xsl:param name="value"/>
+ <xsl:value-of select="format-number($value,'0.000')"/>
+</xsl:template>
+
+<xsl:template name="display-percent">
+ <xsl:param name="value"/>
+ <xsl:value-of select="format-number($value,'0.00%')"/>
+</xsl:template>
+</xsl:stylesheet>
Property changes on: modules/portlet/trunk/tools/etc/junit-frames.xsl
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/tools/etc/junit-noframes.xsl
===================================================================
--- modules/portlet/trunk/tools/etc/junit-noframes.xsl (rev 0)
+++ modules/portlet/trunk/tools/etc/junit-noframes.xsl 2007-08-17 15:29:49 UTC (rev 7981)
@@ -0,0 +1,464 @@
+<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0"
+
xmlns:lxslt="http://xml.apache.org/xslt"
+ xmlns:stringutils="xalan://org.apache.tools.ant.util.StringUtils">
+<xsl:output method="html" indent="yes"
encoding="US-ASCII"
+ doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN" />
+<xsl:decimal-format decimal-separator="." grouping-separator=","
/>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+
http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+
+<!--
+
+ Sample stylesheet to be used with Ant JUnitReport output.
+
+ It creates a non-framed report that can be useful to send via
+ e-mail or such.
+
+-->
+<xsl:template match="testsuites">
+ <html>
+ <head>
+ <title>Unit Test Results</title>
+ <style type="text/css">
+ body {
+ font:normal 68% verdana,arial,helvetica;
+ color:#000000;
+ }
+ table tr td, table tr th {
+ font-size: 68%;
+ }
+ table.details tr th{
+ font-weight: bold;
+ text-align:left;
+ background:#a6caf0;
+ }
+ table.details tr td{
+ background:#eeeee0;
+ }
+
+ p {
+ line-height:1.5em;
+ margin-top:0.5em; margin-bottom:1.0em;
+ }
+ h1 {
+ margin: 0px 0px 5px; font: 165% verdana,arial,helvetica
+ }
+ h2 {
+ margin-top: 1em; margin-bottom: 0.5em; font: bold 125% verdana,arial,helvetica
+ }
+ h3 {
+ margin-bottom: 0.5em; font: bold 115% verdana,arial,helvetica
+ }
+ h4 {
+ margin-bottom: 0.5em; font: bold 100% verdana,arial,helvetica
+ }
+ h5 {
+ margin-bottom: 0.5em; font: bold 100% verdana,arial,helvetica
+ }
+ h6 {
+ margin-bottom: 0.5em; font: bold 100% verdana,arial,helvetica
+ }
+ .Error {
+ font-weight:bold; color:red;
+ }
+ .Failure {
+ font-weight:bold; color:purple;
+ }
+ .Properties {
+ text-align:right;
+ }
+ </style>
+ <script type="text/javascript" language="JavaScript">
+ var TestCases = new Array();
+ var cur;
+ <xsl:for-each select="./testsuite">
+ <xsl:apply-templates select="properties"/>
+ </xsl:for-each>
+
+ </script>
+ <script type="text/javascript"
language="JavaScript"><![CDATA[
+ function displayProperties (name) {
+ var win =
window.open('','JUnitSystemProperties','scrollbars=1,resizable=1');
+ var doc = win.document;
+ doc.open();
+ doc.write("<html><head><title>Properties of " +
name + "</title>");
+ doc.write("<style>")
+ doc.write("body {font:normal 68% verdana,arial,helvetica; color:#000000;
}");
+ doc.write("table tr td, table tr th { font-size: 68%; }");
+ doc.write("table.properties { border-collapse:collapse; border-left:solid
1 #cccccc; border-top:solid 1 #cccccc; padding:5px; }");
+ doc.write("table.properties th { text-align:left; border-right:solid 1
#cccccc; border-bottom:solid 1 #cccccc; background-color:#eeeeee; }");
+ doc.write("table.properties td { font:normal; text-align:left;
border-right:solid 1 #cccccc; border-bottom:solid 1 #cccccc; background-color:#fffffff;
}");
+ doc.write("h3 { margin-bottom: 0.5em; font: bold 115%
verdana,arial,helvetica }");
+ doc.write("</style>");
+ doc.write("</head><body>");
+ doc.write("<h3>Properties of " + name +
"</h3>");
+ doc.write("<div align=\"right\"><a
href=\"javascript:window.close();\">Close</a></div>");
+ doc.write("<table class='properties'>");
+
doc.write("<tr><th>Name</th><th>Value</th></tr>");
+ for (prop in TestCases[name]) {
+ doc.write("<tr><th>" + prop +
"</th><td>" + TestCases[name][prop] +
"</td></tr>");
+ }
+ doc.write("</table>");
+ doc.write("</body></html>");
+ doc.close();
+ win.focus();
+ }
+ ]]>
+ </script>
+ </head>
+ <body>
+ <a name="top"></a>
+ <xsl:call-template name="pageHeader"/>
+
+ <!-- Summary part -->
+ <xsl:call-template name="summary"/>
+ <hr size="1" width="95%" align="left"/>
+
+ <!-- Package List part -->
+ <xsl:call-template name="packagelist"/>
+ <hr size="1" width="95%" align="left"/>
+
+ <!-- For each package create its part -->
+ <xsl:call-template name="packages"/>
+ <hr size="1" width="95%" align="left"/>
+
+ <!-- For each class create the part -->
+ <xsl:call-template name="classes"/>
+
+ </body>
+ </html>
+</xsl:template>
+
+
+
+ <!-- ================================================================== -->
+ <!-- Write a list of all packages with an hyperlink to the anchor of -->
+ <!-- of the package name. -->
+ <!-- ================================================================== -->
+ <xsl:template name="packagelist">
+ <h2>Packages</h2>
+ Note: package statistics are not computed recursively, they only sum up all of
its testsuites numbers.
+ <table class="details" border="0"
cellpadding="5" cellspacing="2" width="95%">
+ <xsl:call-template name="testsuite.test.header"/>
+ <!-- list all packages recursively -->
+ <xsl:for-each select="./testsuite[not(./@package =
preceding-sibling::testsuite/@package)]">
+ <xsl:sort select="@package"/>
+ <xsl:variable name="testsuites-in-package"
select="/testsuites/testsuite[./@package = current()/@package]"/>
+ <xsl:variable name="testCount"
select="sum($testsuites-in-package/@tests)"/>
+ <xsl:variable name="errorCount"
select="sum($testsuites-in-package/@errors)"/>
+ <xsl:variable name="failureCount"
select="sum($testsuites-in-package/@failures)"/>
+ <xsl:variable name="timeCount"
select="sum($testsuites-in-package/@time)"/>
+
+ <!-- write a summary for the package -->
+ <tr valign="top">
+ <!-- set a nice color depending if there is an error/failure
-->
+ <xsl:attribute name="class">
+ <xsl:choose>
+ <xsl:when test="$failureCount >
0">Failure</xsl:when>
+ <xsl:when test="$errorCount >
0">Error</xsl:when>
+ </xsl:choose>
+ </xsl:attribute>
+ <td><a href="#{@package}"><xsl:value-of
select="@package"/></a></td>
+ <td><xsl:value-of
select="$testCount"/></td>
+ <td><xsl:value-of
select="$errorCount"/></td>
+ <td><xsl:value-of
select="$failureCount"/></td>
+ <td>
+ <xsl:call-template name="display-time">
+ <xsl:with-param name="value"
select="$timeCount"/>
+ </xsl:call-template>
+ </td>
+ <td><xsl:value-of
select="$testsuites-in-package/@timestamp"/></td>
+ <td><xsl:value-of
select="$testsuites-in-package/@hostname"/></td>
+ </tr>
+ </xsl:for-each>
+ </table>
+ </xsl:template>
+
+
+ <!-- ================================================================== -->
+ <!-- Write a package level report -->
+ <!-- It creates a table with values from the document: -->
+ <!-- Name | Tests | Errors | Failures | Time -->
+ <!-- ================================================================== -->
+ <xsl:template name="packages">
+ <!-- create an anchor to this package name -->
+ <xsl:for-each select="/testsuites/testsuite[not(./@package =
preceding-sibling::testsuite/@package)]">
+ <xsl:sort select="@package"/>
+ <a name="{@package}"></a>
+ <h3>Package <xsl:value-of
select="@package"/></h3>
+
+ <table class="details" border="0"
cellpadding="5" cellspacing="2" width="95%">
+ <xsl:call-template name="testsuite.test.header"/>
+
+ <!-- match the testsuites of this package -->
+ <xsl:apply-templates select="/testsuites/testsuite[./@package
= current()/@package]" mode="print.test"/>
+ </table>
+ <a href="#top">Back to top</a>
+ <p/>
+ <p/>
+ </xsl:for-each>
+ </xsl:template>
+
+ <xsl:template name="classes">
+ <xsl:for-each select="testsuite">
+ <xsl:sort select="@name"/>
+ <!-- create an anchor to this class name -->
+ <a name="{@name}"></a>
+ <h3>TestCase <xsl:value-of select="@name"/></h3>
+
+ <table class="details" border="0"
cellpadding="5" cellspacing="2" width="95%">
+ <xsl:call-template name="testcase.test.header"/>
+ <!--
+ test can even not be started at all (failure to load the class)
+ so report the error directly
+ -->
+ <xsl:if test="./error">
+ <tr class="Error">
+ <td colspan="4"><xsl:apply-templates
select="./error"/></td>
+ </tr>
+ </xsl:if>
+ <xsl:apply-templates select="./testcase"
mode="print.test"/>
+ </table>
+ <div class="Properties">
+ <a>
+ <xsl:attribute
name="href">javascript:displayProperties('<xsl:value-of
select="@package"/>.<xsl:value-of
select="@name"/>');</xsl:attribute>
+ Properties »
+ </a>
+ </div>
+ <p/>
+
+ <a href="#top">Back to top</a>
+ </xsl:for-each>
+ </xsl:template>
+
+ <xsl:template name="summary">
+ <h2>Summary</h2>
+ <xsl:variable name="testCount"
select="sum(testsuite/@tests)"/>
+ <xsl:variable name="errorCount"
select="sum(testsuite/@errors)"/>
+ <xsl:variable name="failureCount"
select="sum(testsuite/@failures)"/>
+ <xsl:variable name="timeCount"
select="sum(testsuite/@time)"/>
+ <xsl:variable name="successRate" select="($testCount -
$failureCount - $errorCount) div $testCount"/>
+ <table class="details" border="0"
cellpadding="5" cellspacing="2" width="95%">
+ <tr valign="top">
+ <th>Tests</th>
+ <th>Failures</th>
+ <th>Errors</th>
+ <th>Success rate</th>
+ <th>Time</th>
+ </tr>
+ <tr valign="top">
+ <xsl:attribute name="class">
+ <xsl:choose>
+ <xsl:when test="$failureCount >
0">Failure</xsl:when>
+ <xsl:when test="$errorCount >
0">Error</xsl:when>
+ </xsl:choose>
+ </xsl:attribute>
+ <td><xsl:value-of select="$testCount"/></td>
+ <td><xsl:value-of select="$failureCount"/></td>
+ <td><xsl:value-of select="$errorCount"/></td>
+ <td>
+ <xsl:call-template name="display-percent">
+ <xsl:with-param name="value"
select="$successRate"/>
+ </xsl:call-template>
+ </td>
+ <td>
+ <xsl:call-template name="display-time">
+ <xsl:with-param name="value"
select="$timeCount"/>
+ </xsl:call-template>
+ </td>
+
+ </tr>
+ </table>
+ <table border="0" width="95%">
+ <tr>
+ <td style="text-align: justify;">
+ Note: <i>failures</i> are anticipated and checked for with assertions
while <i>errors</i> are unanticipated.
+ </td>
+ </tr>
+ </table>
+ </xsl:template>
+
+ <!--
+ Write properties into a JavaScript data structure.
+ This is based on the original idea by Erik Hatcher (ehatcher(a)apache.org)
+ -->
+ <xsl:template match="properties">
+ cur = TestCases['<xsl:value-of
select="../@package"/>.<xsl:value-of
select="../@name"/>'] = new Array();
+ <xsl:for-each select="property">
+ <xsl:sort select="@name"/>
+ cur['<xsl:value-of select="@name"/>'] =
'<xsl:call-template name="JS-escape"><xsl:with-param
name="string" select="@value"/></xsl:call-template>';
+ </xsl:for-each>
+ </xsl:template>
+
+<!-- Page HEADER -->
+<xsl:template name="pageHeader">
+ <h1>Unit Test Results</h1>
+ <table width="100%">
+ <tr>
+ <td align="left"></td>
+ <td align="right">Designed for use with <a
href='http://www.junit.org'>JUnit</a> and <a
href='http://ant.apache.org/ant'>Ant</a>.</td>
+ </tr>
+ </table>
+ <hr size="1"/>
+</xsl:template>
+
+<xsl:template match="testsuite" mode="header">
+ <tr valign="top">
+ <th width="80%">Name</th>
+ <th>Tests</th>
+ <th>Errors</th>
+ <th>Failures</th>
+ <th nowrap="nowrap">Time(s)</th>
+ </tr>
+</xsl:template>
+
+<!-- class header -->
+<xsl:template name="testsuite.test.header">
+ <tr valign="top">
+ <th width="80%">Name</th>
+ <th>Tests</th>
+ <th>Errors</th>
+ <th>Failures</th>
+ <th nowrap="nowrap">Time(s)</th>
+ <th nowrap="nowrap">Time Stamp</th>
+ <th>Host</th>
+ </tr>
+</xsl:template>
+
+<!-- method header -->
+<xsl:template name="testcase.test.header">
+ <tr valign="top">
+ <th>Name</th>
+ <th>Status</th>
+ <th width="80%">Type</th>
+ <th nowrap="nowrap">Time(s)</th>
+ </tr>
+</xsl:template>
+
+
+<!-- class information -->
+<xsl:template match="testsuite" mode="print.test">
+ <tr valign="top">
+ <!-- set a nice color depending if there is an error/failure -->
+ <xsl:attribute name="class">
+ <xsl:choose>
+ <xsl:when test="(a)failures[.&gt;
0]">Failure</xsl:when>
+ <xsl:when test="(a)errors[.&gt;
0]">Error</xsl:when>
+ </xsl:choose>
+ </xsl:attribute>
+
+ <!-- print testsuite information -->
+ <td><a href="#{@name}"><xsl:value-of
select="@name"/></a></td>
+ <td><xsl:value-of select="@tests"/></td>
+ <td><xsl:value-of select="@errors"/></td>
+ <td><xsl:value-of select="@failures"/></td>
+ <td>
+ <xsl:call-template name="display-time">
+ <xsl:with-param name="value" select="@time"/>
+ </xsl:call-template>
+ </td>
+ <td><xsl:apply-templates select="@timestamp"/></td>
+ <td><xsl:apply-templates select="@hostname"/></td>
+ </tr>
+</xsl:template>
+
+<xsl:template match="testcase" mode="print.test">
+ <tr valign="top">
+ <xsl:attribute name="class">
+ <xsl:choose>
+ <xsl:when test="failure | error">Error</xsl:when>
+ </xsl:choose>
+ </xsl:attribute>
+ <td><xsl:value-of select="@name"/></td>
+ <xsl:choose>
+ <xsl:when test="failure">
+ <td>Failure</td>
+ <td><xsl:apply-templates
select="failure"/></td>
+ </xsl:when>
+ <xsl:when test="error">
+ <td>Error</td>
+ <td><xsl:apply-templates
select="error"/></td>
+ </xsl:when>
+ <xsl:otherwise>
+ <td>Success</td>
+ <td></td>
+ </xsl:otherwise>
+ </xsl:choose>
+ <td>
+ <xsl:call-template name="display-time">
+ <xsl:with-param name="value" select="@time"/>
+ </xsl:call-template>
+ </td>
+ </tr>
+</xsl:template>
+
+
+<xsl:template match="failure">
+ <xsl:call-template name="display-failures"/>
+</xsl:template>
+
+<xsl:template match="error">
+ <xsl:call-template name="display-failures"/>
+</xsl:template>
+
+<!-- Style for the error and failure in the tescase template -->
+<xsl:template name="display-failures">
+ <xsl:choose>
+ <xsl:when test="not(@message)">N/A</xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="@message"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ <!-- display the stacktrace -->
+ <code>
+ <br/><br/>
+ <xsl:call-template name="br-replace">
+ <xsl:with-param name="word" select="."/>
+ </xsl:call-template>
+ </code>
+ <!-- the later is better but might be problematic for non-21" monitors...
-->
+ <!--pre><xsl:value-of select="."/></pre-->
+</xsl:template>
+
+<xsl:template name="JS-escape">
+ <xsl:param name="string"/>
+ <xsl:param name="tmp1"
select="stringutils:replace(string($string),'\','\\')"/>
+ <xsl:param name="tmp2"
select="stringutils:replace(string($tmp1),"'","\'")"/>
+ <xsl:value-of select="$tmp2"/>
+</xsl:template>
+
+
+<!--
+ template that will convert a carriage return into a br tag
+ @param word the text from which to convert CR to BR tag
+-->
+<xsl:template name="br-replace">
+ <xsl:param name="word"/>
+ <xsl:value-of disable-output-escaping="yes"
select='stringutils:replace(string($word),"
","<br/>")'/>
+</xsl:template>
+
+<xsl:template name="display-time">
+ <xsl:param name="value"/>
+ <xsl:value-of select="format-number($value,'0.000')"/>
+</xsl:template>
+
+<xsl:template name="display-percent">
+ <xsl:param name="value"/>
+ <xsl:value-of select="format-number($value,'0.00%')"/>
+</xsl:template>
+
+</xsl:stylesheet>
Property changes on: modules/portlet/trunk/tools/etc/junit-noframes.xsl
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/tools/etc/log.xsl
===================================================================
--- modules/portlet/trunk/tools/etc/log.xsl (rev 0)
+++ modules/portlet/trunk/tools/etc/log.xsl 2007-08-17 15:29:49 UTC (rev 7981)
@@ -0,0 +1,202 @@
+<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
+<xsl:output method="html" indent="yes"
encoding="US-ASCII"/>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+
http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+
+<!--
+
+ The purpose have this XSL is to provide a nice way to look at the output
+ from the Ant XmlLogger (ie: ant -listener org.apache.tools.ant.XmlLogger )
+
+ @author <a href="mailto:sbailliez@apache.org">Stephane
Bailliez</a>
+
+-->
+<xsl:decimal-format decimal-separator="." grouping-separator=","
/>
+
+<xsl:template match="/">
+<html>
+ <head>
+ <style type="text/css">
+ .bannercell {
+ border: 0px;
+ padding: 0px;
+ }
+ body {
+ margin: 0;
+ font:normal 100% arial,helvetica,sanserif;
+ background-color:#FFFFFF;
+ color:#000000;
+ }
+ table.status {
+ font:bold 80% arial,helvetica,sanserif;
+ background-color:#525D76;
+ color:#ffffff;
+ }
+ table.log tr td, tr th {
+ font-size: 80%;
+ }
+ .error {
+ color:red;
+ }
+ .warn {
+ color:brown;
+ }
+ .info {
+ color:gray;
+ }
+ .debug{
+ color:gray;
+ }
+ .failed {
+ font-size:80%;
+ background-color: red;
+ color:#FFFFFF;
+ font-weight: bold
+ }
+ .complete {
+ font-size:80%;
+ background-color: #525D76;
+ color:#FFFFFF;
+ font-weight: bold
+ }
+ .a td {
+ background: #efefef;
+ }
+ .b td {
+ background: #fff;
+ }
+ th, td {
+ text-align: left;
+ vertical-align: top;
+ }
+ th {
+ background: #ccc;
+ color: black;
+ }
+ table, th, td {
+ border: none
+ }
+ h3 {
+ font:bold 80% arial,helvetica,sanserif;
+ background: #525D76;
+ color: white;
+ text-decoration: none;
+ padding: 5px;
+ margin-right: 2px;
+ margin-left: 2px;
+ margin-bottom: 0;
+ }
+ </style>
+ </head>
+ <body>
+ <!-- jakarta logo -->
+ <table border="0" cellpadding="0" cellspacing="0"
width="100%">
+ <tr>
+ <td valign="top" class="bannercell">
+ <a
href="http://jakarta.apache.org/">
+ <img
src="http://jakarta.apache.org/images/jakarta-logo.gif"
alt="http://jakarta.apache.org" align="left"
border="0"/>
+ </a>
+ </td>
+ <td style="text-align:right;vertical-align:bottom">
+ <a
href="http://ant.apache.org/">Apache Ant</a>
+ </td>
+ </tr>
+ </table>
+
+ <table border="0" width="100%">
+ <tr><td><hr noshade="yes"
size="1"/></td></tr>
+ </table>
+
+ <xsl:apply-templates select="build"/>
+
+ </body>
+</html>
+</xsl:template>
+
+<xsl:template match="build">
+ <!-- build status -->
+ <table width="100%">
+ <xsl:attribute name="class">
+ <xsl:if test="@error">failed</xsl:if>
+ <xsl:if test="not(@error)">complete</xsl:if>
+ </xsl:attribute>
+ <tr>
+ <xsl:if test="@error">
+ <td nowrap="yes">Build Failed</td>
+ </xsl:if>
+ <xsl:if test="not(@error)">
+ <td nowrap="yes">Build Complete</td>
+ </xsl:if>
+ <td style="text-align:right" nowrap="yes">Total Time:
<xsl:value-of select="@time"/></td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <xsl:if test="@error">
+ <tt><xsl:value-of
select="@error"/></tt><br/>
+ <i style="font-size:80%">See the <a
href="#stacktrace" alt="Click for
details">stacktrace</a>.</i>
+ </xsl:if>
+ </td>
+ </tr>
+ </table>
+ <table border="1" cellspacing="2" cellpadding="3"
width="100%" style="font-size:80%">
+ <tr class="a"><td
width="1">ant.file</td><td><xsl:value-of
select="substring-after(//message[contains(text(),'ant.file')],
'->')"/></td></tr>
+ <tr class="b"><td
width="1">ant.version</td><td><xsl:value-of
select="substring-after(//message[contains(text(),'ant.version')],
'->')"/></td></tr>
+ <tr class="a"><td
width="1">java.version</td><td><xsl:value-of
select="substring-after(//message[contains(text(),'java.vm.version')],
'->')"/></td></tr>
+ <tr class="b"><td
width="1">os.name</td><td><xsl:value-of
select="substring-after(//message[contains(text(),'os.name')],
'->')"/></td></tr>
+ </table>
+ <!-- build information -->
+ <h3>Build events</h3>
+ <table class="log" border="1" cellspacing="2"
cellpadding="3" width="100%">
+ <tr>
+ <th nowrap="yes" align="left"
width="1%">target</th>
+ <th nowrap="yes" align="left"
width="1%">task</th>
+ <th nowrap="yes" align="left">message</th>
+ </tr>
+ <xsl:apply-templates select=".//message[@priority !=
'debug']"/>
+ </table>
+ <p>
+ <!-- stacktrace -->
+ <xsl:if test="stacktrace">
+ <a name="stacktrace"/>
+ <h3>Error details</h3>
+ <table width="100%">
+ <tr><td>
+ <pre><xsl:value-of select="stacktrace"/></pre>
+ </td></tr>
+ </table>
+ </xsl:if>
+ </p>
+</xsl:template>
+
+<!-- report every message but those with debug priority -->
+<xsl:template match="message[@priority!='debug']">
+ <tr valign="top">
+ <!-- alternated row style -->
+ <xsl:attribute name="class">
+ <xsl:if test="position() mod 2 = 1">a</xsl:if>
+ <xsl:if test="position() mod 2 = 0">b</xsl:if>
+ </xsl:attribute>
+ <td nowrap="yes" width="1%"><xsl:value-of
select="../../@name"/></td>
+ <td nowrap="yes" style="text-align:right"
width="1%">[ <xsl:value-of select="../@name"/> ]</td>
+ <td class="{@priority}" nowrap="yes">
+ <xsl:value-of select="text()"/>
+ </td>
+ </tr>
+</xsl:template>
+
+</xsl:stylesheet>
Property changes on: modules/portlet/trunk/tools/etc/log.xsl
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/tools/etc/maudit-frames.xsl
===================================================================
--- modules/portlet/trunk/tools/etc/maudit-frames.xsl (rev 0)
+++ modules/portlet/trunk/tools/etc/maudit-frames.xsl 2007-08-17 15:29:49 UTC (rev 7981)
@@ -0,0 +1,502 @@
+<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0"
+
xmlns:lxslt="http://xml.apache.org/xslt"
+ xmlns:redirect="org.apache.xalan.lib.Redirect"
+ extension-element-prefixes="redirect">
+<xsl:output method="html" indent="yes"
encoding="US-ASCII"/>
+<xsl:decimal-format decimal-separator="." grouping-separator=","
/>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+
http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!--
+
+ Stylesheet to transform an XML file generated by the Ant MAudit task into
+ a set of JavaDoc-like HTML page to make pages more convenient to be browsed.
+
+ It use the Xalan redirect extension to write to multiple output files.
+
+ @author Stephane Bailliez <a href="mailto:sbailliez@apache.org"/>
+-->
+
+<xsl:param name="output.dir" select="'.'"/>
+
+
+<xsl:template match="classes">
+ <!-- create the index.html -->
+ <redirect:write file="{$output.dir}/index.html">
+ <xsl:call-template name="index.html"/>
+ </redirect:write>
+
+ <!-- create the stylesheet.css -->
+ <redirect:write file="{$output.dir}/stylesheet.css">
+ <xsl:call-template name="stylesheet.css"/>
+ </redirect:write>
+
+ <!-- create the overview-packages.html at the root -->
+ <redirect:write file="{$output.dir}/overview-summary.html">
+ <xsl:apply-templates select="."
mode="overview.packages"/>
+ </redirect:write>
+
+ <!-- create the all-packages.html at the root -->
+ <redirect:write file="{$output.dir}/overview-frame.html">
+ <xsl:apply-templates select="." mode="all.packages"/>
+ </redirect:write>
+
+ <!-- create the all-classes.html at the root -->
+ <redirect:write file="{$output.dir}/allclasses-frame.html">
+ <xsl:apply-templates select="." mode="all.classes"/>
+ </redirect:write>
+
+ <!-- process all packages -->
+ <xsl:for-each select="./class[not(./@package =
preceding-sibling::class/@package)]">
+ <xsl:call-template name="package">
+ <xsl:with-param name="name" select="@package"/>
+ </xsl:call-template>
+ </xsl:for-each>
+</xsl:template>
+
+
+<xsl:template name="package">
+ <xsl:param name="name"/>
+ <xsl:variable name="package.dir">
+ <xsl:if test="not($name = '')"><xsl:value-of
select="translate($name,'.','/')"/></xsl:if>
+ <xsl:if test="$name = ''">.</xsl:if>
+ </xsl:variable>
+ <!--Processing package <xsl:value-of select="@name"/> in
<xsl:value-of select="$output.dir"/> -->
+ <!-- create a classes-list.html in the package directory -->
+ <redirect:write
file="{$output.dir}/{$package.dir}/package-frame.html">
+ <xsl:call-template name="classes.list">
+ <xsl:with-param name="name" select="$name"/>
+ </xsl:call-template>
+ </redirect:write>
+
+ <!-- create a package-summary.html in the package directory -->
+ <redirect:write
file="{$output.dir}/{$package.dir}/package-summary.html">
+ <xsl:call-template name="package.summary">
+ <xsl:with-param name="name" select="$name"/>
+ </xsl:call-template>
+ </redirect:write>
+
+ <!-- for each class, creates a @name.html -->
+ <!-- @bug there will be a problem with inner classes having the same name, it will
be overwritten -->
+ <xsl:for-each select="/classes/class[@package = $name]">
+ <redirect:write
file="{$output.dir}/{$package.dir}/{(a)name}.html">
+ <xsl:apply-templates select="."
mode="class.details"/>
+ </redirect:write>
+ </xsl:for-each>
+</xsl:template>
+
+<xsl:template name="index.html">
+<HTML>
+ <HEAD><TITLE>Audit Results.</TITLE></HEAD>
+ <FRAMESET cols="20%,80%">
+ <FRAMESET rows="30%,70%">
+ <FRAME src="overview-frame.html"
name="packageListFrame"/>
+ <FRAME src="allclasses-frame.html"
name="classListFrame"/>
+ </FRAMESET>
+ <FRAME src="overview-summary.html" name="classFrame"/>
+ </FRAMESET>
+ <noframes>
+ <H2>Frame Alert</H2>
+ <P>
+ This document is designed to be viewed using the frames feature. If you see this
message, you are using a non-frame-capable web client.
+ </P>
+ </noframes>
+</HTML>
+</xsl:template>
+
+
+<!-- this is the stylesheet css to use for nearly everything -->
+<xsl:template name="stylesheet.css">
+ .bannercell {
+ border: 0px;
+ padding: 0px;
+ }
+ body {
+ margin-left: 10;
+ margin-right: 10;
+ font:normal 80% arial,helvetica,sanserif;
+ background-color:#FFFFFF;
+ color:#000000;
+ }
+ .a td {
+ background: #efefef;
+ }
+ .b td {
+ background: #fff;
+ }
+ th, td {
+ text-align: left;
+ vertical-align: top;
+ }
+ th {
+ font-weight:bold;
+ background: #ccc;
+ color: black;
+ }
+ table, th, td {
+ font-size:100%;
+ border: none
+ }
+ table.log tr td, tr th {
+
+ }
+ h2 {
+ font-weight:bold;
+ font-size:140%;
+ margin-bottom: 5;
+ }
+ h3 {
+ font-size:100%;
+ font-weight:bold;
+ background: #525D76;
+ color: white;
+ text-decoration: none;
+ padding: 5px;
+ margin-right: 2px;
+ margin-left: 2px;
+ margin-bottom: 0;
+ }
+</xsl:template>
+
+
+<!-- print the violations of the class -->
+<xsl:template match="class" mode="class.details">
+ <xsl:variable name="package.name" select="@package"/>
+ <HTML>
+ <HEAD>
+ <xsl:call-template name="create.stylesheet.link">
+ <xsl:with-param name="package.name"
select="$package.name"/>
+ </xsl:call-template>
+ </HEAD>
+ <BODY>
+ <xsl:call-template name="pageHeader"/>
+ <H3>Class <xsl:if test="not($package.name =
'')"><xsl:value-of
select="$package.name"/>.</xsl:if><xsl:value-of
select="@name"/></H3>
+
+ <table class="log" border="0"
cellpadding="5" cellspacing="2" width="100%">
+ <xsl:call-template name="class.audit.header"/>
+ <xsl:apply-templates select="."
mode="print.audit"/>
+ </table>
+
+ <H3>Violations</H3>
+ <table class="log" border="0"
cellpadding="5" cellspacing="2" width="100%">
+ <xsl:call-template name="violation.audit.header"/>
+ <xsl:apply-templates select="./violation"
mode="print.audit">
+ <xsl:sort data-type="number"
select="@line"/>
+ </xsl:apply-templates>
+ </table>
+ <xsl:call-template name="pageFooter"/>
+ </BODY>
+ </HTML>
+</xsl:template>
+
+
+<!-- list of classes in a package -->
+<xsl:template name="classes.list">
+ <xsl:param name="name"/>
+ <HTML>
+ <HEAD>
+ <xsl:call-template name="create.stylesheet.link">
+ <xsl:with-param name="package.name"
select="$name"/>
+ </xsl:call-template>
+ </HEAD>
+ <BODY>
+ <table width="100%">
+ <tr>
+ <td nowrap="nowrap">
+ <H2><a href="package-summary.html"
target="classFrame"><xsl:value-of
select="$name"/></a></H2>
+ </td>
+ </tr>
+ </table>
+
+ <h2>Classes</h2>
+ <TABLE WIDTH="100%">
+ <xsl:apply-templates select="/classes/class[./@package =
$name]" mode="classes.list">
+ <xsl:sort select="@name"/>
+ </xsl:apply-templates>
+ </TABLE>
+ </BODY>
+ </HTML>
+</xsl:template>
+<!-- the class to list -->
+<xsl:template match="class" mode="classes.list">
+ <tr>
+ <td nowrap="nowrap">
+ <!-- @bug naming to fix for inner classes -->
+ <a href="{(a)name}.html"
target="classFrame"><xsl:value-of select="@name"/></a>
+ </td>
+ </tr>
+</xsl:template>
+
+
+<!--
+ Creates an all-classes.html file that contains a link to all package-summary.html
+ on each class.
+-->
+<xsl:template match="classes" mode="all.classes">
+ <html>
+ <head>
+ <xsl:call-template name="create.stylesheet.link">
+ <xsl:with-param name="package.name"/>
+ </xsl:call-template>
+ </head>
+ <body>
+ <h2>Classes</h2>
+ <table width="100%">
+ <xsl:apply-templates select=".//class"
mode="all.classes">
+ <xsl:sort select="@name"/>
+ </xsl:apply-templates>
+ </table>
+ </body>
+ </html>
+</xsl:template>
+
+<xsl:template match="class" mode="all.classes">
+ <!-- (ancestor::package)[last()] is buggy in MSXML3 ? -->
+ <xsl:variable name="package.name" select="@package"/>
+ <tr>
+ <td nowrap="nowrap">
+ <a target="classFrame">
+ <xsl:attribute name="href">
+ <xsl:if test="not($package.name='')">
+ <xsl:value-of
select="translate($package.name,'.','/')"/><xsl:text>/</xsl:text>
+ </xsl:if><xsl:value-of
select="@name"/><xsl:text>.html</xsl:text>
+ </xsl:attribute>
+ <xsl:value-of select="@name"/>
+ </a>
+ </td>
+ </tr>
+</xsl:template>
+
+
+<!--
+ Creates an html file that contains a link to all package-summary.html files on
+ each package existing on testsuites.
+ @bug there will be a problem here, I don't know yet how to handle unnamed package
:(
+-->
+<xsl:template match="classes" mode="all.packages">
+ <html>
+ <head>
+ <xsl:call-template name="create.stylesheet.link">
+ <xsl:with-param name="package.name"/>
+ </xsl:call-template>
+ </head>
+ <body>
+ <h2><a href="overview-summary.html"
target="classFrame">Home</a></h2>
+ <h2>Packages</h2>
+ <table width="100%">
+ <xsl:apply-templates select="class[not(./@package =
preceding-sibling::class/@package)]" mode="all.packages">
+ <xsl:sort select="@package"
order="ascending"/>
+ </xsl:apply-templates>
+ </table>
+ </body>
+ </html>
+</xsl:template>
+
+<xsl:template match="class" mode="all.packages">
+ <tr>
+ <td nowrap="nowrap">
+ <a
href="{translate((a)package,'.','/')}/package-summary.html"
target="classFrame">
+ <xsl:value-of select="@package"/>
+ </a>
+ </td>
+ </tr>
+</xsl:template>
+
+
+<xsl:template match="classes" mode="overview.packages">
+ <html>
+ <head>
+ <xsl:call-template name="create.stylesheet.link">
+ <xsl:with-param name="package.name"/>
+ </xsl:call-template>
+ </head>
+ <body
onload="open('allclasses-frame.html','classListFrame')">
+ <xsl:call-template name="pageHeader"/>
+ <h3>Summary</h3>
+ <table class="log" border="0" cellpadding="5"
cellspacing="2" width="100%">
+ <tr>
+ <th>Audited classes</th>
+ <th>Reported classes</th>
+ <th>Violations</th>
+ </tr>
+ <tr class="a">
+ <td><xsl:value-of select="@audited"/></td>
+ <td><xsl:value-of select="@reported"/></td>
+ <td><xsl:value-of select="@violations"/></td>
+ </tr>
+ </table>
+ <table border="0" width="100%">
+ <tr>
+ <td style="text-align: justify;">
+ Note: Rules checked have originated from style guidelines suggested by the
language designers,
+ experience from the Java development community and insite experience. Violations
are generally
+ reported with a reference to the <a
href="http://java.sun.com/docs/books/jls/second_edition/html/jTOC.do...
Language Specifications</a> (JLS x.x.x)
+ and Metamata Audit rules (x.x).
+ Please consult these documents for additional information about violations.
+ <p/>
+ Rules checked also enforce adherence to <a
href="http://java.sun.com/docs/codeconv/html/CodeConvTOC.doc.html&qu... Java
coding guidelines</a> in use at Jakarta.
+ <p/>
+ One should note that these violations do not necessary underline errors but
should be used
+ as an indication for <i>possible</i> errors. As always, use your best
judgment and review
+ them carefully, it might save you hours of debugging.
+ </td>
+ </tr>
+ </table>
+
+ <h3>Packages</h3>
+ <table class="log" border="0" cellpadding="5"
cellspacing="2" width="100%">
+ <xsl:call-template name="class.audit.header"/>
+ <xsl:for-each select="class[not(./@package =
preceding-sibling::class/@package)]">
+ <xsl:sort select="@package"
order="ascending"/>
+ <tr>
+ <xsl:call-template name="alternate-row"/>
+ <td><a
href="{translate(@package,'.','/')}/package-summary.html"><xsl:value-of
select="@package"/></a></td>
+ <td><xsl:value-of select="sum(/classes/class[./@package
= current()/@package]/@violations)"/></td>
+ </tr>
+ </xsl:for-each>
+ </table>
+ <xsl:call-template name="pageFooter"/>
+ </body>
+ </html>
+</xsl:template>
+
+
+<xsl:template name="package.summary">
+ <xsl:param name="name"/>
+ <HTML>
+ <HEAD>
+ <xsl:call-template name="create.stylesheet.link">
+ <xsl:with-param name="package.name"
select="$name"/>
+ </xsl:call-template>
+ </HEAD>
+ <BODY>
+ <xsl:attribute
name="onload">open('package-frame.html','classListFrame')</xsl:attribute>
+ <xsl:call-template name="pageHeader"/>
+ <h3>Package <xsl:value-of select="$name"/></h3>
+
+ <!--table border="0" cellpadding="5"
cellspacing="2" width="100%">
+ <xsl:call-template name="class.metrics.header"/>
+ <xsl:apply-templates select="."
mode="print.metrics"/>
+ </table-->
+
+ <xsl:if test="count(/classes/class[./@package = $name]) >
0">
+ <H3>Classes</H3>
+ <table class="log" border="0"
cellpadding="5" cellspacing="2" width="100%">
+ <xsl:call-template name="class.audit.header"/>
+ <xsl:apply-templates select="/classes/class[./@package =
$name]" mode="print.audit">
+ <xsl:sort select="@name"/>
+ </xsl:apply-templates>
+ </table>
+ </xsl:if>
+ <xsl:call-template name="pageFooter"/>
+ </BODY>
+ </HTML>
+</xsl:template>
+
+
+<!--
+ transform string like a.b.c to ../../../
+ @param path the path to transform into a descending directory path
+-->
+<xsl:template name="path">
+ <xsl:param name="path"/>
+ <xsl:if test="contains($path,'.')">
+ <xsl:text>../</xsl:text>
+ <xsl:call-template name="path">
+ <xsl:with-param name="path"><xsl:value-of
select="substring-after($path,'.')"/></xsl:with-param>
+ </xsl:call-template>
+ </xsl:if>
+ <xsl:if test="not(contains($path,'.')) and not($path =
'')">
+ <xsl:text>../</xsl:text>
+ </xsl:if>
+</xsl:template>
+
+
+<!-- create the link to the stylesheet based on the package name -->
+<xsl:template name="create.stylesheet.link">
+ <xsl:param name="package.name"/>
+ <LINK REL ="stylesheet" TYPE="text/css"
TITLE="Style"><xsl:attribute name="href"><xsl:if
test="not($package.name = 'unnamed package')"><xsl:call-template
name="path"><xsl:with-param name="path"
select="$package.name"/></xsl:call-template></xsl:if>stylesheet.css</xsl:attribute></LINK>
+</xsl:template>
+
+<!-- Page HEADER -->
+<xsl:template name="pageHeader">
+
+ <!-- jakarta logo -->
+ <table border="0" cellpadding="0" cellspacing="0"
width="100%">
+ <tr>
+ <td class="bannercell" rowspan="2">
+ <a
href="http://jakarta.apache.org/">
+ <img
src="http://jakarta.apache.org/images/jakarta-logo.gif"
alt="http://jakarta.apache.org" align="left"
border="0"/>
+ </a>
+ </td>
+ <td style="text-align:right"><h2>Source Code
Audit</h2></td>
+ </tr>
+ <tr>
+ <td style="text-align:right">Designed for use with <a
href='http://www.webgain.com/products/quality_analyzer/'>Webgain QA/Metamata
Audit</a> and <a
href='http://jakarta.apache.org'>Ant</a>.</td>
+ </tr>
+ </table>
+ <hr size="1"/>
+</xsl:template>
+
+<!-- Page HEADER -->
+<xsl:template name="pageFooter">
+</xsl:template>
+
+
+<!-- class header -->
+<xsl:template name="class.audit.header">
+ <tr>
+ <th width="80%">Name</th>
+ <th>Violations</th>
+ </tr>
+</xsl:template>
+
+<!-- method header -->
+<xsl:template name="violation.audit.header">
+ <tr>
+ <th>Line</th>
+ <th>Message</th>
+ </tr>
+</xsl:template>
+
+
+<!-- class information -->
+<xsl:template match="class" mode="print.audit">
+ <tr>
+ <xsl:call-template name="alternate-row"/>
+ <td><a href="{@name}.html"><xsl:value-of
select="@name"/></a></td>
+ <td><xsl:apply-templates select="@violations"/></td>
+ </tr>
+</xsl:template>
+
+<xsl:template match="violation" mode="print.audit">
+ <tr>
+ <xsl:call-template name="alternate-row"/>
+ <td><xsl:value-of select="@line"/></td>
+ <td><xsl:apply-templates select="@message"/></td>
+ </tr>
+</xsl:template>
+
+<!-- alternated row style -->
+<xsl:template name="alternate-row">
+<xsl:attribute name="class">
+ <xsl:if test="position() mod 2 = 1">a</xsl:if>
+ <xsl:if test="position() mod 2 = 0">b</xsl:if>
+</xsl:attribute>
+</xsl:template>
+
+</xsl:stylesheet>
+
Property changes on: modules/portlet/trunk/tools/etc/maudit-frames.xsl
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/tools/etc/mmetrics-frames.xsl
===================================================================
--- modules/portlet/trunk/tools/etc/mmetrics-frames.xsl (rev 0)
+++ modules/portlet/trunk/tools/etc/mmetrics-frames.xsl 2007-08-17 15:29:49 UTC (rev
7981)
@@ -0,0 +1,1025 @@
+<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0"
+
xmlns:lxslt="http://xml.apache.org/xslt"
+
xmlns:xalan="http://xml.apache.org/xalan"
+ xmlns:redirect="org.apache.xalan.lib.Redirect"
+ exclude-result-prefixes="xalan"
+ extension-element-prefixes="redirect">
+<xsl:output method="html" indent="yes"
encoding="US-ASCII"/>
+<xsl:decimal-format decimal-separator="." grouping-separator=","
/>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+
http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!--
+ @author Stephane Bailliez <a href="mailto:sbailliez@apache.org"/>
+ -->
+<xsl:param name="output.dir" select="'.'"/>
+
+<!-- default max value for the metrics -->
+<xsl:param name="vg.max" select="10"/>
+<xsl:param name="loc.max" select="1000"/>
+<xsl:param name="dit.max" select="10"/>
+<xsl:param name="noa.max" select="250"/>
+<xsl:param name="nrm.max" select="50"/>
+<xsl:param name="nlm.max" select="250"/>
+<xsl:param name="wmc.max" select="250"/>
+<xsl:param name="rfc.max" select="50"/>
+<xsl:param name="dac.max" select="10"/>
+<xsl:param name="fanout.max" select="10"/>
+<xsl:param name="cbo.max" select="15"/>
+<xsl:param name="lcom.max" select="10"/>
+<xsl:param name="nocl.max" select="10"/>
+
+
+<!-- create a tree fragment to speed up processing -->
+<xsl:variable name="doctree.var">
+ <xsl:element name="classes">
+ <xsl:for-each select=".//class">
+ <xsl:element name="class">
+ <xsl:attribute name="package">
+ <xsl:value-of select="(ancestor::package)[last()]/@name"/>
+ </xsl:attribute>
+ <xsl:copy-of select="@*"/>
+ <xsl:attribute name="name">
+ <xsl:apply-templates select="." mode="class.name"/>
+ </xsl:attribute>
+ <xsl:copy-of select="method"/>
+ </xsl:element>
+ </xsl:for-each>
+ </xsl:element>
+</xsl:variable>
+
+<xsl:variable name="doctree"
select="xalan:nodeset($doctree.var)"/>
+
+<xsl:template match="metrics">
+
+ <!-- create the index.html -->
+ <redirect:write file="{$output.dir}/index.html">
+ <xsl:call-template name="index.html"/>
+ </redirect:write>
+
+ <!-- create the stylesheet.css -->
+ <redirect:write file="{$output.dir}/stylesheet.css">
+ <xsl:call-template name="stylesheet.css"/>
+ </redirect:write>
+
+ <redirect:write file="{$output.dir}/metrics-reference.html">
+ <xsl:call-template name="metrics-reference.html"/>
+ </redirect:write>
+
+ <!-- create the overview-packages.html at the root -->
+ <redirect:write file="{$output.dir}/overview-summary.html">
+ <xsl:apply-templates select="." mode="overview.packages"/>
+ </redirect:write>
+
+ <!-- create the all-packages.html at the root -->
+ <redirect:write file="{$output.dir}/overview-frame.html">
+ <xsl:apply-templates select="." mode="all.packages"/>
+ </redirect:write>
+
+ <!-- create the all-classes.html at the root -->
+ <redirect:write file="{$output.dir}/allclasses-frame.html">
+ <xsl:apply-templates select="." mode="all.classes"/>
+ </redirect:write>
+
+ <!-- process all packages -->
+ <xsl:apply-templates select=".//package"/>
+</xsl:template>
+
+
+<xsl:template match="package">
+ <xsl:variable name="package.name" select="@name"/>
+ <xsl:variable name="package.dir">
+ <xsl:if test="not($package.name = 'unnamed
package')"><xsl:value-of
select="translate($package.name,'.','/')"/></xsl:if>
+ <xsl:if test="$package.name = 'unnamed
package'">.</xsl:if>
+ </xsl:variable>
+ <!-- create a classes-list.html in the package directory -->
+ <redirect:write
file="{$output.dir}/{$package.dir}/package-frame.html">
+ <xsl:apply-templates select="." mode="classes.list"/>
+ </redirect:write>
+
+ <!-- create a package-summary.html in the package directory -->
+ <redirect:write
file="{$output.dir}/{$package.dir}/package-summary.html">
+ <xsl:apply-templates select="." mode="package.summary"/>
+ </redirect:write>
+
+ <!-- for each class, creates a @name.html -->
+ <!-- @bug there will be a problem with inner classes having the same name, it will
be overwritten -->
+ <xsl:for-each select="$doctree/classes/class[@package =
current()/@name]">
+ <!--Processing <xsl:value-of
select="$class.name"/><xsl:text> </xsl:text> -->
+ <redirect:write file="{$output.dir}/{$package.dir}/{(a)name}.html">
+ <xsl:apply-templates select="." mode="class.details"/>
+ </redirect:write>
+ </xsl:for-each>
+</xsl:template>
+
+<!-- little trick to compute the classname for inner and non inner classes -->
+<!-- this is all in one line to avoid CRLF in the name -->
+<xsl:template match="class" mode="class.name">
+ <xsl:if test="parent::class"><xsl:apply-templates
select="parent::class" mode="class.name"/>.<xsl:value-of
select="@name"/></xsl:if><xsl:if
test="not(parent::class)"><xsl:value-of
select="@name"/></xsl:if>
+</xsl:template>
+
+
+<xsl:template name="index.html">
+<HTML>
+ <HEAD><TITLE>Metrics Results.</TITLE></HEAD>
+ <FRAMESET cols="20%,80%">
+ <FRAMESET rows="30%,70%">
+ <FRAME src="overview-frame.html"
name="packageListFrame"/>
+ <FRAME src="allclasses-frame.html"
name="classListFrame"/>
+ </FRAMESET>
+ <FRAME src="overview-summary.html" name="classFrame"/>
+ </FRAMESET>
+ <noframes>
+ <H2>Frame Alert</H2>
+ <P>
+ This document is designed to be viewed using the frames feature. If you see this
message, you are using a non-frame-capable web client.
+ </P>
+ </noframes>
+</HTML>
+</xsl:template>
+
+<!-- this is the stylesheet css to use for nearly everything -->
+<xsl:template name="metrics-reference.html">
+<html>
+<head>
+<link title="Style" type="text/css" rel="stylesheet"
href="stylesheet.css"/>
+</head>
+<body style="text-align:justify;">
+<h2>Metrics Reference</h2>
+<a href="#V(G)">V(G)</a> |
+<a href="#LOC">LOC</a> |
+<a href="#DIT">DIT</a> |
+<a href="#NOA">NOA</a> |
+<a href="#NRM">NRM</a> |
+<a href="#NLM">NLM</a> |
+<a href="#WMC">WMC</a> |
+<a href="#RFC">RFC</a> |
+<a href="#DAC">DAC</a> |
+<a href="#FANOUT">FANOUT</a> |
+<a href="#CBO">CBO</a> |
+<a href="#LCOM">LCOM</a> |
+<a href="#NOC">NOC</a>
+
+<a name="V(G)"/>
+<h3>Cyclomatic Complexity - V(G)</h3>
+This metric was introduced in the 1970s to measure the amount of control
+flow complexity or branching complexity in a module such as a
+subroutine. It gives the number of paths that may be taken through the
+code, and was initially developed to give some measure of the cost of
+producing a test case for the module by executing each path.
+<p/>
+Methods with a high cyclomatic complexity tend to be more difficult to
+understand and maintain. In general the more complex the methods of an
+application, the more difficult it will be to test it, and this will adversely
+affect its reliability.
+<p/>
+V(G) is a measure of the control flow complexity of a method or
+constructor. It counts the number of branches in the body of the method,
+defined as:
+<ul>
+<li>while statements;</li>
+<li>if statements;</li>
+<li>for statements.</li>
+</ul>
+
+The metric can also be configured to count each case of a switch
+statement as well.
+
+<a name="LOC"/>
+<h3>Lines of Code - LOC</h3>
+
+This is perhaps the simplest of all the metrics to define and compute.
+Counting lines has a long history as a software metric dating from before
+the rise of structured programming, and it is still in widespread use today.
+The size of a method affects the ease with which it can be understood, its
+reusability and its maintainability. There are a variety of ways that the size
+can be calculated. These include counting all the lines of code, the number
+of statements, the blank lines of code, the lines of commentary, and the
+lines consisting only of syntax such as block delimiters.
+<p/>
+This metric can also be used for sizing other constructs as well, for
+example, the overall size of a Java class or package can be measured by
+counting the number of source lines it consists of.
+<p/>
+LOC can be used to determine the size of a compilation unit (source file),
+class or interface, method, constructor, or field. It can be configured to
+ignore:
+<ul>
+<li>blank lines;</li>
+<li>lines consisting only of comments;</li>
+<li>lines consisting only of opening and closing braces.</li>
+</ul>
+
+<a name="DIT"/>
+<h3>Depth of Inheritance Hierarchy - DIT</h3>
+
+This metric calculates how far down the inheritance hierarchy a class is
+declared. In Java all classes have java.lang.Object as their ultimate
+superclass, which is defined to have a depth of 1. So a class that
+immediately extends java.lang.Object has a metric value of 2; any of its
+subclasses will have a value of 3, and so on.
+<p/>
+A class that is deep within the tree inherits more methods and state
+variables, thereby increasing its complexity and making it difficult to
+predict its behavior. It can be harder to understand a system with many
+inheritance layers.
+<p/>
+DIT is defined for classes and interfaces:
+<ul>
+<li>all interface types have a depth of 1;</li>
+<li>the class java.lang.Object has a depth of 1;</li>
+<li>all other classes have a depth of 1 + the depth of their super
class.</li>
+</ul>
+
+<a name="NOA"/>
+<h3>Number of Attributes - NOA</h3>
+
+The number of distinct state variables in a class serves as one measure of
+its complexity. The more state a class represents the more difficult it is to
+maintain invariants for it. It also hinders comprehensibility and reuse.
+<p/>
+In Java, state can be exposed to subclasses through protected fields, which
+entails that the subclass also be aware of and maintain any invariants. This
+interference with the class's data encapsulation can be a source of defects
+and hidden dependencies between the state variables.
+<p/>
+NOA is defined for classes and interfaces. It counts the number of fields
+declared in the class or interface.
+
+<a name="NRM"/>
+<h3>Number of Remote Methods - NRM</h3>
+
+NRM is defined for classes. A remote method call is defined as an
+invocation of a method that is not declared in any of:
+<ul>
+<li>the class itself;</li>
+<li>a class or interface that the class extends or implements;</li>
+<li>a class or method that extends the class.</li>
+</ul>
+
+The value is the count of all the remote method calls in all of the methods
+and constructors of the class.
+
+<a name="NLM"/>
+<h3>Number of Local Methods - NLM</h3>
+
+NLM is defined for classes and interfaces. A local method is defined as a
+method that is declared in the class or interface. NLM can be configured to
+include the local methods of all of the class's superclasses. Methods with
+public, protected, package and private visibility can be independently
+counted by setting configuration parameters.
+
+<a name="WMC"/>
+<h3>Weighted Methods per Class - WMC</h3>
+
+If the number of methods in a class can be determined during the design
+and modeling phase of a project, it can be used as a predictor of how
+much time and effort is needed to develop, debug and maintain it. This
+metric can be further refined by incorporating a weighting for the
+complexity of each method. The usual weighting is given by the cyclomatic
+complexity of the method.
+<p/>
+The subclasses of a class inherit all of its public and protected methods,
+and possibly its package methods as well, so the number of methods a
+class has directly impacts the complexity of its subclasses. Classes with
+large numbers of methods are often specific to a particular application,
+reducing the ability to reuse them.
+<p/>
+The definition of WMC is based upon NLM, and it provides the same
+configuration parameters for counting inherited methods and of varying
+visibility. The main difference is that NLM always counts each method as 1,
+whereas WMC will weight each method. There are two weighting schemes:
+<ul>
+<li>V(G) the cyclomatic complexity of the method is used as its weight.
+ Methods from class files are given a V(G) of 1.</li>
+<li>the arity, or the number of parameters of the method are used to
+ determine the weight.</li>
+</ul>
+
+<a name="RFC"/>
+<h3>Response For Class - RFC</h3>
+
+The response set of a class is the set of all methods that can be invoked as
+a result of a message sent to an object of the class. This includes methods
+in the class's inheritance hierarchy and methods that can be invoked on
+other objects. The Response For Class metric is defined to be size of the
+response set for the class. A class which provides a larger response set is
+considered to be more complex than one with a smaller response set.
+<p/>
+One reason for this is that if a method call on a class can result in a large
+number of different method calls on the target and other classes, then it
+can be harder to test the behavior of the class and debug problems. It will
+typically require a deeper understanding of the potential interactions that
+objects of the class can have with the rest of the system.
+<p/>
+RFC is defined as the sum of NLM and NRM for the class. The local methods
+include all of the public, protected, package and private methods, but not
+methods declared only in a superclass.
+
+<a name="DAC"/>
+<h3>Data Abstraction Coupling - DAC</h3>
+
+DAC is defined for classes and interfaces. It counts the number of reference
+types that are used in the field declarations of the class or interface. The
+component types of arrays are also counted. Any field with a type that is
+either a supertype or a subtype of the class is not counted.
+
+<a name="FANOUT"/>
+<h3>Fan Out - FANOUT</h3>
+
+FANOUT is defined for classes and interfaces, constructors and methods. It
+counts the number of reference types that are used in:
+<ul>
+<li>field declarations;</li>
+<li>formal parameters and return types;</li>
+<li>throws declarations;</li>
+<li>local variables.</li>
+</ul>
+
+The component types of arrays are also counted. Any type that is either a
+supertype or a subtype of the class is not counted.
+
+<a name="CBO"/>
+<h3>Coupling Between Objects - CBO</h3>
+
+When one object or class uses another object or class they are said to be
+coupled. One major source of coupling is that between a superclass and a
+subclass. A coupling is also introduced when a method or field in another
+class is accessed, or when an object of another class is passed into or out
+of a method invocation. Coupling Between Objects is a measure of the
+non-inheritance coupling between two objects.
+<p/>
+A high value of coupling reduces the modularity of the class and makes
+reuse more difficult. The more independent a class is the more likely it is
+that it will be possible to reuse it in another part of the system. When a
+class is coupled to another class it becomes sensitive to changes in that
+class, thereby making maintenance for difficult. In addition, a class that is
+overly dependent on other classes can be difficult to understand and test in
+isolation.
+<p/>
+CBO is defined for classes and interfaces, constructors and methods. It
+counts the number of reference types that are used in:
+<ul>
+<li>field declarations</li>
+<li>formal parameters and return types</li>
+<li>throws declarations</li>
+<li>local variables</li>
+</ul>
+
+It also counts:
+<ul>
+<li>types from which field and method selections are made</li>
+</ul>
+
+The component types of arrays are also counted. Any type that is either a
+supertype or a subtype of the class is not counted.
+
+<a name="LCOM"/>
+<h3>Lack of Cohesion Of Methods - LCOM</h3>
+
+The cohesion of a class is the degree to which its methods are related to
+each other. It is determined by examining the pattern of state variable
+accesses within the set of methods. If all the methods access the same state
+variables then they have high cohesion; if they access disjoint sets of
+variables then the cohesion is low. An extreme example of low cohesion
+would be if none of the methods accessed any of the state variables.
+
+If a class exhibits low method cohesion it indicates that the design of the
+class has probably been partitioned incorrectly, and could benefit by being
+split into more classes with individually higher cohesion. On the other
+hand, a high value of cohesion (a low lack of cohesion) implies that the
+class is well designed. A cohesive class will tend to provide a high degree
+of encapsulation, whereas a lack of cohesion decreases encapsulation and
+increases complexity.
+<p/>
+Another form of cohesion that is useful for Java programs is cohesion
+between nested and enclosing classes. A nested class that has very low
+cohesion with its enclosing class would probably better designed as a peer
+class rather than a nested class.
+<p/>
+LCOM is defined for classes. Operationally, LCOM takes each pair of
+methods in the class and determines the set of fields they each access. If
+they have disjoint sets of field accesses increase the count P by one. If they
+share at least one field access then increase Q by one. After considering
+each pair of methods,
+LCOM = (P > Q) ? (P - Q) : 0
+<p/>
+Indirect access to fields via local methods can be considered by setting a
+metric configuration parameter.
+
+<a name="NOC"/>
+<h3>Number Of Classes - NOC</h3>
+
+The overall size of the system can be estimated by calculating the number
+of classes it contains. A large system with more classes is more complex
+than a smaller one because the number of potential interactions between
+objects is higher. This reduces the comprehensibility of the system which
+in turn makes it harder to test, debug and maintain.
+<p/>
+If the number of classes in the system can be projected during the initial
+design phase of the project it can serve as a base for estimating the total
+effort and cost of developing, debugging and maintaining the system.
+<p/>
+The NOC metric can also usefully be applied at the package and class level
+as well as the total system.
+<p/>
+NOCL is defined for class and interfaces. It counts the number of classes or
+interfaces that are declared. This is usually 1, but nested class declarations
+will increase this number.
+</body>
+</html>
+</xsl:template>
+
+<!-- this is the stylesheet css to use for nearly everything -->
+<xsl:template name="stylesheet.css">
+ .bannercell {
+ border: 0px;
+ padding: 0px;
+ }
+ body {
+ margin-left: 10;
+ margin-right: 10;
+ font:normal 80% arial,helvetica,sanserif;
+ background-color:#FFFFFF;
+ color:#000000;
+ }
+ .a td {
+ background: #efefef;
+ }
+ .b td {
+ background: #fff;
+ }
+ th, td {
+ text-align: left;
+ vertical-align: top;
+ }
+ th {
+ font-weight:bold;
+ background: #ccc;
+ color: black;
+ }
+ table, th, td {
+ font-size:100%;
+ border: none
+ }
+ table.log tr td, tr th {
+
+ }
+ h2 {
+ font-weight:bold;
+ font-size:140%;
+ margin-bottom: 5;
+ }
+ h3 {
+ font-size:100%;
+ font-weight:bold;
+ background: #525D76;
+ color: white;
+ text-decoration: none;
+ padding: 5px;
+ margin-right: 2px;
+ margin-left: 2px;
+ margin-bottom: 0;
+ }
+ .Error {
+ font-weight:bold; color:red;
+ }
+
+</xsl:template>
+
+<!-- print the metrics of the class -->
+<xsl:template match="class" mode="class.details">
+ <!--xsl:variable name="package.name"
select="(ancestor::package)[last()]/@name"/-->
+ <xsl:variable name="package.name" select="@package"/>
+ <HTML>
+ <HEAD>
+ <xsl:call-template name="create.stylesheet.link">
+ <xsl:with-param name="package.name"
select="$package.name"/>
+ </xsl:call-template>
+ </HEAD>
+ <BODY>
+ <xsl:call-template name="pageHeader"/>
+
+ <H3>Class <xsl:if test="not($package.name = 'unnamed
package')"><xsl:value-of
select="$package.name"/>.</xsl:if><xsl:value-of
select="@name"/></H3>
+ <table class="log" border="0" cellpadding="5"
cellspacing="2" width="100%">
+ <xsl:call-template name="all.metrics.header"/>
+ <xsl:apply-templates select="." mode="print.metrics"/>
+ </table>
+
+ <H3>Methods</H3>
+ <table class="log" border="0" cellpadding="5"
cellspacing="2" width="100%">
+ <xsl:call-template name="method.metrics.header"/>
+ <xsl:apply-templates select="method"
mode="print.metrics"/>
+ </table>
+
+ <xsl:call-template name="pageFooter"/>
+ </BODY>
+ </HTML>
+</xsl:template>
+
+
+<!-- list of classes in a package -->
+<xsl:template match="package" mode="classes.list">
+ <HTML>
+ <HEAD>
+ <xsl:call-template name="create.stylesheet.link">
+ <xsl:with-param name="package.name" select="@name"/>
+ </xsl:call-template>
+ </HEAD>
+ <BODY>
+ <table width="100%">
+ <tr>
+ <td nowrap="nowrap">
+ <H2><a href="package-summary.html"
target="classFrame"><xsl:value-of
select="@name"/></a></H2>
+ </td>
+ </tr>
+ </table>
+
+ <H2>Classes</H2>
+ <TABLE WIDTH="100%">
+ <!-- xalan-nodeset:nodeset for Xalan 1.2.2 -->
+ <xsl:for-each select="$doctree/classes/class[@package =
current()/@name]">
+ <xsl:sort select="@name"/>
+ <tr>
+ <td nowrap="nowrap">
+ <a href="{(a)name}.html"
target="classFrame"><xsl:value-of select="@name"/></a>
+ </td>
+ </tr>
+ </xsl:for-each>
+ </TABLE>
+ </BODY>
+ </HTML>
+</xsl:template>
+
+
+<!--
+ Creates an all-classes.html file that contains a link to all package-summary.html
+ on each class.
+-->
+<xsl:template match="metrics" mode="all.classes">
+ <html>
+ <head>
+ <xsl:call-template name="create.stylesheet.link">
+ <xsl:with-param name="package.name"
select="''"/>
+ </xsl:call-template>
+ </head>
+ <body>
+ <h2>Classes</h2>
+ <table width="100%">
+ <xsl:for-each select="$doctree/classes/class">
+ <xsl:sort select="@name"/>
+ <xsl:apply-templates select="."
mode="all.classes"/>
+ </xsl:for-each>
+ </table>
+ </body>
+ </html>
+</xsl:template>
+
+<xsl:template match="class" mode="all.classes">
+ <xsl:variable name="package.name" select="@package"/>
+ <xsl:variable name="class.name" select="@name"/>
+ <tr>
+ <td nowrap="nowrap">
+ <a target="classFrame">
+ <xsl:attribute name="href">
+ <xsl:if test="not($package.name='unnamed package')">
+ <xsl:value-of
select="translate($package.name,'.','/')"/><xsl:text>/</xsl:text>
+ </xsl:if>
+ <xsl:value-of
select="$class.name"/><xsl:text>.html</xsl:text>
+ </xsl:attribute>
+ <xsl:value-of select="$class.name"/>
+ </a>
+ </td>
+ </tr>
+</xsl:template>
+
+<!--
+ Creates an html file that contains a link to all package-summary.html files on
+ each package existing on testsuites.
+ @bug there will be a problem here, I don't know yet how to handle unnamed package
:(
+-->
+<xsl:template match="metrics" mode="all.packages">
+ <html>
+ <head>
+ <xsl:call-template name="create.stylesheet.link">
+ <xsl:with-param name="package.name"
select="./package/@name"/>
+ </xsl:call-template>
+ </head>
+ <body>
+ <h2><a href="overview-summary.html"
target="classFrame">Home</a></h2>
+ <h2>Packages</h2>
+ <table width="100%">
+ <xsl:apply-templates select=".//package[not(./@name = 'unnamed
package')]" mode="all.packages">
+ <xsl:sort select="@name"/>
+ </xsl:apply-templates>
+ </table>
+ </body>
+ </html>
+</xsl:template>
+
+<xsl:template match="package" mode="all.packages">
+ <tr>
+ <td nowrap="nowrap">
+ <a
href="{translate((a)name,'.','/')}/package-summary.html"
target="classFrame">
+ <xsl:value-of select="@name"/>
+ </a>
+ </td>
+ </tr>
+</xsl:template>
+
+
+<xsl:template match="metrics" mode="overview.packages">
+ <html>
+ <head>
+ <xsl:call-template name="create.stylesheet.link">
+ <xsl:with-param name="package.name"
select="''"/>
+ </xsl:call-template>
+ </head>
+ <body
onload="open('allclasses-frame.html','classListFrame')">
+ <xsl:call-template name="pageHeader"/>
+ <h3>Summary</h3>
+ <table class="log" border="0" cellpadding="5"
cellspacing="2" width="100%">
+ <tr>
+ <th><a
href="metrics-reference.html#V(G)">V(G)</a></th>
+ <th><a
href="metrics-reference.html#LOC">LOC</a></th>
+ <th><a
href="metrics-reference.html#DIT">DIT</a></th>
+ <th><a
href="metrics-reference.html#NOA">NOA</a></th>
+ <th><a
href="metrics-reference.html#NRM">NRM</a></th>
+ <th><a
href="metrics-reference.html#NLM">NLM</a></th>
+ <th><a
href="metrics-reference.html#WMC">WMC</a></th>
+ <th><a
href="metrics-reference.html#RFC">RFC</a></th>
+ <th><a
href="metrics-reference.html#DAC">DAC</a></th>
+ <th><a
href="metrics-reference.html#FANOUT">FANOUT</a></th>
+ <th><a
href="metrics-reference.html#CBO">CBO</a></th>
+ <th><a
href="metrics-reference.html#LCOM">LCOM</a></th>
+ <th><a
href="metrics-reference.html#NOCL">NOCL</a></th>
+ </tr>
+ <xsl:apply-templates select="." mode="print.metrics"/>
+ </table>
+ <table border="0" width="100%">
+ <tr>
+ <td style="text-align: justify;">
+ Note: Metrics evaluate the quality of software by analyzing the program source and
quantifying
+ various kind of complexity. Complexity is a common source of problems and defects in
software.
+ High complexity makes it more difficult to develop, understand, maintain, extend,
test and debug
+ a program.
+ <p/>
+ The primary use of metrics is to focus your attention on those parts of code that
potentially are
+ complexity hot spots. Once the complex areas your program have been uncovered, you
can take remedial
+ actions.
+ For additional information about metrics and their meaning, please consult
+ Metamata Metrics manual.
+ </td>
+ </tr>
+ </table>
+
+ <h3>Packages</h3>
+ <table border="0" cellpadding="5" cellspacing="2"
width="100%">
+ <xsl:call-template name="all.metrics.header"/>
+ <xsl:for-each select=".//package[not(@name = 'unnamed
package')]">
+ <xsl:sort select="@name" order="ascending"/>
+ <xsl:apply-templates select="." mode="print.metrics"/>
+ </xsl:for-each>
+ </table>
+ <!-- @bug there could some classes at this level (classes in unnamed package)
-->
+ <xsl:call-template name="pageFooter"/>
+ </body>
+ </html>
+</xsl:template>
+
+<xsl:template match="package" mode="package.summary">
+ <HTML>
+ <HEAD>
+ <xsl:call-template name="create.stylesheet.link">
+ <xsl:with-param name="package.name" select="@name"/>
+ </xsl:call-template>
+ </HEAD>
+ <body
onload="open('package-frame.html','classListFrame')">
+ <xsl:call-template name="pageHeader"/>
+ <!-- create an anchor to this package name -->
+ <h3>Package <xsl:value-of select="@name"/></h3>
+
+ <table class="log" border="0" cellpadding="5"
cellspacing="2" width="100%">
+ <xsl:call-template name="all.metrics.header"/>
+ <xsl:apply-templates select="." mode="print.metrics"/>
+ </table>
+
+ <table border="0" width="100%">
+ <tr>
+ <td style="text-align: justify;">
+ Note: Metrics evaluate the quality of software by analyzing the program source and
quantifying
+ various kind of complexity. Complexity is a common source of problems and defects
in software.
+ High complexity makes it more difficult to develop, understand, maintain, extend,
test and debug
+ a program.
+ <p/>
+ The primary use of metrics is to focus your attention on those parts of code that
potentially are
+ complexity hot spots. Once the complex areas your program have been uncovered, you
can take remedial
+ actions.
+ For additional information about metrics and their meaning, please consult
+ Metamata Metrics manual.
+ </td>
+ </tr>
+ </table>
+
+ <xsl:variable name="classes-in-package"
select="$doctree/classes/class[@package = current()/@name]"/>
+ <xsl:if test="count($classes-in-package) > 0">
+ <H3>Classes</H3>
+ <table class="log" border="0" cellpadding="5"
cellspacing="2" width="100%">
+ <xsl:call-template name="all.metrics.header"/>
+ <xsl:for-each select="$classes-in-package">
+ <xsl:sort select="@name"/>
+ <xsl:apply-templates select="."
mode="print.metrics"/>
+ </xsl:for-each>
+ </table>
+ </xsl:if>
+
+ <xsl:call-template name="pageFooter"/>
+ </body>
+ </HTML>
+</xsl:template>
+
+
+<!--
+ transform string like a.b.c to ../../../
+ @param path the path to transform into a descending directory path
+-->
+<xsl:template name="path">
+ <xsl:param name="path"/>
+ <xsl:if test="contains($path,'.')">
+ <xsl:text>../</xsl:text>
+ <xsl:call-template name="path">
+ <xsl:with-param name="path"><xsl:value-of
select="substring-after($path,'.')"/></xsl:with-param>
+ </xsl:call-template>
+ </xsl:if>
+ <xsl:if test="not(contains($path,'.')) and not($path =
'')">
+ <xsl:text>../</xsl:text>
+ </xsl:if>
+</xsl:template>
+
+
+<!-- create the link to the stylesheet based on the package name -->
+<xsl:template name="create.stylesheet.link">
+ <xsl:param name="package.name"/>
+ <LINK REL ="stylesheet" TYPE="text/css"
TITLE="Style"><xsl:attribute name="href"><xsl:if
test="not($package.name = 'unnamed package')"><xsl:call-template
name="path"><xsl:with-param name="path"
select="$package.name"/></xsl:call-template></xsl:if>stylesheet.css</xsl:attribute></LINK>
+</xsl:template>
+
+
+<!-- Page Header -->
+<xsl:template name="pageHeader">
+
+ <!-- jakarta logo -->
+ <table border="0" cellpadding="0" cellspacing="0"
width="100%">
+ <tr>
+ <td class="bannercell" rowspan="2">
+ <a
href="http://jakarta.apache.org/">
+ <img
src="http://jakarta.apache.org/images/jakarta-logo.gif"
alt="http://jakarta.apache.org" align="left"
border="0"/>
+ </a>
+ </td>
+ <td style="text-align:right"><h2>Source Code
Metrics</h2></td>
+ </tr>
+ <tr>
+ <td style="text-align:right">Designed for use with <a
href='http://www.webgain.com/products/quality_analyzer/'>Webgain QA/Metamata
Metrics</a> and <a
href='http://jakarta.apache.org'>Ant</a>.</td>
+ </tr>
+ </table>
+ <hr size="1"/>
+</xsl:template>
+
+<!-- Page Footer -->
+<xsl:template name="pageFooter">
+</xsl:template>
+
+<!-- class header -->
+<xsl:template name="all.metrics.header">
+ <tr>
+ <th width="80%">Name</th>
+ <th nowrap="nowrap">V(G)</th>
+ <th>LOC</th>
+ <th>DIT</th>
+ <th>NOA</th>
+ <th>NRM</th>
+ <th>NLM</th>
+ <th>WMC</th>
+ <th>RFC</th>
+ <th>DAC</th>
+ <th>FANOUT</th>
+ <th>CBO</th>
+ <th>LCOM</th>
+ <th>NOCL</th>
+ </tr>
+</xsl:template>
+
+<!-- method header -->
+<xsl:template name="method.metrics.header">
+ <tr>
+ <th width="80%">Name</th>
+ <th nowrap="nowrap">V(G)</th>
+ <th>LOC</th>
+ <th>FANOUT</th>
+ <th>CBO</th>
+ </tr>
+</xsl:template>
+
+<!-- method information -->
+<xsl:template match="method" mode="print.metrics">
+ <tr>
+ <xsl:call-template name="alternate-row"/>
+ <td><xsl:apply-templates select="@name"/></td>
+ <td><xsl:apply-templates select="@vg"/></td>
+ <td><xsl:apply-templates select="@loc"/></td>
+ <td><xsl:apply-templates select="@fanout"/></td>
+ <td><xsl:apply-templates select="@cbo"/></td>
+ </tr>
+</xsl:template>
+
+<!-- class information -->
+<xsl:template match="class" mode="print.metrics">
+ <tr>
+ <xsl:call-template name="alternate-row"/>
+ <td><a href="{@name}.html"><xsl:value-of
select="@name"/></a></td>
+ <td><xsl:apply-templates select="@vg"/></td>
+ <td><xsl:apply-templates select="@loc"/></td>
+ <td><xsl:apply-templates select="@dit"/></td>
+ <td><xsl:apply-templates select="@noa"/></td>
+ <td><xsl:apply-templates select="@nrm"/></td>
+ <td><xsl:apply-templates select="@nlm"/></td>
+ <td><xsl:apply-templates select="@wmc"/></td>
+ <td><xsl:apply-templates select="@rfc"/></td>
+ <td><xsl:apply-templates select="@dac"/></td>
+ <td><xsl:apply-templates select="@fanout"/></td>
+ <td><xsl:apply-templates select="@cbo"/></td>
+ <td><xsl:apply-templates select="@lcom"/></td>
+ <td><xsl:apply-templates select="@nocl"/></td>
+ </tr>
+</xsl:template>
+
+<xsl:template match="file|package" mode="print.metrics">
+ <tr>
+ <xsl:call-template name="alternate-row"/>
+ <td>
+ <a
href="{translate((a)name,'.','/')}/package-summary.html"
target="classFrame">
+ <xsl:value-of select="@name"/>
+ </a>
+ </td>
+ <td><xsl:apply-templates select="@vg"/></td>
+ <td><xsl:apply-templates select="@loc"/></td>
+ <td><xsl:apply-templates select="@dit"/></td>
+ <td><xsl:apply-templates select="@noa"/></td>
+ <td><xsl:apply-templates select="@nrm"/></td>
+ <td><xsl:apply-templates select="@nlm"/></td>
+ <td><xsl:apply-templates select="@wmc"/></td>
+ <td><xsl:apply-templates select="@rfc"/></td>
+ <td><xsl:apply-templates select="@dac"/></td>
+ <td><xsl:apply-templates select="@fanout"/></td>
+ <td><xsl:apply-templates select="@cbo"/></td>
+ <td><xsl:apply-templates select="@lcom"/></td>
+ <td><xsl:apply-templates select="@nocl"/></td>
+ </tr>
+</xsl:template>
+
+<xsl:template match="metrics" mode="print.metrics">
+ <tr>
+ <xsl:call-template name="alternate-row"/>
+ <!-- the global metrics is the top package metrics -->
+ <td><xsl:apply-templates select="./package/@vg"/></td>
+ <td><xsl:apply-templates select="./package/@loc"/></td>
+ <td><xsl:apply-templates select="./package/@dit"/></td>
+ <td><xsl:apply-templates select="./package/@noa"/></td>
+ <td><xsl:apply-templates select="./package/@nrm"/></td>
+ <td><xsl:apply-templates select="./package/@nlm"/></td>
+ <td><xsl:apply-templates select="./package/@wmc"/></td>
+ <td><xsl:apply-templates select="./package/@rfc"/></td>
+ <td><xsl:apply-templates select="./package/@dac"/></td>
+ <td><xsl:apply-templates
select="./package/@fanout"/></td>
+ <td><xsl:apply-templates select="./package/@cbo"/></td>
+ <td><xsl:apply-templates select="./package/@lcom"/></td>
+ <td><xsl:apply-templates select="./package/@nocl"/></td>
+ </tr>
+</xsl:template>
+
+<!-- alternated row style -->
+<xsl:template name="alternate-row">
+<xsl:attribute name="class">
+ <xsl:if test="position() mod 2 = 1">a</xsl:if>
+ <xsl:if test="position() mod 2 = 0">b</xsl:if>
+</xsl:attribute>
+</xsl:template>
+
+
+<!-- how to display the metrics with their max value -->
+<!-- @todo the max values must be external to the xsl -->
+
+ <xsl:template match="@vg">
+ <xsl:call-template name="display-value">
+ <xsl:with-param name="value" select="current()"/>
+ <xsl:with-param name="max" select="$vg.max"/>
+ </xsl:call-template>
+ </xsl:template>
+
+ <xsl:template match="@loc">
+ <xsl:call-template name="display-value">
+ <xsl:with-param name="value" select="current()"/>
+ <xsl:with-param name="max" select="$loc.max"/>
+ </xsl:call-template>
+ </xsl:template>
+
+ <xsl:template match="@dit">
+ <xsl:call-template name="display-value">
+ <xsl:with-param name="value" select="current()"/>
+ <xsl:with-param name="max" select="$dit.max"/>
+ </xsl:call-template>
+ </xsl:template>
+
+ <xsl:template match="@noa">
+ <xsl:call-template name="display-value">
+ <xsl:with-param name="value" select="current()"/>
+ <xsl:with-param name="max" select="$noa.max"/>
+ </xsl:call-template>
+ </xsl:template>
+
+ <xsl:template match="@nrm">
+ <xsl:call-template name="display-value">
+ <xsl:with-param name="value" select="current()"/>
+ <xsl:with-param name="max" select="$nrm.max"/>
+ </xsl:call-template>
+ </xsl:template>
+
+ <xsl:template match="@nlm">
+ <xsl:call-template name="display-value">
+ <xsl:with-param name="value" select="current()"/>
+ <xsl:with-param name="max" select="$nlm.max"/>
+ </xsl:call-template>
+ </xsl:template>
+
+ <xsl:template match="@wmc">
+ <xsl:call-template name="display-value">
+ <xsl:with-param name="value" select="current()"/>
+ <xsl:with-param name="max" select="$wmc.max"/>
+ </xsl:call-template>
+ </xsl:template>
+
+ <xsl:template match="@rfc">
+ <xsl:call-template name="display-value">
+ <xsl:with-param name="value" select="current()"/>
+ <xsl:with-param name="max" select="$rfc.max"/>
+ </xsl:call-template>
+ </xsl:template>
+
+ <xsl:template match="@dac">
+ <xsl:call-template name="display-value">
+ <xsl:with-param name="value" select="current()"/>
+ <xsl:with-param name="max" select="$dac.max"/>
+ </xsl:call-template>
+ </xsl:template>
+
+ <xsl:template match="@fanout">
+ <xsl:call-template name="display-value">
+ <xsl:with-param name="value" select="current()"/>
+ <xsl:with-param name="max" select="$fanout.max"/>
+ </xsl:call-template>
+ </xsl:template>
+
+ <xsl:template match="@cbo">
+ <xsl:call-template name="display-value">
+ <xsl:with-param name="value" select="current()"/>
+ <xsl:with-param name="max" select="$cbo.max"/>
+ </xsl:call-template>
+ </xsl:template>
+
+ <xsl:template match="@lcom">
+ <xsl:call-template name="display-value">
+ <xsl:with-param name="value" select="current()"/>
+ <xsl:with-param name="max" select="$lcom.max"/>
+ </xsl:call-template>
+ </xsl:template>
+
+ <xsl:template match="@nocl">
+ <xsl:call-template name="display-value">
+ <xsl:with-param name="value" select="current()"/>
+ <xsl:with-param name="max" select="$nocl.max"/>
+ </xsl:call-template>
+ </xsl:template>
+
+ <xsl:template name="display-value">
+ <xsl:param name="value"/>
+ <xsl:param name="max"/>
+ <xsl:if test="$value > $max">
+ <xsl:attribute name="class">Error</xsl:attribute>
+ </xsl:if>
+ <xsl:value-of select="$value"/>
+ </xsl:template>
+
+</xsl:stylesheet>
+
Property changes on: modules/portlet/trunk/tools/etc/mmetrics-frames.xsl
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/tools/etc/tagdiff.xsl
===================================================================
--- modules/portlet/trunk/tools/etc/tagdiff.xsl (rev 0)
+++ modules/portlet/trunk/tools/etc/tagdiff.xsl 2007-08-17 15:29:49 UTC (rev 7981)
@@ -0,0 +1,178 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+
http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- a stylesheet to display changelogs ala netbeans -->
+<xsl:stylesheet
+
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ version="1.0">
+ <xsl:param name="title"/>
+ <xsl:param name="module"/>
+ <xsl:param name="cvsweb"/>
+
+ <xsl:output method="html" indent="yes"/>
+
+ <!-- Copy standard document elements. Elements that
+ should be ignored must be filtered by apply-templates
+ tags. -->
+ <xsl:template match="*">
+ <xsl:copy>
+ <xsl:copy-of select="attribute::*[. != '']"/>
+ <xsl:apply-templates/>
+ </xsl:copy>
+ </xsl:template>
+
+ <xsl:template match="tagdiff">
+ <html>
+ <head>
+ <title><xsl:value-of select="$title"/></title>
+ <style type="text/css">
+ body, p {
+ font-family: verdana,arial,helvetica;
+ font-size: 80%;
+ color:#000000;
+ }
+ .dateAndAuthor {
+ font-family: verdana,arial,helvetica;
+ font-size: 80%;
+ font-weight: bold;
+ text-align:left;
+ background:#a6caf0;
+ }
+ tr, td{
+ font-family: verdana,arial,helvetica;
+ font-size: 80%;
+ background:#eeeee0;
+ }
+ </style>
+ </head>
+ <body link="#000000" alink="#000000"
vlink="#000000" text="#000000">
+ <h1>
+ <a name="top"><xsl:value-of
select="$title"/></a>
+ </h1>
+ Tagdiff between <xsl:value-of select="@startTag"/>
<xsl:value-of select="@startDate"/> and
+ <xsl:value-of select="@endTag"/> <xsl:value-of
select="@endDate"/>
+ <p align="right">Designed for use with <a
href="http://ant.apache.org/">Ant</a>.</p>
+ <hr size="2"/>
+ <a name="TOP"/>
+ <table width="100%">
+ <tr>
+ <td align="right">
+ <a href="#New">New Files</a> |
+ <a href="#Modified">Modified Files</a> |
+ <a href="#Removed">Removed Files</a>
+ </td>
+ </tr>
+ </table>
+ <table border="0" width="100%" cellpadding="3"
cellspacing="1">
+ <xsl:call-template name="show-entries">
+ <xsl:with-param name="title">New Files</xsl:with-param>
+ <xsl:with-param name="anchor">New</xsl:with-param>
+ <xsl:with-param name="entries"
select=".//entry[file/revision][not(file/prevrevision)]"/>
+ </xsl:call-template>
+
+ <xsl:call-template name="show-entries">
+ <xsl:with-param name="title">Modified Files</xsl:with-param>
+ <xsl:with-param name="anchor">Modified</xsl:with-param>
+ <xsl:with-param name="entries"
select=".//entry[file/revision][file/prevrevision]"/>
+ </xsl:call-template>
+
+ <!-- change to entries select to address bug #36827 -->
+ <xsl:call-template name="show-entries">
+ <xsl:with-param name="title">Removed Files</xsl:with-param>
+ <xsl:with-param name="anchor">Removed</xsl:with-param>
+ <xsl:with-param name="entries"
select=".//entry[not(file/revision)][file/prevrevision]"/>
+ </xsl:call-template>
+ </table>
+
+ </body>
+ </html>
+ </xsl:template>
+
+ <xsl:template name="show-entries">
+ <xsl:param name="title"/>
+ <xsl:param name="anchor"/>
+ <xsl:param name="entries"/>
+ <tr>
+ <td colspan="2" class="dateAndAuthor">
+ <a>
+ <xsl:attribute name="name"><xsl:value-of
select="$anchor"/></xsl:attribute>
+ <xsl:value-of select="$title"/> - <xsl:value-of
select="count($entries)"/> entries
+ </a>
+ <a href="#TOP">(back to top)</a>
+ </td>
+ </tr>
+ <tr>
+ <td width="20">
+ <xsl:text> </xsl:text>
+ </td>
+ <td>
+ <ul>
+ <xsl:apply-templates select="$entries"/>
+ </ul>
+ </td>
+ </tr>
+ </xsl:template>
+
+ <xsl:template match="entry">
+ <xsl:apply-templates select="file"/>
+ </xsl:template>
+
+ <xsl:template match="date">
+ <i><xsl:value-of select="."/></i>
+ </xsl:template>
+
+ <xsl:template match="time">
+ <i><xsl:value-of select="."/></i>
+ </xsl:template>
+
+ <xsl:template match="author">
+ <i>
+ <a>
+ <xsl:attribute name="href">mailto:<xsl:value-of
select="."/></xsl:attribute>
+ <xsl:value-of select="."/>
+ </a>
+ </i>
+ </xsl:template>
+
+ <xsl:template match="file">
+ <li>
+ <a target="_new">
+ <xsl:attribute name="href"><xsl:value-of
select="$cvsweb"/><xsl:value-of select="$module"
/>/<xsl:value-of select="name" /></xsl:attribute>
+ <xsl:value-of select="name" />
+ </a>
+ <xsl:if test="string-length(prevrevision) > 0 or string-length(revision)
> 0">
+ <xsl:text> </xsl:text>
+ <a target="_new">
+ <xsl:choose>
+ <xsl:when test="string-length(prevrevision) = 0 ">
+ <xsl:attribute name="href"><xsl:value-of
select="$cvsweb"/><xsl:value-of select="$module"
/>/<xsl:value-of select="name" />?rev=<xsl:value-of
select="revision"
/>&content-type=text/x-cvsweb-markup</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="href"><xsl:value-of
select="$cvsweb"/><xsl:value-of select="$module"
/>/<xsl:value-of select="name" />?r1=<xsl:value-of
select="revision" />&r2=<xsl:value-of
select="prevrevision"/>&diff_format=h</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose> (<xsl:value-of select="revision"/>)
+ </a>
+ </xsl:if>
+ </li>
+ </xsl:template>
+
+ <!-- Any elements within a msg are processed,
+ so that we can preserve HTML tags. -->
+ <xsl:template match="msg">
+ <b><xsl:apply-templates/></b>
+ </xsl:template>
+
+</xsl:stylesheet>
Property changes on: modules/portlet/trunk/tools/etc/tagdiff.xsl
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/tools/examples/build.bat
===================================================================
--- modules/portlet/trunk/tools/examples/build.bat (rev 0)
+++ modules/portlet/trunk/tools/examples/build.bat 2007-08-17 15:29:49 UTC (rev 7981)
@@ -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: modules/portlet/trunk/tools/examples/build.bat
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/tools/examples/build.sh
===================================================================
--- modules/portlet/trunk/tools/examples/build.sh (rev 0)
+++ modules/portlet/trunk/tools/examples/build.sh 2007-08-17 15:29:49 UTC (rev 7981)
@@ -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: modules/portlet/trunk/tools/examples/build.sh
___________________________________________________________________
Name: svn:executable
+
Added: modules/portlet/trunk/tools/lib/ant-junit.jar
===================================================================
(Binary files differ)
Property changes on: modules/portlet/trunk/tools/lib/ant-junit.jar
___________________________________________________________________
Name: svn:executable
+
Name: svn:mime-type
+ application/octet-stream
Added: modules/portlet/trunk/tools/lib/ant-launcher.jar
===================================================================
(Binary files differ)
Property changes on: modules/portlet/trunk/tools/lib/ant-launcher.jar
___________________________________________________________________
Name: svn:executable
+
Name: svn:mime-type
+ application/octet-stream
Added: modules/portlet/trunk/tools/lib/ant-nodeps.jar
===================================================================
(Binary files differ)
Property changes on: modules/portlet/trunk/tools/lib/ant-nodeps.jar
___________________________________________________________________
Name: svn:executable
+
Name: svn:mime-type
+ application/octet-stream
Added: modules/portlet/trunk/tools/lib/ant.jar
===================================================================
(Binary files differ)
Property changes on: modules/portlet/trunk/tools/lib/ant.jar
___________________________________________________________________
Name: svn:executable
+
Name: svn:mime-type
+ application/octet-stream
Added: modules/portlet/trunk/tools/lib/bsf.jar
===================================================================
(Binary files differ)
Property changes on: modules/portlet/trunk/tools/lib/bsf.jar
___________________________________________________________________
Name: svn:executable
+
Name: svn:mime-type
+ application/octet-stream
Added: modules/portlet/trunk/tools/lib/buildmagic-tasks.jar
===================================================================
(Binary files differ)
Property changes on: modules/portlet/trunk/tools/lib/buildmagic-tasks.jar
___________________________________________________________________
Name: svn:executable
+
Name: svn:mime-type
+ application/octet-stream
Added: modules/portlet/trunk/tools/lib/cargo-core-uberjar-0.8.jar
===================================================================
(Binary files differ)
Property changes on: modules/portlet/trunk/tools/lib/cargo-core-uberjar-0.8.jar
___________________________________________________________________
Name: svn:executable
+
Name: svn:mime-type
+ application/octet-stream
Added: modules/portlet/trunk/tools/lib/crimson.jar
===================================================================
(Binary files differ)
Property changes on: modules/portlet/trunk/tools/lib/crimson.jar
___________________________________________________________________
Name: svn:executable
+
Name: svn:mime-type
+ application/octet-stream
Added: modules/portlet/trunk/tools/lib/explode.jar
===================================================================
(Binary files differ)
Property changes on: modules/portlet/trunk/tools/lib/explode.jar
___________________________________________________________________
Name: svn:executable
+
Name: svn:mime-type
+ application/octet-stream
Added: modules/portlet/trunk/tools/lib/jboss-test.jar
===================================================================
(Binary files differ)
Property changes on: modules/portlet/trunk/tools/lib/jboss-test.jar
___________________________________________________________________
Name: svn:executable
+
Name: svn:mime-type
+ application/octet-stream
Added: modules/portlet/trunk/tools/lib/jbossbuild.jar
===================================================================
(Binary files differ)
Property changes on: modules/portlet/trunk/tools/lib/jbossbuild.jar
___________________________________________________________________
Name: svn:executable
+
Name: svn:mime-type
+ application/octet-stream
Added: modules/portlet/trunk/tools/lib/junit.jar
===================================================================
(Binary files differ)
Property changes on: modules/portlet/trunk/tools/lib/junit.jar
___________________________________________________________________
Name: svn:executable
+
Name: svn:mime-type
+ application/octet-stream
Added: modules/portlet/trunk/tools/lib/saxon.jar
===================================================================
(Binary files differ)
Property changes on: modules/portlet/trunk/tools/lib/saxon.jar
___________________________________________________________________
Name: svn:executable
+
Name: svn:mime-type
+ application/octet-stream
Added: modules/portlet/trunk/tools/lib/xalan.jar
===================================================================
(Binary files differ)
Property changes on: modules/portlet/trunk/tools/lib/xalan.jar
___________________________________________________________________
Name: svn:executable
+
Name: svn:mime-type
+ application/octet-stream
Added: modules/portlet/trunk/tools/lib/xercesImpl.jar
===================================================================
(Binary files differ)
Property changes on: modules/portlet/trunk/tools/lib/xercesImpl.jar
___________________________________________________________________
Name: svn:executable
+
Name: svn:mime-type
+ application/octet-stream
Added: modules/portlet/trunk/tools/lib/xml-apis.jar
===================================================================
(Binary files differ)
Property changes on: modules/portlet/trunk/tools/lib/xml-apis.jar
___________________________________________________________________
Name: svn:executable
+
Name: svn:mime-type
+ application/octet-stream
Added: modules/portlet/trunk/tools/src/main/org/jboss/portal/tools/dtd/DTDToDocbook.java
===================================================================
--- modules/portlet/trunk/tools/src/main/org/jboss/portal/tools/dtd/DTDToDocbook.java
(rev 0)
+++
modules/portlet/trunk/tools/src/main/org/jboss/portal/tools/dtd/DTDToDocbook.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,96 @@
+/******************************************************************************
+ * 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.tools.dtd;
+
+import com.wutka.dtd.DTDParser;
+import com.wutka.dtd.DTD;
+import com.wutka.dtd.DTDComment;
+import com.wutka.dtd.DTDElement;
+import com.wutka.dtd.DTDItem;
+import com.wutka.dtd.DTDContainer;
+
+import java.io.Writer;
+import java.io.IOException;
+import java.io.PrintWriter;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class DTDToDocbook
+{
+
+ /** . */
+ private DTD dtd;
+
+ public DTDToDocbook(DTD dtd)
+ {
+ this.dtd = dtd;
+ }
+
+ public void blah(PrintWriter writer) throws IOException
+ {
+ //
+ writer.println("<itemizedlist>");
+
+ Object[] items = dtd.getItems();
+ Object previous = null;
+ for (int i = 0;i < items.length;i++)
+ {
+ Object item = items[i];
+ if (item instanceof DTDElement)
+ {
+ DTDElement elt = (DTDElement)item;
+
+ writer.println("<listitem>");
+
+ //
+ writer.println("<para>");
+ writer.print("Element <![CDATA[");
+ elt.write(writer);
+ writer.println("]]>");
+ writer.write("</para>");
+
+ //
+ if (previous instanceof DTDComment)
+ {
+ DTDComment comment = (DTDComment)previous;
+
writer.println("<para><programlisting><![CDATA[");
+ writer.print(comment.getText().trim());
+ writer.println("]]></programlisting></para>");
+ }
+
+ writer.write("</listitem>");
+
+ //
+ }
+
+ //
+ previous = item;
+ }
+
+ //
+ writer.println("</itemizedlist>");
+ }
+
+}
Added: modules/portlet/trunk/tools/src/main/org/jboss/portal/tools/dtd/Test.java
===================================================================
--- modules/portlet/trunk/tools/src/main/org/jboss/portal/tools/dtd/Test.java
(rev 0)
+++ modules/portlet/trunk/tools/src/main/org/jboss/portal/tools/dtd/Test.java 2007-08-17
15:29:49 UTC (rev 7981)
@@ -0,0 +1,60 @@
+/******************************************************************************
+ * 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.tools.dtd;
+
+import com.wutka.dtd.DTDParser;
+import com.wutka.dtd.DTD;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.io.FileOutputStream;
+import java.io.PrintStream;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class Test
+{
+
+ public static void main(String[] args) throws IOException
+ {
+ blah("../core/src/resources/portal-core-sar/dtd/jboss-portlet_2_6.dtd",
"output/jboss-portlet_2_6.txt");
+ blah("../core/src/resources/portal-core-sar/dtd/jboss-app_2_6.dtd",
"output/jboss-app_2_6.txt");
+ blah("../core/src/resources/portal-core-sar/dtd/portal-object_2_6.dtd",
"output/portal-object_2_6.txt");
+
blah("../core/src/resources/portal-core-sar/dtd/portlet-instances_2_6.dtd",
"output/portlet-instances_2_6.txt");
+ }
+
+ private static void blah(String src, String dst) throws IOException
+ {
+ File f = new File(src);
+ DTDParser parser = new DTDParser(f);
+ DTD dtd = parser.parse();
+ DTDToDocbook toDocbook = new DTDToDocbook(dtd);
+ FileOutputStream out = new FileOutputStream(dst);
+ PrintWriter writer = new PrintWriter(new PrintStream(out), true);
+ toDocbook.blah(writer);
+ writer.close();
+ }
+}