You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@struts.apache.org by ku...@apache.org on 2023/11/23 09:09:25 UTC
(struts) branch deprecated-plugins created (now f0eefea3e)
This is an automated email from the ASF dual-hosted git repository.
kusal pushed a change to branch deprecated-plugins
in repository https://gitbox.apache.org/repos/asf/struts.git
at f0eefea3e Delete remaining deprecated plugins
This branch includes the following new commits:
new be4c2bc7d Delete unused files missed in previous PR
new f0eefea3e Delete remaining deprecated plugins
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(struts) 02/02: Delete remaining deprecated plugins
Posted by ku...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
kusal pushed a commit to branch deprecated-plugins
in repository https://gitbox.apache.org/repos/asf/struts.git
commit f0eefea3edc22e88ea96197649a94953e1e0b2c1
Author: Kusal Kithul-Godage <gi...@kusal.io>
AuthorDate: Thu Nov 23 20:08:03 2023 +1100
Delete remaining deprecated plugins
---
assembly/pom.xml | 31 -
assembly/src/main/assembly/all.xml | 32 +-
bundles/admin/pom.xml | 62 -
.../struts2/osgi/admin/actions/BundlesAction.java | 215 -
.../struts2/osgi/admin/actions/ShellAction.java | 144 -
.../admin/src/main/resources/JQUERY-LICENSE.txt | 43 -
bundles/admin/src/main/resources/LICENSE.txt | 174 -
bundles/admin/src/main/resources/NOTICE.txt | 9 -
.../main/resources/osgi/admin/commandResult.ftl | 21 -
.../admin/src/main/resources/osgi/admin/shell.ftl | 60 -
.../src/main/resources/osgi/admin/viewBundle.ftl | 170 -
.../src/main/resources/osgi/admin/viewBundles.ftl | 97 -
.../admin/src/main/resources/static/css/main.css | 103 -
.../redmond/images/ui-bg_flat_0_aaaaaa_40x100.png | Bin 180 -> 0 bytes
.../redmond/images/ui-bg_flat_55_fbec88_40x100.png | Bin 182 -> 0 bytes
.../redmond/images/ui-bg_glass_75_d0e5f5_1x400.png | Bin 124 -> 0 bytes
.../redmond/images/ui-bg_glass_85_dfeffc_1x400.png | Bin 123 -> 0 bytes
.../redmond/images/ui-bg_glass_95_fef1ec_1x400.png | Bin 119 -> 0 bytes
.../images/ui-bg_gloss-wave_55_5c9ccc_500x100.png | Bin 4033 -> 0 bytes
.../images/ui-bg_inset-hard_100_f5f8f9_1x100.png | Bin 130 -> 0 bytes
.../images/ui-bg_inset-hard_100_fcfdfd_1x100.png | Bin 88 -> 0 bytes
.../css/redmond/images/ui-icons_217bc0_256x240.png | Bin 5399 -> 0 bytes
.../css/redmond/images/ui-icons_2e83ff_256x240.png | Bin 4379 -> 0 bytes
.../css/redmond/images/ui-icons_469bdd_256x240.png | Bin 4379 -> 0 bytes
.../css/redmond/images/ui-icons_6da8d5_256x240.png | Bin 4379 -> 0 bytes
.../css/redmond/images/ui-icons_cd0a0a_256x240.png | Bin 4379 -> 0 bytes
.../css/redmond/images/ui-icons_d8e7f3_256x240.png | Bin 5399 -> 0 bytes
.../css/redmond/images/ui-icons_f9bd01_256x240.png | Bin 5399 -> 0 bytes
.../css/redmond/jquery-ui-1.12.1.redmond.css | 1311 ------
.../admin/src/main/resources/static/css/shell.css | 43 -
.../main/resources/static/js/jquery-1.12.4.min.js | 5 -
.../resources/static/js/jquery-ui-1.12.1.min.js | 13 -
.../admin/src/main/resources/static/js/shell.js | 83 -
bundles/admin/src/main/resources/struts.xml | 50 -
bundles/demo/pom.xml | 78 -
.../src/main/java/actions/osgi/BundlesAction.java | 43 -
.../main/java/actions/osgi/HelloWorldAction.java | 63 -
.../demo/src/main/java/actions/osgi/Message.java | 37 -
.../META-INF/spring/applicationContext.xml | 33 -
.../src/main/resources/content/osgi/bundles.ftl | 38 -
.../resources/content/osgi/hello-convention.ftl | 30 -
.../demo/src/main/resources/content/osgi/hello.ftl | 30 -
.../demo/src/main/resources/content/osgi/hello.vm | 28 -
.../demo/src/main/resources/content/osgi/home.ftl | 34 -
bundles/demo/src/main/resources/struts.xml | 55 -
bundles/pom.xml | 83 -
plugins/embeddedjsp/README.md | 2 -
plugins/embeddedjsp/pom.xml | 102 -
.../java/org/apache/struts2/EmbeddedJSPResult.java | 32 -
.../main/java/org/apache/struts2/JSPLoader.java | 271 --
.../main/java/org/apache/struts2/JSPRuntime.java | 79 -
.../java/org/apache/struts2/JSPServletConfig.java | 53 -
.../main/java/org/apache/struts2/ServletCache.java | 74 -
.../apache/struts2/compiler/MemoryClassLoader.java | 52 -
.../struts2/compiler/MemoryJavaFileObject.java | 59 -
.../apache/struts2/el/ExpressionFactoryImpl.java | 79 -
.../apache/struts2/el/MethodExpressionImpl.java | 315 --
.../apache/struts2/el/MethodExpressionLiteral.java | 96 -
.../org/apache/struts2/el/ValueExpressionImpl.java | 267 --
.../apache/struts2/el/ValueExpressionLiteral.java | 113 -
.../org/apache/struts2/el/lang/ELArithmetic.java | 378 --
.../java/org/apache/struts2/el/lang/ELSupport.java | 474 ---
.../apache/struts2/el/lang/EvaluationContext.java | 82 -
.../apache/struts2/el/lang/ExpressionBuilder.java | 211 -
.../struts2/el/lang/FunctionMapperFactory.java | 60 -
.../apache/struts2/el/lang/FunctionMapperImpl.java | 190 -
.../struts2/el/lang/VariableMapperFactory.java | 54 -
.../apache/struts2/el/lang/VariableMapperImpl.java | 57 -
.../apache/struts2/el/parser/ArithmeticNode.java | 43 -
.../java/org/apache/struts2/el/parser/AstAnd.java | 46 -
.../apache/struts2/el/parser/AstBracketSuffix.java | 39 -
.../org/apache/struts2/el/parser/AstChoice.java | 47 -
.../struts2/el/parser/AstCompositeExpression.java | 55 -
.../struts2/el/parser/AstDeferredExpression.java | 54 -
.../java/org/apache/struts2/el/parser/AstDiv.java | 42 -
.../org/apache/struts2/el/parser/AstDotSuffix.java | 39 -
.../struts2/el/parser/AstDynamicExpression.java | 54 -
.../org/apache/struts2/el/parser/AstEmpty.java | 59 -
.../org/apache/struts2/el/parser/AstEqual.java | 41 -
.../org/apache/struts2/el/parser/AstFalse.java | 39 -
.../apache/struts2/el/parser/AstFloatingPoint.java | 59 -
.../org/apache/struts2/el/parser/AstFunction.java | 134 -
.../apache/struts2/el/parser/AstGreaterThan.java | 47 -
.../struts2/el/parser/AstGreaterThanEqual.java | 47 -
.../apache/struts2/el/parser/AstIdentifier.java | 137 -
.../org/apache/struts2/el/parser/AstInteger.java | 59 -
.../org/apache/struts2/el/parser/AstLessThan.java | 46 -
.../apache/struts2/el/parser/AstLessThanEqual.java | 46 -
.../struts2/el/parser/AstLiteralExpression.java | 63 -
.../org/apache/struts2/el/parser/AstMinus.java | 41 -
.../java/org/apache/struts2/el/parser/AstMod.java | 41 -
.../java/org/apache/struts2/el/parser/AstMult.java | 41 -
.../org/apache/struts2/el/parser/AstNegative.java | 82 -
.../java/org/apache/struts2/el/parser/AstNot.java | 45 -
.../org/apache/struts2/el/parser/AstNotEqual.java | 40 -
.../java/org/apache/struts2/el/parser/AstNull.java | 43 -
.../java/org/apache/struts2/el/parser/AstOr.java | 45 -
.../java/org/apache/struts2/el/parser/AstPlus.java | 41 -
.../org/apache/struts2/el/parser/AstString.java | 74 -
.../java/org/apache/struts2/el/parser/AstTrue.java | 38 -
.../org/apache/struts2/el/parser/AstValue.java | 179 -
.../org/apache/struts2/el/parser/BooleanNode.java | 40 -
.../org/apache/struts2/el/parser/ELParser.html | 223 --
.../org/apache/struts2/el/parser/ELParser.java | 2483 ------------
.../java/org/apache/struts2/el/parser/ELParser.jjt | 470 ---
.../struts2/el/parser/ELParserConstants.java | 206 -
.../struts2/el/parser/ELParserTokenManager.java | 1343 -------
.../struts2/el/parser/ELParserTreeConstants.java | 95 -
.../apache/struts2/el/parser/JJTELParserState.java | 141 -
.../java/org/apache/struts2/el/parser/Node.java | 97 -
.../org/apache/struts2/el/parser/NodeVisitor.java | 27 -
.../apache/struts2/el/parser/ParseException.java | 226 --
.../apache/struts2/el/parser/SimpleCharStream.java | 589 ---
.../org/apache/struts2/el/parser/SimpleNode.java | 159 -
.../java/org/apache/struts2/el/parser/Token.java | 152 -
.../apache/struts2/el/parser/TokenMgrError.java | 175 -
.../apache/struts2/el/util/ConcurrentCache.java | 57 -
.../org/apache/struts2/el/util/MessageFactory.java | 72 -
.../org/apache/struts2/el/util/ReflectionUtil.java | 182 -
.../java/org/apache/struts2/jasper/Constants.java | 208 -
.../org/apache/struts2/jasper/CustomCompiler.java | 35 -
.../struts2/jasper/EmbeddedServletOptions.java | 668 ----
.../org/apache/struts2/jasper/JasperException.java | 52 -
.../main/java/org/apache/struts2/jasper/JspC.java | 1237 ------
.../struts2/jasper/JspCompilationContext.java | 732 ----
.../java/org/apache/struts2/jasper/Options.java | 196 -
.../struts2/jasper/compiler/BeanRepository.java | 79 -
.../apache/struts2/jasper/compiler/Collector.java | 205 -
.../apache/struts2/jasper/compiler/Compiler.java | 569 ---
.../jasper/compiler/DefaultErrorHandler.java | 110 -
.../org/apache/struts2/jasper/compiler/Dumper.java | 200 -
.../struts2/jasper/compiler/ELFunctionMapper.java | 284 --
.../org/apache/struts2/jasper/compiler/ELNode.java | 256 --
.../apache/struts2/jasper/compiler/ELParser.java | 383 --
.../struts2/jasper/compiler/ErrorDispatcher.java | 699 ----
.../struts2/jasper/compiler/ErrorHandler.java | 79 -
.../apache/struts2/jasper/compiler/Generator.java | 4190 --------------------
.../jasper/compiler/ImplicitTagLibraryInfo.java | 219 -
.../struts2/jasper/compiler/JasperTagInfo.java | 59 -
.../struts2/jasper/compiler/JavacErrorDetail.java | 233 --
.../apache/struts2/jasper/compiler/JspConfig.java | 536 ---
.../struts2/jasper/compiler/JspDocumentParser.java | 1455 -------
.../apache/struts2/jasper/compiler/JspReader.java | 656 ---
.../struts2/jasper/compiler/JspRuntimeContext.java | 468 ---
.../apache/struts2/jasper/compiler/JspUtil.java | 1202 ------
.../apache/struts2/jasper/compiler/Localizer.java | 161 -
.../org/apache/struts2/jasper/compiler/Mark.java | 284 --
.../org/apache/struts2/jasper/compiler/Node.java | 2568 ------------
.../struts2/jasper/compiler/PageDataImpl.java | 713 ----
.../apache/struts2/jasper/compiler/PageInfo.java | 713 ----
.../org/apache/struts2/jasper/compiler/Parser.java | 1792 ---------
.../struts2/jasper/compiler/ParserController.java | 636 ---
.../jasper/compiler/ScriptingVariabler.java | 149 -
.../struts2/jasper/compiler/ServletWriter.java | 204 -
.../struts2/jasper/compiler/SmapGenerator.java | 172 -
.../struts2/jasper/compiler/SmapStratum.java | 333 --
.../apache/struts2/jasper/compiler/SmapUtil.java | 723 ----
.../struts2/jasper/compiler/TagConstants.java | 117 -
.../struts2/jasper/compiler/TagFileProcessor.java | 726 ----
.../jasper/compiler/TagLibraryInfoImpl.java | 769 ----
.../struts2/jasper/compiler/TagPluginManager.java | 241 --
.../struts2/jasper/compiler/TextOptimizer.java | 117 -
.../struts2/jasper/compiler/TldLocationsCache.java | 580 ---
.../apache/struts2/jasper/compiler/Validator.java | 1804 ---------
.../jasper/compiler/tagplugin/TagPlugin.java | 38 -
.../compiler/tagplugin/TagPluginContext.java | 133 -
.../apache/struts2/jasper/el/ELContextImpl.java | 101 -
.../apache/struts2/jasper/el/ELContextWrapper.java | 80 -
.../apache/struts2/jasper/el/ELResolverImpl.java | 147 -
.../struts2/jasper/el/ExpressionEvaluatorImpl.java | 59 -
.../apache/struts2/jasper/el/ExpressionImpl.java | 40 -
.../struts2/jasper/el/FunctionMapperImpl.java | 37 -
.../apache/struts2/jasper/el/JspELException.java | 28 -
.../struts2/jasper/el/JspMethodExpression.java | 110 -
.../jasper/el/JspMethodNotFoundException.java | 28 -
.../jasper/el/JspPropertyNotFoundException.java | 30 -
.../jasper/el/JspPropertyNotWritableException.java | 29 -
.../struts2/jasper/el/JspValueExpression.java | 139 -
.../struts2/jasper/el/VariableResolverImpl.java | 37 -
.../struts2/jasper/runtime/BodyContentImpl.java | 632 ---
.../apache/struts2/jasper/runtime/HttpJspBase.java | 89 -
.../struts2/jasper/runtime/InstanceHelper.java | 191 -
.../jasper/runtime/JspApplicationContextImpl.java | 140 -
.../struts2/jasper/runtime/JspContextWrapper.java | 463 ---
.../struts2/jasper/runtime/JspFactoryImpl.java | 211 -
.../struts2/jasper/runtime/JspFragmentHelper.java | 66 -
.../struts2/jasper/runtime/JspRuntimeLibrary.java | 1059 -----
.../struts2/jasper/runtime/JspSourceDependent.java | 40 -
.../struts2/jasper/runtime/JspWriterImpl.java | 662 ----
.../struts2/jasper/runtime/PageContextImpl.java | 957 -----
.../jasper/runtime/PerThreadTagHandlerPool.java | 135 -
.../jasper/runtime/ProtectedFunctionMapper.java | 200 -
.../runtime/ServletResponseWrapperInclude.java | 77 -
.../struts2/jasper/runtime/TagHandlerPool.java | 193 -
.../struts2/jasper/security/SecurityClassLoad.java | 111 -
.../struts2/jasper/security/SecurityUtil.java | 84 -
.../struts2/jasper/servlet/JasperLoader.java | 173 -
.../struts2/jasper/servlet/JspCServletContext.java | 567 ---
.../apache/struts2/jasper/servlet/JspServlet.java | 347 --
.../struts2/jasper/servlet/JspServletWrapper.java | 528 ---
.../struts2/jasper/tagplugins/jstl/Util.java | 371 --
.../struts2/jasper/tagplugins/jstl/core/Catch.java | 72 -
.../jasper/tagplugins/jstl/core/Choose.java | 34 -
.../jasper/tagplugins/jstl/core/ForEach.java | 344 --
.../jasper/tagplugins/jstl/core/ForTokens.java | 119 -
.../struts2/jasper/tagplugins/jstl/core/If.java | 50 -
.../jasper/tagplugins/jstl/core/Import.java | 382 --
.../jasper/tagplugins/jstl/core/Otherwise.java | 32 -
.../struts2/jasper/tagplugins/jstl/core/Out.java | 90 -
.../struts2/jasper/tagplugins/jstl/core/Param.java | 77 -
.../jasper/tagplugins/jstl/core/Redirect.java | 83 -
.../jasper/tagplugins/jstl/core/Remove.java | 45 -
.../struts2/jasper/tagplugins/jstl/core/Set.java | 167 -
.../struts2/jasper/tagplugins/jstl/core/Url.java | 101 -
.../struts2/jasper/tagplugins/jstl/core/When.java | 50 -
.../org/apache/struts2/jasper/util/Enumerator.java | 174 -
.../struts2/jasper/xmlparser/ASCIIReader.java | 205 -
.../struts2/jasper/xmlparser/EncodingMap.java | 1015 -----
.../struts2/jasper/xmlparser/ParserUtils.java | 240 --
.../struts2/jasper/xmlparser/SymbolTable.java | 312 --
.../apache/struts2/jasper/xmlparser/TreeNode.java | 364 --
.../apache/struts2/jasper/xmlparser/UCSReader.java | 302 --
.../struts2/jasper/xmlparser/UTF8Reader.java | 636 ---
.../apache/struts2/jasper/xmlparser/XMLChar.java | 1031 -----
.../jasper/xmlparser/XMLEncodingDetector.java | 1651 --------
.../apache/struts2/jasper/xmlparser/XMLString.java | 197 -
.../struts2/jasper/xmlparser/XMLStringBuffer.java | 194 -
plugins/embeddedjsp/src/main/resources/LICENSE.txt | 174 -
.../org/apache/struts2/el/Messages.properties | 66 -
.../org/apache/struts2/el/Messages_es.properties | 45 -
.../jasper/resources/LocalStrings.properties | 431 --
.../jasper/resources/LocalStrings_es.properties | 421 --
.../jasper/resources/LocalStrings_fr.properties | 318 --
.../jasper/resources/LocalStrings_ja.properties | 424 --
.../struts2/jasper/servlet/mbeans-descriptors.xml | 40 -
.../struts2/jasper/tagplugins/jstl/tagPlugins.xml | 67 -
.../src/main/resources/struts-plugin.xml | 32 -
plugins/embeddedjsp/src/site/site.xml | 56 -
.../org/apache/struts2/EmbeddedJSPResultTest.java | 456 ---
.../src/test/java/org/apache/struts2/SoyBean.java | 33 -
plugins/embeddedjsp/src/test/resources/jsps.jar | Bin 557 -> 0 bytes
.../test/resources/org/apache/struts2/beans.jsp | 22 -
.../test/resources/org/apache/struts2/broken0.jsp | 22 -
.../test/resources/org/apache/struts2/complex0.jsp | 219 -
.../test/resources/org/apache/struts2/dont-use.jsp | 21 -
.../src/test/resources/org/apache/struts2/el.jsp | 21 -
.../resources/org/apache/struts2/includes0.jsp | 22 -
.../resources/org/apache/struts2/includes1.jsp | 22 -
.../resources/org/apache/struts2/includes2.jsp | 24 -
.../resources/org/apache/struts2/includes3.jsp | 22 -
.../src/test/resources/org/apache/struts2/jstl.jsp | 29 -
.../resources/org/apache/struts2/printParam.jsp | 21 -
.../resources/org/apache/struts2/scriptlet.jsp | 24 -
.../test/resources/org/apache/struts2/simple0.jsp | 21 -
.../resources/org/apache/struts2/sub/simple0.jsp | 21 -
.../src/test/resources/org/apache/struts2/tag0.jsp | 25 -
plugins/gxp/README.md | 2 -
plugins/gxp/pom.xml | 50 -
.../org/apache/struts2/views/gxp/AbstractGxp.java | 363 --
.../struts2/views/gxp/AbstractGxpResult.java | 132 -
.../java/org/apache/struts2/views/gxp/Gxp.java | 88 -
.../org/apache/struts2/views/gxp/GxpInstance.java | 146 -
.../org/apache/struts2/views/gxp/GxpResult.java | 153 -
.../java/org/apache/struts2/views/gxp/Param.java | 94 -
plugins/gxp/src/main/resources/struts-plugin.xml | 33 -
plugins/gxp/src/site/site.xml | 56 -
plugins/osgi/README.md | 2 -
plugins/osgi/pom.xml | 107 -
.../org/apache/struts2/osgi/BundleAccessor.java | 60 -
.../struts2/osgi/BundleClassLoaderInterface.java | 65 -
.../struts2/osgi/BundleFreemarkerManager.java | 83 -
.../apache/struts2/osgi/BundlePackageLoader.java | 191 -
.../apache/struts2/osgi/DefaultBundleAccessor.java | 236 --
.../struts2/osgi/DelegatingObjectFactory.java | 151 -
.../struts2/osgi/OsgiConfigurationProvider.java | 347 --
.../org/apache/struts2/osgi/OsgiHostFactory.java | 52 -
.../java/org/apache/struts2/osgi/OsgiUtil.java | 174 -
.../org/apache/struts2/osgi/PackageLoader.java | 74 -
.../struts2/osgi/SpringOsgiObjectFactory.java | 111 -
.../apache/struts2/osgi/StrutsOsgiListener.java | 85 -
.../struts2/osgi/action/BundleContextAware.java | 31 -
.../apache/struts2/osgi/action/ServiceAware.java | 34 -
.../org/apache/struts2/osgi/host/BaseOsgiHost.java | 524 ---
.../apache/struts2/osgi/host/FelixOsgiHost.java | 608 ---
.../struts2/osgi/host/GlassfishOSGiHost.java | 178 -
.../org/apache/struts2/osgi/host/OsgiHost.java | 40 -
.../osgi/interceptor/BundleContextAware.java | 38 -
.../struts2/osgi/interceptor/OsgiInterceptor.java | 152 -
.../struts2/osgi/interceptor/ServiceAware.java | 38 -
.../loaders/FreeMarkerBundleResourceLoader.java | 37 -
.../loaders/StaticContentBundleResourceLoader.java | 46 -
.../osgi/loaders/VelocityBundleResourceLoader.java | 71 -
plugins/osgi/src/main/resources/beanRefContext.xml | 31 -
.../osgi/src/main/resources/struts-osgi.properties | 26 -
plugins/osgi/src/main/resources/struts-plugin.xml | 54 -
plugins/osgi/src/site/site.xml | 56 -
.../java/org/apache/struts2/osgi/OsgiUtilTest.java | 158 -
.../apache/struts2/osgi/action/ServiceAction.java | 34 -
.../struts2/osgi/host/FelixOsgiHostTest.java | 216 -
.../osgi/interceptor/OsgiInterceptorTest.java | 174 -
.../struts2/osgi/interceptor/SomeAction.java | 34 -
plugins/osgi/src/test/resources/default.properties | 787 ----
.../osgi/src/test/resources/struts-osgi.properties | 26 -
plugins/oval/README.md | 2 -
plugins/oval/pom.xml | 75 -
.../apache/struts2/oval/annotation/Profiles.java | 33 -
.../interceptor/DefaultOValValidationManager.java | 193 -
.../interceptor/OValValidationInterceptor.java | 363 --
.../oval/interceptor/OValValidationManager.java | 67 -
plugins/oval/src/main/resources/LICENSE.txt | 174 -
plugins/oval/src/main/resources/NOTICE.txt | 9 -
plugins/oval/src/main/resources/OVAL-LICENSE.txt | 88 -
.../oval/src/main/resources/XSTREAM-LICENSE.txt | 26 -
plugins/oval/src/main/resources/struts-plugin.xml | 65 -
plugins/oval/src/site/site.xml | 56 -
.../DummyDefaultOValValidationManager.java | 33 -
.../oval/interceptor/FieldsWithProfiles.java | 68 -
.../struts2/oval/interceptor/MemberObject.java | 36 -
.../oval/interceptor/ModelDrivenAction.java | 37 -
.../interceptor/OValValidationInterceptorTest.java | 322 --
.../struts2/oval/interceptor/SimpleField.java | 57 -
.../struts2/oval/interceptor/SimpleFieldI18n.java | 37 -
.../interceptor/SimpleFieldI18nDefaultKey.java | 37 -
.../interceptor/SimpleFieldJPAAnnotations.java | 36 -
.../interceptor/SimpleFieldOGNLExpression.java | 36 -
.../struts2/oval/interceptor/SimpleFieldsXML.java | 46 -
.../oval/interceptor/SimpleFieldsXMLChild.java | 31 -
.../struts2/oval/interceptor/SimpleMethod.java | 39 -
.../oval/interceptor/ValidationInMethods.java | 50 -
.../struts2/oval/interceptor/VoidResult.java | 27 -
.../struts2/oval/interceptor/domain/Address.java | 36 -
.../struts2/oval/interceptor/domain/Person.java | 61 -
.../oval/interceptor/SimpleFieldI18n.properties | 20 -
.../interceptor/SimpleFieldsXML-validation.xml | 30 -
.../SimpleFieldsXMLChild-validation.xml | 30 -
plugins/oval/src/test/resources/oval-test.xml | 124 -
plugins/plexus/README.md | 2 -
plugins/plexus/pom.xml | 44 -
.../org/apache/struts2/plexus/PlexusFilter.java | 116 -
.../struts2/plexus/PlexusLifecycleListener.java | 114 -
.../apache/struts2/plexus/PlexusObjectFactory.java | 311 --
.../apache/struts2/plexus/PlexusThreadLocal.java | 42 -
.../org/apache/struts2/plexus/PlexusUtils.java | 54 -
.../src/main/resources/CLASSWORLDS-LICENSE.txt | 47 -
plugins/plexus/src/main/resources/LICENSE.txt | 174 -
plugins/plexus/src/main/resources/NOTICE.txt | 9 -
.../plexus/src/main/resources/struts-plugin.xml | 31 -
plugins/plexus/src/site/site.xml | 56 -
plugins/pom.xml | 5 -
pom.xml | 31 -
350 files changed, 1 insertion(+), 71798 deletions(-)
diff --git a/assembly/pom.xml b/assembly/pom.xml
index f5d0aeffe..2c5209364 100644
--- a/assembly/pom.xml
+++ b/assembly/pom.xml
@@ -178,11 +178,6 @@
<artifactId>struts2-junit-plugin</artifactId>
</dependency>
- <dependency>
- <groupId>org.apache.struts</groupId>
- <artifactId>struts2-plexus-plugin</artifactId>
- </dependency>
-
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-rest-plugin</artifactId>
@@ -210,31 +205,5 @@
<groupId>org.apache.struts</groupId>
<artifactId>struts2-json-plugin</artifactId>
</dependency>
-
- <dependency>
- <groupId>org.apache.struts</groupId>
- <artifactId>struts2-embeddedjsp-plugin</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.apache.struts</groupId>
- <artifactId>struts2-gxp-plugin</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.apache.struts</groupId>
- <artifactId>struts2-osgi-plugin</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.apache.struts</groupId>
- <artifactId>struts2-osgi-admin-bundle</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.apache.struts</groupId>
- <artifactId>struts2-osgi-demo-bundle</artifactId>
- </dependency>
-
</dependencies>
</project>
diff --git a/assembly/src/main/assembly/all.xml b/assembly/src/main/assembly/all.xml
index 866f60d7e..45d5d3049 100644
--- a/assembly/src/main/assembly/all.xml
+++ b/assembly/src/main/assembly/all.xml
@@ -56,13 +56,6 @@
<include>OGNL-LICENSE.txt</include>
</includes>
</fileSet>
- <fileSet>
- <directory>../plugins/plexus/src/main/resources</directory>
- <outputDirectory></outputDirectory>
- <includes>
- <include>CLASSWORLDS-LICENSE.txt</include>
- </includes>
- </fileSet>
<fileSet>
<directory>../plugins/rest/src/main/resources</directory>
<outputDirectory></outputDirectory>
@@ -103,7 +96,7 @@
</fileSet>
<!-- Plugins -->
- <!--
+ <!--
<fileSet>
<directory>../plugins/$plugin/target/site</directory>
<outputDirectory>docs/struts2-plugins/struts2-$plugin-plugin</outputDirectory>
@@ -125,14 +118,6 @@
<directory>../plugins/convention/target/apidocs</directory>
<outputDirectory>docs/struts2-plugins/struts2-convention-plugin/apidocs</outputDirectory>
</fileSet>
- <fileSet>
- <directory>../plugins/embeddedjsp/target/apidocs</directory>
- <outputDirectory>docs/struts2-plugins/struts2-embeddedjsp-plugin/apidocs</outputDirectory>
- </fileSet>
- <fileSet>
- <directory>../plugins/gxp/target/apidocs</directory>
- <outputDirectory>docs/struts2-plugins/struts2-gxp-plugin/apidocs</outputDirectory>
- </fileSet>
<fileSet>
<directory>../plugins/jasperreports/target/apidocs</directory>
<outputDirectory>docs/struts2-plugins/struts2-jasperreports-plugin/apidocs</outputDirectory>
@@ -153,10 +138,6 @@
<directory>../plugins/junit/target/apidocs</directory>
<outputDirectory>docs/struts2-plugins/struts2-junit-plugin/apidocs</outputDirectory>
</fileSet>
- <fileSet>
- <directory>../plugins/osgi/target/apidocs</directory>
- <outputDirectory>docs/struts2-plugins/struts2-osgi-plugin/apidocs</outputDirectory>
- </fileSet>
<fileSet>
<directory>../plugins/rest/target/apidocs</directory>
<outputDirectory>docs/struts2-plugins/struts2-rest-plugin/apidocs</outputDirectory>
@@ -182,17 +163,6 @@
<outputDirectory>docs/struts2-plugins/struts2-velocity-plugin/apidocs</outputDirectory>
</fileSet>
- <!-- bundles -->
- <fileSet>
- <directory>../bundles/admin/target/site</directory>
- <outputDirectory>docs/struts2-bundles/admin</outputDirectory>
- </fileSet>
-
- <fileSet>
- <directory>../bundles/demo/target/site</directory>
- <outputDirectory>docs/struts2-bundles/demo</outputDirectory>
- </fileSet>
-
<!-- Include the source code in the assembly -->
<fileSet>
<directory>../</directory>
diff --git a/bundles/admin/pom.xml b/bundles/admin/pom.xml
deleted file mode 100644
index f4e774951..000000000
--- a/bundles/admin/pom.xml
+++ /dev/null
@@ -1,62 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-/*
- * 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.
- */
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.struts</groupId>
- <artifactId>struts2-osgi-bundles</artifactId>
- <version>7.0.0-SNAPSHOT</version>
- </parent>
-
- <artifactId>struts2-osgi-admin-bundle</artifactId>
- <packaging>bundle</packaging>
- <name>DEPRECATED: Struts 2 OSGi Admin Bundle - since 6.0.0</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.struts</groupId>
- <artifactId>struts2-osgi-plugin</artifactId>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <extensions>true</extensions>
- <configuration>
- <instructions>
- <manifestLocation>META-INF</manifestLocation>
- <Struts2-Enabled>true</Struts2-Enabled>
- <Import-Package>*</Import-Package>
- <Export-Package>org.apache.struts2.osgi.admin*</Export-Package>
- <Spring-Context>*;create-asynchronously:=false</Spring-Context>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
- <properties>
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- </properties>
-</project>
diff --git a/bundles/admin/src/main/java/org/apache/struts2/osgi/admin/actions/BundlesAction.java b/bundles/admin/src/main/java/org/apache/struts2/osgi/admin/actions/BundlesAction.java
deleted file mode 100644
index 26b703002..000000000
--- a/bundles/admin/src/main/java/org/apache/struts2/osgi/admin/actions/BundlesAction.java
+++ /dev/null
@@ -1,215 +0,0 @@
-/*
- * $Id$
- *
- * 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.
- */
-
-package org.apache.struts2.osgi.admin.actions;
-
-import com.opensymphony.xwork2.ActionSupport;
-import com.opensymphony.xwork2.config.Configuration;
-import com.opensymphony.xwork2.config.entities.PackageConfig;
-import com.opensymphony.xwork2.inject.Inject;
-import org.apache.struts2.osgi.BundleAccessor;
-import org.apache.struts2.osgi.host.OsgiHost;
-import org.apache.struts2.osgi.StrutsOsgiListener;
-import org.apache.struts2.action.ServletContextAware;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleException;
-
-import javax.servlet.ServletContext;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.List;
-import java.util.Collections;
-import java.util.Comparator;
-
-public class BundlesAction extends ActionSupport implements ServletContextAware {
-
- private String id;
-
- private BundleAccessor bundleAccessor;
- private Configuration configuration;
- private OsgiHost osgiHost;
-
- public BundlesAction() {
- }
-
- public String index() {
- return SUCCESS;
- }
-
- public String view() {
- return SUCCESS;
- }
-
- public String start() throws BundleException {
- clearErrorsAndMessages();
- addActionMessage("Start - OSGi Host: " + osgiHost + ", ID: " + id);
-
- Bundle bundle = osgiHost.getBundles().get(id);
- try {
- bundle.start();
-
- //start() fires a BundleEvent.STARTED, which loads the config
- //we need to wait until the config is loaded from that bundle but
- //there no easy way/elegant way to know if the bundle was processed already
- Thread.sleep(1000);
- } catch (Exception e) {
- addActionError("Exception: " + e.toString() + " (" + e.getMessage() + ")");
- }
-
- return view();
- }
-
- public String stop() throws BundleException {
- clearErrorsAndMessages();
- addActionMessage("Stop - OSGi Host: " + osgiHost + ", ID: " + id);
-
- Bundle bundle = osgiHost.getBundles().get(id);
- try {
- bundle.stop();
- } catch (Exception e) {
- addActionError("Exception: " + e.toString() + " (" + e.getMessage() + ")");
- }
-
- return view();
- }
-
- public String update() throws BundleException {
- clearErrorsAndMessages();
- addActionMessage("Update - OSGi Host: " + osgiHost + ", ID: " + id);
-
- Bundle bundle = osgiHost.getBundles().get(id);
- try {
- bundle.update();
- } catch (Exception e) {
- addActionError("Exception: " + e.toString() + " (" + e.getMessage() + ")");
- }
-
- return view();
- }
-
- public boolean isStrutsEnabled(Bundle bundle) {
- return "true".equalsIgnoreCase((String) bundle.getHeaders().get(OsgiHost.OSGI_HEADER_STRUTS_ENABLED));
- }
-
- public String getId() {
- return id;
- }
-
- public void setId(String id) {
- this.id = id;
- }
-
- public Bundle getBundle() {
- return osgiHost.getBundles().get(id);
- }
-
- public List<PackageConfig> getPackages() {
- List<PackageConfig> pkgs = new ArrayList<>();
- Bundle bundle = getBundle();
- if (bundle.getState() == Bundle.ACTIVE) {
- bundleAccessor.getPackagesByBundle(bundle).stream().map(
- name -> configuration.getPackageConfig(name)).filter(
- packageConfig -> (packageConfig != null)).forEachOrdered(packageConfig -> {
- pkgs.add(packageConfig);
- });
- }
- return pkgs;
- }
-
- public ArrayList<String> getHeaderKeys() {
- return Collections.list(getBundle().getHeaders().keys());
- }
-
- public Collection<Bundle> getBundles() {
- List<Bundle> bundles = new ArrayList(osgiHost.getBundles().values());
- Collections.sort(bundles, (Bundle bundle1, Bundle bundle2) -> {
- boolean bundle1StrutsEnabled = isStrutsEnabled(bundle1);
- boolean bundle2StrutsEnabled = isStrutsEnabled(bundle2);
-
- if ((bundle1StrutsEnabled && bundle2StrutsEnabled) || (!bundle1StrutsEnabled && !bundle2StrutsEnabled)) {
- return bundle1.getSymbolicName().compareTo(bundle2.getSymbolicName());
- } else {
- return bundle1StrutsEnabled ? -1 : 1;
- }
- });
- return bundles;
- }
-
- public String displayProperty(Object obj) {
- if (obj.getClass().isArray()) {
- return Arrays.asList((Object[])obj).toString();
- } else {
- return obj.toString();
- }
- }
-
- public String getBundleState(Bundle bundle) {
- switch (bundle.getState()) {
- case Bundle.ACTIVE : return "Active";
- case Bundle.INSTALLED : return "Installed";
- case Bundle.RESOLVED : return "Resolved";
- case Bundle.STARTING : return "Starting";
- case Bundle.STOPPING : return "Stopping";
- case Bundle.UNINSTALLED : return "Uninstalled";
- default : throw new IllegalStateException("Invalid state");
- }
- }
-
- public boolean isAllowedAction(Bundle bundle, String val) {
- int state = -1;
- try {
- state = bundle.getState();
- } catch (Exception e) {
- addActionError("Unable to determine bundle state. Exception: " + e.toString() + " (" + e.getMessage() + ")");
- return false;
- }
-
- if (val != null) {
- switch (val) {
- case "start":
- return state == Bundle.RESOLVED;
- case "stop":
- return state == Bundle.ACTIVE;
- case "update":
- return state == Bundle.ACTIVE || state == Bundle.INSTALLED || state == Bundle.RESOLVED;
- default:
- break;
- }
- }
- throw new IllegalArgumentException("Invalid state");
- }
-
- @Inject
- public void setConfiguration(Configuration configuration) {
- this.configuration = configuration;
- }
-
- @Inject
- public void setBundleAccessor(BundleAccessor bundleAccessor) {
- this.bundleAccessor = bundleAccessor;
- }
-
- @Override
- public void withServletContext(ServletContext servletContext) {
- osgiHost = (OsgiHost) servletContext.getAttribute(StrutsOsgiListener.OSGI_HOST);
- }
-}
diff --git a/bundles/admin/src/main/java/org/apache/struts2/osgi/admin/actions/ShellAction.java b/bundles/admin/src/main/java/org/apache/struts2/osgi/admin/actions/ShellAction.java
deleted file mode 100644
index 1870a5b38..000000000
--- a/bundles/admin/src/main/java/org/apache/struts2/osgi/admin/actions/ShellAction.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
- * $Id$
- *
- * 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.
- */
-
-package org.apache.struts2.osgi.admin.actions;
-
-import java.io.ByteArrayOutputStream;
-import java.io.PrintStream;
-
-import org.apache.felix.shell.ShellService;
-import org.apache.struts2.osgi.DefaultBundleAccessor;
-import org.apache.struts2.osgi.interceptor.BundleContextAware;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceReference;
-
-import com.opensymphony.xwork2.Action;
-import com.opensymphony.xwork2.ActionSupport;
-
-/**
- * This action executes commands on the Felix Shell.
- *
- * The action is BundleContextAware so that if the OSGi interceptor is used the BundleContext
- * can be provided for configurations where the DefaultBundleAccessor is insufficient.
- *
- */
-public class ShellAction extends ActionSupport implements BundleContextAware {
- private String command;
- private String output;
- private BundleContext bundleContext;
-
- @Override
- public String execute() {
- // get service
- ByteArrayOutputStream outByteStream = new ByteArrayOutputStream();
- ByteArrayOutputStream errByteStream = new ByteArrayOutputStream();
- PrintStream outStream = new PrintStream(outByteStream);
- PrintStream errStream = new PrintStream(errByteStream);
-
- String outString = null;
- String errString = null;
- try {
- executeCommand(command, outStream, errStream);
- outString = outByteStream.toString().trim();
- errString = errByteStream.toString().trim();
- } catch (Exception e) {
- outString = outByteStream.toString().trim();
- errString = "Exception: " + e.toString() + " (" + e.getMessage() + "). Output:" + outString +
- ". Error: " + errByteStream.toString().trim(); // Full details for troubleshooting.
- } finally {
- outStream.close();
- errStream.close();
- }
-
- output = errString != null && errString.length() > 0 ? errString : outString;
- return Action.SUCCESS;
- }
-
- public String getCommand() {
- return command;
- }
-
- public void setCommand(String command) {
- this.command = command;
- }
-
- public String getOutput() {
- return output;
- }
-
- public void executeCommand(String commandLine, PrintStream out, PrintStream err) throws Exception {
- ShellService shellService = getShellService(out);
- if (shellService != null) {
- out.println("Attempting to execute command: " + commandLine);
- shellService.executeCommand(commandLine, out, err);
- }
- else {
- err.println("Apache Felix Shell service is not installed");
- }
- }
-
- private ShellService getShellService(PrintStream out) {
- //bundle can be de-activated, so keeping a reference aorund is not a good idea
- final DefaultBundleAccessor bundleAccessor = DefaultBundleAccessor.getInstance();
- ServiceReference ref = (bundleAccessor != null ? bundleAccessor.getServiceReference(ShellService.class.getName()) : null);
- //out.println("DefaultBundleAccessor: " + bundleAcessor + ", ServiceReference [" + ShellService.class.getName() + "]: " + ref); // No logger, for debugging only.
-
- if (ref == null && this.bundleContext != null) {
- // Depending on OSGi and Felix bundle configurations, the DefaultBundleAccessor may not be able to locate the ShellService.
- // In such cases, use the bundleContext (if available) to locate the ShellService in a "brute-force" manner.
- final Bundle[] bundles = this.bundleContext.getBundles();
- if (bundles != null && bundles.length > 0) {
- for (Bundle currentBundle : bundles) {
- if (currentBundle != null) {
- //out.println("Bundle [" + index + "], SymbolicName: " + currentBundle.getSymbolicName() + ", Location: " + currentBundle.getLocation() + ", BundleID: " + currentBundle.getBundleId()); // No logger, for debugging only.
- if (currentBundle.getSymbolicName().startsWith("org.apache.felix.shell")) {
- BundleContext currentBundleContext = currentBundle.getBundleContext();
- Object directShellServiceByClass = (currentBundleContext != null ? currentBundleContext.getServiceReference(org.apache.felix.shell.ShellService.class) : null);
- Object directShellServiceByName = (currentBundleContext != null ? currentBundleContext.getServiceReference("org.apache.felix.shell.ShellService") : null);
- //out.println(" ShellService reference (via bundle's context) by class: " + directShellServiceByClass); // No logger, for debugging only.
- //out.println(" ShellService reference (via bundle's context) by name: " + directShellServiceByName); // No logger, for debugging only.
- if (ref == null) {
- ref = (directShellServiceByClass != null ? (ServiceReference) directShellServiceByClass : (ServiceReference) directShellServiceByName);
- }
- }
- } else {
- //out.println("Bundle [" + index + "] is null"); // No logger, for debugging only.
- }
- }
- } else {
- //out.println("OSGi Interceptor-provided BundleContext bundle array is null or empty"); // No logger, for debugging only.
- }
- }
-
- if (ref == null) {
- out.println("ShellService reference cannot be found (null), service lookup will fail.");
- }
-
- return (ShellService) (bundleAccessor != null ? bundleAccessor.getService(ref) : null);
- }
-
- @Override
- public void setBundleContext(BundleContext bundleContext) {
- //System.out.println("ShellAction - setBundleContext called. BundleContext: " + bundleContext); // No logger, for debugging only.
- this.bundleContext = bundleContext;
- }
-}
diff --git a/bundles/admin/src/main/resources/JQUERY-LICENSE.txt b/bundles/admin/src/main/resources/JQUERY-LICENSE.txt
deleted file mode 100644
index 4819e5421..000000000
--- a/bundles/admin/src/main/resources/JQUERY-LICENSE.txt
+++ /dev/null
@@ -1,43 +0,0 @@
-Copyright jQuery Foundation and other contributors, https://jquery.org/
-
-This software consists of voluntary contributions made by many
-individuals. For exact contribution history, see the revision history
-available at https://github.com/jquery/jquery-ui
-
-The following license applies to all parts of this software except as
-documented below:
-
-====
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-====
-
-Copyright and related rights for sample code are waived via CC0. Sample
-code is defined as all source code contained within the demos directory.
-
-CC0: http://creativecommons.org/publicdomain/zero/1.0/
-
-====
-
-All files located in the node_modules and external directories are
-externally maintained libraries used by this software which have their
-own licenses; we recommend you read them, as their terms may differ from
-the terms above.
diff --git a/bundles/admin/src/main/resources/LICENSE.txt b/bundles/admin/src/main/resources/LICENSE.txt
deleted file mode 100644
index dd5b3a58a..000000000
--- a/bundles/admin/src/main/resources/LICENSE.txt
+++ /dev/null
@@ -1,174 +0,0 @@
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
diff --git a/bundles/admin/src/main/resources/NOTICE.txt b/bundles/admin/src/main/resources/NOTICE.txt
deleted file mode 100644
index 2494732ef..000000000
--- a/bundles/admin/src/main/resources/NOTICE.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-Apache Struts
-Copyright 2000-2011 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (https://www.apache.org/).
-
-The binary distributions includes the following third party software:
-jQuery (https://jquery.com/).
-jQuery UI (https://jqueryui.com/).
diff --git a/bundles/admin/src/main/resources/osgi/admin/commandResult.ftl b/bundles/admin/src/main/resources/osgi/admin/commandResult.ftl
deleted file mode 100644
index 9d37f6bfd..000000000
--- a/bundles/admin/src/main/resources/osgi/admin/commandResult.ftl
+++ /dev/null
@@ -1,21 +0,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.
- */
--->
-${output!}
diff --git a/bundles/admin/src/main/resources/osgi/admin/shell.ftl b/bundles/admin/src/main/resources/osgi/admin/shell.ftl
deleted file mode 100644
index 62d0cce6c..000000000
--- a/bundles/admin/src/main/resources/osgi/admin/shell.ftl
+++ /dev/null
@@ -1,60 +0,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.
- */
--->
-<html>
- <head>
- <title>OSGi Console</title>
-
- <link rel="stylesheet" type="text/css" href="<@s.url value="${parameters.staticContentPath}/css/shell.css" />" />
- <link rel="stylesheet" type="text/css" href="<@s.url value="${parameters.staticContentPath}/css/main.css" />" />
- <link rel="stylesheet" type="text/css" href="<@s.url value="${parameters.staticContentPath}/css/redmond/jquery-ui-1.12.1.redmond.css" />" />
-
- <script src="<@s.url value="${parameters.staticContentPath}/js/shell.js" />"></script>
- <script src="<@s.url value="${parameters.staticContentPath}/js/jquery-1.12.4.min.js" />"></script>
- <script src="<@s.url value="${parameters.staticContentPath}/js/jquery-ui-1.12.1.min.js" />"></script>
- </head>
-<body>
-<div class="menu">
- <div style="float:right;">
- <@s.url var="bundlesUrl" namespace="/osgi/admin" action="bundles" includeParams="none" />
- <@s.url var="osgiShellUrl" namespace="/osgi/admin" action="shell" includeParams="none" />
- <a href="${bundlesUrl}" class="ui-state-default ui-corner-all fg-button fg-button-icon-left">
- <span class="ui-icon ui-icon-bullet"></span>
- Bundles
- </a>
- <a href="${osgiShellUrl}" class="ui-state-default ui-corner-all fg-button fg-button-icon-left">
- <span class="ui-icon ui-icon-transferthick-e-w"></span>
- OSGi Shell
- </a>
- </div>
-</div>
-<div id="shell" >
- <form onsubmit="return false" id="wc-form">
- <div class="wc-results" id="wc-result">
- Welcome to the OSGi console! Type 'help' to see the list of available commands.
- <br />
- </div>
- <@s.url var="execUrl" namespace="/osgi/admin" action="execCommand" />
- <label for"command">Command:</label>
- <input name="command" onkeyup="keyEvent(event, '${execUrl}')" class="wc-command" id="wc-command" type="text" />
- </form>
-</div>
-</body>
-</html>
diff --git a/bundles/admin/src/main/resources/osgi/admin/viewBundle.ftl b/bundles/admin/src/main/resources/osgi/admin/viewBundle.ftl
deleted file mode 100644
index 97f22a3d6..000000000
--- a/bundles/admin/src/main/resources/osgi/admin/viewBundle.ftl
+++ /dev/null
@@ -1,170 +0,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.
- */
--->
-<html>
- <head>
- <title>${bundle.symbolicName!}</title>
-
- <link rel="stylesheet" type="text/css" href="<@s.url value="${parameters.staticContentPath}/css/main.css" />" />
- <link rel="stylesheet" type="text/css" href="<@s.url value="${parameters.staticContentPath}/css/redmond/jquery-ui-1.12.1.redmond.css" />" />
-
- <script src="<@s.url value="${parameters.staticContentPath}/js/jquery-1.12.4.min.js" />"></script>
- <script src="<@s.url value="${parameters.staticContentPath}/js/jquery-ui-1.12.1.min.js" />"></script>
-
- <script type="text/javascript">
- $(function() {
- $("#tabs").tabs();
- });
- </script>
-
- </head>
-<body>
-
-<div class="menu">
- <div style="float:left;">
- <#if action.isAllowedAction(bundle, "start")>
- <a href="bundle_${bundle.symbolicName}!start.action" class="ui-state-default ui-corner-all fg-button fg-button-icon-left">
- <span class="ui-icon ui-icon-play"></span>
- Start
- </a>
- </#if>
-
- <#if action.isAllowedAction(bundle, "stop")>
- <a href="bundle_${bundle.symbolicName}!stop.action" class="ui-state-default ui-corner-all fg-button fg-button-icon-left">
- <span class="ui-icon ui-icon-stop"></span>
- Stop
- </a>
- </#if>
-
- <#if action.isAllowedAction(bundle, "update")>
- <a href="bundle_${bundle.symbolicName}!update.action" class="ui-state-default ui-corner-all fg-button fg-button-icon-left">
- <span class="ui-icon ui-icon-refresh"></span>
- Update
- </a>
- </#if>
- </div>
-
- <div style="float:right;">
- <@s.url var="bundlesUrl" namespace="/osgi/admin" action="bundles" includeParams="none" />
- <@s.url var="osgiShellUrl" namespace="/osgi/admin" action="shell" includeParams="none" />
- <a href="${bundlesUrl}" class="ui-state-default ui-corner-all fg-button fg-button-icon-left">
- <span class="ui-icon ui-icon-bullet"></span>
- Bundles
- </a>
- <a href="${osgiShellUrl}" class="ui-state-default ui-corner-all fg-button fg-button-icon-left">
- <span class="ui-icon ui-icon-transferthick-e-w"></span>
- OSGi Shell
- </a>
- </div>
-</div>
-
-<@s.actionerror />
-
-<div id="tabs" class="tabs">
- <ul>
- <li><a href="#tabs-1">OSGi Metadata</a></li>
- <li><a href="#tabs-2">Resgistered Services</a></li>
- <li><a href="#tabs-3">Services in Use</a></li>
- <li><a href="#tabs-4">Packages</a></li>
- <li><a href="#tabs-5">Headers</a></li>
- </ul>
- <div id="tabs-1">
- <table class="properties">
- <tr>
- <td class="name">Id</td>
- <td>${bundle.bundleId!}</td>
- </tr>
- <tr>
- <td class="name">Name</td>
- <td>${bundle.symbolicName!}</td>
- </tr>
- <tr>
- <td class="name">Location</td>
- <td>${bundle.location!}</td>
- </tr>
- <tr>
- <td class="name">Status</td>
- <td>${action.getBundleState(bundle)}</td>
- </tr>
- </table>
- </div>
- <div id="tabs-2">
- <#list (bundle.registeredServices)! as service>
- <table class="properties">
- <#list (service.propertyKeys)! as key >
- <tr>
- <td class="name">${key}</td>
- <td>${action.displayProperty(service.getProperty(key))}</td>
- </tr>
- </#list>
- </table>
- <br/>
- </#list>
- </div>
- <div id="tabs-3">
- <#list (bundle.servicesInUse)! as service>
- <table class="properties">
- <#list (service.propertyKeys)! as key >
- <tr>
- <td class="name">${key}</td>
- <td>${action.displayProperty(service.getProperty(key))!}</td>
- </tr>
- </#list>
- </table>
- <br/>
- </#list>
- </div>
- <div id="tabs-4">
- <#list packages! as pkg>
- <table class="properties">
- <tr>
- <td class="name">Name</td>
- <td>${pkg.name}</td>
- </tr>
- <tr>
- <td class="name">Actions</td>
- <td>
- <ul>
- <#list (pkg.actionConfigs.keySet())! as name >
- <li>${name}</li>
- </#list>
- </ul>
- </td>
- </tr>
- </table>
- <br/>
- </#list>
- </div>
- <div id="tabs-5">
- <table class="properties">
- <#list headerKeys as header>
- <tr>
- <td class="name">${header}</td>
- <td><div class="propertyValue">${bundle.headers.get(header)}</div> </td>
- </tr>
- </#list>
- </table>
- </div>
-</div>
-
-<@s.actionmessage />
-
-</body>
-</html>
\ No newline at end of file
diff --git a/bundles/admin/src/main/resources/osgi/admin/viewBundles.ftl b/bundles/admin/src/main/resources/osgi/admin/viewBundles.ftl
deleted file mode 100644
index f20fed85a..000000000
--- a/bundles/admin/src/main/resources/osgi/admin/viewBundles.ftl
+++ /dev/null
@@ -1,97 +0,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.
- */
--->
-<html>
- <head>
- <title>OSGi Bundles</title>
-
- <link rel="stylesheet" type="text/css" href="<@s.url value="${parameters.staticContentPath}/css/main.css" />" />
- <link rel="stylesheet" type="text/css" href="<@s.url value="${parameters.staticContentPath}/css/redmond/jquery-ui-1.12.1.redmond.css" />" />
-
- <script src="<@s.url value="${parameters.staticContentPath}/js/jquery-1.12.4.min.js" />"></script>
- <script src="<@s.url value="${parameters.staticContentPath}/js/jquery-ui-1.12.1.min.js" />"></script>
- </head>
-<body>
-
-<div class="menu">
- <div style="float:right;">
- <@s.url var="bundlesUrl" namespace="/osgi/admin" action="bundles" includeParams="none" />
- <@s.url var="osgiShellUrl" namespace="/osgi/admin" action="shell" includeParams="none" />
- <a href="${bundlesUrl}" class="ui-state-default ui-corner-all fg-button fg-button-icon-left">
- <span class="ui-icon ui-icon-bullet"></span>
- Bundles
- </a>
- <a href="${osgiShellUrl}" class="ui-state-default ui-corner-all fg-button fg-button-icon-left">
- <span class="ui-icon ui-icon-transferthick-e-w"></span>
- OSGi Shell
- </a>
- </div>
-</div>
-
-<@s.actionerror />
-
-<table class="properties" style="clear:both; width:700px">
- <thead>
- <tr>
- <th>Name</th>
- <th>Status</th>
- <th>Struts Bundle</th>
- <th>Actions</th>
- </tr>
- </thead>
- <tbody>
- <#list bundles as bundle>
- <tr>
- <td>
- <a href="bundle_${bundle.symbolicName}!view.action">${bundle.symbolicName}</a>
- </td>
- <td>${action.getBundleState(bundle)}</td>
- <td>${action.isStrutsEnabled(bundle)?string("yes", "no")}</td>
- <td style="width:200px">
- <#if action.isAllowedAction(bundle, "start")>
- <a href="bundle_${bundle.symbolicName}!start.action" class="ui-state-default ui-corner-all fg-button-small fg-button-icon-left">
- <span class="ui-icon ui-icon-play"></span>
- Start
- </a>
- </#if>
-
- <#if action.isAllowedAction(bundle, "stop")>
- <a href="bundle_${bundle.symbolicName}!stop.action" class="ui-state-default ui-corner-all fg-button-small fg-button-icon-left">
- <span class="ui-icon ui-icon-stop"></span>
- Stop
- </a>
- </#if>
-
- <#if action.isAllowedAction(bundle, "update")>
- <a href="bundle_${bundle.symbolicName}!update.action" class="ui-state-default ui-corner-all fg-button-small fg-button-icon-left">
- <span class="ui-icon ui-icon-refresh"></span>
- Update
- </a>
- </#if>
- </td>
- </tr>
- </#list>
- </tbody>
-</table>
-
-<@s.actionmessage />
-
-</body>
-</html>
diff --git a/bundles/admin/src/main/resources/static/css/main.css b/bundles/admin/src/main/resources/static/css/main.css
deleted file mode 100644
index 985aba8fa..000000000
--- a/bundles/admin/src/main/resources/static/css/main.css
+++ /dev/null
@@ -1,103 +0,0 @@
-.right {
- clear: both;
- float: right;
-}
-
-.left {
- clear: both;
- float: left;
-}
-
-.bundleDetails td {
- border: 1px solid #C8C8C8;
-}
-
-.rowTitle {
- width: 141px;
- font-weight: bold;
- vertical-align: top;
-}
-
-table.properties {
- border-style: solid;
- border-width: 1px;
- border-color: #3366CC;
-}
-
-table.properties td {
- border-style: solid;
- border-width: 1px;
- border-color: #3366CC;
-}
-
-table.properties td.name {
- background-color: #C3D9FF;
- vertical-align: top;
-}
-
-table.properties th {
- background-color: #C3D9FF;
-}
-
-img {
- border-style: none;
-}
-
-.fg-button {
- outline: 0;
- margin: 0 4px 0 0;
- padding: .4em 1em;
- text-decoration: none !important;
- cursor: pointer;
- position: relative;
- text-align: center;
- zoom: 1;
-}
-
-.fg-button .ui-icon {
- margin-left: -3px;
- margin-top: -8px;
- position: absolute;
- top: 50%;
-}
-
-.fg-button-small {
- outline: 0;
- margin: 0 4px 0 0;
- padding: 0em 1em;
- text-decoration: none !important;
- cursor: pointer;
- position: relative;
- text-align: center;
-}
-
-.fg-button-small .ui-icon {
- margin-left: -3px;
- margin-top: -8px;
- position: absolute;
- top: 50%;
-}
-
-.fg-button-icon-left .ui-icon {
- left: 0em;
- margin-left: 0;
- right: auto;
-}
-
-.menu {
- clear: both;
- padding-bottom: 10px;
- height:25px;
-}
-
-.tabs {
- clear: both;
-}
-
-.propertyValue {
- width: 600px;
- overflow: auto;
-}
-
-
-
diff --git a/bundles/admin/src/main/resources/static/css/redmond/images/ui-bg_flat_0_aaaaaa_40x100.png b/bundles/admin/src/main/resources/static/css/redmond/images/ui-bg_flat_0_aaaaaa_40x100.png
deleted file mode 100644
index 5b5dab2ab..000000000
Binary files a/bundles/admin/src/main/resources/static/css/redmond/images/ui-bg_flat_0_aaaaaa_40x100.png and /dev/null differ
diff --git a/bundles/admin/src/main/resources/static/css/redmond/images/ui-bg_flat_55_fbec88_40x100.png b/bundles/admin/src/main/resources/static/css/redmond/images/ui-bg_flat_55_fbec88_40x100.png
deleted file mode 100644
index 47acaadd7..000000000
Binary files a/bundles/admin/src/main/resources/static/css/redmond/images/ui-bg_flat_55_fbec88_40x100.png and /dev/null differ
diff --git a/bundles/admin/src/main/resources/static/css/redmond/images/ui-bg_glass_75_d0e5f5_1x400.png b/bundles/admin/src/main/resources/static/css/redmond/images/ui-bg_glass_75_d0e5f5_1x400.png
deleted file mode 100644
index 9fb564f8d..000000000
Binary files a/bundles/admin/src/main/resources/static/css/redmond/images/ui-bg_glass_75_d0e5f5_1x400.png and /dev/null differ
diff --git a/bundles/admin/src/main/resources/static/css/redmond/images/ui-bg_glass_85_dfeffc_1x400.png b/bundles/admin/src/main/resources/static/css/redmond/images/ui-bg_glass_85_dfeffc_1x400.png
deleted file mode 100644
index 014951529..000000000
Binary files a/bundles/admin/src/main/resources/static/css/redmond/images/ui-bg_glass_85_dfeffc_1x400.png and /dev/null differ
diff --git a/bundles/admin/src/main/resources/static/css/redmond/images/ui-bg_glass_95_fef1ec_1x400.png b/bundles/admin/src/main/resources/static/css/redmond/images/ui-bg_glass_95_fef1ec_1x400.png
deleted file mode 100644
index 4443fdc1a..000000000
Binary files a/bundles/admin/src/main/resources/static/css/redmond/images/ui-bg_glass_95_fef1ec_1x400.png and /dev/null differ
diff --git a/bundles/admin/src/main/resources/static/css/redmond/images/ui-bg_gloss-wave_55_5c9ccc_500x100.png b/bundles/admin/src/main/resources/static/css/redmond/images/ui-bg_gloss-wave_55_5c9ccc_500x100.png
deleted file mode 100644
index 0cdbda36a..000000000
Binary files a/bundles/admin/src/main/resources/static/css/redmond/images/ui-bg_gloss-wave_55_5c9ccc_500x100.png and /dev/null differ
diff --git a/bundles/admin/src/main/resources/static/css/redmond/images/ui-bg_inset-hard_100_f5f8f9_1x100.png b/bundles/admin/src/main/resources/static/css/redmond/images/ui-bg_inset-hard_100_f5f8f9_1x100.png
deleted file mode 100644
index f7cc01623..000000000
Binary files a/bundles/admin/src/main/resources/static/css/redmond/images/ui-bg_inset-hard_100_f5f8f9_1x100.png and /dev/null differ
diff --git a/bundles/admin/src/main/resources/static/css/redmond/images/ui-bg_inset-hard_100_fcfdfd_1x100.png b/bundles/admin/src/main/resources/static/css/redmond/images/ui-bg_inset-hard_100_fcfdfd_1x100.png
deleted file mode 100644
index 38c38335d..000000000
Binary files a/bundles/admin/src/main/resources/static/css/redmond/images/ui-bg_inset-hard_100_fcfdfd_1x100.png and /dev/null differ
diff --git a/bundles/admin/src/main/resources/static/css/redmond/images/ui-icons_217bc0_256x240.png b/bundles/admin/src/main/resources/static/css/redmond/images/ui-icons_217bc0_256x240.png
deleted file mode 100644
index 0d979071b..000000000
Binary files a/bundles/admin/src/main/resources/static/css/redmond/images/ui-icons_217bc0_256x240.png and /dev/null differ
diff --git a/bundles/admin/src/main/resources/static/css/redmond/images/ui-icons_2e83ff_256x240.png b/bundles/admin/src/main/resources/static/css/redmond/images/ui-icons_2e83ff_256x240.png
deleted file mode 100644
index b425c446d..000000000
Binary files a/bundles/admin/src/main/resources/static/css/redmond/images/ui-icons_2e83ff_256x240.png and /dev/null differ
diff --git a/bundles/admin/src/main/resources/static/css/redmond/images/ui-icons_469bdd_256x240.png b/bundles/admin/src/main/resources/static/css/redmond/images/ui-icons_469bdd_256x240.png
deleted file mode 100644
index 5e7915fa7..000000000
Binary files a/bundles/admin/src/main/resources/static/css/redmond/images/ui-icons_469bdd_256x240.png and /dev/null differ
diff --git a/bundles/admin/src/main/resources/static/css/redmond/images/ui-icons_6da8d5_256x240.png b/bundles/admin/src/main/resources/static/css/redmond/images/ui-icons_6da8d5_256x240.png
deleted file mode 100644
index 60e20ca18..000000000
Binary files a/bundles/admin/src/main/resources/static/css/redmond/images/ui-icons_6da8d5_256x240.png and /dev/null differ
diff --git a/bundles/admin/src/main/resources/static/css/redmond/images/ui-icons_cd0a0a_256x240.png b/bundles/admin/src/main/resources/static/css/redmond/images/ui-icons_cd0a0a_256x240.png
deleted file mode 100644
index 2db88b796..000000000
Binary files a/bundles/admin/src/main/resources/static/css/redmond/images/ui-icons_cd0a0a_256x240.png and /dev/null differ
diff --git a/bundles/admin/src/main/resources/static/css/redmond/images/ui-icons_d8e7f3_256x240.png b/bundles/admin/src/main/resources/static/css/redmond/images/ui-icons_d8e7f3_256x240.png
deleted file mode 100644
index 8da5e0a8f..000000000
Binary files a/bundles/admin/src/main/resources/static/css/redmond/images/ui-icons_d8e7f3_256x240.png and /dev/null differ
diff --git a/bundles/admin/src/main/resources/static/css/redmond/images/ui-icons_f9bd01_256x240.png b/bundles/admin/src/main/resources/static/css/redmond/images/ui-icons_f9bd01_256x240.png
deleted file mode 100644
index 2fb5ba505..000000000
Binary files a/bundles/admin/src/main/resources/static/css/redmond/images/ui-icons_f9bd01_256x240.png and /dev/null differ
diff --git a/bundles/admin/src/main/resources/static/css/redmond/jquery-ui-1.12.1.redmond.css b/bundles/admin/src/main/resources/static/css/redmond/jquery-ui-1.12.1.redmond.css
deleted file mode 100644
index 409dac080..000000000
--- a/bundles/admin/src/main/resources/static/css/redmond/jquery-ui-1.12.1.redmond.css
+++ /dev/null
@@ -1,1311 +0,0 @@
-/*! jQuery UI - v1.12.1 - 2016-09-14
-* http://jqueryui.com
-* Includes: core.css, accordion.css, autocomplete.css, menu.css, button.css, controlgroup.css, checkboxradio.css, datepicker.css, dialog.css, draggable.css, resizable.css, progressbar.css, selectable.css, selectmenu.css, slider.css, sortable.css, spinner.css, tabs.css, tooltip.css, theme.css
-* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Lucida%20Grande%2CLucida%20Sans%2CArial%2Csans-serif&fwDefault=bold&fsDefault=1.1em&cornerRadius=5px&bgColorHeader=5c9ccc&bgTextureHeader=gloss_wave&bgImgOpacityHeader=55&borderColorHeader=4297d7&fcHeader=ffffff&iconColorHeader=d8e7f3&bgColorContent=fcfdfd&bgTextureContent=inset_hard&bgImgOpacityContent=100&borderColorContent=a6c9e2&fcContent=222222&iconColorContent=469bdd&bgColorDefault=dfeffc&bgTextureDef [...]
-* Copyright jQuery Foundation and other contributors; Licensed MIT */
-
-/* Layout helpers
-----------------------------------*/
-.ui-helper-hidden {
- display: none;
-}
-.ui-helper-hidden-accessible {
- border: 0;
- clip: rect(0 0 0 0);
- height: 1px;
- margin: -1px;
- overflow: hidden;
- padding: 0;
- position: absolute;
- width: 1px;
-}
-.ui-helper-reset {
- margin: 0;
- padding: 0;
- border: 0;
- outline: 0;
- line-height: 1.3;
- text-decoration: none;
- font-size: 100%;
- list-style: none;
-}
-.ui-helper-clearfix:before,
-.ui-helper-clearfix:after {
- content: "";
- display: table;
- border-collapse: collapse;
-}
-.ui-helper-clearfix:after {
- clear: both;
-}
-.ui-helper-zfix {
- width: 100%;
- height: 100%;
- top: 0;
- left: 0;
- position: absolute;
- opacity: 0;
- filter:Alpha(Opacity=0); /* support: IE8 */
-}
-
-.ui-front {
- z-index: 100;
-}
-
-
-/* Interaction Cues
-----------------------------------*/
-.ui-state-disabled {
- cursor: default !important;
- pointer-events: none;
-}
-
-
-/* Icons
-----------------------------------*/
-.ui-icon {
- display: inline-block;
- vertical-align: middle;
- margin-top: -.25em;
- position: relative;
- text-indent: -99999px;
- overflow: hidden;
- background-repeat: no-repeat;
-}
-
-.ui-widget-icon-block {
- left: 50%;
- margin-left: -8px;
- display: block;
-}
-
-/* Misc visuals
-----------------------------------*/
-
-/* Overlays */
-.ui-widget-overlay {
- position: fixed;
- top: 0;
- left: 0;
- width: 100%;
- height: 100%;
-}
-.ui-accordion .ui-accordion-header {
- display: block;
- cursor: pointer;
- position: relative;
- margin: 2px 0 0 0;
- padding: .5em .5em .5em .7em;
- font-size: 100%;
-}
-.ui-accordion .ui-accordion-content {
- padding: 1em 2.2em;
- border-top: 0;
- overflow: auto;
-}
-.ui-autocomplete {
- position: absolute;
- top: 0;
- left: 0;
- cursor: default;
-}
-.ui-menu {
- list-style: none;
- padding: 0;
- margin: 0;
- display: block;
- outline: 0;
-}
-.ui-menu .ui-menu {
- position: absolute;
-}
-.ui-menu .ui-menu-item {
- margin: 0;
- cursor: pointer;
- /* support: IE10, see #8844 */
- list-style-image: url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7");
-}
-.ui-menu .ui-menu-item-wrapper {
- position: relative;
- padding: 3px 1em 3px .4em;
-}
-.ui-menu .ui-menu-divider {
- margin: 5px 0;
- height: 0;
- font-size: 0;
- line-height: 0;
- border-width: 1px 0 0 0;
-}
-.ui-menu .ui-state-focus,
-.ui-menu .ui-state-active {
- margin: -1px;
-}
-
-/* icon support */
-.ui-menu-icons {
- position: relative;
-}
-.ui-menu-icons .ui-menu-item-wrapper {
- padding-left: 2em;
-}
-
-/* left-aligned */
-.ui-menu .ui-icon {
- position: absolute;
- top: 0;
- bottom: 0;
- left: .2em;
- margin: auto 0;
-}
-
-/* right-aligned */
-.ui-menu .ui-menu-icon {
- left: auto;
- right: 0;
-}
-.ui-button {
- padding: .4em 1em;
- display: inline-block;
- position: relative;
- line-height: normal;
- margin-right: .1em;
- cursor: pointer;
- vertical-align: middle;
- text-align: center;
- -webkit-user-select: none;
- -moz-user-select: none;
- -ms-user-select: none;
- user-select: none;
-
- /* Support: IE <= 11 */
- overflow: visible;
-}
-
-.ui-button,
-.ui-button:link,
-.ui-button:visited,
-.ui-button:hover,
-.ui-button:active {
- text-decoration: none;
-}
-
-/* to make room for the icon, a width needs to be set here */
-.ui-button-icon-only {
- width: 2em;
- box-sizing: border-box;
- text-indent: -9999px;
- white-space: nowrap;
-}
-
-/* no icon support for input elements */
-input.ui-button.ui-button-icon-only {
- text-indent: 0;
-}
-
-/* button icon element(s) */
-.ui-button-icon-only .ui-icon {
- position: absolute;
- top: 50%;
- left: 50%;
- margin-top: -8px;
- margin-left: -8px;
-}
-
-.ui-button.ui-icon-notext .ui-icon {
- padding: 0;
- width: 2.1em;
- height: 2.1em;
- text-indent: -9999px;
- white-space: nowrap;
-
-}
-
-input.ui-button.ui-icon-notext .ui-icon {
- width: auto;
- height: auto;
- text-indent: 0;
- white-space: normal;
- padding: .4em 1em;
-}
-
-/* workarounds */
-/* Support: Firefox 5 - 40 */
-input.ui-button::-moz-focus-inner,
-button.ui-button::-moz-focus-inner {
- border: 0;
- padding: 0;
-}
-.ui-controlgroup {
- vertical-align: middle;
- display: inline-block;
-}
-.ui-controlgroup > .ui-controlgroup-item {
- float: left;
- margin-left: 0;
- margin-right: 0;
-}
-.ui-controlgroup > .ui-controlgroup-item:focus,
-.ui-controlgroup > .ui-controlgroup-item.ui-visual-focus {
- z-index: 9999;
-}
-.ui-controlgroup-vertical > .ui-controlgroup-item {
- display: block;
- float: none;
- width: 100%;
- margin-top: 0;
- margin-bottom: 0;
- text-align: left;
-}
-.ui-controlgroup-vertical .ui-controlgroup-item {
- box-sizing: border-box;
-}
-.ui-controlgroup .ui-controlgroup-label {
- padding: .4em 1em;
-}
-.ui-controlgroup .ui-controlgroup-label span {
- font-size: 80%;
-}
-.ui-controlgroup-horizontal .ui-controlgroup-label + .ui-controlgroup-item {
- border-left: none;
-}
-.ui-controlgroup-vertical .ui-controlgroup-label + .ui-controlgroup-item {
- border-top: none;
-}
-.ui-controlgroup-horizontal .ui-controlgroup-label.ui-widget-content {
- border-right: none;
-}
-.ui-controlgroup-vertical .ui-controlgroup-label.ui-widget-content {
- border-bottom: none;
-}
-
-/* Spinner specific style fixes */
-.ui-controlgroup-vertical .ui-spinner-input {
-
- /* Support: IE8 only, Android < 4.4 only */
- width: 75%;
- width: calc( 100% - 2.4em );
-}
-.ui-controlgroup-vertical .ui-spinner .ui-spinner-up {
- border-top-style: solid;
-}
-
-.ui-checkboxradio-label .ui-icon-background {
- box-shadow: inset 1px 1px 1px #ccc;
- border-radius: .12em;
- border: none;
-}
-.ui-checkboxradio-radio-label .ui-icon-background {
- width: 16px;
- height: 16px;
- border-radius: 1em;
- overflow: visible;
- border: none;
-}
-.ui-checkboxradio-radio-label.ui-checkboxradio-checked .ui-icon,
-.ui-checkboxradio-radio-label.ui-checkboxradio-checked:hover .ui-icon {
- background-image: none;
- width: 8px;
- height: 8px;
- border-width: 4px;
- border-style: solid;
-}
-.ui-checkboxradio-disabled {
- pointer-events: none;
-}
-.ui-datepicker {
- width: 17em;
- padding: .2em .2em 0;
- display: none;
-}
-.ui-datepicker .ui-datepicker-header {
- position: relative;
- padding: .2em 0;
-}
-.ui-datepicker .ui-datepicker-prev,
-.ui-datepicker .ui-datepicker-next {
- position: absolute;
- top: 2px;
- width: 1.8em;
- height: 1.8em;
-}
-.ui-datepicker .ui-datepicker-prev-hover,
-.ui-datepicker .ui-datepicker-next-hover {
- top: 1px;
-}
-.ui-datepicker .ui-datepicker-prev {
- left: 2px;
-}
-.ui-datepicker .ui-datepicker-next {
- right: 2px;
-}
-.ui-datepicker .ui-datepicker-prev-hover {
- left: 1px;
-}
-.ui-datepicker .ui-datepicker-next-hover {
- right: 1px;
-}
-.ui-datepicker .ui-datepicker-prev span,
-.ui-datepicker .ui-datepicker-next span {
- display: block;
- position: absolute;
- left: 50%;
- margin-left: -8px;
- top: 50%;
- margin-top: -8px;
-}
-.ui-datepicker .ui-datepicker-title {
- margin: 0 2.3em;
- line-height: 1.8em;
- text-align: center;
-}
-.ui-datepicker .ui-datepicker-title select {
- font-size: 1em;
- margin: 1px 0;
-}
-.ui-datepicker select.ui-datepicker-month,
-.ui-datepicker select.ui-datepicker-year {
- width: 45%;
-}
-.ui-datepicker table {
- width: 100%;
- font-size: .9em;
- border-collapse: collapse;
- margin: 0 0 .4em;
-}
-.ui-datepicker th {
- padding: .7em .3em;
- text-align: center;
- font-weight: bold;
- border: 0;
-}
-.ui-datepicker td {
- border: 0;
- padding: 1px;
-}
-.ui-datepicker td span,
-.ui-datepicker td a {
- display: block;
- padding: .2em;
- text-align: right;
- text-decoration: none;
-}
-.ui-datepicker .ui-datepicker-buttonpane {
- background-image: none;
- margin: .7em 0 0 0;
- padding: 0 .2em;
- border-left: 0;
- border-right: 0;
- border-bottom: 0;
-}
-.ui-datepicker .ui-datepicker-buttonpane button {
- float: right;
- margin: .5em .2em .4em;
- cursor: pointer;
- padding: .2em .6em .3em .6em;
- width: auto;
- overflow: visible;
-}
-.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current {
- float: left;
-}
-
-/* with multiple calendars */
-.ui-datepicker.ui-datepicker-multi {
- width: auto;
-}
-.ui-datepicker-multi .ui-datepicker-group {
- float: left;
-}
-.ui-datepicker-multi .ui-datepicker-group table {
- width: 95%;
- margin: 0 auto .4em;
-}
-.ui-datepicker-multi-2 .ui-datepicker-group {
- width: 50%;
-}
-.ui-datepicker-multi-3 .ui-datepicker-group {
- width: 33.3%;
-}
-.ui-datepicker-multi-4 .ui-datepicker-group {
- width: 25%;
-}
-.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,
-.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header {
- border-left-width: 0;
-}
-.ui-datepicker-multi .ui-datepicker-buttonpane {
- clear: left;
-}
-.ui-datepicker-row-break {
- clear: both;
- width: 100%;
- font-size: 0;
-}
-
-/* RTL support */
-.ui-datepicker-rtl {
- direction: rtl;
-}
-.ui-datepicker-rtl .ui-datepicker-prev {
- right: 2px;
- left: auto;
-}
-.ui-datepicker-rtl .ui-datepicker-next {
- left: 2px;
- right: auto;
-}
-.ui-datepicker-rtl .ui-datepicker-prev:hover {
- right: 1px;
- left: auto;
-}
-.ui-datepicker-rtl .ui-datepicker-next:hover {
- left: 1px;
- right: auto;
-}
-.ui-datepicker-rtl .ui-datepicker-buttonpane {
- clear: right;
-}
-.ui-datepicker-rtl .ui-datepicker-buttonpane button {
- float: left;
-}
-.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,
-.ui-datepicker-rtl .ui-datepicker-group {
- float: right;
-}
-.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,
-.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header {
- border-right-width: 0;
- border-left-width: 1px;
-}
-
-/* Icons */
-.ui-datepicker .ui-icon {
- display: block;
- text-indent: -99999px;
- overflow: hidden;
- background-repeat: no-repeat;
- left: .5em;
- top: .3em;
-}
-.ui-dialog {
- position: absolute;
- top: 0;
- left: 0;
- padding: .2em;
- outline: 0;
-}
-.ui-dialog .ui-dialog-titlebar {
- padding: .4em 1em;
- position: relative;
-}
-.ui-dialog .ui-dialog-title {
- float: left;
- margin: .1em 0;
- white-space: nowrap;
- width: 90%;
- overflow: hidden;
- text-overflow: ellipsis;
-}
-.ui-dialog .ui-dialog-titlebar-close {
- position: absolute;
- right: .3em;
- top: 50%;
- width: 20px;
- margin: -10px 0 0 0;
- padding: 1px;
- height: 20px;
-}
-.ui-dialog .ui-dialog-content {
- position: relative;
- border: 0;
- padding: .5em 1em;
- background: none;
- overflow: auto;
-}
-.ui-dialog .ui-dialog-buttonpane {
- text-align: left;
- border-width: 1px 0 0 0;
- background-image: none;
- margin-top: .5em;
- padding: .3em 1em .5em .4em;
-}
-.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset {
- float: right;
-}
-.ui-dialog .ui-dialog-buttonpane button {
- margin: .5em .4em .5em 0;
- cursor: pointer;
-}
-.ui-dialog .ui-resizable-n {
- height: 2px;
- top: 0;
-}
-.ui-dialog .ui-resizable-e {
- width: 2px;
- right: 0;
-}
-.ui-dialog .ui-resizable-s {
- height: 2px;
- bottom: 0;
-}
-.ui-dialog .ui-resizable-w {
- width: 2px;
- left: 0;
-}
-.ui-dialog .ui-resizable-se,
-.ui-dialog .ui-resizable-sw,
-.ui-dialog .ui-resizable-ne,
-.ui-dialog .ui-resizable-nw {
- width: 7px;
- height: 7px;
-}
-.ui-dialog .ui-resizable-se {
- right: 0;
- bottom: 0;
-}
-.ui-dialog .ui-resizable-sw {
- left: 0;
- bottom: 0;
-}
-.ui-dialog .ui-resizable-ne {
- right: 0;
- top: 0;
-}
-.ui-dialog .ui-resizable-nw {
- left: 0;
- top: 0;
-}
-.ui-draggable .ui-dialog-titlebar {
- cursor: move;
-}
-.ui-draggable-handle {
- -ms-touch-action: none;
- touch-action: none;
-}
-.ui-resizable {
- position: relative;
-}
-.ui-resizable-handle {
- position: absolute;
- font-size: 0.1px;
- display: block;
- -ms-touch-action: none;
- touch-action: none;
-}
-.ui-resizable-disabled .ui-resizable-handle,
-.ui-resizable-autohide .ui-resizable-handle {
- display: none;
-}
-.ui-resizable-n {
- cursor: n-resize;
- height: 7px;
- width: 100%;
- top: -5px;
- left: 0;
-}
-.ui-resizable-s {
- cursor: s-resize;
- height: 7px;
- width: 100%;
- bottom: -5px;
- left: 0;
-}
-.ui-resizable-e {
- cursor: e-resize;
- width: 7px;
- right: -5px;
- top: 0;
- height: 100%;
-}
-.ui-resizable-w {
- cursor: w-resize;
- width: 7px;
- left: -5px;
- top: 0;
- height: 100%;
-}
-.ui-resizable-se {
- cursor: se-resize;
- width: 12px;
- height: 12px;
- right: 1px;
- bottom: 1px;
-}
-.ui-resizable-sw {
- cursor: sw-resize;
- width: 9px;
- height: 9px;
- left: -5px;
- bottom: -5px;
-}
-.ui-resizable-nw {
- cursor: nw-resize;
- width: 9px;
- height: 9px;
- left: -5px;
- top: -5px;
-}
-.ui-resizable-ne {
- cursor: ne-resize;
- width: 9px;
- height: 9px;
- right: -5px;
- top: -5px;
-}
-.ui-progressbar {
- height: 2em;
- text-align: left;
- overflow: hidden;
-}
-.ui-progressbar .ui-progressbar-value {
- margin: -1px;
- height: 100%;
-}
-.ui-progressbar .ui-progressbar-overlay {
- background: url("data:image/gif;base64,R0lGODlhKAAoAIABAAAAAP///yH/C05FVFNDQVBFMi4wAwEAAAAh+QQJAQABACwAAAAAKAAoAAACkYwNqXrdC52DS06a7MFZI+4FHBCKoDeWKXqymPqGqxvJrXZbMx7Ttc+w9XgU2FB3lOyQRWET2IFGiU9m1frDVpxZZc6bfHwv4c1YXP6k1Vdy292Fb6UkuvFtXpvWSzA+HycXJHUXiGYIiMg2R6W459gnWGfHNdjIqDWVqemH2ekpObkpOlppWUqZiqr6edqqWQAAIfkECQEAAQAsAAAAACgAKAAAApSMgZnGfaqcg1E2uuzDmmHUBR8Qil95hiPKqWn3aqtLsS18y7G1SzNeowWBENtQd+T1JktP05nzPTdJZlR6vUxNWWjV+vUWhWNkWFwxl9VpZRedYcflIOLafaa28XdsH/ynlcc1uPVDZxQIR0K25+cICCmo [...]
- height: 100%;
- filter: alpha(opacity=25); /* support: IE8 */
- opacity: 0.25;
-}
-.ui-progressbar-indeterminate .ui-progressbar-value {
- background-image: none;
-}
-.ui-selectable {
- -ms-touch-action: none;
- touch-action: none;
-}
-.ui-selectable-helper {
- position: absolute;
- z-index: 100;
- border: 1px dotted black;
-}
-.ui-selectmenu-menu {
- padding: 0;
- margin: 0;
- position: absolute;
- top: 0;
- left: 0;
- display: none;
-}
-.ui-selectmenu-menu .ui-menu {
- overflow: auto;
- overflow-x: hidden;
- padding-bottom: 1px;
-}
-.ui-selectmenu-menu .ui-menu .ui-selectmenu-optgroup {
- font-size: 1em;
- font-weight: bold;
- line-height: 1.5;
- padding: 2px 0.4em;
- margin: 0.5em 0 0 0;
- height: auto;
- border: 0;
-}
-.ui-selectmenu-open {
- display: block;
-}
-.ui-selectmenu-text {
- display: block;
- margin-right: 20px;
- overflow: hidden;
- text-overflow: ellipsis;
-}
-.ui-selectmenu-button.ui-button {
- text-align: left;
- white-space: nowrap;
- width: 14em;
-}
-.ui-selectmenu-icon.ui-icon {
- float: right;
- margin-top: 0;
-}
-.ui-slider {
- position: relative;
- text-align: left;
-}
-.ui-slider .ui-slider-handle {
- position: absolute;
- z-index: 2;
- width: 1.2em;
- height: 1.2em;
- cursor: default;
- -ms-touch-action: none;
- touch-action: none;
-}
-.ui-slider .ui-slider-range {
- position: absolute;
- z-index: 1;
- font-size: .7em;
- display: block;
- border: 0;
- background-position: 0 0;
-}
-
-/* support: IE8 - See #6727 */
-.ui-slider.ui-state-disabled .ui-slider-handle,
-.ui-slider.ui-state-disabled .ui-slider-range {
- filter: inherit;
-}
-
-.ui-slider-horizontal {
- height: .8em;
-}
-.ui-slider-horizontal .ui-slider-handle {
- top: -.3em;
- margin-left: -.6em;
-}
-.ui-slider-horizontal .ui-slider-range {
- top: 0;
- height: 100%;
-}
-.ui-slider-horizontal .ui-slider-range-min {
- left: 0;
-}
-.ui-slider-horizontal .ui-slider-range-max {
- right: 0;
-}
-
-.ui-slider-vertical {
- width: .8em;
- height: 100px;
-}
-.ui-slider-vertical .ui-slider-handle {
- left: -.3em;
- margin-left: 0;
- margin-bottom: -.6em;
-}
-.ui-slider-vertical .ui-slider-range {
- left: 0;
- width: 100%;
-}
-.ui-slider-vertical .ui-slider-range-min {
- bottom: 0;
-}
-.ui-slider-vertical .ui-slider-range-max {
- top: 0;
-}
-.ui-sortable-handle {
- -ms-touch-action: none;
- touch-action: none;
-}
-.ui-spinner {
- position: relative;
- display: inline-block;
- overflow: hidden;
- padding: 0;
- vertical-align: middle;
-}
-.ui-spinner-input {
- border: none;
- background: none;
- color: inherit;
- padding: .222em 0;
- margin: .2em 0;
- vertical-align: middle;
- margin-left: .4em;
- margin-right: 2em;
-}
-.ui-spinner-button {
- width: 1.6em;
- height: 50%;
- font-size: .5em;
- padding: 0;
- margin: 0;
- text-align: center;
- position: absolute;
- cursor: default;
- display: block;
- overflow: hidden;
- right: 0;
-}
-/* more specificity required here to override default borders */
-.ui-spinner a.ui-spinner-button {
- border-top-style: none;
- border-bottom-style: none;
- border-right-style: none;
-}
-.ui-spinner-up {
- top: 0;
-}
-.ui-spinner-down {
- bottom: 0;
-}
-.ui-tabs {
- position: relative;/* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
- padding: .2em;
-}
-.ui-tabs .ui-tabs-nav {
- margin: 0;
- padding: .2em .2em 0;
-}
-.ui-tabs .ui-tabs-nav li {
- list-style: none;
- float: left;
- position: relative;
- top: 0;
- margin: 1px .2em 0 0;
- border-bottom-width: 0;
- padding: 0;
- white-space: nowrap;
-}
-.ui-tabs .ui-tabs-nav .ui-tabs-anchor {
- float: left;
- padding: .5em 1em;
- text-decoration: none;
-}
-.ui-tabs .ui-tabs-nav li.ui-tabs-active {
- margin-bottom: -1px;
- padding-bottom: 1px;
-}
-.ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor,
-.ui-tabs .ui-tabs-nav li.ui-state-disabled .ui-tabs-anchor,
-.ui-tabs .ui-tabs-nav li.ui-tabs-loading .ui-tabs-anchor {
- cursor: text;
-}
-.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor {
- cursor: pointer;
-}
-.ui-tabs .ui-tabs-panel {
- display: block;
- border-width: 0;
- padding: 1em 1.4em;
- background: none;
-}
-.ui-tooltip {
- padding: 8px;
- position: absolute;
- z-index: 9999;
- max-width: 300px;
-}
-body .ui-tooltip {
- border-width: 2px;
-}
-/* Component containers
-----------------------------------*/
-.ui-widget {
- font-family: Lucida Grande,Lucida Sans,Arial,sans-serif;
- font-size: 1.1em;
-}
-.ui-widget .ui-widget {
- font-size: 1em;
-}
-.ui-widget input,
-.ui-widget select,
-.ui-widget textarea,
-.ui-widget button {
- font-family: Lucida Grande,Lucida Sans,Arial,sans-serif;
- font-size: 1em;
-}
-.ui-widget.ui-widget-content {
- border: 1px solid #c5dbec;
-}
-.ui-widget-content {
- border: 1px solid #a6c9e2;
- background: #fcfdfd url("images/ui-bg_inset-hard_100_fcfdfd_1x100.png") 50% bottom repeat-x;
- color: #222222;
-}
-.ui-widget-content a {
- color: #222222;
-}
-.ui-widget-header {
- border: 1px solid #4297d7;
- background: #5c9ccc url("images/ui-bg_gloss-wave_55_5c9ccc_500x100.png") 50% 50% repeat-x;
- color: #ffffff;
- font-weight: bold;
-}
-.ui-widget-header a {
- color: #ffffff;
-}
-
-/* Interaction states
-----------------------------------*/
-.ui-state-default,
-.ui-widget-content .ui-state-default,
-.ui-widget-header .ui-state-default,
-.ui-button,
-
-/* We use html here because we need a greater specificity to make sure disabled
-works properly when clicked or hovered */
-html .ui-button.ui-state-disabled:hover,
-html .ui-button.ui-state-disabled:active {
- border: 1px solid #c5dbec;
- background: #dfeffc url("images/ui-bg_glass_85_dfeffc_1x400.png") 50% 50% repeat-x;
- font-weight: bold;
- color: #2e6e9e;
-}
-.ui-state-default a,
-.ui-state-default a:link,
-.ui-state-default a:visited,
-a.ui-button,
-a:link.ui-button,
-a:visited.ui-button,
-.ui-button {
- color: #2e6e9e;
- text-decoration: none;
-}
-.ui-state-hover,
-.ui-widget-content .ui-state-hover,
-.ui-widget-header .ui-state-hover,
-.ui-state-focus,
-.ui-widget-content .ui-state-focus,
-.ui-widget-header .ui-state-focus,
-.ui-button:hover,
-.ui-button:focus {
- border: 1px solid #79b7e7;
- background: #d0e5f5 url("images/ui-bg_glass_75_d0e5f5_1x400.png") 50% 50% repeat-x;
- font-weight: bold;
- color: #1d5987;
-}
-.ui-state-hover a,
-.ui-state-hover a:hover,
-.ui-state-hover a:link,
-.ui-state-hover a:visited,
-.ui-state-focus a,
-.ui-state-focus a:hover,
-.ui-state-focus a:link,
-.ui-state-focus a:visited,
-a.ui-button:hover,
-a.ui-button:focus {
- color: #1d5987;
- text-decoration: none;
-}
-
-.ui-visual-focus {
- box-shadow: 0 0 3px 1px rgb(94, 158, 214);
-}
-.ui-state-active,
-.ui-widget-content .ui-state-active,
-.ui-widget-header .ui-state-active,
-a.ui-button:active,
-.ui-button:active,
-.ui-button.ui-state-active:hover {
- border: 1px solid #79b7e7;
- background: #f5f8f9 url("images/ui-bg_inset-hard_100_f5f8f9_1x100.png") 50% 50% repeat-x;
- font-weight: bold;
- color: #e17009;
-}
-.ui-icon-background,
-.ui-state-active .ui-icon-background {
- border: #79b7e7;
- background-color: #e17009;
-}
-.ui-state-active a,
-.ui-state-active a:link,
-.ui-state-active a:visited {
- color: #e17009;
- text-decoration: none;
-}
-
-/* Interaction Cues
-----------------------------------*/
-.ui-state-highlight,
-.ui-widget-content .ui-state-highlight,
-.ui-widget-header .ui-state-highlight {
- border: 1px solid #fad42e;
- background: #fbec88;
- color: #363636;
-}
-.ui-state-checked {
- border: 1px solid #fad42e;
- background: #fbec88;
-}
-.ui-state-highlight a,
-.ui-widget-content .ui-state-highlight a,
-.ui-widget-header .ui-state-highlight a {
- color: #363636;
-}
-.ui-state-error,
-.ui-widget-content .ui-state-error,
-.ui-widget-header .ui-state-error {
- border: 1px solid #cd0a0a;
- background: #fef1ec url("images/ui-bg_glass_95_fef1ec_1x400.png") 50% 50% repeat-x;
- color: #cd0a0a;
-}
-.ui-state-error a,
-.ui-widget-content .ui-state-error a,
-.ui-widget-header .ui-state-error a {
- color: #cd0a0a;
-}
-.ui-state-error-text,
-.ui-widget-content .ui-state-error-text,
-.ui-widget-header .ui-state-error-text {
- color: #cd0a0a;
-}
-.ui-priority-primary,
-.ui-widget-content .ui-priority-primary,
-.ui-widget-header .ui-priority-primary {
- font-weight: bold;
-}
-.ui-priority-secondary,
-.ui-widget-content .ui-priority-secondary,
-.ui-widget-header .ui-priority-secondary {
- opacity: .7;
- filter:Alpha(Opacity=70); /* support: IE8 */
- font-weight: normal;
-}
-.ui-state-disabled,
-.ui-widget-content .ui-state-disabled,
-.ui-widget-header .ui-state-disabled {
- opacity: .35;
- filter:Alpha(Opacity=35); /* support: IE8 */
- background-image: none;
-}
-.ui-state-disabled .ui-icon {
- filter:Alpha(Opacity=35); /* support: IE8 - See #6059 */
-}
-
-/* Icons
-----------------------------------*/
-
-/* states and images */
-.ui-icon {
- width: 16px;
- height: 16px;
-}
-.ui-icon,
-.ui-widget-content .ui-icon {
- background-image: url("images/ui-icons_469bdd_256x240.png");
-}
-.ui-widget-header .ui-icon {
- background-image: url("images/ui-icons_d8e7f3_256x240.png");
-}
-.ui-state-hover .ui-icon,
-.ui-state-focus .ui-icon,
-.ui-button:hover .ui-icon,
-.ui-button:focus .ui-icon {
- background-image: url("images/ui-icons_217bc0_256x240.png");
-}
-.ui-state-active .ui-icon,
-.ui-button:active .ui-icon {
- background-image: url("images/ui-icons_f9bd01_256x240.png");
-}
-.ui-state-highlight .ui-icon,
-.ui-button .ui-state-highlight.ui-icon {
- background-image: url("images/ui-icons_2e83ff_256x240.png");
-}
-.ui-state-error .ui-icon,
-.ui-state-error-text .ui-icon {
- background-image: url("images/ui-icons_cd0a0a_256x240.png");
-}
-.ui-button .ui-icon {
- background-image: url("images/ui-icons_6da8d5_256x240.png");
-}
-
-/* positioning */
-.ui-icon-blank { background-position: 16px 16px; }
-.ui-icon-caret-1-n { background-position: 0 0; }
-.ui-icon-caret-1-ne { background-position: -16px 0; }
-.ui-icon-caret-1-e { background-position: -32px 0; }
-.ui-icon-caret-1-se { background-position: -48px 0; }
-.ui-icon-caret-1-s { background-position: -65px 0; }
-.ui-icon-caret-1-sw { background-position: -80px 0; }
-.ui-icon-caret-1-w { background-position: -96px 0; }
-.ui-icon-caret-1-nw { background-position: -112px 0; }
-.ui-icon-caret-2-n-s { background-position: -128px 0; }
-.ui-icon-caret-2-e-w { background-position: -144px 0; }
-.ui-icon-triangle-1-n { background-position: 0 -16px; }
-.ui-icon-triangle-1-ne { background-position: -16px -16px; }
-.ui-icon-triangle-1-e { background-position: -32px -16px; }
-.ui-icon-triangle-1-se { background-position: -48px -16px; }
-.ui-icon-triangle-1-s { background-position: -65px -16px; }
-.ui-icon-triangle-1-sw { background-position: -80px -16px; }
-.ui-icon-triangle-1-w { background-position: -96px -16px; }
-.ui-icon-triangle-1-nw { background-position: -112px -16px; }
-.ui-icon-triangle-2-n-s { background-position: -128px -16px; }
-.ui-icon-triangle-2-e-w { background-position: -144px -16px; }
-.ui-icon-arrow-1-n { background-position: 0 -32px; }
-.ui-icon-arrow-1-ne { background-position: -16px -32px; }
-.ui-icon-arrow-1-e { background-position: -32px -32px; }
-.ui-icon-arrow-1-se { background-position: -48px -32px; }
-.ui-icon-arrow-1-s { background-position: -65px -32px; }
-.ui-icon-arrow-1-sw { background-position: -80px -32px; }
-.ui-icon-arrow-1-w { background-position: -96px -32px; }
-.ui-icon-arrow-1-nw { background-position: -112px -32px; }
-.ui-icon-arrow-2-n-s { background-position: -128px -32px; }
-.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
-.ui-icon-arrow-2-e-w { background-position: -160px -32px; }
-.ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
-.ui-icon-arrowstop-1-n { background-position: -192px -32px; }
-.ui-icon-arrowstop-1-e { background-position: -208px -32px; }
-.ui-icon-arrowstop-1-s { background-position: -224px -32px; }
-.ui-icon-arrowstop-1-w { background-position: -240px -32px; }
-.ui-icon-arrowthick-1-n { background-position: 1px -48px; }
-.ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
-.ui-icon-arrowthick-1-e { background-position: -32px -48px; }
-.ui-icon-arrowthick-1-se { background-position: -48px -48px; }
-.ui-icon-arrowthick-1-s { background-position: -64px -48px; }
-.ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
-.ui-icon-arrowthick-1-w { background-position: -96px -48px; }
-.ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
-.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
-.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
-.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
-.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
-.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
-.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
-.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
-.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
-.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
-.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
-.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
-.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
-.ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
-.ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
-.ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
-.ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
-.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
-.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
-.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
-.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
-.ui-icon-arrow-4 { background-position: 0 -80px; }
-.ui-icon-arrow-4-diag { background-position: -16px -80px; }
-.ui-icon-extlink { background-position: -32px -80px; }
-.ui-icon-newwin { background-position: -48px -80px; }
-.ui-icon-refresh { background-position: -64px -80px; }
-.ui-icon-shuffle { background-position: -80px -80px; }
-.ui-icon-transfer-e-w { background-position: -96px -80px; }
-.ui-icon-transferthick-e-w { background-position: -112px -80px; }
-.ui-icon-folder-collapsed { background-position: 0 -96px; }
-.ui-icon-folder-open { background-position: -16px -96px; }
-.ui-icon-document { background-position: -32px -96px; }
-.ui-icon-document-b { background-position: -48px -96px; }
-.ui-icon-note { background-position: -64px -96px; }
-.ui-icon-mail-closed { background-position: -80px -96px; }
-.ui-icon-mail-open { background-position: -96px -96px; }
-.ui-icon-suitcase { background-position: -112px -96px; }
-.ui-icon-comment { background-position: -128px -96px; }
-.ui-icon-person { background-position: -144px -96px; }
-.ui-icon-print { background-position: -160px -96px; }
-.ui-icon-trash { background-position: -176px -96px; }
-.ui-icon-locked { background-position: -192px -96px; }
-.ui-icon-unlocked { background-position: -208px -96px; }
-.ui-icon-bookmark { background-position: -224px -96px; }
-.ui-icon-tag { background-position: -240px -96px; }
-.ui-icon-home { background-position: 0 -112px; }
-.ui-icon-flag { background-position: -16px -112px; }
-.ui-icon-calendar { background-position: -32px -112px; }
-.ui-icon-cart { background-position: -48px -112px; }
-.ui-icon-pencil { background-position: -64px -112px; }
-.ui-icon-clock { background-position: -80px -112px; }
-.ui-icon-disk { background-position: -96px -112px; }
-.ui-icon-calculator { background-position: -112px -112px; }
-.ui-icon-zoomin { background-position: -128px -112px; }
-.ui-icon-zoomout { background-position: -144px -112px; }
-.ui-icon-search { background-position: -160px -112px; }
-.ui-icon-wrench { background-position: -176px -112px; }
-.ui-icon-gear { background-position: -192px -112px; }
-.ui-icon-heart { background-position: -208px -112px; }
-.ui-icon-star { background-position: -224px -112px; }
-.ui-icon-link { background-position: -240px -112px; }
-.ui-icon-cancel { background-position: 0 -128px; }
-.ui-icon-plus { background-position: -16px -128px; }
-.ui-icon-plusthick { background-position: -32px -128px; }
-.ui-icon-minus { background-position: -48px -128px; }
-.ui-icon-minusthick { background-position: -64px -128px; }
-.ui-icon-close { background-position: -80px -128px; }
-.ui-icon-closethick { background-position: -96px -128px; }
-.ui-icon-key { background-position: -112px -128px; }
-.ui-icon-lightbulb { background-position: -128px -128px; }
-.ui-icon-scissors { background-position: -144px -128px; }
-.ui-icon-clipboard { background-position: -160px -128px; }
-.ui-icon-copy { background-position: -176px -128px; }
-.ui-icon-contact { background-position: -192px -128px; }
-.ui-icon-image { background-position: -208px -128px; }
-.ui-icon-video { background-position: -224px -128px; }
-.ui-icon-script { background-position: -240px -128px; }
-.ui-icon-alert { background-position: 0 -144px; }
-.ui-icon-info { background-position: -16px -144px; }
-.ui-icon-notice { background-position: -32px -144px; }
-.ui-icon-help { background-position: -48px -144px; }
-.ui-icon-check { background-position: -64px -144px; }
-.ui-icon-bullet { background-position: -80px -144px; }
-.ui-icon-radio-on { background-position: -96px -144px; }
-.ui-icon-radio-off { background-position: -112px -144px; }
-.ui-icon-pin-w { background-position: -128px -144px; }
-.ui-icon-pin-s { background-position: -144px -144px; }
-.ui-icon-play { background-position: 0 -160px; }
-.ui-icon-pause { background-position: -16px -160px; }
-.ui-icon-seek-next { background-position: -32px -160px; }
-.ui-icon-seek-prev { background-position: -48px -160px; }
-.ui-icon-seek-end { background-position: -64px -160px; }
-.ui-icon-seek-start { background-position: -80px -160px; }
-/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
-.ui-icon-seek-first { background-position: -80px -160px; }
-.ui-icon-stop { background-position: -96px -160px; }
-.ui-icon-eject { background-position: -112px -160px; }
-.ui-icon-volume-off { background-position: -128px -160px; }
-.ui-icon-volume-on { background-position: -144px -160px; }
-.ui-icon-power { background-position: 0 -176px; }
-.ui-icon-signal-diag { background-position: -16px -176px; }
-.ui-icon-signal { background-position: -32px -176px; }
-.ui-icon-battery-0 { background-position: -48px -176px; }
-.ui-icon-battery-1 { background-position: -64px -176px; }
-.ui-icon-battery-2 { background-position: -80px -176px; }
-.ui-icon-battery-3 { background-position: -96px -176px; }
-.ui-icon-circle-plus { background-position: 0 -192px; }
-.ui-icon-circle-minus { background-position: -16px -192px; }
-.ui-icon-circle-close { background-position: -32px -192px; }
-.ui-icon-circle-triangle-e { background-position: -48px -192px; }
-.ui-icon-circle-triangle-s { background-position: -64px -192px; }
-.ui-icon-circle-triangle-w { background-position: -80px -192px; }
-.ui-icon-circle-triangle-n { background-position: -96px -192px; }
-.ui-icon-circle-arrow-e { background-position: -112px -192px; }
-.ui-icon-circle-arrow-s { background-position: -128px -192px; }
-.ui-icon-circle-arrow-w { background-position: -144px -192px; }
-.ui-icon-circle-arrow-n { background-position: -160px -192px; }
-.ui-icon-circle-zoomin { background-position: -176px -192px; }
-.ui-icon-circle-zoomout { background-position: -192px -192px; }
-.ui-icon-circle-check { background-position: -208px -192px; }
-.ui-icon-circlesmall-plus { background-position: 0 -208px; }
-.ui-icon-circlesmall-minus { background-position: -16px -208px; }
-.ui-icon-circlesmall-close { background-position: -32px -208px; }
-.ui-icon-squaresmall-plus { background-position: -48px -208px; }
-.ui-icon-squaresmall-minus { background-position: -64px -208px; }
-.ui-icon-squaresmall-close { background-position: -80px -208px; }
-.ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
-.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
-.ui-icon-grip-solid-vertical { background-position: -32px -224px; }
-.ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
-.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
-.ui-icon-grip-diagonal-se { background-position: -80px -224px; }
-
-
-/* Misc visuals
-----------------------------------*/
-
-/* Corner radius */
-.ui-corner-all,
-.ui-corner-top,
-.ui-corner-left,
-.ui-corner-tl {
- border-top-left-radius: 5px;
-}
-.ui-corner-all,
-.ui-corner-top,
-.ui-corner-right,
-.ui-corner-tr {
- border-top-right-radius: 5px;
-}
-.ui-corner-all,
-.ui-corner-bottom,
-.ui-corner-left,
-.ui-corner-bl {
- border-bottom-left-radius: 5px;
-}
-.ui-corner-all,
-.ui-corner-bottom,
-.ui-corner-right,
-.ui-corner-br {
- border-bottom-right-radius: 5px;
-}
-
-/* Overlays */
-.ui-widget-overlay {
- background: #aaaaaa;
- opacity: .3;
- filter: Alpha(Opacity=30); /* support: IE8 */
-}
-.ui-widget-shadow {
- -webkit-box-shadow: -8px -8px 8px #aaaaaa;
- box-shadow: -8px -8px 8px #aaaaaa;
-}
diff --git a/bundles/admin/src/main/resources/static/css/shell.css b/bundles/admin/src/main/resources/static/css/shell.css
deleted file mode 100644
index cf22837ad..000000000
--- a/bundles/admin/src/main/resources/static/css/shell.css
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * $Id: webconsole.css 590812 2007-10-31 20:32:54Z apetrelli $
- *
- * 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.
- */
-#shell {
- clear: both;
-}
-
-.wc-results {
- overflow: auto;
- margin: 0px;
- padding: 5px;
- font-family: courier;
- color: white;
- background-color: black;
- height: 400px;
-}
-.wc-results pre {
- display: inline;
-}
-.wc-command {
- margin: 0px;
- font-family: courier;
- color: white;
- background-color: black;
- width: 100%;
-}
diff --git a/bundles/admin/src/main/resources/static/js/jquery-1.12.4.min.js b/bundles/admin/src/main/resources/static/js/jquery-1.12.4.min.js
deleted file mode 100644
index e83647587..000000000
--- a/bundles/admin/src/main/resources/static/js/jquery-1.12.4.min.js
+++ /dev/null
@@ -1,5 +0,0 @@
-/*! jQuery v1.12.4 | (c) jQuery Foundation | jquery.org/license */
-!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=a.document,e=c.slice,f=c.concat,g=c.push,h=c.indexOf,i={},j=i.toString,k=i.hasOwnProperty,l={},m="1.12.4",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r [...]
-}return c}function Q(a){var b;for(b in a)if(("data"!==b||!n.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;return!0}function R(a,b,d,e){if(M(a)){var f,g,h=n.expando,i=a.nodeType,j=i?n.cache:a,k=i?a[h]:a[h]&&h;if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof b)return k||(k=i?a[h]=c.pop()||n.guid++:h),j[k]||(j[k]=i?{}:{toJSON:n.noop}),"object"!=typeof b&&"function"!=typeof b||(e?j[k]=n.extend(j[k],b):j[k].data=n.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d& [...]
-marginLeft:0},function(){return a.getBoundingClientRect().left}):0))+"px":void 0}),n.each({margin:"",padding:"",border:"Width"},function(a,b){n.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+V[d]+b]=f[d]||f[d-2]||f[0];return e}},Na.test(a)||(n.cssHooks[a+b].set=db)}),n.fn.extend({css:function(a,b){return Y(this,function(a,b,c){var d,e,f={},g=0;if(n.isArray(b)){for(d=Ra(a),e=b.length;e>g;g++)f[b[g]]=n.css(a,b[g],!1,d);return f}return v [...]
-padding:"inner"+a,content:b,"":"outer"+a},function(c,d){n.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return Y(this,function(b,c,d){var e;return n.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?n.css(b,c,g):n.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),n.fn.extend({bind:function(a,b,c){ [...]
diff --git a/bundles/admin/src/main/resources/static/js/jquery-ui-1.12.1.min.js b/bundles/admin/src/main/resources/static/js/jquery-ui-1.12.1.min.js
deleted file mode 100644
index 117cb35e4..000000000
--- a/bundles/admin/src/main/resources/static/js/jquery-ui-1.12.1.min.js
+++ /dev/null
@@ -1,13 +0,0 @@
-/*! jQuery UI - v1.12.1 - 2016-09-14
-* http://jqueryui.com
-* Includes: widget.js, position.js, data.js, disable-selection.js, effect.js, effects/effect-blind.js, effects/effect-bounce.js, effects/effect-clip.js, effects/effect-drop.js, effects/effect-explode.js, effects/effect-fade.js, effects/effect-fold.js, effects/effect-highlight.js, effects/effect-puff.js, effects/effect-pulsate.js, effects/effect-scale.js, effects/effect-shake.js, effects/effect-size.js, effects/effect-slide.js, effects/effect-transfer.js, focusable.js, form-reset-mixin.js [...]
-* Copyright jQuery Foundation and other contributors; Licensed MIT */
-
-(function(t){"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery)})(function(t){function e(t){for(var e=t.css("visibility");"inherit"===e;)t=t.parent(),e=t.css("visibility");return"hidden"!==e}function i(t){for(var e,i;t.length&&t[0]!==document;){if(e=t.css("position"),("absolute"===e||"relative"===e||"fixed"===e)&&(i=parseInt(t.css("zIndex"),10),!isNaN(i)&&0!==i))return i;t=t.parent()}return 0}function s(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this [...]
-}}(t.fn.show),hide:function(t){return function(s){if(i(s))return t.apply(this,arguments);var n=e.apply(this,arguments);return n.mode="hide",this.effect.call(this,n)}}(t.fn.hide),toggle:function(t){return function(s){if(i(s)||"boolean"==typeof s)return t.apply(this,arguments);var n=e.apply(this,arguments);return n.mode="toggle",this.effect.call(this,n)}}(t.fn.toggle),cssUnit:function(e){var i=this.css(e),s=[];return t.each(["em","px","%","pt"],function(t,e){i.indexOf(e)>0&&(s=[parseFloat( [...]
-this.isMultiLine=o||!a&&this._isContentEditable(this.element),this.valueMethod=this.element[o||a?"val":"text"],this.isNewMenu=!0,this._addClass("ui-autocomplete-input"),this.element.attr("autocomplete","off"),this._on(this.element,{keydown:function(n){if(this.element.prop("readOnly"))return e=!0,s=!0,i=!0,void 0;e=!1,s=!1,i=!1;var o=t.ui.keyCode;switch(n.keyCode){case o.PAGE_UP:e=!0,this._move("previousPage",n);break;case o.PAGE_DOWN:e=!0,this._move("nextPage",n);break;case o.UP:e=!0,thi [...]
-}},_updateDatepicker:function(e){this.maxRows=4,m=e,e.dpDiv.empty().append(this._generateHTML(e)),this._attachHandlers(e);var i,s=this._getNumberOfMonths(e),n=s[1],a=17,r=e.dpDiv.find("."+this._dayOverClass+" a");r.length>0&&o.apply(r.get(0)),e.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),n>1&&e.dpDiv.addClass("ui-datepicker-multi-"+n).css("width",a*n+"em"),e.dpDiv[(1!==s[0]||1!==s[1]?"add":"remove")+"Class"]("ui-datepicker-multi"),e.dp [...]
-},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e,i,s,n=this.options,o=this.document[0];return this.relativeContainer=null,n.cont [...]
-},disable:t.noop,enable:t.noop,close:function(e){var i=this;this._isOpen&&this._trigger("beforeClose",e)!==!1&&(this._isOpen=!1,this._focusedElement=null,this._destroyOverlay(),this._untrackInstance(),this.opener.filter(":focusable").trigger("focus").length||t.ui.safeBlur(t.ui.safeActiveElement(this.document[0])),this._hide(this.uiDialog,this.options.hide,function(){i._trigger("close",e)}))},isOpen:function(){return this._isOpen},moveToTop:function(){this._moveToTop()},_moveToTop:functio [...]
-},_refresh:function(){this._createRange(),this._createHandles(),this._setupEvents(),this._refreshValue()},_createHandles:function(){var e,i,s=this.options,n=this.element.find(".ui-slider-handle"),o="<span tabindex='0'></span>",a=[];for(i=s.values&&s.values.length||1,n.length>i&&(n.slice(i).remove(),n=n.slice(0,i)),e=n.length;i>e;e++)a.push(o);this.handles=n.add(t(a.join("")).appendTo(this.element)),this._addClass(this.handles,"ui-slider-handle","ui-state-default"),this.handle=this.handle [...]
-this._delay(function(){n===this.counter&&this.refreshPositions(!s)})},_clear:function(t,e){function i(t,e,i){return function(s){i._trigger(t,s,e._uiHash(e))}}this.reverting=!1;var s,n=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(s in this._storedCSS)("auto"===this._storedCSS[s]||"static"===this._storedCSS[s])&&(this._storedCSS[s]="");this.currentItem.css(this._storedC [...]
\ No newline at end of file
diff --git a/bundles/admin/src/main/resources/static/js/shell.js b/bundles/admin/src/main/resources/static/js/shell.js
deleted file mode 100644
index 8f3486efa..000000000
--- a/bundles/admin/src/main/resources/static/js/shell.js
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * $Id: webconsole.js 590812 2007-10-31 20:32:54Z apetrelli $
- *
- * 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.
- */
-
- function printResult(result_string)
- {
- var result_div = $('#wc-result')[0];
- var result_array = result_string.split('\n');
-
- var new_command = $('#wc-command').val();
- result_div.appendChild(document.createTextNode('$ ' + new_command));
- result_div.appendChild(document.createElement('br'));
-
- for (var line_index in result_array) {
- var result_wrap = document.createElement('pre');
- var line = document.createTextNode(result_array[line_index]);
- result_wrap.appendChild(line);
- result_div.appendChild(result_wrap);
- result_div.appendChild(document.createElement('br'));
-
- }
-
- result_div.scrollTop = result_div.scrollHeight;
- $('#wc-command').val('');
- }
-
- function keyEvent(event, url)
- {
- switch(event.keyCode){
- case 13:
- var the_shell_command = $('#wc-command').val();
- if (the_shell_command) {
- commands_history[commands_history.length] = the_shell_command;
- history_pointer = commands_history.length;
- $.ajax({
- type: "GET",
- url: url,
- data: $("#wc-command").serialize(),
- success: function (data, textStatus) {
- printResult(data);
- },
- error: function (request, textStatus) {
- printResult(textStatus);
- }
- });
- }
- break;
- case 38: // this is the arrow up
- if (history_pointer > 0) {
- history_pointer--;
- $('#wc-command').val(commands_history[history_pointer]);
- }
- break;
- case 40: // this is the arrow down
- if (history_pointer < commands_history.length - 1 ) {
- history_pointer++;
- $('#wc-command').val(commands_history[history_pointer]);
- }
- break;
- default:
- break;
- }
- }
-
- var commands_history = new Array();
- var history_pointer;
diff --git a/bundles/admin/src/main/resources/struts.xml b/bundles/admin/src/main/resources/struts.xml
deleted file mode 100644
index 2f002892d..000000000
--- a/bundles/admin/src/main/resources/struts.xml
+++ /dev/null
@@ -1,50 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!--
-/*
- * 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.
- */
--->
-
-<!DOCTYPE struts PUBLIC
- "-//Apache Software Foundation//DTD Struts Configuration 6.0//EN"
- "https://struts.apache.org/dtds/struts-6.0.dtd">
-
-<struts>
- <constant name="struts.enable.DynamicMethodInvocation" value="false" />
- <package name="bundle-admin" namespace="/osgi/admin" extends="osgi-default" strict-method-invocation="true">
- <default-action-ref name="bundles" />
-
- <action name="bundle_*!*" class="org.apache.struts2.osgi.admin.actions.BundlesAction" method="{2}">
- <param name="id">{1}</param>
- <result type="freemarker">viewBundle.ftl</result>
- <allowed-methods>index,view,start,stop,update</allowed-methods>
- </action>
-
- <action name="bundles" class="org.apache.struts2.osgi.admin.actions.BundlesAction" method="index">
- <result type="freemarker">viewBundles.ftl</result>
- </action>
-
- <action name="execCommand" class="org.apache.struts2.osgi.admin.actions.ShellAction">
- <result type="freemarker">commandResult.ftl</result>
- </action>
-
- <action name="shell" class="org.apache.struts2.osgi.admin.actions.ShellAction">
- <result type="freemarker">shell.ftl</result>
- </action>
- </package>
-</struts>
diff --git a/bundles/demo/pom.xml b/bundles/demo/pom.xml
deleted file mode 100644
index 76e3a9252..000000000
--- a/bundles/demo/pom.xml
+++ /dev/null
@@ -1,78 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-/*
- * 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.
- */
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.struts</groupId>
- <artifactId>struts2-osgi-bundles</artifactId>
- <version>7.0.0-SNAPSHOT</version>
- </parent>
-
- <artifactId>struts2-osgi-demo-bundle</artifactId>
- <packaging>bundle</packaging>
- <name>DEPRECATED: Struts 2 OSGi Demo Bundle - since 6.0.0</name>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.struts</groupId>
- <artifactId>struts2-velocity-plugin</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.apache.commons</groupId>
- <artifactId>commons-digester3</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.apache.struts</groupId>
- <artifactId>struts2-convention-plugin</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.apache.struts</groupId>
- <artifactId>struts2-osgi-plugin</artifactId>
- </dependency>
-
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <extensions>true</extensions>
- <configuration>
- <instructions>
- <manifestLocation>META-INF</manifestLocation>
- <Import-Package>*</Import-Package>
- <Spring-Context>*;create-asynchronously:=false</Spring-Context>
- <Struts2-Enabled>true</Struts2-Enabled>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
- <properties>
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- </properties>
-</project>
diff --git a/bundles/demo/src/main/java/actions/osgi/BundlesAction.java b/bundles/demo/src/main/java/actions/osgi/BundlesAction.java
deleted file mode 100644
index 9c5464fcb..000000000
--- a/bundles/demo/src/main/java/actions/osgi/BundlesAction.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * $Id$
- *
- * 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.
- */
-package actions.osgi;
-
-import com.opensymphony.xwork2.ActionSupport;
-import org.apache.struts2.convention.annotation.ResultPath;
-import org.apache.struts2.osgi.action.BundleContextAware;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-
-/**
- * This action shows how to interact with the OSGi container, using the OSGi interceptor
- */
-@ResultPath("/content")
-public class BundlesAction extends ActionSupport implements BundleContextAware {
- private BundleContext bundleContext;
-
- public void withBundleContext(BundleContext bundleContext) {
- this.bundleContext = bundleContext;
- }
-
- public Bundle[] getBundles() {
- return bundleContext.getBundles();
- }
-}
diff --git a/bundles/demo/src/main/java/actions/osgi/HelloWorldAction.java b/bundles/demo/src/main/java/actions/osgi/HelloWorldAction.java
deleted file mode 100644
index dad0c25a7..000000000
--- a/bundles/demo/src/main/java/actions/osgi/HelloWorldAction.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * $Id$
- *
- * 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.
- */
-package actions.osgi;
-
-import com.opensymphony.xwork2.ActionSupport;
-import org.apache.struts2.convention.annotation.Action;
-import org.apache.struts2.convention.annotation.Actions;
-import org.apache.struts2.convention.annotation.Namespace;
-import org.apache.struts2.convention.annotation.Result;
-import org.apache.struts2.convention.annotation.ResultPath;
-
-@Namespace("/osgi")
-@ResultPath("/content/osgi")
-public class HelloWorldAction extends ActionSupport {
- private Message message = new Message("Default non-null message");
-
- @Override
- @Actions({
- @Action(value="hello-convention", results={@Result(name="success", type="freemarker", location="/content/osgi/hello-convention.ftl")}),
- @Action(value="/osgi/hello-convention", results={@Result(name="success", type="freemarker", location="/content/osgi/hello-convention.ftl")})
- })
- public String execute() {
- return SUCCESS;
- }
-
- public Message getMessage() {
- return message;
- }
-
- public void setMessage(Message message) {
- this.message = message;
- }
-
- public String getSimpleMessage() {
- return "Hello!!!";
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder("{message:");
- sb.append(message != null ? message.getText() : "null");
- sb.append("}");
- return sb.toString();
- }
-}
\ No newline at end of file
diff --git a/bundles/demo/src/main/java/actions/osgi/Message.java b/bundles/demo/src/main/java/actions/osgi/Message.java
deleted file mode 100644
index eb31f2948..000000000
--- a/bundles/demo/src/main/java/actions/osgi/Message.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * $Id$
- *
- * 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.
- */
-package actions.osgi;
-
-public class Message {
- private String text;
-
- public Message(String text) {
- this.text = text;
- }
-
- public String getText() {
- return text;
- }
-
- public void setText(String text) {
- this.text = text;
- }
-}
diff --git a/bundles/demo/src/main/resources/META-INF/spring/applicationContext.xml b/bundles/demo/src/main/resources/META-INF/spring/applicationContext.xml
deleted file mode 100644
index 38cd7bf7a..000000000
--- a/bundles/demo/src/main/resources/META-INF/spring/applicationContext.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-/*
- * 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.
- */
--->
-<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
-
- <bean class="actions.osgi.Message" id="message">
- <constructor-arg type="java.lang.String" value="Welcome to the OSGi plugin. You can checkout any time you like, but can never leave"/>
- </bean>
-
- <bean class="actions.osgi.HelloWorldAction" id="helloWorldAction" scope="prototype">
- <property name="message" ref="message" />
- </bean>
-</beans>
-
diff --git a/bundles/demo/src/main/resources/content/osgi/bundles.ftl b/bundles/demo/src/main/resources/content/osgi/bundles.ftl
deleted file mode 100644
index 7b2006efb..000000000
--- a/bundles/demo/src/main/resources/content/osgi/bundles.ftl
+++ /dev/null
@@ -1,38 +0,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.
- */
--->
-<html>
- <head>
- <title>OSGi integration</title>
- </head>
- <body>
- This action was mapped by <b>Convention</b>, and shows how to get access to the <b>BundleContext</b>
- and registered services
- <br />
- Spring Application Contexts: ${applicationContextsCount!}
- <br>
- Bundles List:
- <ul>
- <#list bundles as bundle>
- <li>${bundle.symbolicName!}</li>
- </#list>
- </ul>
- </body>
-</html>
\ No newline at end of file
diff --git a/bundles/demo/src/main/resources/content/osgi/hello-convention.ftl b/bundles/demo/src/main/resources/content/osgi/hello-convention.ftl
deleted file mode 100644
index 7dde413ce..000000000
--- a/bundles/demo/src/main/resources/content/osgi/hello-convention.ftl
+++ /dev/null
@@ -1,30 +0,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.
- */
--->
-<html>
- <head>
- <title>Action mapped by the Convention plugin</title>
- </head>
- <body>
- This is an action mapped by the Convention plugin, using a FreeMarker result.
- <br />
- Message from Action: ${simpleMessage}
- </body>
-</html>
\ No newline at end of file
diff --git a/bundles/demo/src/main/resources/content/osgi/hello.ftl b/bundles/demo/src/main/resources/content/osgi/hello.ftl
deleted file mode 100644
index 1d81dc076..000000000
--- a/bundles/demo/src/main/resources/content/osgi/hello.ftl
+++ /dev/null
@@ -1,30 +0,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.
- */
--->
-<html>
- <head>
- <title>Action mapped by the XML configuration</title>
- </head>
- <body>
- This is an action mapped by XML configuration, using a <b>FreeMarker</b> result.
- <br />
- Message from Action: ${message.text}
- </body>
-</html>
\ No newline at end of file
diff --git a/bundles/demo/src/main/resources/content/osgi/hello.vm b/bundles/demo/src/main/resources/content/osgi/hello.vm
deleted file mode 100644
index 55d05774a..000000000
--- a/bundles/demo/src/main/resources/content/osgi/hello.vm
+++ /dev/null
@@ -1,28 +0,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.
-*#
-<html>
- <head>
- <title>Action mapped by the XML configuration</title>
- </head>
- <body>
- This is an action mapped by XML configuration, using a <b>Velocity</b> result.
- <br />
- Message from Action: $message.text
- </body>
-</html>
\ No newline at end of file
diff --git a/bundles/demo/src/main/resources/content/osgi/home.ftl b/bundles/demo/src/main/resources/content/osgi/home.ftl
deleted file mode 100644
index b6645fd52..000000000
--- a/bundles/demo/src/main/resources/content/osgi/home.ftl
+++ /dev/null
@@ -1,34 +0,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.
- */
--->
-<html>
- <head>
- <title>OSGi Demo Bundle</title>
- </head>
- <body>
- This demo contains actions that will be packaged into an OSGi bundle and loaded by the Struts 2 OSGi plugin.
- <br />
- <ul>
- <li><@s.a namespace="/osgi" action="hello-convention">Action mapped by the Convention plugin, with FreeMarker result</...@s.a></li>
- <li><@s.a namespace="/osgi" action="hello-freemarker">Action mapped by XML, with FreeMarker result</...@s.a></li>
- <li><@s.a namespace="/osgi" action="hello-velocity">Action mapped by XML, with Velocity result</...@s.a></li>
- </ul>
- </body>
-</html>
\ No newline at end of file
diff --git a/bundles/demo/src/main/resources/struts.xml b/bundles/demo/src/main/resources/struts.xml
deleted file mode 100644
index 2c9baf948..000000000
--- a/bundles/demo/src/main/resources/struts.xml
+++ /dev/null
@@ -1,55 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!--
-/*
- * 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.
- */
--->
-<!DOCTYPE struts PUBLIC
- "-//Apache Software Foundation//DTD Struts Configuration 6.0//EN"
- "https://struts.apache.org/dtds/struts-6.0.dtd">
-
-<struts>
- <!-- Set some Struts 2 constants relevant to the OSGi Plugin.
- Note: The constant definitions specified here (within the demo bundle) may also need to be
- duplicated in the struts.xml configuration of the outer project that packages the demo
- bundle JAR file within it.
- -->
- <constant name="struts.objectFactory" value="osgi" />
- <constant name="struts.objectFactory.delegate" value="struts" />
- <constant name="struts.freemarker.manager.classname" value="org.apache.struts2.osgi.BundleFreemarkerManager" />
- <constant name="struts.velocity.manager.classname" value="org.apache.struts2.osgi.VelocityBundleResourceLoader" />
- <constant name="struts.staticContentLoader" value="org.apache.struts2.osgi.loaders.StaticContentBundleResourceLoader" />
-
- <package name="bundle-demo" namespace="/osgi" extends="osgi-default, velocity-default" strict-method-invocation="true">
-
- <default-action-ref name="home" />
-
- <action name="hello-velocity" class="actions.osgi.HelloWorldAction">
- <result type="velocity">/content/osgi/hello.vm</result>
- </action>
-
- <action name="hello-freemarker" class="actions.osgi.HelloWorldAction">
- <result type="freemarker">/content/osgi/hello.ftl</result>
- </action>
-
- <action name="home" class="actions.osgi.HelloWorldAction">
- <result type="freemarker">/content/osgi/home.ftl</result>
- </action>
-
- </package>
-</struts>
diff --git a/bundles/pom.xml b/bundles/pom.xml
deleted file mode 100755
index 2b5a6811f..000000000
--- a/bundles/pom.xml
+++ /dev/null
@@ -1,83 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-/*
- * 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.
- */
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.struts</groupId>
- <artifactId>struts2-parent</artifactId>
- <version>7.0.0-SNAPSHOT</version>
- </parent>
-
- <artifactId>struts2-osgi-bundles</artifactId>
- <packaging>pom</packaging>
- <name>DEPRECATED: Struts 2 OSGi Bundles - since 6.0.0</name>
-
- <modules>
- <module>admin</module>
- <module>demo</module>
- </modules>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.struts</groupId>
- <artifactId>struts2-core</artifactId>
- </dependency>
-
- <!-- Test dependencies -->
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>compile</scope>
- </dependency>
-
-
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>javax.servlet-api</artifactId>
- <scope>provided</scope>
- </dependency>
-
- </dependencies>
-
- <reporting>
- <plugins>
- <plugin>
- <groupId>org.apache.rat</groupId>
- <artifactId>apache-rat-plugin</artifactId>
- <configuration>
- <includes>
- <include>pom.xml</include>
- <include>src/**</include>
- </includes>
- <excludes>
- <exclude>src/main/resources/*LICENSE.txt</exclude>
- </excludes>
- </configuration>
- </plugin>
- </plugins>
- </reporting>
-
- <properties>
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- </properties>
-</project>
diff --git a/plugins/embeddedjsp/README.md b/plugins/embeddedjsp/README.md
deleted file mode 100644
index 7064762e2..000000000
--- a/plugins/embeddedjsp/README.md
+++ /dev/null
@@ -1,2 +0,0 @@
-# Struts 2 EmbeddedJSP plugin
-This plugin is deprecated and it will be removed soon, **please do not use it**!
diff --git a/plugins/embeddedjsp/pom.xml b/plugins/embeddedjsp/pom.xml
deleted file mode 100644
index 656d9c446..000000000
--- a/plugins/embeddedjsp/pom.xml
+++ /dev/null
@@ -1,102 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-/*
- * 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.
- */
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.struts</groupId>
- <artifactId>struts2-plugins</artifactId>
- <version>7.0.0-SNAPSHOT</version>
- </parent>
-
- <artifactId>struts2-embeddedjsp-plugin</artifactId>
- <packaging>jar</packaging>
- <name>DEPRECATED: Struts 2 Embedded JSP Plugin, since 6.0.0</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.struts</groupId>
- <artifactId>struts2-velocity-plugin</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-test</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-core</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-web</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.easymock</groupId>
- <artifactId>easymock</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>taglibs</groupId>
- <artifactId>request</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.tomcat</groupId>
- <artifactId>tomcat-juli</artifactId>
- </dependency>
- <dependency>
- <groupId>taglibs</groupId>
- <artifactId>standard</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>jstl</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.tomcat</groupId>
- <artifactId>tomcat-jasper</artifactId>
- <scope>provided</scope>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <argLine>@{argLine}</argLine>
- <additionalClasspathElements>
- <element>${project.build.testOutputDirectory}/jsps.jar</element>
- </additionalClasspathElements>
- </configuration>
- </plugin>
- </plugins>
- </build>
- <properties>
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- </properties>
-</project>
diff --git a/plugins/embeddedjsp/src/main/java/org/apache/struts2/EmbeddedJSPResult.java b/plugins/embeddedjsp/src/main/java/org/apache/struts2/EmbeddedJSPResult.java
deleted file mode 100644
index a3afce46b..000000000
--- a/plugins/embeddedjsp/src/main/java/org/apache/struts2/EmbeddedJSPResult.java
+++ /dev/null
@@ -1,32 +0,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.
- */
-package org.apache.struts2;
-
-import com.opensymphony.xwork2.ActionInvocation;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.struts2.result.StrutsResultSupport;
-
-/**
- * Can render jsps from the classpath. "includes" in the jsps must not use relative paths
- */
-public class EmbeddedJSPResult extends StrutsResultSupport {
- protected void doExecute(String finalLocation, ActionInvocation invocation) throws Exception {
- JSPRuntime.handle(StringUtils.removeStart(finalLocation, "/"));
- }
-}
diff --git a/plugins/embeddedjsp/src/main/java/org/apache/struts2/JSPLoader.java b/plugins/embeddedjsp/src/main/java/org/apache/struts2/JSPLoader.java
deleted file mode 100644
index 57c19fba9..000000000
--- a/plugins/embeddedjsp/src/main/java/org/apache/struts2/JSPLoader.java
+++ /dev/null
@@ -1,271 +0,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.
- */
-package org.apache.struts2;
-
-import com.opensymphony.xwork2.FileManager;
-import com.opensymphony.xwork2.FileManagerFactory;
-import com.opensymphony.xwork2.util.finder.ClassLoaderInterface;
-import com.opensymphony.xwork2.util.finder.ClassLoaderInterfaceDelegate;
-import com.opensymphony.xwork2.util.finder.UrlSet;
-import com.opensymphony.xwork2.util.fs.DefaultFileManager;
-import com.opensymphony.xwork2.util.fs.DefaultFileManagerFactory;
-import org.apache.logging.log4j.Logger;
-import org.apache.logging.log4j.LogManager;
-import org.apache.commons.io.FileUtils;
-import org.apache.commons.lang3.ObjectUtils;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.struts2.compiler.MemoryClassLoader;
-import org.apache.struts2.compiler.MemoryJavaFileObject;
-import org.apache.struts2.jasper.JasperException;
-import org.apache.struts2.jasper.JspC;
-
-import javax.servlet.Servlet;
-import javax.servlet.ServletContext;
-import javax.servlet.ServletException;
-import javax.servlet.jsp.JspPage;
-import javax.tools.DiagnosticCollector;
-import javax.tools.FileObject;
-import javax.tools.ForwardingJavaFileManager;
-import javax.tools.JavaCompiler;
-import javax.tools.JavaFileManager;
-import javax.tools.JavaFileObject;
-import javax.tools.SimpleJavaFileObject;
-import javax.tools.StandardJavaFileManager;
-import javax.tools.ToolProvider;
-import java.io.File;
-import java.io.IOException;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.security.CodeSource;
-import java.security.ProtectionDomain;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- * Uses jasper to extract a JSP from the classpath to a file and compile it. The classpath used for
- * compilation is built by finding all the jar files using the current class loader (Thread), plus
- * directories.
- */
-public class JSPLoader {
- private static final Logger LOG = LogManager.getLogger(JSPLoader.class);
-
- private static MemoryClassLoader classLoader = new MemoryClassLoader();
- private static final String DEFAULT_PACKAGE = "org.apache.struts2.jsp";
-
- private static final Pattern PACKAGE_PATTERN = Pattern.compile("package (.*?);");
- private static final Pattern CLASS_PATTERN = Pattern.compile("public final class (.*?) ");
-
- public Servlet load(String location) throws Exception {
- location = StringUtils.substringBeforeLast(location, "?");
-
- LOG.debug("Compiling JSP [{}]", location);
-
- //use Jasper to compile the JSP into java code
- JspC jspC = compileJSP(location);
- String source = jspC.getSourceCode();
-
- //System.out.print(source);
-
- String className = extractClassName(source);
-
- //use Java Compiler API to compile the java code into a class
- //the tlds that were discovered are added (their jars) to the classpath
- compileJava(className, source, jspC.getTldAbsolutePaths());
-
- //load the class that was just built
- Class clazz = Class.forName(className, false, classLoader);
- return createServlet(clazz);
- }
-
- private String extractClassName(String source) {
- Matcher matcher = PACKAGE_PATTERN.matcher(source);
- matcher.find();
- String packageName = matcher.group(1);
-
- matcher = CLASS_PATTERN.matcher(source);
- matcher.find();
- String className = matcher.group(1);
-
- return packageName + "." + className;
- }
-
- /**
- * Creates and inits a servlet
- */
- private Servlet createServlet(Class clazz) throws IllegalAccessException, InstantiationException, ServletException {
- JSPServletConfig config = new JSPServletConfig(ServletActionContext.getServletContext());
-
- Servlet servlet = (Servlet) clazz.newInstance();
- servlet.init(config);
-
- /*
- there is no need to call JspPage.init explicitly because Jasper's
- JSP base classe HttpJspBase.init(ServletConfig) calls:
- jspInit();
- _jspInit();
- */
-
- return servlet;
- }
-
- /**
- * Compiles the given source code into java bytecode
- */
- private void compileJava(String className, final String source, Set<String> extraClassPath) throws IOException {
- LOG.trace("Compiling [{}], source: [{}]", className, source);
-
- JavaCompiler compiler =ToolProvider.getSystemJavaCompiler();
- DiagnosticCollector<JavaFileObject> diagnostics = new DiagnosticCollector<JavaFileObject>();
-
- //the generated bytecode is fed to the class loader
- JavaFileManager jfm = new
- ForwardingJavaFileManager<StandardJavaFileManager>(
- compiler.getStandardFileManager(diagnostics, null, null)) {
-
- @Override
- public JavaFileObject getJavaFileForOutput(Location location,
- String name,
- JavaFileObject.Kind kind,
- FileObject sibling) throws IOException {
- MemoryJavaFileObject fileObject = new MemoryJavaFileObject(name, kind);
- classLoader.addMemoryJavaFileObject(name, fileObject);
- return fileObject;
- }
- };
-
- //read java source code from memory
- String fileName = className.replace('.', '/') + ".java";
- SimpleJavaFileObject sourceCodeObject = new SimpleJavaFileObject(toURI(fileName), JavaFileObject.Kind.SOURCE) {
- @Override
- public CharSequence getCharContent(boolean
- ignoreEncodingErrors)
- throws IOException, IllegalStateException,
- UnsupportedOperationException {
- return source;
- }
-
- };
-
- //build classpath
- //some entries will be added multiple times, hence the set
- List<String> optionList = new ArrayList<String>();
- Set<String> classPath = new HashSet<String>();
-
- //find available jars
- ClassLoaderInterface classLoaderInterface = getClassLoaderInterface();
- UrlSet urlSet = new UrlSet(classLoaderInterface);
-
- //find jars
- List<URL> urls = urlSet.getUrls();
-
- if (urls != null && urls.size() > 0) {
- final FileManagerFactory fileManagerFactoryGetInstance = ServletActionContext.getActionContext().getInstance(FileManagerFactory.class);
- final FileManagerFactory contextFileManagerFactory = (fileManagerFactoryGetInstance != null ? fileManagerFactoryGetInstance : (FileManagerFactory) ServletActionContext.getActionContext().get(StrutsConstants.STRUTS_FILE_MANAGER_FACTORY));
- final FileManagerFactory fileManagerFactory = (contextFileManagerFactory != null ? contextFileManagerFactory : new DefaultFileManagerFactory());
- final FileManager fileManagerGetInstance = fileManagerFactory.getFileManager();
- final FileManager contextFileManager = (fileManagerGetInstance != null ? fileManagerGetInstance : (FileManager) ServletActionContext.getActionContext().get(StrutsConstants.STRUTS_FILE_MANAGER));
- final FileManager fileManager = (contextFileManager != null ? contextFileManager : new DefaultFileManager());
- for (URL url : urls) {
- URL normalizedUrl = fileManager.normalizeToFileProtocol(url);
- File file = FileUtils.toFile(ObjectUtils.defaultIfNull(normalizedUrl, url));
- if (file.exists())
- classPath.add(file.getAbsolutePath());
- }
- }
-
- //these should be in the list already, but I am feeling paranoid
- //this jar
- classPath.add(getJarUrl(EmbeddedJSPResult.class));
- //servlet api
- classPath.add(getJarUrl(Servlet.class));
- //jsp api
- classPath.add(getJarUrl(JspPage.class));
-
- try {
- Class instanceManager = Class.forName("org.apache.tomcat.InstanceManager");
- classPath.add(getJarUrl(instanceManager));
- } catch (ClassNotFoundException e) {
- //ok ignore
- }
-
- //add extra classpath entries (jars where tlds were found will be here)
- for (Iterator<String> iterator = extraClassPath.iterator(); iterator.hasNext();) {
- String entry = iterator.next();
- classPath.add(entry);
- }
-
- String classPathString = StringUtils.join(classPath, File.pathSeparator);
- if (LOG.isDebugEnabled()) {
- LOG.debug("Compiling [#0] with classpath [#1]", className, classPathString);
- }
-
- optionList.addAll(Arrays.asList("-classpath", classPathString));
-
- //compile
- JavaCompiler.CompilationTask task = compiler.getTask(
- null, jfm, diagnostics, optionList, null,
- Arrays.asList(sourceCodeObject));
-
- if (!task.call()) {
- throw new StrutsException("Compilation failed:" + diagnostics.getDiagnostics().get(0).toString());
- }
- }
-
- protected String getJarUrl(Class clazz) {
- ProtectionDomain protectionDomain = clazz.getProtectionDomain();
- CodeSource codeSource = protectionDomain.getCodeSource();
- URL loc = codeSource.getLocation();
- File file = FileUtils.toFile(loc);
- return file.getAbsolutePath();
- }
-
- private JspC compileJSP(String location) throws JasperException {
- JspC jspC = new JspC();
- jspC.setClassLoaderInterface(getClassLoaderInterface());
- jspC.setCompile(false);
- jspC.setJspFiles(location);
- jspC.setPackage(DEFAULT_PACKAGE);
- jspC.execute();
- return jspC;
- }
-
- private ClassLoaderInterface getClassLoaderInterface() {
- ClassLoaderInterface classLoaderInterface = null;
- ServletContext ctx = ServletActionContext.getServletContext();
- if (ctx != null)
- classLoaderInterface = (ClassLoaderInterface) ctx.getAttribute(ClassLoaderInterface.CLASS_LOADER_INTERFACE);
-
- return (ClassLoaderInterface) ObjectUtils.defaultIfNull(classLoaderInterface, new ClassLoaderInterfaceDelegate(JSPLoader.class.getClassLoader()));
- }
-
- private static URI toURI(String name) {
- try {
- return new URI(name);
- } catch (URISyntaxException e) {
- throw new RuntimeException(e);
- }
- }
-}
diff --git a/plugins/embeddedjsp/src/main/java/org/apache/struts2/JSPRuntime.java b/plugins/embeddedjsp/src/main/java/org/apache/struts2/JSPRuntime.java
deleted file mode 100644
index d9425bbb6..000000000
--- a/plugins/embeddedjsp/src/main/java/org/apache/struts2/JSPRuntime.java
+++ /dev/null
@@ -1,79 +0,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.
- */
-package org.apache.struts2;
-
-import com.opensymphony.xwork2.ActionContext;
-import org.apache.struts2.dispatcher.Parameter;
-import org.apache.struts2.url.QueryStringParser;
-
-import javax.servlet.Servlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.jsp.HttpJspPage;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * Maintains a cache of jsp locations -> servlet instances for those jsps. When a jsp is requested
- * from the cache, the cache will block if the jsp was not compiled already, and wait for the compilation
- */
-public abstract class JSPRuntime {
- //maps from jsp path -> pagelet
- protected static final ServletCache servletCache = new ServletCache();
-
- public static void clearCache() {
- servletCache.clear();
- }
-
- public static void handle(String location) throws Exception {
- handle(location, false);
- }
-
- public static void handle(String location, boolean flush) throws Exception {
- final HttpServletResponse response = ServletActionContext.getResponse();
- final HttpServletRequest request = ServletActionContext.getRequest();
-
- int i = location.indexOf("?");
- if (i > 0) {
- //extract params from the url and add them to the request
- ActionContext actionContext = ServletActionContext.getActionContext();
- if (actionContext == null) {
- throw new StrutsException("Running out of action context!");
- }
- final QueryStringParser parser = actionContext.getInstance(QueryStringParser.class);
- String query = location.substring(i + 1);
- Map<String, Object> queryParams = parser.parse(query, true);
- if (queryParams != null && !queryParams.isEmpty()) {
- Map<String, Parameter> newParams = new HashMap<>();
- for (Map.Entry<String, Object> entry : queryParams.entrySet()) {
- newParams.put(entry.getKey(), new Parameter.Request(entry.getKey(), entry.getValue()));
- }
- ActionContext.getContext().getParameters().appendAll(newParams);
- }
- location = location.substring(0, i);
- }
-
- Servlet servlet = servletCache.get(location);
- HttpJspPage page = (HttpJspPage) servlet;
-
- page._jspService(request, response);
- if (flush)
- response.flushBuffer();
- }
-}
diff --git a/plugins/embeddedjsp/src/main/java/org/apache/struts2/JSPServletConfig.java b/plugins/embeddedjsp/src/main/java/org/apache/struts2/JSPServletConfig.java
deleted file mode 100644
index 35abe2b1a..000000000
--- a/plugins/embeddedjsp/src/main/java/org/apache/struts2/JSPServletConfig.java
+++ /dev/null
@@ -1,53 +0,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.
- */
-package org.apache.struts2;
-
-import javax.servlet.ServletConfig;
-import javax.servlet.ServletContext;
-import java.util.Collections;
-import java.util.Enumeration;
-
-/**
- * Used to init the servlets for the jsps
- */
-public class JSPServletConfig implements ServletConfig {
- private final Enumeration EMPTY_ENUMERATION = Collections.enumeration(Collections.EMPTY_LIST);
-
- private ServletContext servletContext;
-
- public JSPServletConfig(ServletContext servletContext) {
- this.servletContext = servletContext;
- }
-
- public String getInitParameter(String name) {
- return null;
- }
-
- public Enumeration getInitParameterNames() {
- return EMPTY_ENUMERATION;
- }
-
- public ServletContext getServletContext() {
- return servletContext;
- }
-
- public String getServletName() {
- return null;
- }
-}
diff --git a/plugins/embeddedjsp/src/main/java/org/apache/struts2/ServletCache.java b/plugins/embeddedjsp/src/main/java/org/apache/struts2/ServletCache.java
deleted file mode 100644
index 15f59fb61..000000000
--- a/plugins/embeddedjsp/src/main/java/org/apache/struts2/ServletCache.java
+++ /dev/null
@@ -1,74 +0,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.
- */
-package org.apache.struts2;
-
-import javax.servlet.Servlet;
-import java.util.concurrent.*;
-
-/**
- * Caches servlet instances by jsp location. If a requested jsp is not in the cache, "get"
- * will block and wait for the jsp to be loaded
- */
-public class ServletCache {
- protected final ConcurrentMap<String, Future<Servlet>> cache
- = new ConcurrentHashMap<String, Future<Servlet>>();
-
- private final JSPLoader jspLoader = new JSPLoader();
-
- public void clear() {
- cache.clear();
- }
-
- public Servlet get(final String location) throws InterruptedException {
- while (true) {
- Future<Servlet> future = cache.get(location);
- if (future == null) {
- Callable<Servlet> loadJSPCallable = new Callable<Servlet>() {
- public Servlet call() throws Exception {
- return jspLoader.load(location);
- }
- };
- FutureTask<Servlet> futureTask = new FutureTask<Servlet>(loadJSPCallable);
- future = cache.putIfAbsent(location, futureTask);
- if (future == null) {
- future = futureTask;
- futureTask.run();
- }
- }
- try {
- return future.get();
- } catch (CancellationException e) {
- cache.remove(location, future);
- } catch (ExecutionException e) {
- throw launderThrowable(e.getCause());
- }
- }
- }
-
- public static RuntimeException launderThrowable(Throwable t) {
- if (t instanceof RuntimeException)
- return (RuntimeException) t;
- else if (t instanceof Error)
- throw (Error) t;
- else
- throw new IllegalStateException(t);
- }
-
-}
-
diff --git a/plugins/embeddedjsp/src/main/java/org/apache/struts2/compiler/MemoryClassLoader.java b/plugins/embeddedjsp/src/main/java/org/apache/struts2/compiler/MemoryClassLoader.java
deleted file mode 100644
index 06c52300d..000000000
--- a/plugins/embeddedjsp/src/main/java/org/apache/struts2/compiler/MemoryClassLoader.java
+++ /dev/null
@@ -1,52 +0,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.
- */
-package org.apache.struts2.compiler;
-
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-
-/**
- * Keeps a cache of class name -> MemoryJavaFileObject. If the requested class name is in the cache
- * a new class is defined for it, otherwise findClass delegates to the parent class loader
- */
-public class MemoryClassLoader extends ClassLoader {
- private Map<String, MemoryJavaFileObject> cachedObjects = new ConcurrentHashMap<>();
-
- public MemoryClassLoader() {
- //without this, the tests will not run, because the tests are loaded by a custom classloader
- //so the classes referenced from the compiled code will not be found by the System Class Loader because
- //the target dir is not part of the classpath used when calling the jvm to execute the tests
- super(Thread.currentThread().getContextClassLoader());
- }
-
- @Override
- protected Class<?> findClass(String name) throws
- ClassNotFoundException {
- MemoryJavaFileObject fileObject = cachedObjects.get(name);
- if (fileObject != null) {
- byte[] bytes = fileObject.toByteArray();
- return defineClass(name, bytes, 0, bytes.length);
- }
- return super.findClass(name);
- }
-
- public void addMemoryJavaFileObject(String jsp, MemoryJavaFileObject memoryJavaFileObject) {
- cachedObjects.put(jsp, memoryJavaFileObject);
- }
-}
diff --git a/plugins/embeddedjsp/src/main/java/org/apache/struts2/compiler/MemoryJavaFileObject.java b/plugins/embeddedjsp/src/main/java/org/apache/struts2/compiler/MemoryJavaFileObject.java
deleted file mode 100644
index b9923c8fb..000000000
--- a/plugins/embeddedjsp/src/main/java/org/apache/struts2/compiler/MemoryJavaFileObject.java
+++ /dev/null
@@ -1,59 +0,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.
- */
-package org.apache.struts2.compiler;
-
-import javax.tools.JavaFileObject;
-import javax.tools.SimpleJavaFileObject;
-import java.io.*;
-import java.net.URI;
-import java.net.URISyntaxException;
-
-/**
- * Captures the output of the java compiler in memory
- */
-public class MemoryJavaFileObject extends SimpleJavaFileObject {
-
- private ByteArrayOutputStream out;
-
- public MemoryJavaFileObject(String name, JavaFileObject.Kind kind) {
- super(toURI(name), kind);
- }
-
- public InputStream openInputStream() throws IOException,
- IllegalStateException, UnsupportedOperationException {
- return new ByteArrayInputStream(out.toByteArray());
- }
-
- public OutputStream openOutputStream() throws IOException,
- IllegalStateException, UnsupportedOperationException {
- return out = new ByteArrayOutputStream();
- }
-
- private static URI toURI(String name) {
- try {
- return new URI(name);
- } catch (URISyntaxException e) {
- throw new RuntimeException(e);
- }
- }
-
- public byte[] toByteArray() {
- return out.toByteArray();
- }
-}
diff --git a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/ExpressionFactoryImpl.java b/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/ExpressionFactoryImpl.java
deleted file mode 100644
index efb9155e1..000000000
--- a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/ExpressionFactoryImpl.java
+++ /dev/null
@@ -1,79 +0,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.
- */
-package org.apache.struts2.el;
-
-import javax.el.ELContext;
-import javax.el.ExpressionFactory;
-import javax.el.MethodExpression;
-import javax.el.ValueExpression;
-
-import org.apache.struts2.el.lang.ELSupport;
-import org.apache.struts2.el.lang.ExpressionBuilder;
-import org.apache.struts2.el.util.MessageFactory;
-
-/**
- * @see javax.el.ExpressionFactory
- *
- * @author Jacob Hookom [jacob@hookom.net]
- * @version $Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author: markt $
- */
-public class ExpressionFactoryImpl extends ExpressionFactory {
-
- /**
- *
- */
- public ExpressionFactoryImpl() {
- super();
- }
-
- public Object coerceToType(Object obj, Class type) {
- return ELSupport.coerceToType(obj, type);
- }
-
- public MethodExpression createMethodExpression(ELContext context,
- String expression, Class<?> expectedReturnType,
- Class<?>[] expectedParamTypes) {
- if (expectedParamTypes == null) {
- throw new NullPointerException(MessageFactory
- .get("error.method.nullParms"));
- }
- ExpressionBuilder builder = new ExpressionBuilder(expression, context);
- return builder.createMethodExpression(expectedReturnType,
- expectedParamTypes);
- }
-
- public ValueExpression createValueExpression(ELContext context,
- String expression, Class expectedType) {
- if (expectedType == null) {
- throw new NullPointerException(MessageFactory
- .get("error.value.expectedType"));
- }
- ExpressionBuilder builder = new ExpressionBuilder(expression, context);
- return builder.createValueExpression(expectedType);
- }
-
- public ValueExpression createValueExpression(Object instance,
- Class expectedType) {
- if (expectedType == null) {
- throw new NullPointerException(MessageFactory
- .get("error.value.expectedType"));
- }
- return new ValueExpressionLiteral(instance, expectedType);
- }
-}
diff --git a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/MethodExpressionImpl.java b/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/MethodExpressionImpl.java
deleted file mode 100644
index ec2617149..000000000
--- a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/MethodExpressionImpl.java
+++ /dev/null
@@ -1,315 +0,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.
- */
-package org.apache.struts2.el;
-
-import java.io.Externalizable;
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-
-import javax.el.ELContext;
-import javax.el.ELException;
-import javax.el.ELResolver;
-import javax.el.Expression;
-import javax.el.ExpressionFactory;
-import javax.el.FunctionMapper;
-import javax.el.MethodExpression;
-import javax.el.MethodInfo;
-import javax.el.MethodNotFoundException;
-import javax.el.PropertyNotFoundException;
-import javax.el.VariableMapper;
-
-import org.apache.struts2.el.lang.EvaluationContext;
-import org.apache.struts2.el.lang.ExpressionBuilder;
-import org.apache.struts2.el.parser.Node;
-import org.apache.struts2.el.util.ReflectionUtil;
-
-/**
- * An <code>Expression</code> that refers to a method on an object.
- *
- * <p>
- * The {@link ExpressionFactory#createMethodExpression} method
- * can be used to parse an expression string and return a concrete instance
- * of <code>MethodExpression</code> that encapsulates the parsed expression.
- * The {@link FunctionMapper} is used at parse time, not evaluation time,
- * so one is not needed to evaluate an expression using this class.
- * However, the {@link ELContext} is needed at evaluation time.</p>
- *
- * <p>The {@link #getMethodInfo} and {@link #invoke} methods will evaluate the
- * expression each time they are called. The {@link ELResolver} in the
- * <code>ELContext</code> is used to resolve the top-level variables and to
- * determine the behavior of the <code>.</code> and <code>[]</code>
- * operators. For any of the two methods, the {@link ELResolver#getValue}
- * method is used to resolve all properties up to but excluding the last
- * one. This provides the <code>base</code> object on which the method
- * appears. If the <code>base</code> object is null, a
- * <code>NullPointerException</code> must be thrown. At the last resolution,
- * the final <code>property</code> is then coerced to a <code>String</code>,
- * which provides the name of the method to be found. A method matching the
- * name and expected parameters provided at parse time is found and it is
- * either queried or invoked (depending on the method called on this
- * <code>MethodExpression</code>).</p>
- *
- * <p>See the notes about comparison, serialization and immutability in
- * the {@link Expression} javadocs.
- *
- * @see javax.el.ELResolver
- * @see javax.el.Expression
- * @see javax.el.ExpressionFactory
- * @see javax.el.MethodExpression
- *
- * @author Jacob Hookom [jacob@hookom.net]
- * @version $Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author: markt $
- */
-public final class MethodExpressionImpl extends MethodExpression implements
- Externalizable {
-
- private Class expectedType;
-
- private String expr;
-
- private FunctionMapper fnMapper;
-
- private VariableMapper varMapper;
-
- private transient Node node;
-
- private Class[] paramTypes;
-
- /**
- *
- */
- public MethodExpressionImpl() {
- super();
- }
-
- /**
- * @param expr expression
- * @param node node
- * @param fnMapper function mapper
- * @param varMapper variable mapper
- * @param expectedType expected type
- * @param paramTypes parameter types array
- */
- public MethodExpressionImpl(String expr, Node node,
- FunctionMapper fnMapper, VariableMapper varMapper,
- Class expectedType, Class[] paramTypes) {
- super();
- this.expr = expr;
- this.node = node;
- this.fnMapper = fnMapper;
- this.varMapper = varMapper;
- this.expectedType = expectedType;
- this.paramTypes = paramTypes;
- }
-
- /**
- * Determines whether the specified object is equal to this
- * <code>Expression</code>.
- *
- * <p>
- * The result is <code>true</code> if and only if the argument is not
- * <code>null</code>, is an <code>Expression</code> object that is the
- * of the same type (<code>ValueExpression</code> or
- * <code>MethodExpression</code>), and has an identical parsed
- * representation.
- * </p>
- *
- * <p>
- * Note that two expressions can be equal if their expression Strings are
- * different. For example, <code>${fn1:foo()}</code> and
- * <code>${fn2:foo()}</code> are equal if their corresponding
- * <code>FunctionMapper</code>s mapped <code>fn1:foo</code> and
- * <code>fn2:foo</code> to the same method.
- * </p>
- *
- * @param obj
- * the <code>Object</code> to test for equality.
- * @return <code>true</code> if <code>obj</code> equals this
- * <code>Expression</code>; <code>false</code> otherwise.
- * @see java.util.Hashtable
- * @see java.lang.Object#equals(java.lang.Object)
- */
- public boolean equals(Object obj) {
- return (obj instanceof MethodExpressionImpl && obj.hashCode() == this
- .hashCode());
- }
-
- /**
- * Returns the original String used to create this <code>Expression</code>,
- * unmodified.
- *
- * <p>
- * This is used for debugging purposes but also for the purposes of
- * comparison (e.g. to ensure the expression in a configuration file has not
- * changed).
- * </p>
- *
- * <p>
- * This method does not provide sufficient information to re-create an
- * expression. Two different expressions can have exactly the same
- * expression string but different function mappings. Serialization should
- * be used to save and restore the state of an <code>Expression</code>.
- * </p>
- *
- * @return The original expression String.
- *
- * @see javax.el.Expression#getExpressionString()
- */
- public String getExpressionString() {
- return this.expr;
- }
-
- /**
- * Evaluates the expression relative to the provided context, and returns
- * information about the actual referenced method.
- *
- * @param context
- * The context of this evaluation
- * @return an instance of <code>MethodInfo</code> containing information
- * about the method the expression evaluated to.
- * @throws NullPointerException
- * if context is <code>null</code> or the base object is
- * <code>null</code> on the last resolution.
- * @throws PropertyNotFoundException
- * if one of the property resolutions failed because a specified
- * variable or property does not exist or is not readable.
- * @throws MethodNotFoundException
- * if no suitable method can be found.
- * @throws ELException
- * if an exception was thrown while performing property or
- * variable resolution. The thrown exception must be included as
- * the cause property of this exception, if available.
- * @see javax.el.MethodExpression#getMethodInfo(javax.el.ELContext)
- */
- public MethodInfo getMethodInfo(ELContext context)
- throws PropertyNotFoundException, MethodNotFoundException,
- ELException {
- Node n = this.getNode();
- EvaluationContext ctx = new EvaluationContext(context, this.fnMapper,
- this.varMapper);
- return n.getMethodInfo(ctx, this.paramTypes);
- }
-
- /**
- * @return
- * @throws ELException
- */
- private Node getNode() throws ELException {
- if (this.node == null) {
- this.node = ExpressionBuilder.createNode(this.expr);
- }
- return this.node;
- }
-
- /**
- * Returns the hash code for this <code>Expression</code>.
- *
- * <p>
- * See the note in the {@link #equals} method on how two expressions can be
- * equal if their expression Strings are different. Recall that if two
- * objects are equal according to the <code>equals(Object)</code> method,
- * then calling the <code>hashCode</code> method on each of the two
- * objects must produce the same integer result. Implementations must take
- * special note and implement <code>hashCode</code> correctly.
- * </p>
- *
- * @return The hash code for this <code>Expression</code>.
- * @see #equals
- * @see java.util.Hashtable
- * @see java.lang.Object#hashCode()
- */
- public int hashCode() {
- return this.expr.hashCode();
- }
-
- /**
- * Evaluates the expression relative to the provided context, invokes the
- * method that was found using the supplied parameters, and returns the
- * result of the method invocation.
- *
- * @param context
- * The context of this evaluation.
- * @param params
- * The parameters to pass to the method, or <code>null</code>
- * if no parameters.
- * @return the result of the method invocation (<code>null</code> if the
- * method has a <code>void</code> return type).
- * @throws NullPointerException
- * if context is <code>null</code> or the base object is
- * <code>null</code> on the last resolution.
- * @throws PropertyNotFoundException
- * if one of the property resolutions failed because a specified
- * variable or property does not exist or is not readable.
- * @throws MethodNotFoundException
- * if no suitable method can be found.
- * @throws ELException
- * if an exception was thrown while performing property or
- * variable resolution. The thrown exception must be included as
- * the cause property of this exception, if available. If the
- * exception thrown is an <code>InvocationTargetException</code>,
- * extract its <code>cause</code> and pass it to the
- * <code>ELException</code> constructor.
- * @see javax.el.MethodExpression#invoke(javax.el.ELContext,
- * java.lang.Object[])
- */
- public Object invoke(ELContext context, Object[] params)
- throws PropertyNotFoundException, MethodNotFoundException,
- ELException {
- EvaluationContext ctx = new EvaluationContext(context, this.fnMapper,
- this.varMapper);
- return this.getNode().invoke(ctx, this.paramTypes, params);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.io.Externalizable#readExternal(java.io.ObjectInput)
- */
- public void readExternal(ObjectInput in) throws IOException,
- ClassNotFoundException {
- this.expr = in.readUTF();
- String type = in.readUTF();
- if (!"".equals(type)) {
- this.expectedType = ReflectionUtil.forName(type);
- }
- this.paramTypes = ReflectionUtil.toTypeArray(((String[]) in
- .readObject()));
- this.fnMapper = (FunctionMapper) in.readObject();
- this.varMapper = (VariableMapper) in.readObject();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.io.Externalizable#writeExternal(java.io.ObjectOutput)
- */
- public void writeExternal(ObjectOutput out) throws IOException {
- out.writeUTF(this.expr);
- out.writeUTF((this.expectedType != null) ? this.expectedType.getName()
- : "");
- out.writeObject(ReflectionUtil.toTypeNameArray(this.paramTypes));
- out.writeObject(this.fnMapper);
- out.writeObject(this.varMapper);
- }
-
- public boolean isLiteralText() {
- return false;
- }
-}
diff --git a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/MethodExpressionLiteral.java b/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/MethodExpressionLiteral.java
deleted file mode 100644
index 83f24d68c..000000000
--- a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/MethodExpressionLiteral.java
+++ /dev/null
@@ -1,96 +0,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.
- */
-package org.apache.struts2.el;
-
-import java.io.Externalizable;
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-
-import javax.el.ELContext;
-import javax.el.ELException;
-import javax.el.MethodExpression;
-import javax.el.MethodInfo;
-
-import org.apache.struts2.el.lang.ELSupport;
-import org.apache.struts2.el.util.ReflectionUtil;
-
-public class MethodExpressionLiteral extends MethodExpression implements Externalizable {
-
- private Class expectedType;
-
- private String expr;
-
- private Class[] paramTypes;
-
- public MethodExpressionLiteral() {
- // do nothing
- }
-
- public MethodExpressionLiteral(String expr, Class expectedType, Class[] paramTypes) {
- this.expr = expr;
- this.expectedType = expectedType;
- this.paramTypes = paramTypes;
- }
-
- public MethodInfo getMethodInfo(ELContext context) throws ELException {
- return new MethodInfo(this.expr, this.expectedType, this.paramTypes);
- }
-
- public Object invoke(ELContext context, Object[] params) throws ELException {
- if (this.expectedType != null) {
- return ELSupport.coerceToType(this.expr, this.expectedType);
- } else {
- return this.expr;
- }
- }
-
- public String getExpressionString() {
- return this.expr;
- }
-
- public boolean equals(Object obj) {
- return (obj instanceof MethodExpressionLiteral && this.hashCode() == obj.hashCode());
- }
-
- public int hashCode() {
- return this.expr.hashCode();
- }
-
- public boolean isLiteralText() {
- return true;
- }
-
- public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
- this.expr = in.readUTF();
- String type = in.readUTF();
- if (!"".equals(type)) {
- this.expectedType = ReflectionUtil.forName(type);
- }
- this.paramTypes = ReflectionUtil.toTypeArray(((String[]) in
- .readObject()));
- }
-
- public void writeExternal(ObjectOutput out) throws IOException {
- out.writeUTF(this.expr);
- out.writeUTF((this.expectedType != null) ? this.expectedType.getName()
- : "");
- out.writeObject(ReflectionUtil.toTypeNameArray(this.paramTypes));
- }
-}
diff --git a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/ValueExpressionImpl.java b/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/ValueExpressionImpl.java
deleted file mode 100644
index ba7e007ef..000000000
--- a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/ValueExpressionImpl.java
+++ /dev/null
@@ -1,267 +0,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.
- */
-package org.apache.struts2.el;
-
-import java.io.Externalizable;
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-
-import javax.el.ELContext;
-import javax.el.ELException;
-import javax.el.ELResolver;
-import javax.el.Expression;
-import javax.el.ExpressionFactory;
-import javax.el.FunctionMapper;
-import javax.el.PropertyNotFoundException;
-import javax.el.PropertyNotWritableException;
-import javax.el.ValueExpression;
-import javax.el.VariableMapper;
-
-import org.apache.struts2.el.lang.ELSupport;
-import org.apache.struts2.el.lang.EvaluationContext;
-import org.apache.struts2.el.lang.ExpressionBuilder;
-import org.apache.struts2.el.parser.AstLiteralExpression;
-import org.apache.struts2.el.parser.Node;
-import org.apache.struts2.el.util.ReflectionUtil;
-
-/**
- * An <code>Expression</code> that can get or set a value.
- *
- * <p>
- * In previous incarnations of this API, expressions could only be read.
- * <code>ValueExpression</code> objects can now be used both to retrieve a
- * value and to set a value. Expressions that can have a value set on them are
- * referred to as l-value expressions. Those that cannot are referred to as
- * r-value expressions. Not all r-value expressions can be used as l-value
- * expressions (e.g. <code>"${1+1}"</code> or
- * <code>"${firstName} ${lastName}"</code>). See the EL Specification for
- * details. Expressions that cannot be used as l-values must always return
- * <code>true</code> from <code>isReadOnly()</code>.
- * </p>
- *
- * <p>
- * The {@link ExpressionFactory#createValueExpression} method
- * can be used to parse an expression string and return a concrete instance
- * of <code>ValueExpression</code> that encapsulates the parsed expression.
- * The {@link FunctionMapper} is used at parse time, not evaluation time,
- * so one is not needed to evaluate an expression using this class.
- * However, the {@link ELContext} is needed at evaluation time.</p>
- *
- * <p>The {@link #getValue}, {@link #setValue}, {@link #isReadOnly} and
- * {@link #getType} methods will evaluate the expression each time they are
- * called. The {@link ELResolver} in the <code>ELContext</code> is used to
- * resolve the top-level variables and to determine the behavior of the
- * <code>.</code> and <code>[]</code> operators. For any of the four methods,
- * the {@link ELResolver#getValue} method is used to resolve all properties
- * up to but excluding the last one. This provides the <code>base</code>
- * object. At the last resolution, the <code>ValueExpression</code> will
- * call the corresponding {@link ELResolver#getValue},
- * {@link ELResolver#setValue}, {@link ELResolver#isReadOnly} or
- * {@link ELResolver#getType} method, depending on which was called on
- * the <code>ValueExpression</code>.
- * </p>
- *
- * <p>See the notes about comparison, serialization and immutability in
- * the {@link Expression} javadocs.
- *
- * @see javax.el.ELResolver
- * @see javax.el.Expression
- * @see javax.el.ExpressionFactory
- * @see javax.el.ValueExpression
- *
- * @author Jacob Hookom [jacob@hookom.net]
- * @version $Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author: markt $
- */
-public final class ValueExpressionImpl extends ValueExpression implements
- Externalizable {
-
- private Class expectedType;
-
- private String expr;
-
- private FunctionMapper fnMapper;
-
- private VariableMapper varMapper;
-
- private transient Node node;
-
- public ValueExpressionImpl() {
-
- }
-
- /**
- * @param expr expression
- * @param node node
- * @param fnMapper function mapper
- * @param varMapper variable mapper
- * @param expectedType expected type
- */
- public ValueExpressionImpl(String expr, Node node, FunctionMapper fnMapper,
- VariableMapper varMapper, Class expectedType) {
- this.expr = expr;
- this.node = node;
- this.fnMapper = fnMapper;
- this.varMapper = varMapper;
- this.expectedType = expectedType;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.lang.Object#equals(java.lang.Object)
- */
- public boolean equals(Object obj) {
- return (obj instanceof ValueExpressionImpl && obj.hashCode() == this
- .hashCode());
- }
-
- /*
- * (non-Javadoc)
- *
- * @see javax.el.ValueExpression#getExpectedType()
- */
- public Class getExpectedType() {
- return this.expectedType;
- }
-
- /**
- * Returns the type the result of the expression will be coerced to after
- * evaluation.
- *
- * @return the <code>expectedType</code> passed to the
- * <code>ExpressionFactory.createValueExpression</code> method
- * that created this <code>ValueExpression</code>.
- *
- * @see javax.el.Expression#getExpressionString()
- */
- public String getExpressionString() {
- return this.expr;
- }
-
- /**
- * @return
- * @throws ELException
- */
- private Node getNode() throws ELException {
- if (this.node == null) {
- this.node = ExpressionBuilder.createNode(this.expr);
- }
- return this.node;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see javax.el.ValueExpression#getType(javax.el.ELContext)
- */
- public Class getType(ELContext context) throws PropertyNotFoundException,
- ELException {
- EvaluationContext ctx = new EvaluationContext(context, this.fnMapper,
- this.varMapper);
- return this.getNode().getType(ctx);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see javax.el.ValueExpression#getValue(javax.el.ELContext)
- */
- public Object getValue(ELContext context) throws PropertyNotFoundException,
- ELException {
- EvaluationContext ctx = new EvaluationContext(context, this.fnMapper,
- this.varMapper);
- Object value = this.getNode().getValue(ctx);
- if (this.expectedType != null) {
- return ELSupport.coerceToType(value, this.expectedType);
- }
- return value;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.lang.Object#hashCode()
- */
- public int hashCode() {
- return this.expr.hashCode();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see javax.el.ValueExpression#isLiteralText()
- */
- public boolean isLiteralText() {
- try {
- return this.getNode() instanceof AstLiteralExpression;
- } catch (ELException ele) {
- return false;
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see javax.el.ValueExpression#isReadOnly(javax.el.ELContext)
- */
- public boolean isReadOnly(ELContext context)
- throws PropertyNotFoundException, ELException {
- EvaluationContext ctx = new EvaluationContext(context, this.fnMapper,
- this.varMapper);
- return this.getNode().isReadOnly(ctx);
- }
-
- public void readExternal(ObjectInput in) throws IOException,
- ClassNotFoundException {
- this.expr = in.readUTF();
- String type = in.readUTF();
- if (!"".equals(type)) {
- this.expectedType = ReflectionUtil.forName(type);
- }
- this.fnMapper = (FunctionMapper) in.readObject();
- this.varMapper = (VariableMapper) in.readObject();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see javax.el.ValueExpression#setValue(javax.el.ELContext,
- * java.lang.Object)
- */
- public void setValue(ELContext context, Object value)
- throws PropertyNotFoundException, PropertyNotWritableException,
- ELException {
- EvaluationContext ctx = new EvaluationContext(context, this.fnMapper,
- this.varMapper);
- this.getNode().setValue(ctx, value);
- }
-
- public void writeExternal(ObjectOutput out) throws IOException {
- out.writeUTF(this.expr);
- out.writeUTF((this.expectedType != null) ? this.expectedType.getName()
- : "");
- out.writeObject(this.fnMapper);
- out.writeObject(this.varMapper);
- }
-
- public String toString() {
- return "ValueExpression["+this.expr+"]";
- }
-}
diff --git a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/ValueExpressionLiteral.java b/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/ValueExpressionLiteral.java
deleted file mode 100644
index 5994a2494..000000000
--- a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/ValueExpressionLiteral.java
+++ /dev/null
@@ -1,113 +0,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.
- */
-package org.apache.struts2.el;
-
-import java.io.Externalizable;
-import java.io.IOException;
-import javax.el.ELContext;
-import javax.el.PropertyNotWritableException;
-
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-
-import javax.el.ValueExpression;
-
-import org.apache.struts2.el.lang.ELSupport;
-import org.apache.struts2.el.util.MessageFactory;
-import org.apache.struts2.el.util.ReflectionUtil;
-
-public final class ValueExpressionLiteral extends ValueExpression implements
- Externalizable {
-
- private static final long serialVersionUID = 1L;
-
- private Object value;
-
- private Class expectedType;
-
- public ValueExpressionLiteral() {
- super();
- }
-
- public ValueExpressionLiteral(Object value, Class expectedType) {
- this.value = value;
- this.expectedType = expectedType;
- }
-
- public Object getValue(ELContext context) {
- if (this.expectedType != null) {
- return ELSupport.coerceToType(this.value, this.expectedType);
- }
- return this.value;
- }
-
- public void setValue(ELContext context, Object value) {
- throw new PropertyNotWritableException(MessageFactory.get(
- "error.value.literal.write", this.value));
- }
-
- public boolean isReadOnly(ELContext context) {
- return true;
- }
-
- public Class getType(ELContext context) {
- return (this.value != null) ? this.value.getClass() : null;
- }
-
- public Class getExpectedType() {
- return this.expectedType;
- }
-
- public String getExpressionString() {
- return (this.value != null) ? this.value.toString() : null;
- }
-
- public boolean equals(Object obj) {
- return (obj instanceof ValueExpressionLiteral && this
- .equals((ValueExpressionLiteral) obj));
- }
-
- public boolean equals(ValueExpressionLiteral ve) {
- return (ve != null && (this.value != null && ve.value != null && (this.value == ve.value || this.value
- .equals(ve.value))));
- }
-
- public int hashCode() {
- return (this.value != null) ? this.value.hashCode() : 0;
- }
-
- public boolean isLiteralText() {
- return true;
- }
-
- public void writeExternal(ObjectOutput out) throws IOException {
- out.writeObject(this.value);
- out.writeUTF((this.expectedType != null) ? this.expectedType.getName()
- : "");
- }
-
- public void readExternal(ObjectInput in) throws IOException,
- ClassNotFoundException {
- this.value = in.readObject();
- String type = in.readUTF();
- if (!"".equals(type)) {
- this.expectedType = ReflectionUtil.forName(type);
- }
- }
-}
diff --git a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/lang/ELArithmetic.java b/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/lang/ELArithmetic.java
deleted file mode 100644
index 35d89f4b2..000000000
--- a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/lang/ELArithmetic.java
+++ /dev/null
@@ -1,378 +0,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.
- */
-package org.apache.struts2.el.lang;
-
-import java.math.BigDecimal;
-import java.math.BigInteger;
-
-import org.apache.struts2.el.util.MessageFactory;
-
-
-/**
- * A helper class of Arithmetic defined by the EL Specification
- * @author Jacob Hookom [jacob@hookom.net]
- * @version $Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author: rjung $
- */
-public abstract class ELArithmetic {
-
- public final static class BigDecimalDelegate extends ELArithmetic {
-
- protected Number add(Number num0, Number num1) {
- return ((BigDecimal) num0).add((BigDecimal) num1);
- }
-
- protected Number coerce(Number num) {
- if (num instanceof BigDecimal)
- return num;
- if (num instanceof BigInteger)
- return new BigDecimal((BigInteger) num);
- return new BigDecimal(num.doubleValue());
- }
-
- protected Number coerce(String str) {
- return new BigDecimal(str);
- }
-
- protected Number divide(Number num0, Number num1) {
- return ((BigDecimal) num0).divide((BigDecimal) num1,
- BigDecimal.ROUND_HALF_UP);
- }
-
- protected Number subtract(Number num0, Number num1) {
- return ((BigDecimal) num0).subtract((BigDecimal) num1);
- }
-
- protected Number mod(Number num0, Number num1) {
- return new Double(num0.doubleValue() % num1.doubleValue());
- }
-
- protected Number multiply(Number num0, Number num1) {
- return ((BigDecimal) num0).multiply((BigDecimal) num1);
- }
-
- public boolean matches(Object obj0, Object obj1) {
- return (obj0 instanceof BigDecimal || obj1 instanceof BigDecimal);
- }
- }
-
- public final static class BigIntegerDelegate extends ELArithmetic {
-
- protected Number add(Number num0, Number num1) {
- return ((BigInteger) num0).add((BigInteger) num1);
- }
-
- protected Number coerce(Number num) {
- if (num instanceof BigInteger)
- return num;
- return new BigInteger(num.toString());
- }
-
- protected Number coerce(String str) {
- return new BigInteger(str);
- }
-
- protected Number divide(Number num0, Number num1) {
- return (new BigDecimal((BigInteger) num0)).divide(new BigDecimal((BigInteger) num1), BigDecimal.ROUND_HALF_UP);
- }
-
- protected Number multiply(Number num0, Number num1) {
- return ((BigInteger) num0).multiply((BigInteger) num1);
- }
-
- protected Number mod(Number num0, Number num1) {
- return ((BigInteger) num0).mod((BigInteger) num1);
- }
-
- protected Number subtract(Number num0, Number num1) {
- return ((BigInteger) num0).subtract((BigInteger) num1);
- }
-
- public boolean matches(Object obj0, Object obj1) {
- return (obj0 instanceof BigInteger || obj1 instanceof BigInteger);
- }
- }
-
- public final static class DoubleDelegate extends ELArithmetic {
-
- protected Number add(Number num0, Number num1) {
- // could only be one of these
- if (num0 instanceof BigDecimal) {
- return ((BigDecimal) num0).add(new BigDecimal(num1.doubleValue()));
- } else if (num1 instanceof BigDecimal) {
- return ((new BigDecimal(num0.doubleValue()).add((BigDecimal) num1)));
- }
- return new Double(num0.doubleValue() + num1.doubleValue());
- }
-
- protected Number coerce(Number num) {
- if (num instanceof Double)
- return num;
- if (num instanceof BigInteger)
- return new BigDecimal((BigInteger) num);
- return new Double(num.doubleValue());
- }
-
- protected Number coerce(String str) {
- return new Double(str);
- }
-
- protected Number divide(Number num0, Number num1) {
- return new Double(num0.doubleValue() / num1.doubleValue());
- }
-
- protected Number mod(Number num0, Number num1) {
- return new Double(num0.doubleValue() % num1.doubleValue());
- }
-
- protected Number subtract(Number num0, Number num1) {
- // could only be one of these
- if (num0 instanceof BigDecimal) {
- return ((BigDecimal) num0).subtract(new BigDecimal(num1.doubleValue()));
- } else if (num1 instanceof BigDecimal) {
- return ((new BigDecimal(num0.doubleValue()).subtract((BigDecimal) num1)));
- }
- return new Double(num0.doubleValue() - num1.doubleValue());
- }
-
- protected Number multiply(Number num0, Number num1) {
- // could only be one of these
- if (num0 instanceof BigDecimal) {
- return ((BigDecimal) num0).multiply(new BigDecimal(num1.doubleValue()));
- } else if (num1 instanceof BigDecimal) {
- return ((new BigDecimal(num0.doubleValue()).multiply((BigDecimal) num1)));
- }
- return new Double(num0.doubleValue() * num1.doubleValue());
- }
-
- public boolean matches(Object obj0, Object obj1) {
- return (obj0 instanceof Double
- || obj1 instanceof Double
- || obj0 instanceof Float
- || obj1 instanceof Float
- || (obj0 instanceof String && ELSupport
- .isStringFloat((String) obj0)) || (obj1 instanceof String && ELSupport
- .isStringFloat((String) obj1)));
- }
- }
-
- public final static class LongDelegate extends ELArithmetic {
-
- protected Number add(Number num0, Number num1) {
- return new Long(num0.longValue() + num1.longValue());
- }
-
- protected Number coerce(Number num) {
- if (num instanceof Long)
- return num;
- return new Long(num.longValue());
- }
-
- protected Number coerce(String str) {
- return new Long(str);
- }
-
- protected Number divide(Number num0, Number num1) {
- return new Long(num0.longValue() / num1.longValue());
- }
-
- protected Number mod(Number num0, Number num1) {
- return new Long(num0.longValue() % num1.longValue());
- }
-
- protected Number subtract(Number num0, Number num1) {
- return new Long(num0.longValue() - num1.longValue());
- }
-
- protected Number multiply(Number num0, Number num1) {
- return new Long(num0.longValue() * num1.longValue());
- }
-
- public boolean matches(Object obj0, Object obj1) {
- return (obj0 instanceof Long || obj1 instanceof Long);
- }
- }
-
- public final static BigDecimalDelegate BIGDECIMAL = new BigDecimalDelegate();
-
- public final static BigIntegerDelegate BIGINTEGER = new BigIntegerDelegate();
-
- public final static DoubleDelegate DOUBLE = new DoubleDelegate();
-
- public final static LongDelegate LONG = new LongDelegate();
-
- private final static Long ZERO = new Long(0);
-
- public final static Number add(final Object obj0, final Object obj1) {
- if (obj0 == null && obj1 == null) {
- return new Long(0);
- }
-
- final ELArithmetic delegate;
- if (BIGDECIMAL.matches(obj0, obj1))
- delegate = BIGDECIMAL;
- else if (DOUBLE.matches(obj0, obj1))
- delegate = DOUBLE;
- else if (BIGINTEGER.matches(obj0, obj1))
- delegate = BIGINTEGER;
- else
- delegate = LONG;
-
- Number num0 = delegate.coerce(obj0);
- Number num1 = delegate.coerce(obj1);
-
- return delegate.add(num0, num1);
- }
-
- public final static Number mod(final Object obj0, final Object obj1) {
- if (obj0 == null && obj1 == null) {
- return new Long(0);
- }
-
- final ELArithmetic delegate;
- if (BIGDECIMAL.matches(obj0, obj1))
- delegate = BIGDECIMAL;
- else if (DOUBLE.matches(obj0, obj1))
- delegate = DOUBLE;
- else if (BIGINTEGER.matches(obj0, obj1))
- delegate = BIGINTEGER;
- else
- delegate = LONG;
-
- Number num0 = delegate.coerce(obj0);
- Number num1 = delegate.coerce(obj1);
-
- return delegate.mod(num0, num1);
- }
-
- public final static Number subtract(final Object obj0, final Object obj1) {
- if (obj0 == null && obj1 == null) {
- return new Long(0);
- }
-
- final ELArithmetic delegate;
- if (BIGDECIMAL.matches(obj0, obj1))
- delegate = BIGDECIMAL;
- else if (DOUBLE.matches(obj0, obj1))
- delegate = DOUBLE;
- else if (BIGINTEGER.matches(obj0, obj1))
- delegate = BIGINTEGER;
- else
- delegate = LONG;
-
- Number num0 = delegate.coerce(obj0);
- Number num1 = delegate.coerce(obj1);
-
- return delegate.subtract(num0, num1);
- }
-
- public final static Number divide(final Object obj0, final Object obj1) {
- if (obj0 == null && obj1 == null) {
- return ZERO;
- }
-
- final ELArithmetic delegate;
- if (BIGDECIMAL.matches(obj0, obj1))
- delegate = BIGDECIMAL;
- else if (BIGINTEGER.matches(obj0, obj1))
- delegate = BIGDECIMAL;
- else
- delegate = DOUBLE;
-
- Number num0 = delegate.coerce(obj0);
- Number num1 = delegate.coerce(obj1);
-
- return delegate.divide(num0, num1);
- }
-
- public final static Number multiply(final Object obj0, final Object obj1) {
- if (obj0 == null && obj1 == null) {
- return new Long(0);
- }
-
- final ELArithmetic delegate;
- if (BIGDECIMAL.matches(obj0, obj1))
- delegate = BIGDECIMAL;
- else if (DOUBLE.matches(obj0, obj1))
- delegate = DOUBLE;
- else if (BIGINTEGER.matches(obj0, obj1))
- delegate = BIGINTEGER;
- else
- delegate = LONG;
-
- Number num0 = delegate.coerce(obj0);
- Number num1 = delegate.coerce(obj1);
-
- return delegate.multiply(num0, num1);
- }
-
- public final static boolean isNumber(final Object obj) {
- return (obj != null && isNumberType(obj.getClass()));
- }
-
- public final static boolean isNumberType(final Class<?> type) {
- return type == Long.TYPE || type == Double.TYPE ||
- type == Byte.TYPE || type == Short.TYPE ||
- type == Integer.TYPE || type == Float.TYPE ||
- Number.class.isAssignableFrom(type);
- }
-
- /**
- *
- */
- protected ELArithmetic() {
- super();
- }
-
- protected abstract Number add(final Number num0, final Number num1);
-
- protected abstract Number multiply(final Number num0, final Number num1);
-
- protected abstract Number subtract(final Number num0, final Number num1);
-
- protected abstract Number mod(final Number num0, final Number num1);
-
- protected abstract Number coerce(final Number num);
-
- protected final Number coerce(final Object obj) {
-
- if (isNumber(obj)) {
- return coerce((Number) obj);
- }
- if (obj instanceof String) {
- return coerce((String) obj);
- }
- if (obj == null || "".equals(obj)) {
- return coerce(ZERO);
- }
-
- if (obj instanceof Character) {
- return coerce(new Short((short) ((Character) obj).charValue()));
- }
-
- throw new IllegalArgumentException(MessageFactory.get("error.convert",
- obj, obj.getClass(), "Number"));
- }
-
- protected abstract Number coerce(final String str);
-
- protected abstract Number divide(final Number num0, final Number num1);
-
- protected abstract boolean matches(final Object obj0, final Object obj1);
-
-}
diff --git a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/lang/ELSupport.java b/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/lang/ELSupport.java
deleted file mode 100644
index 95a69f8fa..000000000
--- a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/lang/ELSupport.java
+++ /dev/null
@@ -1,474 +0,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.
- */
-package org.apache.struts2.el.lang;
-
-import java.beans.PropertyEditor;
-import java.beans.PropertyEditorManager;
-import java.math.BigDecimal;
-import java.math.BigInteger;
-
-import javax.el.ELException;
-import javax.el.PropertyNotFoundException;
-
-import org.apache.struts2.el.util.MessageFactory;
-
-
-/**
- * A helper class that implements the EL Specification
- *
- * @author Jacob Hookom [jacob@hookom.net]
- * @version $Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author: markt $
- */
-public class ELSupport {
-
- private final static Long ZERO = new Long(0L);
-
- public final static void throwUnhandled(Object base, Object property)
- throws ELException {
- if (base == null) {
- throw new PropertyNotFoundException(MessageFactory.get(
- "error.resolver.unhandled.null", property));
- } else {
- throw new PropertyNotFoundException(MessageFactory.get(
- "error.resolver.unhandled", base.getClass(), property));
- }
- }
-
- /**
- * @param obj0 first object
- * @param obj1 second object
- * @return 0 if objects are equals
- * @throws ELException in case of errors
- */
- public final static int compare(final Object obj0, final Object obj1)
- throws ELException {
- if (obj0 == obj1 || equals(obj0, obj1)) {
- return 0;
- }
- if (isBigDecimalOp(obj0, obj1)) {
- BigDecimal bd0 = (BigDecimal) coerceToNumber(obj0, BigDecimal.class);
- BigDecimal bd1 = (BigDecimal) coerceToNumber(obj1, BigDecimal.class);
- return bd0.compareTo(bd1);
- }
- if (isDoubleOp(obj0, obj1)) {
- Double d0 = (Double) coerceToNumber(obj0, Double.class);
- Double d1 = (Double) coerceToNumber(obj1, Double.class);
- return d0.compareTo(d1);
- }
- if (isBigIntegerOp(obj0, obj1)) {
- BigInteger bi0 = (BigInteger) coerceToNumber(obj0, BigInteger.class);
- BigInteger bi1 = (BigInteger) coerceToNumber(obj1, BigInteger.class);
- return bi0.compareTo(bi1);
- }
- if (isLongOp(obj0, obj1)) {
- Long l0 = (Long) coerceToNumber(obj0, Long.class);
- Long l1 = (Long) coerceToNumber(obj1, Long.class);
- return l0.compareTo(l1);
- }
- if (obj0 instanceof String || obj1 instanceof String) {
- return coerceToString(obj0).compareTo(coerceToString(obj1));
- }
- if (obj0 instanceof Comparable) {
- return (obj1 != null) ? ((Comparable) obj0).compareTo(obj1) : 1;
- }
- if (obj1 instanceof Comparable) {
- return (obj0 != null) ? -((Comparable) obj1).compareTo(obj0) : -1;
- }
- throw new ELException(MessageFactory.get("error.compare", obj0, obj1));
- }
-
- /**
- * @param obj0 first object
- * @param obj1 second object
- * @return true if objects are equals
- * @throws ELException in case of errors
- */
- public final static boolean equals(final Object obj0, final Object obj1)
- throws ELException {
- if (obj0 == obj1) {
- return true;
- } else if (obj0 == null || obj1 == null) {
- return false;
- } else if (obj0 instanceof Boolean || obj1 instanceof Boolean) {
- return coerceToBoolean(obj0).equals(coerceToBoolean(obj1));
- } else if (obj0.getClass().isEnum()) {
- return obj0.equals(coerceToEnum(obj1, obj0.getClass()));
- } else if (obj1.getClass().isEnum()) {
- return obj1.equals(coerceToEnum(obj0, obj1.getClass()));
- } else if (obj0 instanceof String || obj1 instanceof String) {
- int lexCompare = coerceToString(obj0).compareTo(coerceToString(obj1));
- return (lexCompare == 0) ? true : false;
- }
- if (isBigDecimalOp(obj0, obj1)) {
- BigDecimal bd0 = (BigDecimal) coerceToNumber(obj0, BigDecimal.class);
- BigDecimal bd1 = (BigDecimal) coerceToNumber(obj1, BigDecimal.class);
- return bd0.equals(bd1);
- }
- if (isDoubleOp(obj0, obj1)) {
- Double d0 = (Double) coerceToNumber(obj0, Double.class);
- Double d1 = (Double) coerceToNumber(obj1, Double.class);
- return d0.equals(d1);
- }
- if (isBigIntegerOp(obj0, obj1)) {
- BigInteger bi0 = (BigInteger) coerceToNumber(obj0, BigInteger.class);
- BigInteger bi1 = (BigInteger) coerceToNumber(obj1, BigInteger.class);
- return bi0.equals(bi1);
- }
- if (isLongOp(obj0, obj1)) {
- Long l0 = (Long) coerceToNumber(obj0, Long.class);
- Long l1 = (Long) coerceToNumber(obj1, Long.class);
- return l0.equals(l1);
- } else {
- return obj0.equals(obj1);
- }
- }
-
- /**
- * @param obj object
- * @param type class ytpe
- * @return enum
- */
- public final static Enum coerceToEnum(final Object obj, Class type) {
- if (obj == null || "".equals(obj)) {
- return null;
- }
- if (obj.getClass().isEnum()) {
- return (Enum) obj;
- }
- return Enum.valueOf(type, obj.toString());
- }
-
- /**
- * @param obj object
- * @return boolean
- */
- public final static Boolean coerceToBoolean(final Object obj)
- throws IllegalArgumentException {
- if (obj == null || "".equals(obj)) {
- return Boolean.FALSE;
- }
- if (obj instanceof Boolean) {
- return (Boolean) obj;
- }
- if (obj instanceof String) {
- return Boolean.valueOf((String) obj);
- }
-
- throw new IllegalArgumentException(MessageFactory.get("error.convert",
- obj, obj.getClass(), Boolean.class));
- }
-
- public final static Character coerceToCharacter(final Object obj)
- throws IllegalArgumentException {
- if (obj == null || "".equals(obj)) {
- return new Character((char) 0);
- }
- if (obj instanceof String) {
- return new Character(((String) obj).charAt(0));
- }
- if (ELArithmetic.isNumber(obj)) {
- return new Character((char) ((Number) obj).shortValue());
- }
- Class objType = obj.getClass();
- if (obj instanceof Character) {
- return (Character) obj;
- }
-
- throw new IllegalArgumentException(MessageFactory.get("error.convert",
- obj, objType, Character.class));
- }
-
- public final static Number coerceToNumber(final Object obj) {
- if (obj == null) {
- return ZERO;
- } else if (obj instanceof Number) {
- return (Number) obj;
- } else {
- String str = coerceToString(obj);
- if (isStringFloat(str)) {
- return toFloat(str);
- } else {
- return toNumber(str);
- }
- }
- }
-
- protected final static Number coerceToNumber(final Number number,
- final Class type) throws IllegalArgumentException {
- if (Long.TYPE == type || Long.class.equals(type)) {
- return new Long(number.longValue());
- }
- if (Double.TYPE == type || Double.class.equals(type)) {
- return new Double(number.doubleValue());
- }
- if (Integer.TYPE == type || Integer.class.equals(type)) {
- return new Integer(number.intValue());
- }
- if (BigInteger.class.equals(type)) {
- if (number instanceof BigDecimal) {
- return ((BigDecimal) number).toBigInteger();
- }
- if (number instanceof BigInteger) {
- return number;
- }
- return BigInteger.valueOf(number.longValue());
- }
- if (BigDecimal.class.equals(type)) {
- if (number instanceof BigDecimal) {
- return number;
- }
- if (number instanceof BigInteger) {
- return new BigDecimal((BigInteger) number);
- }
- return new BigDecimal(number.doubleValue());
- }
- if (Byte.TYPE == type || Byte.class.equals(type)) {
- return new Byte(number.byteValue());
- }
- if (Short.TYPE == type || Short.class.equals(type)) {
- return new Short(number.shortValue());
- }
- if (Float.TYPE == type || Float.class.equals(type)) {
- return new Float(number.floatValue());
- }
-
- throw new IllegalArgumentException(MessageFactory.get("error.convert",
- number, number.getClass(), type));
- }
-
- public final static Number coerceToNumber(final Object obj, final Class type)
- throws IllegalArgumentException {
- if (obj == null || "".equals(obj)) {
- return coerceToNumber(ZERO, type);
- }
- if (obj instanceof String) {
- return coerceToNumber((String) obj, type);
- }
- if (ELArithmetic.isNumber(obj)) {
- return coerceToNumber((Number) obj, type);
- }
-
- if (obj instanceof Character) {
- return coerceToNumber(new Short((short) ((Character) obj)
- .charValue()), type);
- }
-
- throw new IllegalArgumentException(MessageFactory.get("error.convert",
- obj, obj.getClass(), type));
- }
-
- protected final static Number coerceToNumber(final String val,
- final Class type) throws IllegalArgumentException {
- if (Long.TYPE == type || Long.class.equals(type)) {
- return Long.valueOf(val);
- }
- if (Integer.TYPE == type || Integer.class.equals(type)) {
- return Integer.valueOf(val);
- }
- if (Double.TYPE == type || Double.class.equals(type)) {
- return Double.valueOf(val);
- }
- if (BigInteger.class.equals(type)) {
- return new BigInteger(val);
- }
- if (BigDecimal.class.equals(type)) {
- return new BigDecimal(val);
- }
- if (Byte.TYPE == type || Byte.class.equals(type)) {
- return Byte.valueOf(val);
- }
- if (Short.TYPE == type || Short.class.equals(type)) {
- return Short.valueOf(val);
- }
- if (Float.TYPE == type || Float.class.equals(type)) {
- return Float.valueOf(val);
- }
-
- throw new IllegalArgumentException(MessageFactory.get("error.convert",
- val, String.class, type));
- }
-
- /**
- * @param obj object
- * @return String
- */
- public final static String coerceToString(final Object obj) {
- if (obj == null) {
- return "";
- } else if (obj instanceof String) {
- return (String) obj;
- } else if (obj instanceof Enum) {
- return ((Enum) obj).name();
- } else {
- return obj.toString();
- }
- }
-
- public final static void checkType(final Object obj, final Class type)
- throws IllegalArgumentException {
- if (String.class.equals(type)) {
- coerceToString(obj);
- }
- if (ELArithmetic.isNumberType(type)) {
- coerceToNumber(obj, type);
- }
- if (Character.class.equals(type) || Character.TYPE == type) {
- coerceToCharacter(obj);
- }
- if (Boolean.class.equals(type) || Boolean.TYPE == type) {
- coerceToBoolean(obj);
- }
- if (type.isEnum()) {
- coerceToEnum(obj, type);
- }
- }
-
- public final static Object coerceToType(final Object obj, final Class type)
- throws IllegalArgumentException {
- if (type == null || Object.class.equals(type) ||
- (obj != null && type.isAssignableFrom(obj.getClass()))) {
- return obj;
- }
- if (String.class.equals(type)) {
- return coerceToString(obj);
- }
- if (ELArithmetic.isNumberType(type)) {
- return coerceToNumber(obj, type);
- }
- if (Character.class.equals(type) || Character.TYPE == type) {
- return coerceToCharacter(obj);
- }
- if (Boolean.class.equals(type) || Boolean.TYPE == type) {
- return coerceToBoolean(obj);
- }
- if (type.isEnum()) {
- return coerceToEnum(obj, type);
- }
-
- // new to spec
- if (obj == null)
- return null;
- if (obj instanceof String) {
- if ("".equals(obj))
- return null;
- PropertyEditor editor = PropertyEditorManager.findEditor(type);
- if (editor != null) {
- editor.setAsText((String) obj);
- return editor.getValue();
- }
- }
- throw new IllegalArgumentException(MessageFactory.get("error.convert",
- obj, obj.getClass(), type));
- }
-
- /**
- * @param obj object array
- * @return true if object array contains null values
- */
- public final static boolean containsNulls(final Object[] obj) {
- for (int i = 0; i < obj.length; i++) {
- if (obj[i] == null) {
- return true;
- }
- }
- return false;
- }
-
- public final static boolean isBigDecimalOp(final Object obj0,
- final Object obj1) {
- return (obj0 instanceof BigDecimal || obj1 instanceof BigDecimal);
- }
-
- public final static boolean isBigIntegerOp(final Object obj0,
- final Object obj1) {
- return (obj0 instanceof BigInteger || obj1 instanceof BigInteger);
- }
-
- public final static boolean isDoubleOp(final Object obj0, final Object obj1) {
- return (obj0 instanceof Double
- || obj1 instanceof Double
- || obj0 instanceof Float
- || obj1 instanceof Float);
- }
-
- public final static boolean isDoubleStringOp(final Object obj0,
- final Object obj1) {
- return (isDoubleOp(obj0, obj1)
- || (obj0 instanceof String && isStringFloat((String) obj0)) || (obj1 instanceof String && isStringFloat((String) obj1)));
- }
-
- public final static boolean isLongOp(final Object obj0, final Object obj1) {
- return (obj0 instanceof Long
- || obj1 instanceof Long
- || obj0 instanceof Integer
- || obj1 instanceof Integer
- || obj0 instanceof Character
- || obj1 instanceof Character
- || obj0 instanceof Short
- || obj1 instanceof Short
- || obj0 instanceof Byte
- || obj1 instanceof Byte);
- }
-
- public final static boolean isStringFloat(final String str) {
- int len = str.length();
- if (len > 1) {
- for (int i = 0; i < len; i++) {
- switch (str.charAt(i)) {
- case 'E':
- return true;
- case 'e':
- return true;
- case '.':
- return true;
- }
- }
- }
- return false;
- }
-
- public final static Number toFloat(final String value) {
- try {
- if (Double.parseDouble(value) > Double.MAX_VALUE) {
- return new BigDecimal(value);
- } else {
- return new Double(value);
- }
- } catch (NumberFormatException e0) {
- return new BigDecimal(value);
- }
- }
-
- public final static Number toNumber(final String value) {
- try {
- return new Integer(Integer.parseInt(value));
- } catch (NumberFormatException e0) {
- try {
- return new Long(Long.parseLong(value));
- } catch (NumberFormatException e1) {
- return new BigInteger(value);
- }
- }
- }
-
- public ELSupport() {
- super();
- }
-
-}
diff --git a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/lang/EvaluationContext.java b/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/lang/EvaluationContext.java
deleted file mode 100644
index 978724c40..000000000
--- a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/lang/EvaluationContext.java
+++ /dev/null
@@ -1,82 +0,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.
- */
-package org.apache.struts2.el.lang;
-
-import java.util.Locale;
-
-import javax.el.ELContext;
-import javax.el.ELResolver;
-import javax.el.FunctionMapper;
-import javax.el.VariableMapper;
-
-public final class EvaluationContext extends ELContext {
-
- private final ELContext elContext;
-
- private final FunctionMapper fnMapper;
-
- private final VariableMapper varMapper;
-
- public EvaluationContext(ELContext elContext, FunctionMapper fnMapper,
- VariableMapper varMapper) {
- this.elContext = elContext;
- this.fnMapper = fnMapper;
- this.varMapper = varMapper;
- }
-
- public ELContext getELContext() {
- return this.elContext;
- }
-
- public FunctionMapper getFunctionMapper() {
- return this.fnMapper;
- }
-
- public VariableMapper getVariableMapper() {
- return this.varMapper;
- }
-
- public Object getContext(Class key) {
- return this.elContext.getContext(key);
- }
-
- public ELResolver getELResolver() {
- return this.elContext.getELResolver();
- }
-
- public boolean isPropertyResolved() {
- return this.elContext.isPropertyResolved();
- }
-
- public void putContext(Class key, Object contextObject) {
- this.elContext.putContext(key, contextObject);
- }
-
- public void setPropertyResolved(boolean resolved) {
- this.elContext.setPropertyResolved(resolved);
- }
-
- public Locale getLocale() {
- return this.elContext.getLocale();
- }
-
- public void setLocale(Locale locale) {
- this.elContext.setLocale(locale);
- }
-}
diff --git a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/lang/ExpressionBuilder.java b/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/lang/ExpressionBuilder.java
deleted file mode 100644
index ccc2f82b4..000000000
--- a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/lang/ExpressionBuilder.java
+++ /dev/null
@@ -1,211 +0,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.
- */
-package org.apache.struts2.el.lang;
-
-import java.io.StringReader;
-import java.lang.reflect.Method;
-
-import javax.el.ELContext;
-import javax.el.ELException;
-import javax.el.FunctionMapper;
-import javax.el.MethodExpression;
-import javax.el.ValueExpression;
-import javax.el.VariableMapper;
-
-import org.apache.struts2.el.MethodExpressionImpl;
-import org.apache.struts2.el.MethodExpressionLiteral;
-import org.apache.struts2.el.ValueExpressionImpl;
-import org.apache.struts2.el.parser.AstCompositeExpression;
-import org.apache.struts2.el.parser.AstDeferredExpression;
-import org.apache.struts2.el.parser.AstDynamicExpression;
-import org.apache.struts2.el.parser.AstFunction;
-import org.apache.struts2.el.parser.AstIdentifier;
-import org.apache.struts2.el.parser.AstLiteralExpression;
-import org.apache.struts2.el.parser.AstValue;
-import org.apache.struts2.el.parser.ELParser;
-import org.apache.struts2.el.parser.Node;
-import org.apache.struts2.el.parser.NodeVisitor;
-import org.apache.struts2.el.parser.ParseException;
-import org.apache.struts2.el.util.ConcurrentCache;
-import org.apache.struts2.el.util.MessageFactory;
-
-/**
- * @author Jacob Hookom [jacob@hookom.net]
- * @version $Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author: rjung $
- */
-public final class ExpressionBuilder implements NodeVisitor {
-
- private static final ConcurrentCache<String, Node> cache = new ConcurrentCache<String, Node>(5000);
-
- private FunctionMapper fnMapper;
-
- private VariableMapper varMapper;
-
- private String expression;
-
- public ExpressionBuilder(String expression, ELContext ctx)
- throws ELException {
- this.expression = expression;
-
- FunctionMapper ctxFn = ctx.getFunctionMapper();
- VariableMapper ctxVar = ctx.getVariableMapper();
-
- if (ctxFn != null) {
- this.fnMapper = new FunctionMapperFactory(ctxFn);
- }
- if (ctxVar != null) {
- this.varMapper = new VariableMapperFactory(ctxVar);
- }
- }
-
- public final static Node createNode(String expr) throws ELException {
- Node n = createNodeInternal(expr);
- return n;
- }
-
- private final static Node createNodeInternal(String expr)
- throws ELException {
- if (expr == null) {
- throw new ELException(MessageFactory.get("error.null"));
- }
-
- Node n = cache.get(expr);
- if (n == null) {
- try {
- n = (new ELParser(new StringReader(expr)))
- .CompositeExpression();
-
- // validate composite expression
- if (n instanceof AstCompositeExpression) {
- int numChildren = n.jjtGetNumChildren();
- if (numChildren == 1) {
- n = n.jjtGetChild(0);
- } else {
- Class type = null;
- Node child = null;
- for (int i = 0; i < numChildren; i++) {
- child = n.jjtGetChild(i);
- if (child instanceof AstLiteralExpression)
- continue;
- if (type == null)
- type = child.getClass();
- else {
- if (!type.equals(child.getClass())) {
- throw new ELException(MessageFactory.get(
- "error.mixed", expr));
- }
- }
- }
- }
- }
- if (n instanceof AstDeferredExpression
- || n instanceof AstDynamicExpression) {
- n = n.jjtGetChild(0);
- }
- cache.put(expr, n);
- } catch (ParseException pe) {
- throw new ELException("Error Parsing: " + expr, pe);
- }
- }
- return n;
- }
-
- private void prepare(Node node) throws ELException {
- try {
- node.accept(this);
- } catch (Exception e) {
- if (e instanceof ELException) {
- throw (ELException) e;
- } else {
- throw (new ELException(e));
- }
- }
- if (this.fnMapper instanceof FunctionMapperFactory) {
- this.fnMapper = ((FunctionMapperFactory) this.fnMapper).create();
- }
- if (this.varMapper instanceof VariableMapperFactory) {
- this.varMapper = ((VariableMapperFactory) this.varMapper).create();
- }
- }
-
- private Node build() throws ELException {
- Node n = createNodeInternal(this.expression);
- this.prepare(n);
- if (n instanceof AstDeferredExpression
- || n instanceof AstDynamicExpression) {
- n = n.jjtGetChild(0);
- }
- return n;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.sun.el.parser.NodeVisitor#visit(com.sun.el.parser.Node)
- */
- public void visit(Node node) throws ELException {
- if (node instanceof AstFunction) {
-
- AstFunction funcNode = (AstFunction) node;
-
- if (this.fnMapper == null) {
- throw new ELException(MessageFactory.get("error.fnMapper.null"));
- }
- Method m = fnMapper.resolveFunction(funcNode.getPrefix(), funcNode
- .getLocalName());
- if (m == null) {
- throw new ELException(MessageFactory.get(
- "error.fnMapper.method", funcNode.getOutputName()));
- }
- int pcnt = m.getParameterTypes().length;
- if (node.jjtGetNumChildren() != pcnt) {
- throw new ELException(MessageFactory.get(
- "error.fnMapper.paramcount", funcNode.getOutputName(),
- "" + pcnt, "" + node.jjtGetNumChildren()));
- }
- } else if (node instanceof AstIdentifier && this.varMapper != null) {
- String variable = ((AstIdentifier) node).getImage();
-
- // simply capture it
- this.varMapper.resolveVariable(variable);
- }
- }
-
- public ValueExpression createValueExpression(Class expectedType)
- throws ELException {
- Node n = this.build();
- return new ValueExpressionImpl(this.expression, n, this.fnMapper,
- this.varMapper, expectedType);
- }
-
- public MethodExpression createMethodExpression(Class expectedReturnType,
- Class[] expectedParamTypes) throws ELException {
- Node n = this.build();
- if (n instanceof AstValue || n instanceof AstIdentifier) {
- return new MethodExpressionImpl(expression, n, this.fnMapper,
- this.varMapper, expectedReturnType, expectedParamTypes);
- } else if (n instanceof AstLiteralExpression) {
- return new MethodExpressionLiteral(expression, expectedReturnType,
- expectedParamTypes);
- } else {
- throw new ELException("Not a Valid Method Expression: "
- + expression);
- }
- }
-}
diff --git a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/lang/FunctionMapperFactory.java b/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/lang/FunctionMapperFactory.java
deleted file mode 100644
index 54aac4eef..000000000
--- a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/lang/FunctionMapperFactory.java
+++ /dev/null
@@ -1,60 +0,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.
- */
-package org.apache.struts2.el.lang;
-
-import java.lang.reflect.Method;
-
-import javax.el.FunctionMapper;
-
-/**
- * @author Jacob Hookom [jacob@hookom.net]
- * @version $Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author: rjung $
- */
-public class FunctionMapperFactory extends FunctionMapper {
-
- protected FunctionMapperImpl memento = null;
- protected FunctionMapper target;
-
- public FunctionMapperFactory(FunctionMapper mapper) {
- if (mapper == null) {
- throw new NullPointerException("FunctionMapper target cannot be null");
- }
- this.target = mapper;
- }
-
-
- /* (non-Javadoc)
- * @see javax.el.FunctionMapper#resolveFunction(java.lang.String, java.lang.String)
- */
- public Method resolveFunction(String prefix, String localName) {
- if (this.memento == null) {
- this.memento = new FunctionMapperImpl();
- }
- Method m = this.target.resolveFunction(prefix, localName);
- if (m != null) {
- this.memento.addFunction(prefix, localName, m);
- }
- return m;
- }
-
- public FunctionMapper create() {
- return this.memento;
- }
-
-}
diff --git a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/lang/FunctionMapperImpl.java b/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/lang/FunctionMapperImpl.java
deleted file mode 100644
index 0b7b7f37d..000000000
--- a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/lang/FunctionMapperImpl.java
+++ /dev/null
@@ -1,190 +0,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.
- */
-package org.apache.struts2.el.lang;
-
-import java.io.Externalizable;
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-import java.lang.reflect.Method;
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.el.FunctionMapper;
-
-import org.apache.struts2.el.util.ReflectionUtil;
-
-
-/**
- * @author Jacob Hookom [jacob@hookom.net]
- * @version $Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author: rjung $
- */
-public class FunctionMapperImpl extends FunctionMapper implements
- Externalizable {
-
- private static final long serialVersionUID = 1L;
-
- protected Map<String, Function> functions = null;
-
- /*
- * (non-Javadoc)
- *
- * @see javax.el.FunctionMapper#resolveFunction(java.lang.String,
- * java.lang.String)
- */
- public Method resolveFunction(String prefix, String localName) {
- if (this.functions != null) {
- Function f = this.functions.get(prefix + ":" + localName);
- return f.getMethod();
- }
- return null;
- }
-
- public void addFunction(String prefix, String localName, Method m) {
- if (this.functions == null) {
- this.functions = new HashMap<String, Function>();
- }
- Function f = new Function(prefix, localName, m);
- synchronized (this) {
- this.functions.put(prefix+":"+localName, f);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.io.Externalizable#writeExternal(java.io.ObjectOutput)
- */
- public void writeExternal(ObjectOutput out) throws IOException {
- out.writeObject(this.functions);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.io.Externalizable#readExternal(java.io.ObjectInput)
- */
- public void readExternal(ObjectInput in) throws IOException,
- ClassNotFoundException {
- this.functions = (Map<String, Function>) in.readObject();
- }
-
- public static class Function implements Externalizable {
-
- protected transient Method m;
- protected String owner;
- protected String name;
- protected String[] types;
- protected String prefix;
- protected String localName;
-
- public Function(String prefix, String localName, Method m) {
- if (localName == null) {
- throw new NullPointerException("LocalName cannot be null");
- }
- if (m == null) {
- throw new NullPointerException("Method cannot be null");
- }
- this.prefix = prefix;
- this.localName = localName;
- this.m = m;
- }
-
- public Function() {
- // for serialization
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.io.Externalizable#writeExternal(java.io.ObjectOutput)
- */
- public void writeExternal(ObjectOutput out) throws IOException {
- out.writeUTF((this.prefix != null) ? this.prefix : "");
- out.writeUTF(this.localName);
- // make sure m isn't null
- getMethod();
- out.writeUTF((this.owner != null) ?
- this.owner :
- this.m.getDeclaringClass().getName());
- out.writeUTF((this.name != null) ?
- this.name :
- this.m.getName());
- out.writeObject((this.types != null) ?
- this.types :
- ReflectionUtil.toTypeNameArray(this.m.getParameterTypes()));
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.io.Externalizable#readExternal(java.io.ObjectInput)
- */
- public void readExternal(ObjectInput in) throws IOException,
- ClassNotFoundException {
-
- this.prefix = in.readUTF();
- if ("".equals(this.prefix)) this.prefix = null;
- this.localName = in.readUTF();
- this.owner = in.readUTF();
- this.name = in.readUTF();
- this.types = (String[]) in.readObject();
- }
-
- public Method getMethod() {
- if (this.m == null) {
- try {
- Class t = ReflectionUtil.forName(this.owner);
- Class[] p = ReflectionUtil.toTypeArray(this.types);
- this.m = t.getMethod(this.name, p);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- return this.m;
- }
-
- public boolean matches(String prefix, String localName) {
- if (this.prefix != null) {
- if (prefix == null) return false;
- if (!this.prefix.equals(prefix)) return false;
- }
- return this.localName.equals(localName);
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#equals(java.lang.Object)
- */
- public boolean equals(Object obj) {
- if (obj instanceof Function) {
- return this.hashCode() == obj.hashCode();
- }
- return false;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#hashCode()
- */
- public int hashCode() {
- return (this.prefix + this.localName).hashCode();
- }
- }
-
-}
diff --git a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/lang/VariableMapperFactory.java b/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/lang/VariableMapperFactory.java
deleted file mode 100644
index 41d4035ef..000000000
--- a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/lang/VariableMapperFactory.java
+++ /dev/null
@@ -1,54 +0,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.
- */
-package org.apache.struts2.el.lang;
-
-import javax.el.ValueExpression;
-import javax.el.VariableMapper;
-
-public class VariableMapperFactory extends VariableMapper {
-
- private final VariableMapper target;
- private VariableMapper momento;
-
- public VariableMapperFactory(VariableMapper target) {
- if (target == null) {
- throw new NullPointerException("Target VariableMapper cannot be null");
- }
- this.target = target;
- }
-
- public VariableMapper create() {
- return this.momento;
- }
-
- public ValueExpression resolveVariable(String variable) {
- ValueExpression expr = this.target.resolveVariable(variable);
- if (expr != null) {
- if (this.momento == null) {
- this.momento = new VariableMapperImpl();
- }
- this.momento.setVariable(variable, expr);
- }
- return expr;
- }
-
- public ValueExpression setVariable(String variable, ValueExpression expression) {
- throw new UnsupportedOperationException("Cannot Set Variables on Factory");
- }
-}
diff --git a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/lang/VariableMapperImpl.java b/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/lang/VariableMapperImpl.java
deleted file mode 100644
index a0012f9e3..000000000
--- a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/lang/VariableMapperImpl.java
+++ /dev/null
@@ -1,57 +0,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.
- */
-package org.apache.struts2.el.lang;
-
-import java.io.Externalizable;
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.el.ValueExpression;
-import javax.el.VariableMapper;
-
-public class VariableMapperImpl extends VariableMapper implements Externalizable {
-
- private static final long serialVersionUID = 1L;
-
- private Map<String, ValueExpression> vars = new HashMap<String, ValueExpression>();
-
- public VariableMapperImpl() {
- super();
- }
-
- public ValueExpression resolveVariable(String variable) {
- return this.vars.get(variable);
- }
-
- public ValueExpression setVariable(String variable,
- ValueExpression expression) {
- return this.vars.put(variable, expression);
- }
-
- public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
- this.vars = (Map<String, ValueExpression>) in.readObject();
- }
-
- public void writeExternal(ObjectOutput out) throws IOException {
- out.writeObject(this.vars);
- }
-}
diff --git a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/ArithmeticNode.java b/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/ArithmeticNode.java
deleted file mode 100644
index f5f75ddd6..000000000
--- a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/ArithmeticNode.java
+++ /dev/null
@@ -1,43 +0,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.
- */
-package org.apache.struts2.el.parser;
-
-import javax.el.ELException;
-
-import org.apache.struts2.el.lang.EvaluationContext;
-
-
-/**
- * @author Jacob Hookom [jacob@hookom.net]
- * @version $Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author: markt $
- */
-public class ArithmeticNode extends SimpleNode {
-
- /**
- * @param i i
- */
- public ArithmeticNode(int i) {
- super(i);
- }
-
- public Class getType(EvaluationContext ctx)
- throws ELException {
- return Number.class;
- }
-}
diff --git a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstAnd.java b/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstAnd.java
deleted file mode 100644
index 6f79ad386..000000000
--- a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstAnd.java
+++ /dev/null
@@ -1,46 +0,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.
- */
-package org.apache.struts2.el.parser;
-
-import javax.el.ELException;
-
-import org.apache.struts2.el.lang.EvaluationContext;
-
-
-/**
- * @author Jacob Hookom [jacob@hookom.net]
- * @version $Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author: markt $
- */
-public final class AstAnd extends BooleanNode {
- public AstAnd(int id) {
- super(id);
- }
-
- public Object getValue(EvaluationContext ctx)
- throws ELException {
- Object obj = children[0].getValue(ctx);
- Boolean b = coerceToBoolean(obj);
- if (!b.booleanValue()) {
- return b;
- }
- obj = children[1].getValue(ctx);
- b = coerceToBoolean(obj);
- return b;
- }
-}
diff --git a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstBracketSuffix.java b/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstBracketSuffix.java
deleted file mode 100644
index 0bf328d49..000000000
--- a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstBracketSuffix.java
+++ /dev/null
@@ -1,39 +0,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.
- */
-package org.apache.struts2.el.parser;
-
-import javax.el.ELException;
-
-import org.apache.struts2.el.lang.EvaluationContext;
-
-
-/**
- * @author Jacob Hookom [jacob@hookom.net]
- * @version $Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author: markt $
- */
-public final class AstBracketSuffix extends SimpleNode {
- public AstBracketSuffix(int id) {
- super(id);
- }
-
- public Object getValue(EvaluationContext ctx)
- throws ELException {
- return this.children[0].getValue(ctx);
- }
-}
diff --git a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstChoice.java b/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstChoice.java
deleted file mode 100644
index 89845e24e..000000000
--- a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstChoice.java
+++ /dev/null
@@ -1,47 +0,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.
- */
-package org.apache.struts2.el.parser;
-
-import javax.el.ELException;
-
-import org.apache.struts2.el.lang.EvaluationContext;
-
-
-/**
- * @author Jacob Hookom [jacob@hookom.net]
- * @version $Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author: markt $
- */
-public final class AstChoice extends SimpleNode {
- public AstChoice(int id) {
- super(id);
- }
-
- public Class getType(EvaluationContext ctx)
- throws ELException {
- Object val = this.getValue(ctx);
- return (val != null) ? val.getClass() : null;
- }
-
- public Object getValue(EvaluationContext ctx)
- throws ELException {
- Object obj0 = this.children[0].getValue(ctx);
- Boolean b0 = coerceToBoolean(obj0);
- return this.children[((b0.booleanValue() ? 1 : 2))].getValue(ctx);
- }
-}
diff --git a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstCompositeExpression.java b/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstCompositeExpression.java
deleted file mode 100644
index 05f8fe164..000000000
--- a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstCompositeExpression.java
+++ /dev/null
@@ -1,55 +0,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.
- */
-package org.apache.struts2.el.parser;
-
-import javax.el.ELException;
-
-import org.apache.struts2.el.lang.EvaluationContext;
-
-
-/**
- * @author Jacob Hookom [jacob@hookom.net]
- * @version $Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author: markt $
- */
-public final class AstCompositeExpression extends SimpleNode {
-
- public AstCompositeExpression(int id) {
- super(id);
- }
-
- public Class getType(EvaluationContext ctx)
- throws ELException {
- return String.class;
- }
-
- public Object getValue(EvaluationContext ctx)
- throws ELException {
- StringBuffer sb = new StringBuffer(16);
- Object obj = null;
- if (this.children != null) {
- for (int i = 0; i < this.children.length; i++) {
- obj = this.children[i].getValue(ctx);
- if (obj != null) {
- sb.append(obj);
- }
- }
- }
- return sb.toString();
- }
-}
diff --git a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstDeferredExpression.java b/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstDeferredExpression.java
deleted file mode 100644
index 1ea15bb4d..000000000
--- a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstDeferredExpression.java
+++ /dev/null
@@ -1,54 +0,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.
- */
-package org.apache.struts2.el.parser;
-
-import javax.el.ELException;
-
-import org.apache.struts2.el.lang.EvaluationContext;
-
-
-/**
- * @author Jacob Hookom [jacob@hookom.net]
- * @version $Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author: markt $
- */
-public final class AstDeferredExpression extends SimpleNode {
- public AstDeferredExpression(int id) {
- super(id);
- }
-
- public Class getType(EvaluationContext ctx)
- throws ELException {
- return this.children[0].getType(ctx);
- }
-
- public Object getValue(EvaluationContext ctx)
- throws ELException {
- return this.children[0].getValue(ctx);
- }
-
- public boolean isReadOnly(EvaluationContext ctx)
- throws ELException {
- return this.children[0].isReadOnly(ctx);
- }
-
- public void setValue(EvaluationContext ctx, Object value)
- throws ELException {
- this.children[0].setValue(ctx, value);
- }
-}
diff --git a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstDiv.java b/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstDiv.java
deleted file mode 100644
index 1d3259706..000000000
--- a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstDiv.java
+++ /dev/null
@@ -1,42 +0,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.
- */
-package org.apache.struts2.el.parser;
-
-import javax.el.ELException;
-
-import org.apache.struts2.el.lang.ELArithmetic;
-import org.apache.struts2.el.lang.EvaluationContext;
-
-
-/**
- * @author Jacob Hookom [jacob@hookom.net]
- * @version $Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author: markt $
- */
-public final class AstDiv extends ArithmeticNode {
- public AstDiv(int id) {
- super(id);
- }
-
- public Object getValue(EvaluationContext ctx)
- throws ELException {
- Object obj0 = this.children[0].getValue(ctx);
- Object obj1 = this.children[1].getValue(ctx);
- return ELArithmetic.divide(obj0, obj1);
- }
-}
diff --git a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstDotSuffix.java b/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstDotSuffix.java
deleted file mode 100644
index 01e02d7cc..000000000
--- a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstDotSuffix.java
+++ /dev/null
@@ -1,39 +0,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.
- */
-package org.apache.struts2.el.parser;
-
-import javax.el.ELException;
-
-import org.apache.struts2.el.lang.EvaluationContext;
-
-
-/**
- * @author Jacob Hookom [jacob@hookom.net]
- * @version $Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author: markt $
- */
-public final class AstDotSuffix extends SimpleNode {
- public AstDotSuffix(int id) {
- super(id);
- }
-
- public Object getValue(EvaluationContext ctx)
- throws ELException {
- return this.image;
- }
-}
diff --git a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstDynamicExpression.java b/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstDynamicExpression.java
deleted file mode 100644
index be33015b8..000000000
--- a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstDynamicExpression.java
+++ /dev/null
@@ -1,54 +0,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.
- */
-package org.apache.struts2.el.parser;
-
-import javax.el.ELException;
-
-import org.apache.struts2.el.lang.EvaluationContext;
-
-
-/**
- * @author Jacob Hookom [jacob@hookom.net]
- * @version $Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author: markt $
- */
-public final class AstDynamicExpression extends SimpleNode {
- public AstDynamicExpression(int id) {
- super(id);
- }
-
- public Class getType(EvaluationContext ctx)
- throws ELException {
- return this.children[0].getType(ctx);
- }
-
- public Object getValue(EvaluationContext ctx)
- throws ELException {
- return this.children[0].getValue(ctx);
- }
-
- public boolean isReadOnly(EvaluationContext ctx)
- throws ELException {
- return this.children[0].isReadOnly(ctx);
- }
-
- public void setValue(EvaluationContext ctx, Object value)
- throws ELException {
- this.children[0].setValue(ctx, value);
- }
-}
diff --git a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstEmpty.java b/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstEmpty.java
deleted file mode 100644
index c53c2a521..000000000
--- a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstEmpty.java
+++ /dev/null
@@ -1,59 +0,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.
- */
-package org.apache.struts2.el.parser;
-
-import java.util.Collection;
-import java.util.Map;
-
-import javax.el.ELException;
-
-import org.apache.struts2.el.lang.EvaluationContext;
-
-
-/**
- * @author Jacob Hookom [jacob@hookom.net]
- * @version $Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author: markt $
- */
-public final class AstEmpty extends SimpleNode {
- public AstEmpty(int id) {
- super(id);
- }
-
- public Class getType(EvaluationContext ctx)
- throws ELException {
- return Boolean.class;
- }
-
- public Object getValue(EvaluationContext ctx)
- throws ELException {
- Object obj = this.children[0].getValue(ctx);
- if (obj == null) {
- return Boolean.TRUE;
- } else if (obj instanceof String) {
- return Boolean.valueOf(((String) obj).length() == 0);
- } else if (obj instanceof Object[]) {
- return Boolean.valueOf(((Object[]) obj).length == 0);
- } else if (obj instanceof Collection) {
- return Boolean.valueOf(((Collection) obj).isEmpty());
- } else if (obj instanceof Map) {
- return Boolean.valueOf(((Map) obj).isEmpty());
- }
- return Boolean.FALSE;
- }
-}
diff --git a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstEqual.java b/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstEqual.java
deleted file mode 100644
index b7aceb7ca..000000000
--- a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstEqual.java
+++ /dev/null
@@ -1,41 +0,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.
- */
-package org.apache.struts2.el.parser;
-
-import javax.el.ELException;
-
-import org.apache.struts2.el.lang.EvaluationContext;
-
-
-/**
- * @author Jacob Hookom [jacob@hookom.net]
- * @version $Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author: markt $
- */
-public final class AstEqual extends BooleanNode {
- public AstEqual(int id) {
- super(id);
- }
-
- public Object getValue(EvaluationContext ctx)
- throws ELException {
- Object obj0 = this.children[0].getValue(ctx);
- Object obj1 = this.children[1].getValue(ctx);
- return Boolean.valueOf(equals(obj0, obj1));
- }
-}
diff --git a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstFalse.java b/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstFalse.java
deleted file mode 100644
index 9042e5283..000000000
--- a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstFalse.java
+++ /dev/null
@@ -1,39 +0,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.
- */
-package org.apache.struts2.el.parser;
-
-import javax.el.ELException;
-
-import org.apache.struts2.el.lang.EvaluationContext;
-
-
-/**
- * @author Jacob Hookom [jacob@hookom.net]
- * @version $Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author: markt $
- */
-public final class AstFalse extends BooleanNode {
- public AstFalse(int id) {
- super(id);
- }
-
- public Object getValue(EvaluationContext ctx)
- throws ELException {
- return Boolean.FALSE;
- }
-}
diff --git a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstFloatingPoint.java b/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstFloatingPoint.java
deleted file mode 100644
index 6cb0ce7ac..000000000
--- a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstFloatingPoint.java
+++ /dev/null
@@ -1,59 +0,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.
- */
-package org.apache.struts2.el.parser;
-
-import java.math.BigDecimal;
-
-import javax.el.ELException;
-
-import org.apache.struts2.el.lang.EvaluationContext;
-
-
-/**
- * @author Jacob Hookom [jacob@hookom.net]
- * @version $Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author: markt $
- */
-public final class AstFloatingPoint extends SimpleNode {
- public AstFloatingPoint(int id) {
- super(id);
- }
-
- private Number number;
-
- public Number getFloatingPoint() {
- if (this.number == null) {
- try {
- this.number = new Double(this.image);
- } catch (ArithmeticException e0) {
- this.number = new BigDecimal(this.image);
- }
- }
- return this.number;
- }
-
- public Object getValue(EvaluationContext ctx)
- throws ELException {
- return this.getFloatingPoint();
- }
-
- public Class getType(EvaluationContext ctx)
- throws ELException {
- return this.getFloatingPoint().getClass();
- }
-}
diff --git a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstFunction.java b/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstFunction.java
deleted file mode 100644
index acecf8cc6..000000000
--- a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstFunction.java
+++ /dev/null
@@ -1,134 +0,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.
- */
-package org.apache.struts2.el.parser;
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-
-import javax.el.ELException;
-import javax.el.FunctionMapper;
-
-import org.apache.struts2.el.lang.EvaluationContext;
-import org.apache.struts2.el.util.MessageFactory;
-
-
-/**
- * @author Jacob Hookom [jacob@hookom.net]
- * @version $Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author: markt $
- */
-public final class AstFunction extends SimpleNode {
-
- protected String localName = "";
-
- protected String prefix = "";
-
- public AstFunction(int id) {
- super(id);
- }
-
- public String getLocalName() {
- return localName;
- }
-
- public String getOutputName() {
- if (this.prefix == null) {
- return this.localName;
- } else {
- return this.prefix + ":" + this.localName;
- }
- }
-
- public String getPrefix() {
- return prefix;
- }
-
- public Class getType(EvaluationContext ctx)
- throws ELException {
-
- FunctionMapper fnMapper = ctx.getFunctionMapper();
-
- // quickly validate again for this request
- if (fnMapper == null) {
- throw new ELException(MessageFactory.get("error.fnMapper.null"));
- }
- Method m = fnMapper.resolveFunction(this.prefix, this.localName);
- if (m == null) {
- throw new ELException(MessageFactory.get("error.fnMapper.method",
- this.getOutputName()));
- }
- return m.getReturnType();
- }
-
- public Object getValue(EvaluationContext ctx)
- throws ELException {
-
- FunctionMapper fnMapper = ctx.getFunctionMapper();
-
- // quickly validate again for this request
- if (fnMapper == null) {
- throw new ELException(MessageFactory.get("error.fnMapper.null"));
- }
- Method m = fnMapper.resolveFunction(this.prefix, this.localName);
- if (m == null) {
- throw new ELException(MessageFactory.get("error.fnMapper.method",
- this.getOutputName()));
- }
-
- Class[] paramTypes = m.getParameterTypes();
- Object[] params = null;
- Object result = null;
- int numParams = this.jjtGetNumChildren();
- if (numParams > 0) {
- params = new Object[numParams];
- try {
- for (int i = 0; i < numParams; i++) {
- params[i] = this.children[i].getValue(ctx);
- params[i] = coerceToType(params[i], paramTypes[i]);
- }
- } catch (ELException ele) {
- throw new ELException(MessageFactory.get("error.function", this
- .getOutputName()), ele);
- }
- }
- try {
- result = m.invoke(null, params);
- } catch (IllegalAccessException iae) {
- throw new ELException(MessageFactory.get("error.function", this
- .getOutputName()), iae);
- } catch (InvocationTargetException ite) {
- throw new ELException(MessageFactory.get("error.function", this
- .getOutputName()), ite.getCause());
- }
- return result;
- }
-
- public void setLocalName(String localName) {
- this.localName = localName;
- }
-
- public void setPrefix(String prefix) {
- this.prefix = prefix;
- }
-
-
- public String toString()
- {
- return ELParserTreeConstants.jjtNodeName[id] + "[" + this.getOutputName() + "]";
- }
-}
diff --git a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstGreaterThan.java b/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstGreaterThan.java
deleted file mode 100644
index dad15a6bc..000000000
--- a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstGreaterThan.java
+++ /dev/null
@@ -1,47 +0,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.
- */
-package org.apache.struts2.el.parser;
-
-import javax.el.ELException;
-
-import org.apache.struts2.el.lang.EvaluationContext;
-
-
-/**
- * @author Jacob Hookom [jacob@hookom.net]
- * @version $Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author: markt $
- */
-public final class AstGreaterThan extends BooleanNode {
- public AstGreaterThan(int id) {
- super(id);
- }
-
- public Object getValue(EvaluationContext ctx)
- throws ELException {
- Object obj0 = this.children[0].getValue(ctx);
- if (obj0 == null) {
- return Boolean.FALSE;
- }
- Object obj1 = this.children[1].getValue(ctx);
- if (obj1 == null) {
- return Boolean.FALSE;
- }
- return (compare(obj0, obj1) > 0) ? Boolean.TRUE : Boolean.FALSE;
- }
-}
diff --git a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstGreaterThanEqual.java b/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstGreaterThanEqual.java
deleted file mode 100644
index a9cbc8b91..000000000
--- a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstGreaterThanEqual.java
+++ /dev/null
@@ -1,47 +0,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.
- */
-package org.apache.struts2.el.parser;
-
-import javax.el.ELException;
-
-import org.apache.struts2.el.lang.EvaluationContext;
-
-
-/**
- * @author Jacob Hookom [jacob@hookom.net]
- * @version $Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author: markt $
- */
-public final class AstGreaterThanEqual extends BooleanNode {
- public AstGreaterThanEqual(int id) {
- super(id);
- }
-
- public Object getValue(EvaluationContext ctx)
- throws ELException {
- Object obj0 = this.children[0].getValue(ctx);
- Object obj1 = this.children[1].getValue(ctx);
- if (obj0 == obj1) {
- return Boolean.TRUE;
- }
- if (obj0 == null || obj1 == null) {
- return Boolean.FALSE;
- }
- return (compare(obj0, obj1) >= 0) ? Boolean.TRUE : Boolean.FALSE;
- }
-}
diff --git a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstIdentifier.java b/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstIdentifier.java
deleted file mode 100644
index 7cc120ee5..000000000
--- a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstIdentifier.java
+++ /dev/null
@@ -1,137 +0,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.
- */
-package org.apache.struts2.el.parser;
-
-import javax.el.ELException;
-import javax.el.MethodExpression;
-import javax.el.MethodInfo;
-import javax.el.MethodNotFoundException;
-import javax.el.ValueExpression;
-import javax.el.VariableMapper;
-
-import org.apache.struts2.el.lang.EvaluationContext;
-
-
-/**
- * @author Jacob Hookom [jacob@hookom.net]
- * @version $Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author: markt $
- */
-public final class AstIdentifier extends SimpleNode {
- public AstIdentifier(int id) {
- super(id);
- }
-
- public Class getType(EvaluationContext ctx) throws ELException {
- VariableMapper varMapper = ctx.getVariableMapper();
- if (varMapper != null) {
- ValueExpression expr = varMapper.resolveVariable(this.image);
- if (expr != null) {
- return expr.getType(ctx.getELContext());
- }
- }
- ctx.setPropertyResolved(false);
- return ctx.getELResolver().getType(ctx, null, this.image);
- }
-
- public Object getValue(EvaluationContext ctx) throws ELException {
- VariableMapper varMapper = ctx.getVariableMapper();
- if (varMapper != null) {
- ValueExpression expr = varMapper.resolveVariable(this.image);
- if (expr != null) {
- return expr.getValue(ctx.getELContext());
- }
- }
- ctx.setPropertyResolved(false);
- return ctx.getELResolver().getValue(ctx, null, this.image);
- }
-
- public boolean isReadOnly(EvaluationContext ctx) throws ELException {
- VariableMapper varMapper = ctx.getVariableMapper();
- if (varMapper != null) {
- ValueExpression expr = varMapper.resolveVariable(this.image);
- if (expr != null) {
- return expr.isReadOnly(ctx.getELContext());
- }
- }
- ctx.setPropertyResolved(false);
- return ctx.getELResolver().isReadOnly(ctx, null, this.image);
- }
-
- public void setValue(EvaluationContext ctx, Object value)
- throws ELException {
- VariableMapper varMapper = ctx.getVariableMapper();
- if (varMapper != null) {
- ValueExpression expr = varMapper.resolveVariable(this.image);
- if (expr != null) {
- expr.setValue(ctx.getELContext(), value);
- return;
- }
- }
- ctx.setPropertyResolved(false);
- ctx.getELResolver().setValue(ctx, null, this.image, value);
- }
-
- public Object invoke(EvaluationContext ctx, Class[] paramTypes,
- Object[] paramValues) throws ELException {
- return this.getMethodExpression(ctx).invoke(ctx.getELContext(), paramValues);
- }
-
-
- public MethodInfo getMethodInfo(EvaluationContext ctx, Class[] paramTypes)
- throws ELException {
- return this.getMethodExpression(ctx).getMethodInfo(ctx.getELContext());
- }
-
- private final MethodExpression getMethodExpression(EvaluationContext ctx)
- throws ELException {
- Object obj = null;
-
- // case A: ValueExpression exists, getValue which must
- // be a MethodExpression
- VariableMapper varMapper = ctx.getVariableMapper();
- ValueExpression ve = null;
- if (varMapper != null) {
- ve = varMapper.resolveVariable(this.image);
- if (ve != null) {
- obj = ve.getValue(ctx);
- }
- }
-
- // case B: evaluate the identity against the ELResolver, again, must be
- // a MethodExpression to be able to invoke
- if (ve == null) {
- ctx.setPropertyResolved(false);
- obj = ctx.getELResolver().getValue(ctx, null, this.image);
- }
-
- // finally provide helpful hints
- if (obj instanceof MethodExpression) {
- return (MethodExpression) obj;
- } else if (obj == null) {
- throw new MethodNotFoundException("Identity '" + this.image
- + "' was null and was unable to invoke");
- } else {
- throw new ELException(
- "Identity '"
- + this.image
- + "' does not reference a MethodExpression instance, returned type: "
- + obj.getClass().getName());
- }
- }
-}
diff --git a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstInteger.java b/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstInteger.java
deleted file mode 100644
index 628c2dc40..000000000
--- a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstInteger.java
+++ /dev/null
@@ -1,59 +0,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.
- */
-package org.apache.struts2.el.parser;
-
-import java.math.BigInteger;
-
-import javax.el.ELException;
-
-import org.apache.struts2.el.lang.EvaluationContext;
-
-
-/**
- * @author Jacob Hookom [jacob@hookom.net]
- * @version $Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author: markt $
- */
-public final class AstInteger extends SimpleNode {
- public AstInteger(int id) {
- super(id);
- }
-
- private Number number;
-
- protected Number getInteger() {
- if (this.number == null) {
- try {
- this.number = new Long(this.image);
- } catch (ArithmeticException e1) {
- this.number = new BigInteger(this.image);
- }
- }
- return number;
- }
-
- public Class getType(EvaluationContext ctx)
- throws ELException {
- return this.getInteger().getClass();
- }
-
- public Object getValue(EvaluationContext ctx)
- throws ELException {
- return this.getInteger();
- }
-}
diff --git a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstLessThan.java b/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstLessThan.java
deleted file mode 100644
index 54b61e854..000000000
--- a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstLessThan.java
+++ /dev/null
@@ -1,46 +0,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.
- */
-package org.apache.struts2.el.parser;
-
-import javax.el.ELException;
-
-import org.apache.struts2.el.lang.EvaluationContext;
-
-/**
- * @author Jacob Hookom [jacob@hookom.net]
- * @version $Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author: markt $
- */
-public final class AstLessThan extends BooleanNode {
- public AstLessThan(int id) {
- super(id);
- }
-
- public Object getValue(EvaluationContext ctx)
- throws ELException {
- Object obj0 = this.children[0].getValue(ctx);
- if (obj0 == null) {
- return Boolean.FALSE;
- }
- Object obj1 = this.children[1].getValue(ctx);
- if (obj1 == null) {
- return Boolean.FALSE;
- }
- return (compare(obj0, obj1) < 0) ? Boolean.TRUE : Boolean.FALSE;
- }
-}
diff --git a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstLessThanEqual.java b/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstLessThanEqual.java
deleted file mode 100644
index 271b3f9d8..000000000
--- a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstLessThanEqual.java
+++ /dev/null
@@ -1,46 +0,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.
- */
-package org.apache.struts2.el.parser;
-
-import javax.el.ELException;
-
-import org.apache.struts2.el.lang.EvaluationContext;
-
-/**
- * @author Jacob Hookom [jacob@hookom.net]
- * @version $Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author: markt $
- */
-public final class AstLessThanEqual extends BooleanNode {
- public AstLessThanEqual(int id) {
- super(id);
- }
-
- public Object getValue(EvaluationContext ctx)
- throws ELException {
- Object obj0 = this.children[0].getValue(ctx);
- Object obj1 = this.children[1].getValue(ctx);
- if (obj0 == obj1) {
- return Boolean.TRUE;
- }
- if (obj0 == null || obj1 == null) {
- return Boolean.FALSE;
- }
- return (compare(obj0, obj1) <= 0) ? Boolean.TRUE : Boolean.FALSE;
- }
-}
diff --git a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstLiteralExpression.java b/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstLiteralExpression.java
deleted file mode 100644
index a5727f61d..000000000
--- a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstLiteralExpression.java
+++ /dev/null
@@ -1,63 +0,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.
- */
-package org.apache.struts2.el.parser;
-
-import javax.el.ELException;
-
-import org.apache.struts2.el.lang.EvaluationContext;
-
-/**
- * @author Jacob Hookom [jacob@hookom.net]
- * @version $Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author: markt $
- */
-public final class AstLiteralExpression extends SimpleNode {
- public AstLiteralExpression(int id) {
- super(id);
- }
-
- public Class getType(EvaluationContext ctx) throws ELException {
- return String.class;
- }
-
- public Object getValue(EvaluationContext ctx) throws ELException {
- return this.image;
- }
-
- public void setImage(String image) {
- if (image.indexOf('\\') == -1) {
- this.image = image;
- return;
- }
- int size = image.length();
- StringBuffer buf = new StringBuffer(size);
- for (int i = 0; i < size; i++) {
- char c = image.charAt(i);
- if (c == '\\' && i + 1 < size) {
- char c1 = image.charAt(i + 1);
- if (c1 == '\\' || c1 == '"' || c1 == '\'' || c1 == '#'
- || c1 == '$') {
- c = c1;
- i++;
- }
- }
- buf.append(c);
- }
- this.image = buf.toString();
- }
-}
diff --git a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstMinus.java b/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstMinus.java
deleted file mode 100644
index 0573515f8..000000000
--- a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstMinus.java
+++ /dev/null
@@ -1,41 +0,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.
- */
-package org.apache.struts2.el.parser;
-
-import javax.el.ELException;
-
-import org.apache.struts2.el.lang.ELArithmetic;
-import org.apache.struts2.el.lang.EvaluationContext;
-
-/**
- * @author Jacob Hookom [jacob@hookom.net]
- * @version $Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author: markt $
- */
-public final class AstMinus extends ArithmeticNode {
- public AstMinus(int id) {
- super(id);
- }
-
- public Object getValue(EvaluationContext ctx)
- throws ELException {
- Object obj0 = this.children[0].getValue(ctx);
- Object obj1 = this.children[1].getValue(ctx);
- return ELArithmetic.subtract(obj0, obj1);
- }
-}
diff --git a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstMod.java b/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstMod.java
deleted file mode 100644
index f322c3a1a..000000000
--- a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstMod.java
+++ /dev/null
@@ -1,41 +0,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.
- */
-package org.apache.struts2.el.parser;
-
-import javax.el.ELException;
-
-import org.apache.struts2.el.lang.ELArithmetic;
-import org.apache.struts2.el.lang.EvaluationContext;
-
-/**
- * @author Jacob Hookom [jacob@hookom.net]
- * @version $Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author: markt $
- */
-public final class AstMod extends ArithmeticNode {
- public AstMod(int id) {
- super(id);
- }
-
- public Object getValue(EvaluationContext ctx)
- throws ELException {
- Object obj0 = this.children[0].getValue(ctx);
- Object obj1 = this.children[1].getValue(ctx);
- return ELArithmetic.mod(obj0, obj1);
- }
-}
diff --git a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstMult.java b/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstMult.java
deleted file mode 100644
index 389b03473..000000000
--- a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstMult.java
+++ /dev/null
@@ -1,41 +0,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.
- */
-package org.apache.struts2.el.parser;
-
-import javax.el.ELException;
-
-import org.apache.struts2.el.lang.ELArithmetic;
-import org.apache.struts2.el.lang.EvaluationContext;
-
-/**
- * @author Jacob Hookom [jacob@hookom.net]
- * @version $Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author: markt $
- */
-public final class AstMult extends ArithmeticNode {
- public AstMult(int id) {
- super(id);
- }
-
- public Object getValue(EvaluationContext ctx)
- throws ELException {
- Object obj0 = this.children[0].getValue(ctx);
- Object obj1 = this.children[1].getValue(ctx);
- return ELArithmetic.multiply(obj0, obj1);
- }
-}
diff --git a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstNegative.java b/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstNegative.java
deleted file mode 100644
index f93b82391..000000000
--- a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstNegative.java
+++ /dev/null
@@ -1,82 +0,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.
- */
-package org.apache.struts2.el.parser;
-
-import java.math.BigDecimal;
-import java.math.BigInteger;
-
-import javax.el.ELException;
-
-import org.apache.struts2.el.lang.EvaluationContext;
-
-/**
- * @author Jacob Hookom [jacob@hookom.net]
- * @version $Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author: markt $
- */
-public final class AstNegative extends SimpleNode {
- public AstNegative(int id) {
- super(id);
- }
-
- public Class getType(EvaluationContext ctx)
- throws ELException {
- return Number.class;
- }
-
- public Object getValue(EvaluationContext ctx)
- throws ELException {
- Object obj = this.children[0].getValue(ctx);
-
- if (obj == null) {
- return new Long(0);
- }
- if (obj instanceof BigDecimal) {
- return ((BigDecimal) obj).negate();
- }
- if (obj instanceof BigInteger) {
- return ((BigInteger) obj).negate();
- }
- if (obj instanceof String) {
- if (isStringFloat((String) obj)) {
- return new Double(-Double.parseDouble((String) obj));
- }
- return new Long(-Long.parseLong((String) obj));
- }
- if (obj instanceof Long) {
- return new Long(-((Long) obj).longValue());
- }
- if (obj instanceof Double) {
- return new Double(-((Double) obj).doubleValue());
- }
- if (obj instanceof Integer) {
- return new Integer(-((Integer) obj).intValue());
- }
- if (obj instanceof Float) {
- return new Float(-((Float) obj).floatValue());
- }
- if (obj instanceof Short) {
- return new Short((short) -((Short) obj).shortValue());
- }
- if (obj instanceof Byte) {
- return new Byte((byte) -((Byte) obj).byteValue());
- }
- Long num = (Long) coerceToNumber(obj, Long.class);
- return new Long(-num.longValue());
- }
-}
diff --git a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstNot.java b/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstNot.java
deleted file mode 100644
index 3bda765ff..000000000
--- a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstNot.java
+++ /dev/null
@@ -1,45 +0,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.
- */
-package org.apache.struts2.el.parser;
-
-import javax.el.ELException;
-
-import org.apache.struts2.el.lang.EvaluationContext;
-
-/**
- * @author Jacob Hookom [jacob@hookom.net]
- * @version $Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author: markt $
- */
-public final class AstNot extends SimpleNode {
- public AstNot(int id) {
- super(id);
- }
-
- public Class getType(EvaluationContext ctx)
- throws ELException {
- return Boolean.class;
- }
-
- public Object getValue(EvaluationContext ctx)
- throws ELException {
- Object obj = this.children[0].getValue(ctx);
- Boolean b = coerceToBoolean(obj);
- return Boolean.valueOf(!b.booleanValue());
- }
-}
diff --git a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstNotEqual.java b/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstNotEqual.java
deleted file mode 100644
index 8f1a2cdda..000000000
--- a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstNotEqual.java
+++ /dev/null
@@ -1,40 +0,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.
- */
-package org.apache.struts2.el.parser;
-
-import javax.el.ELException;
-
-import org.apache.struts2.el.lang.EvaluationContext;
-
-/**
- * @author Jacob Hookom [jacob@hookom.net]
- * @version $Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author: markt $
- */
-public final class AstNotEqual extends BooleanNode {
- public AstNotEqual(int id) {
- super(id);
- }
-
- public Object getValue(EvaluationContext ctx)
- throws ELException {
- Object obj0 = this.children[0].getValue(ctx);
- Object obj1 = this.children[1].getValue(ctx);
- return Boolean.valueOf(!equals(obj0, obj1));
- }
-}
diff --git a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstNull.java b/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstNull.java
deleted file mode 100644
index a06bb6228..000000000
--- a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstNull.java
+++ /dev/null
@@ -1,43 +0,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.
- */
-package org.apache.struts2.el.parser;
-
-import javax.el.ELException;
-
-import org.apache.struts2.el.lang.EvaluationContext;
-
-/**
- * @author Jacob Hookom [jacob@hookom.net]
- * @version $Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author: markt $
- */
-public final class AstNull extends SimpleNode {
- public AstNull(int id) {
- super(id);
- }
-
- public Class getType(EvaluationContext ctx)
- throws ELException {
- return null;
- }
-
- public Object getValue(EvaluationContext ctx)
- throws ELException {
- return null;
- }
-}
diff --git a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstOr.java b/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstOr.java
deleted file mode 100644
index 6b62f29e7..000000000
--- a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstOr.java
+++ /dev/null
@@ -1,45 +0,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.
- */
-package org.apache.struts2.el.parser;
-
-import javax.el.ELException;
-
-import org.apache.struts2.el.lang.EvaluationContext;
-
-/**
- * @author Jacob Hookom [jacob@hookom.net]
- * @version $Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author: markt $
- */
-public final class AstOr extends BooleanNode {
- public AstOr(int id) {
- super(id);
- }
-
- public Object getValue(EvaluationContext ctx)
- throws ELException {
- Object obj = this.children[0].getValue(ctx);
- Boolean b = coerceToBoolean(obj);
- if (b.booleanValue()) {
- return b;
- }
- obj = this.children[1].getValue(ctx);
- b = coerceToBoolean(obj);
- return b;
- }
-}
diff --git a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstPlus.java b/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstPlus.java
deleted file mode 100644
index ed783c3c1..000000000
--- a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstPlus.java
+++ /dev/null
@@ -1,41 +0,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.
- */
-package org.apache.struts2.el.parser;
-
-import javax.el.ELException;
-
-import org.apache.struts2.el.lang.ELArithmetic;
-import org.apache.struts2.el.lang.EvaluationContext;
-
-/**
- * @author Jacob Hookom [jacob@hookom.net]
- * @version $Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author: markt $
- */
-public final class AstPlus extends ArithmeticNode {
- public AstPlus(int id) {
- super(id);
- }
-
- public Object getValue(EvaluationContext ctx)
- throws ELException {
- Object obj0 = this.children[0].getValue(ctx);
- Object obj1 = this.children[1].getValue(ctx);
- return ELArithmetic.add(obj0, obj1);
- }
-}
diff --git a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstString.java b/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstString.java
deleted file mode 100644
index d40c32215..000000000
--- a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstString.java
+++ /dev/null
@@ -1,74 +0,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.
- */
-package org.apache.struts2.el.parser;
-
-import javax.el.ELException;
-
-import org.apache.struts2.el.lang.EvaluationContext;
-
-/**
- * @author Jacob Hookom [jacob@hookom.net]
- * @version $Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author: markt $
- */
-public final class AstString extends SimpleNode {
- public AstString(int id) {
- super(id);
- }
-
- private String string;
-
- public String getString() {
- if (this.string == null) {
- this.string = this.image.substring(1, this.image.length() - 1);
- }
- return this.string;
- }
-
- public Class getType(EvaluationContext ctx)
- throws ELException {
- return String.class;
- }
-
- public Object getValue(EvaluationContext ctx)
- throws ELException {
- return this.getString();
- }
-
- public void setImage(String image) {
- if (image.indexOf('\\') == -1) {
- this.image = image;
- return;
- }
- int size = image.length();
- StringBuffer buf = new StringBuffer(size);
- for (int i = 0; i < size; i++) {
- char c = image.charAt(i);
- if (c == '\\' && i + 1 < size) {
- char c1 = image.charAt(i + 1);
- if (c1 == '\\' || c1 == '"' || c1 == '\'' || c1 == '#'
- || c1 == '$') {
- c = c1;
- i++;
- }
- }
- buf.append(c);
- }
- this.image = buf.toString();
- }
-}
diff --git a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstTrue.java b/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstTrue.java
deleted file mode 100644
index 3ecce9fa9..000000000
--- a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstTrue.java
+++ /dev/null
@@ -1,38 +0,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.
- */
-package org.apache.struts2.el.parser;
-
-import javax.el.ELException;
-
-import org.apache.struts2.el.lang.EvaluationContext;
-
-/**
- * @author Jacob Hookom [jacob@hookom.net]
- * @version $Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author: markt $
- */
-public final class AstTrue extends BooleanNode {
- public AstTrue(int id) {
- super(id);
- }
-
- public Object getValue(EvaluationContext ctx)
- throws ELException {
- return Boolean.TRUE;
- }
-}
diff --git a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstValue.java b/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstValue.java
deleted file mode 100644
index 572ced678..000000000
--- a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/AstValue.java
+++ /dev/null
@@ -1,179 +0,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.
- */
-package org.apache.struts2.el.parser;
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-
-import javax.el.ELException;
-import javax.el.ELResolver;
-import javax.el.MethodInfo;
-import javax.el.PropertyNotFoundException;
-
-import org.apache.struts2.el.lang.ELSupport;
-import org.apache.struts2.el.lang.EvaluationContext;
-import org.apache.struts2.el.util.MessageFactory;
-import org.apache.struts2.el.util.ReflectionUtil;
-
-/**
- * @author Jacob Hookom [jacob@hookom.net]
- * @version $Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author: markt $
- */
-public final class AstValue extends SimpleNode {
-
- protected static final boolean COERCE_TO_ZERO =
- Boolean.valueOf(System.getProperty(
- "org.apache.el.parser.COERCE_TO_ZERO", "true")).booleanValue();
-
- protected static class Target {
- protected Object base;
-
- protected Object property;
- }
-
- public AstValue(int id) {
- super(id);
- }
-
- public Class getType(EvaluationContext ctx) throws ELException {
- Target t = getTarget(ctx);
- ctx.setPropertyResolved(false);
- return ctx.getELResolver().getType(ctx, t.base, t.property);
- }
-
- private final Target getTarget(EvaluationContext ctx) throws ELException {
- // evaluate expr-a to value-a
- Object base = this.children[0].getValue(ctx);
-
- // if our base is null (we know there are more properites to evaluate)
- if (base == null) {
- throw new PropertyNotFoundException(MessageFactory.get(
- "error.unreachable.base", this.children[0].getImage()));
- }
-
- // set up our start/end
- Object property = null;
- int propCount = this.jjtGetNumChildren() - 1;
- int i = 1;
-
- // evaluate any properties before our target
- ELResolver resolver = ctx.getELResolver();
- if (propCount > 1) {
- while (base != null && i < propCount) {
- property = this.children[i].getValue(ctx);
- ctx.setPropertyResolved(false);
- base = resolver.getValue(ctx, base, property);
- i++;
- }
- // if we are in this block, we have more properties to resolve,
- // but our base was null
- if (base == null || property == null) {
- throw new PropertyNotFoundException(MessageFactory.get(
- "error.unreachable.property", property));
- }
- }
-
- property = this.children[i].getValue(ctx);
-
- if (property == null) {
- throw new PropertyNotFoundException(MessageFactory.get(
- "error.unreachable.property", this.children[i]));
- }
-
- Target t = new Target();
- t.base = base;
- t.property = property;
- return t;
- }
-
- public Object getValue(EvaluationContext ctx) throws ELException {
- Object base = this.children[0].getValue(ctx);
- int propCount = this.jjtGetNumChildren();
- int i = 1;
- Object property = null;
- ELResolver resolver = ctx.getELResolver();
- while (base != null && i < propCount) {
- property = this.children[i].getValue(ctx);
- if (property == null) {
- return null;
- } else {
- ctx.setPropertyResolved(false);
- base = resolver.getValue(ctx, base, property);
- }
- i++;
- }
- return base;
- }
-
- public boolean isReadOnly(EvaluationContext ctx) throws ELException {
- Target t = getTarget(ctx);
- ctx.setPropertyResolved(false);
- return ctx.getELResolver().isReadOnly(ctx, t.base, t.property);
- }
-
- public void setValue(EvaluationContext ctx, Object value)
- throws ELException {
- Target t = getTarget(ctx);
- ctx.setPropertyResolved(false);
- ELResolver resolver = ctx.getELResolver();
-
- // coerce to the expected type
- Class<?> targetClass = resolver.getType(ctx, t.base, t.property);
- if (COERCE_TO_ZERO == true
- || !isAssignable(value, targetClass)) {
- value = ELSupport.coerceToType(value, targetClass);
- }
- resolver.setValue(ctx, t.base, t.property, value);
- }
-
- private boolean isAssignable(Object value, Class<?> targetClass) {
- if (targetClass == null) {
- return false;
- } else if (value != null && targetClass.isPrimitive()) {
- return false;
- } else if (value != null && !targetClass.isInstance(value)) {
- return false;
- }
- return true;
- }
-
-
- public MethodInfo getMethodInfo(EvaluationContext ctx, Class[] paramTypes)
- throws ELException {
- Target t = getTarget(ctx);
- Method m = ReflectionUtil.getMethod(t.base, t.property, paramTypes);
- return new MethodInfo(m.getName(), m.getReturnType(), m
- .getParameterTypes());
- }
-
- public Object invoke(EvaluationContext ctx, Class[] paramTypes,
- Object[] paramValues) throws ELException {
- Target t = getTarget(ctx);
- Method m = ReflectionUtil.getMethod(t.base, t.property, paramTypes);
- Object result = null;
- try {
- result = m.invoke(t.base, (Object[]) paramValues);
- } catch (IllegalAccessException iae) {
- throw new ELException(iae);
- } catch (InvocationTargetException ite) {
- throw new ELException(ite.getCause());
- }
- return result;
- }
-}
diff --git a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/BooleanNode.java b/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/BooleanNode.java
deleted file mode 100644
index 586898495..000000000
--- a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/BooleanNode.java
+++ /dev/null
@@ -1,40 +0,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.
- */
-package org.apache.struts2.el.parser;
-
-import javax.el.ELException;
-
-import org.apache.struts2.el.lang.EvaluationContext;
-
-/**
- * @author Jacob Hookom [jacob@hookom.net]
- * @version $Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author: markt $
- */
-public class BooleanNode extends SimpleNode {
- /**
- * @param i i
- */
- public BooleanNode(int i) {
- super(i);
- }
- public Class getType(EvaluationContext ctx)
- throws ELException {
- return Boolean.class;
- }
-}
diff --git a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/ELParser.html b/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/ELParser.html
deleted file mode 100644
index 24a312a6c..000000000
--- a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/ELParser.html
+++ /dev/null
@@ -1,223 +0,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.
--->
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
-<HTML>
-<HEAD>
-<TITLE>BNF for ELParser.jj</TITLE>
-</HEAD>
-<BODY>
-<H1 ALIGN=CENTER>BNF for ELParser.jj</H1>
-<H2 ALIGN=CENTER>NON-TERMINALS</H2>
-<TABLE>
-<TR>
-<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod1">CompositeExpression</A></TD>
-<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
-<TD ALIGN=LEFT VALIGN=BASELINE>( <A HREF="#prod2">DeferredExpression</A> | <A HREF="#prod3">DynamicExpression</A> | <A HREF="#prod4">LiteralExpression</A> )* <EOF></TD>
-</TR>
-<TR>
-<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod4">LiteralExpression</A></TD>
-<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
-<TD ALIGN=LEFT VALIGN=BASELINE><LITERAL_EXPRESSION></TD>
-</TR>
-<TR>
-<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod2">DeferredExpression</A></TD>
-<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
-<TD ALIGN=LEFT VALIGN=BASELINE><START_DEFERRED_EXPRESSION> <A HREF="#prod5">Expression</A> <END_EXPRESSION></TD>
-</TR>
-<TR>
-<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod3">DynamicExpression</A></TD>
-<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
-<TD ALIGN=LEFT VALIGN=BASELINE><START_DYNAMIC_EXPRESSION> <A HREF="#prod5">Expression</A> <END_EXPRESSION></TD>
-</TR>
-<TR>
-<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod5">Expression</A></TD>
-<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
-<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod6">Choice</A></TD>
-</TR>
-<TR>
-<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod6">Choice</A></TD>
-<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
-<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod7">Or</A> ( <QUESTIONMARK> <A HREF="#prod6">Choice</A> <COLON> <A HREF="#prod6">Choice</A> )*</TD>
-</TR>
-<TR>
-<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod7">Or</A></TD>
-<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
-<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod8">And</A> ( ( <OR0> | <OR1> ) <A HREF="#prod8">And</A> )*</TD>
-</TR>
-<TR>
-<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod8">And</A></TD>
-<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
-<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod9">Equality</A> ( ( <AND0> | <AND1> ) <A HREF="#prod9">Equality</A> )*</TD>
-</TR>
-<TR>
-<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod9">Equality</A></TD>
-<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
-<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod10">Compare</A> ( ( ( <EQ0> | <EQ1> ) <A HREF="#prod10">Compare</A> ) | ( ( <NE0> | <NE1> ) <A HREF="#prod10">Compare</A> ) )*</TD>
-</TR>
-<TR>
-<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod10">Compare</A></TD>
-<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
-<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod11">Math</A> ( ( ( <LT0> | <LT1> ) <A HREF="#prod11">Math</A> ) | ( ( <GT0> | <GT1> ) <A HREF="#prod11">Math</A> ) | ( ( <LE0> | <LE1> ) <A HREF="#prod11">Math</A> ) | ( ( <GE0> | <GE1> ) <A HREF="#prod11">Math</A> ) )*</TD>
-</TR>
-<TR>
-<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod11">Math</A></TD>
-<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
-<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod12">Multiplication</A> ( ( <PLUS> <A HREF="#prod12">Multiplication</A> ) | ( <MINUS> <A HREF="#prod12">Multiplication</A> ) )*</TD>
-</TR>
-<TR>
-<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod12">Multiplication</A></TD>
-<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
-<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod13">Unary</A> ( ( <MULT> <A HREF="#prod13">Unary</A> ) | ( <DIV> <A HREF="#prod13">Unary</A> ) | ( ( <MOD0> | <MOD1> ) <A HREF="#prod13">Unary</A> ) )*</TD>
-</TR>
-<TR>
-<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod13">Unary</A></TD>
-<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
-<TD ALIGN=LEFT VALIGN=BASELINE><MINUS> <A HREF="#prod13">Unary</A></TD>
-</TR>
-<TR>
-<TD ALIGN=RIGHT VALIGN=BASELINE></TD>
-<TD ALIGN=CENTER VALIGN=BASELINE>|</TD>
-<TD ALIGN=LEFT VALIGN=BASELINE>( <NOT0> | <NOT1> ) <A HREF="#prod13">Unary</A></TD>
-</TR>
-<TR>
-<TD ALIGN=RIGHT VALIGN=BASELINE></TD>
-<TD ALIGN=CENTER VALIGN=BASELINE>|</TD>
-<TD ALIGN=LEFT VALIGN=BASELINE><EMPTY> <A HREF="#prod13">Unary</A></TD>
-</TR>
-<TR>
-<TD ALIGN=RIGHT VALIGN=BASELINE></TD>
-<TD ALIGN=CENTER VALIGN=BASELINE>|</TD>
-<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod14">Value</A></TD>
-</TR>
-<TR>
-<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod14">Value</A></TD>
-<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
-<TD ALIGN=LEFT VALIGN=BASELINE>( <A HREF="#prod15">ValuePrefix</A> ( <A HREF="#prod16">ValueSuffix</A> )* )</TD>
-</TR>
-<TR>
-<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod15">ValuePrefix</A></TD>
-<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
-<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod17">Literal</A></TD>
-</TR>
-<TR>
-<TD ALIGN=RIGHT VALIGN=BASELINE></TD>
-<TD ALIGN=CENTER VALIGN=BASELINE>|</TD>
-<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod18">NonLiteral</A></TD>
-</TR>
-<TR>
-<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod16">ValueSuffix</A></TD>
-<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
-<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod19">DotSuffix</A></TD>
-</TR>
-<TR>
-<TD ALIGN=RIGHT VALIGN=BASELINE></TD>
-<TD ALIGN=CENTER VALIGN=BASELINE>|</TD>
-<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod20">BracketSuffix</A></TD>
-</TR>
-<TR>
-<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod19">DotSuffix</A></TD>
-<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
-<TD ALIGN=LEFT VALIGN=BASELINE><DOT> <IDENTIFIER></TD>
-</TR>
-<TR>
-<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod20">BracketSuffix</A></TD>
-<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
-<TD ALIGN=LEFT VALIGN=BASELINE><LBRACK> <A HREF="#prod5">Expression</A> <RBRACK></TD>
-</TR>
-<TR>
-<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod18">NonLiteral</A></TD>
-<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
-<TD ALIGN=LEFT VALIGN=BASELINE><LPAREN> <A HREF="#prod5">Expression</A> <RPAREN></TD>
-</TR>
-<TR>
-<TD ALIGN=RIGHT VALIGN=BASELINE></TD>
-<TD ALIGN=CENTER VALIGN=BASELINE>|</TD>
-<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod21">Function</A></TD>
-</TR>
-<TR>
-<TD ALIGN=RIGHT VALIGN=BASELINE></TD>
-<TD ALIGN=CENTER VALIGN=BASELINE>|</TD>
-<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod22">Identifier</A></TD>
-</TR>
-<TR>
-<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod22">Identifier</A></TD>
-<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
-<TD ALIGN=LEFT VALIGN=BASELINE><IDENTIFIER></TD>
-</TR>
-<TR>
-<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod21">Function</A></TD>
-<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
-<TD ALIGN=LEFT VALIGN=BASELINE><IDENTIFIER> ( <FUNCTIONSUFFIX> )? <LPAREN> ( <A HREF="#prod5">Expression</A> ( <COMMA> <A HREF="#prod5">Expression</A> )* )? <RPAREN></TD>
-</TR>
-<TR>
-<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod17">Literal</A></TD>
-<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
-<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod23">Boolean</A></TD>
-</TR>
-<TR>
-<TD ALIGN=RIGHT VALIGN=BASELINE></TD>
-<TD ALIGN=CENTER VALIGN=BASELINE>|</TD>
-<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod24">FloatingPoint</A></TD>
-</TR>
-<TR>
-<TD ALIGN=RIGHT VALIGN=BASELINE></TD>
-<TD ALIGN=CENTER VALIGN=BASELINE>|</TD>
-<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod25">Integer</A></TD>
-</TR>
-<TR>
-<TD ALIGN=RIGHT VALIGN=BASELINE></TD>
-<TD ALIGN=CENTER VALIGN=BASELINE>|</TD>
-<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod26">String</A></TD>
-</TR>
-<TR>
-<TD ALIGN=RIGHT VALIGN=BASELINE></TD>
-<TD ALIGN=CENTER VALIGN=BASELINE>|</TD>
-<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod27">Null</A></TD>
-</TR>
-<TR>
-<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod23">Boolean</A></TD>
-<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
-<TD ALIGN=LEFT VALIGN=BASELINE><TRUE></TD>
-</TR>
-<TR>
-<TD ALIGN=RIGHT VALIGN=BASELINE></TD>
-<TD ALIGN=CENTER VALIGN=BASELINE>|</TD>
-<TD ALIGN=LEFT VALIGN=BASELINE><FALSE></TD>
-</TR>
-<TR>
-<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod24">FloatingPoint</A></TD>
-<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
-<TD ALIGN=LEFT VALIGN=BASELINE><FLOATING_POINT_LITERAL></TD>
-</TR>
-<TR>
-<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod25">Integer</A></TD>
-<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
-<TD ALIGN=LEFT VALIGN=BASELINE><INTEGER_LITERAL></TD>
-</TR>
-<TR>
-<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod26">String</A></TD>
-<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
-<TD ALIGN=LEFT VALIGN=BASELINE><STRING_LITERAL></TD>
-</TR>
-<TR>
-<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod27">Null</A></TD>
-<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
-<TD ALIGN=LEFT VALIGN=BASELINE><NULL></TD>
-</TR>
-</TABLE>
-</BODY>
-</HTML>
diff --git a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/ELParser.java b/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/ELParser.java
deleted file mode 100644
index 56e31c49b..000000000
--- a/plugins/embeddedjsp/src/main/java/org/apache/struts2/el/parser/ELParser.java
+++ /dev/null
@@ -1,2483 +0,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.
- */
-/* Generated By:JJTree&JavaCC: Do not edit this line. ELParser.java */
-package org.apache.struts2.el.parser;
-
-import javax.el.ELException;
-import java.io.StringReader;
-
-public class ELParser/*@bgen(jjtree)*/ implements ELParserTreeConstants, ELParserConstants {/*@bgen(jjtree)*/
- protected JJTELParserState jjtree = new JJTELParserState();
-
- public static Node parse(String ref) throws ELException {
- try {
- return (new ELParser(new StringReader(ref))).CompositeExpression();
- } catch (ParseException pe) {
- throw new ELException(pe.getMessage());
- }
- }
-
- /*
- * CompositeExpression
- * Allow most flexible parsing, restrict by examining
- * type of returned node
- */
- final public AstCompositeExpression CompositeExpression() throws ParseException {
- /*@bgen(jjtree) CompositeExpression */
- AstCompositeExpression jjtn000 = new AstCompositeExpression(JJTCOMPOSITEEXPRESSION);
- boolean jjtc000 = true;
- jjtree.openNodeScope(jjtn000);
- try {
- label_1:
- while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case LITERAL_EXPRESSION:
- case START_DYNAMIC_EXPRESSION:
- case START_DEFERRED_EXPRESSION:
- ;
- break;
- default:
- jj_la1[0] = jj_gen;
- break label_1;
- }
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case START_DEFERRED_EXPRESSION:
- DeferredExpression();
- break;
- case START_DYNAMIC_EXPRESSION:
- DynamicExpression();
- break;
- case LITERAL_EXPRESSION:
- LiteralExpression();
- break;
- default:
- jj_la1[1] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- }
- jj_consume_token(0);
- jjtree.closeNodeScope(jjtn000, true);
- jjtc000 = false;
- {
- if (true) return jjtn000;
- }
- } catch (Throwable jjte000) {
- if (jjtc000) {
- jjtree.clearNodeScope(jjtn000);
- jjtc000 = false;
- } else {
- jjtree.popNode();
- }
- if (jjte000 instanceof RuntimeException) {
- {
- if (true) throw (RuntimeException) jjte000;
- }
- }
- if (jjte000 instanceof ParseException) {
- {
- if (true) throw (ParseException) jjte000;
- }
- }
- {
- if (true) throw (Error) jjte000;
- }
- } finally {
- if (jjtc000) {
- jjtree.closeNodeScope(jjtn000, true);
- }
- }
- throw new Error("Missing return statement in function");
- }
-
- /*
- * LiteralExpression
- * Non-EL Expression blocks
- */
- final public void LiteralExpression() throws ParseException {
- /*@bgen(jjtree) LiteralExpression */
- AstLiteralExpression jjtn000 = new AstLiteralExpression(JJTLITERALEXPRESSION);
- boolean jjtc000 = true;
- jjtree.openNodeScope(jjtn000);
- Token t = null;
- try {
- t = jj_consume_token(LITERAL_EXPRESSION);
- jjtree.closeNodeScope(jjtn000, true);
- jjtc000 = false;
- jjtn000.setImage(t.image);
- } finally {
- if (jjtc000) {
- jjtree.closeNodeScope(jjtn000, true);
- }
- }
- }
-
- /*
- * DeferredExpression
- * #{..} Expressions
- */
- final public void DeferredExpression() throws ParseException {
- /*@bgen(jjtree) DeferredExpression */
- AstDeferredExpression jjtn000 = new AstDeferredExpression(JJTDEFERREDEXPRESSION);
- boolean jjtc000 = true;
- jjtree.openNodeScope(jjtn000);
- try {
- jj_consume_token(START_DEFERRED_EXPRESSION);
- Expression();
- jj_consume_token(END_EXPRESSION);
- } catch (Throwable jjte000) {
- if (jjtc000) {
- jjtree.clearNodeScope(jjtn000);
- jjtc000 = false;
- } else {
- jjtree.popNode();
- }
- if (jjte000 instanceof RuntimeException) {
- {
- if (true) throw (RuntimeException) jjte000;
- }
- }
- if (jjte000 instanceof ParseException) {
- {
- if (true) throw (ParseException) jjte000;
- }
- }
- {
- if (true) throw (Error) jjte000;
- }
- } finally {
- if (jjtc000) {
- jjtree.closeNodeScope(jjtn000, true);
- }
- }
- }
-
- /*
- * DynamicExpression
- * ${..} Expressions
- */
- final public void DynamicExpression() throws ParseException {
- /*@bgen(jjtree) DynamicExpression */
- AstDynamicExpression jjtn000 = new AstDynamicExpression(JJTDYNAMICEXPRESSION);
- boolean jjtc000 = true;
- jjtree.openNodeScope(jjtn000);
- try {
- jj_consume_token(START_DYNAMIC_EXPRESSION);
- Expression();
- jj_consume_token(END_EXPRESSION);
- } catch (Throwable jjte000) {
- if (jjtc000) {
- jjtree.clearNodeScope(jjtn000);
- jjtc000 = false;
- } else {
- jjtree.popNode();
- }
- if (jjte000 instanceof RuntimeException) {
- {
- if (true) throw (RuntimeException) jjte000;
- }
- }
- if (jjte000 instanceof ParseException) {
- {
- if (true) throw (ParseException) jjte000;
- }
- }
- {
- if (true) throw (Error) jjte000;
- }
- } finally {
- if (jjtc000) {
- jjtree.closeNodeScope(jjtn000, true);
- }
- }
- }
-
- /*
- * Expression
- * EL Expression Language Root, goes to Choice
- */
- final public void Expression() throws ParseException {
- Choice();
- }
-
- /*
- * Choice
- * For Choice markup a ? b : c, then Or
- */
- final public void Choice() throws ParseException {
- Or();
- label_2:
- while (true) {
- if (jj_2_1(3)) {
- ;
- } else {
- break label_2;
- }
- jj_consume_token(QUESTIONMARK);
- Choice();
- jj_consume_token(COLON);
- AstChoice jjtn001 = new AstChoice(JJTCHOICE);
- boolean jjtc001 = true;
- jjtree.openNodeScope(jjtn001);
- try {
- Choice();
- } catch (Throwable jjte001) {
- if (jjtc001) {
- jjtree.clearNodeScope(jjtn001);
- jjtc001 = false;
- } else {
- jjtree.popNode();
- }
- if (jjte001 instanceof RuntimeException) {
- {
- if (true) throw (RuntimeException) jjte001;
- }
- }
- if (jjte001 instanceof ParseException) {
- {
- if (true) throw (ParseException) jjte001;
- }
- }
- {
- if (true) throw (Error) jjte001;
- }
- } finally {
- if (jjtc001) {
- jjtree.closeNodeScope(jjtn001, 3);
- }
- }
- }
- }
-
- /*
- * Or
- * For 'or' '||', then And
- */
- final public void Or() throws ParseException {
- And();
- label_3:
- while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case OR0:
- case OR1:
- ;
- break;
- default:
- jj_la1[2] = jj_gen;
- break label_3;
- }
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case OR0:
- jj_consume_token(OR0);
- break;
- case OR1:
- jj_consume_token(OR1);
- break;
- default:
- jj_la1[3] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- AstOr jjtn001 = new AstOr(JJTOR);
- boolean jjtc001 = true;
- jjtree.openNodeScope(jjtn001);
- try {
- And();
- } catch (Throwable jjte001) {
- if (jjtc001) {
- jjtree.clearNodeScope(jjtn001);
- jjtc001 = false;
- } else {
- jjtree.popNode();
- }
- if (jjte001 instanceof RuntimeException) {
- {
- if (true) throw (RuntimeException) jjte001;
- }
- }
- if (jjte001 instanceof ParseException) {
- {
- if (true) throw (ParseException) jjte001;
- }
- }
- {
- if (true) throw (Error) jjte001;
- }
- } finally {
- if (jjtc001) {
- jjtree.closeNodeScope(jjtn001, 2);
- }
- }
- }
- }
-
- /*
- * And
- * For 'and' '&&', then Equality
- */
- final public void And() throws ParseException {
- Equality();
- label_4:
- while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case AND0:
- case AND1:
- ;
- break;
- default:
- jj_la1[4] = jj_gen;
- break label_4;
- }
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case AND0:
- jj_consume_token(AND0);
- break;
- case AND1:
- jj_consume_token(AND1);
- break;
- default:
- jj_la1[5] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- AstAnd jjtn001 = new AstAnd(JJTAND);
- boolean jjtc001 = true;
- jjtree.openNodeScope(jjtn001);
- try {
- Equality();
- } catch (Throwable jjte001) {
- if (jjtc001) {
- jjtree.clearNodeScope(jjtn001);
- jjtc001 = false;
- } else {
- jjtree.popNode();
- }
- if (jjte001 instanceof RuntimeException) {
- {
- if (true) throw (RuntimeException) jjte001;
- }
- }
- if (jjte001 instanceof ParseException) {
- {
- if (true) throw (ParseException) jjte001;
- }
- }
- {
- if (true) throw (Error) jjte001;
- }
- } finally {
- if (jjtc001) {
- jjtree.closeNodeScope(jjtn001, 2);
- }
- }
- }
- }
-
- /*
- * Equality
- * For '==' 'eq' '!=' 'ne', then Compare
- */
- final public void Equality() throws ParseException {
- Compare();
- label_5:
- while (true) {
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case EQ0:
- case EQ1:
- case NE0:
- case NE1:
- ;
- break;
- default:
- jj_la1[6] = jj_gen;
- break label_5;
- }
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case EQ0:
- case EQ1:
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case EQ0:
- jj_consume_token(EQ0);
- break;
- case EQ1:
- jj_consume_token(EQ1);
- break;
- default:
- jj_la1[7] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- AstEqual jjtn001 = new AstEqual(JJTEQUAL);
- boolean jjtc001 = true;
- jjtree.openNodeScope(jjtn001);
- try {
- Compare();
- } catch (Throwable jjte001) {
- if (jjtc001) {
- jjtree.clearNodeScope(jjtn001);
- jjtc001 = false;
- } else {
- jjtree.popNode();
- }
- if (jjte001 instanceof RuntimeException) {
- {
- if (true) throw (RuntimeException) jjte001;
- }
- }
- if (jjte001 instanceof ParseException) {
- {
- if (true) throw (ParseException) jjte001;
- }
- }
- {
- if (true) throw (Error) jjte001;
- }
- } finally {
- if (jjtc001) {
- jjtree.closeNodeScope(jjtn001, 2);
- }
- }
- break;
- case NE0:
- case NE1:
- switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
- case NE0:
- jj_consume_token(NE0);
- break;
- case NE1:
- jj_consume_token(NE1);
- break;
- default:
- jj_la1[8] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- AstNotEqual jjtn002 = new AstNotEqual(JJTNOTEQUAL);
- boolean jjtc002 = true;
- jjtree.openNodeScope(jjtn002);
- try {
- Compare();
- } catch (Throwable jjte002) {
- if (jjtc002) {
- jjtree.clearNodeScope(jjtn002);
- jjtc002 = false;
- } else {
- jjtree.popNode();
- }
- if (jjte002 instanceof RuntimeException) {
- {
- if (true) throw (RuntimeException) jjte002;
- }
- }
- if (jjte002 instanceof ParseException) {
- {
- if (true) throw (ParseException) jjte002;
- }
- }
- {
- if (true) throw (Error) jjte002;
- }
- } finally {
- if (jjtc002) {
- jjtree.closeNodeScope(jjtn002, 2);
- }
- }
- break;
- default:
- jj_la1[9] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- }
- }
-
... 64341 lines suppressed ...
(struts) 01/02: Delete unused files missed in previous PR
Posted by ku...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
kusal pushed a commit to branch deprecated-plugins
in repository https://gitbox.apache.org/repos/asf/struts.git
commit be4c2bc7dcfc37fa624de3fb081c777421c7edeb
Author: Kusal Kithul-Godage <gi...@kusal.io>
AuthorDate: Thu Nov 23 19:58:56 2023 +1100
Delete unused files missed in previous PR
---
assembly/src/main/assembly/all.xml | 12 -
plugins/portlet-junit/README.md | 2 -
plugins/portlet-junit/pom.xml | 58 -
.../struts2/junit/StrutsPortletTestCase.java | 107 --
plugins/portlet-junit/src/site/site.xml | 56 -
.../struts2/junit/StrutsPortletTestCaseTest.java | 64 -
.../portlet-junit/src/test/resources/struts.xml | 34 -
plugins/portlet-mocks/README.md | 2 -
plugins/portlet-mocks/pom.xml | 56 -
.../mock/web/portlet/MockActionRequest.java | 86 --
.../mock/web/portlet/MockActionResponse.java | 132 --
.../struts2/mock/web/portlet/MockBaseURL.java | 161 --
.../struts2/mock/web/portlet/MockCacheControl.java | 78 -
.../mock/web/portlet/MockClientDataRequest.java | 135 --
.../apache/struts2/mock/web/portlet/MockEvent.java | 91 --
.../struts2/mock/web/portlet/MockEventRequest.java | 90 --
.../mock/web/portlet/MockEventResponse.java | 35 -
.../struts2/mock/web/portlet/MockMimeResponse.java | 259 ----
.../web/portlet/MockMultipartActionRequest.java | 101 --
.../mock/web/portlet/MockPortalContext.java | 106 --
.../mock/web/portlet/MockPortletConfig.java | 194 ---
.../mock/web/portlet/MockPortletContext.java | 285 ----
.../mock/web/portlet/MockPortletPreferences.java | 123 --
.../mock/web/portlet/MockPortletRequest.java | 565 -------
.../web/portlet/MockPortletRequestDispatcher.java | 87 --
.../mock/web/portlet/MockPortletResponse.java | 202 ---
.../mock/web/portlet/MockPortletSession.java | 250 ---
.../struts2/mock/web/portlet/MockPortletURL.java | 121 --
.../mock/web/portlet/MockRenderRequest.java | 94 --
.../mock/web/portlet/MockRenderResponse.java | 90 --
.../mock/web/portlet/MockResourceRequest.java | 132 --
.../mock/web/portlet/MockResourceResponse.java | 41 -
.../struts2/mock/web/portlet/MockResourceURL.java | 73 -
.../mock/web/portlet/MockStateAwareResponse.java | 165 --
.../web/portlet/ServletWrappingPortletContext.java | 161 --
.../portlet/multipart/MultipartActionRequest.java | 41 -
.../mock/web/portlet/multipart/package-info.java | 38 -
.../struts2/mock/web/portlet/package-info.java | 35 -
plugins/portlet-mocks/src/site/site.xml | 56 -
.../StrutsSpringPortletMockObjectsTest.java | 1604 --------------------
.../src/test/resources/applicationContext.xml | 36 -
plugins/portlet-tiles/README.md | 2 -
plugins/portlet-tiles/pom.xml | 57 -
.../struts2/views/tiles/PortletTilesResult.java | 111 --
.../tiles/request/portlet/PortletRequest.java | 344 -----
.../request/portlet/RenderPortletRequest.java | 47 -
.../portlet/delegate/MimeResponseDelegate.java | 72 -
.../portlet/delegate/PortletRequestDelegate.java | 79 -
.../request/portlet/delegate/RequestDelegate.java | 43 -
.../request/portlet/delegate/ResponseDelegate.java | 70 -
.../request/portlet/delegate/package-info.java | 24 -
.../extractor/ApplicationScopeExtractor.java | 66 -
.../request/portlet/extractor/HeaderExtractor.java | 74 -
.../portlet/extractor/InitParameterExtractor.java | 57 -
.../portlet/extractor/ParameterExtractor.java | 56 -
.../portlet/extractor/RequestScopeExtractor.java | 66 -
.../portlet/extractor/SessionScopeExtractor.java | 88 --
.../extractor/StateAwareParameterExtractor.java | 53 -
.../request/portlet/extractor/package-info.java | 24 -
.../apache/tiles/request/portlet/package-info.java | 24 -
.../portlet-tiles/src/main/resources/LICENSE.txt | 174 ---
.../portlet-tiles/src/main/resources/NOTICE.txt | 5 -
.../src/main/resources/struts-plugin.xml | 40 -
plugins/portlet-tiles/src/site/site.xml | 56 -
.../tiles/request/portlet/PortletRequestTest.java | 424 ------
.../request/portlet/RenderPortletRequestTest.java | 69 -
.../portlet/delegate/MimeResponseDelegateTest.java | 132 --
.../delegate/PortletRequestDelegateTest.java | 83 -
.../extractor/ApplicationScopeExtractorTest.java | 106 --
.../portlet/extractor/HeaderExtractorTest.java | 117 --
.../extractor/InitParameterExtractorTest.java | 83 -
.../portlet/extractor/ParameterExtractorTest.java | 83 -
.../extractor/RequestScopeExtractorTest.java | 107 --
.../extractor/SessionScopeExtractorTest.java | 154 --
.../StateAwareParameterExtractorTest.java | 50 -
plugins/portlet/README.md | 2 -
plugins/portlet/pom.xml | 101 --
.../struts2/components/PortletUrlRenderer.java | 211 ---
.../struts2/portlet/PortletApplicationMap.java | 208 ---
.../apache/struts2/portlet/PortletConstants.java | 133 --
.../org/apache/struts2/portlet/PortletPhase.java | 64 -
.../apache/struts2/portlet/PortletRequestMap.java | 158 --
.../apache/struts2/portlet/PortletSessionMap.java | 154 --
.../portlet/action/PortletContextAware.java | 30 -
.../portlet/action/PortletPreferencesAware.java | 39 -
.../portlet/action/PortletRequestAware.java | 30 -
.../portlet/action/PortletResponseAware.java | 30 -
.../portlet/context/PortletActionContext.java | 233 ---
.../dispatcher/DirectRenderFromEventAction.java | 75 -
.../portlet/dispatcher/DispatcherServlet.java | 53 -
.../portlet/dispatcher/Jsr168Dispatcher.java | 674 --------
.../portlet/dispatcher/Jsr286Dispatcher.java | 90 --
.../interceptor/PortletAwareInterceptor.java | 89 --
.../portlet/interceptor/PortletPrincipalProxy.java | 80 -
.../interceptor/PortletStateInterceptor.java | 95 --
.../interceptor/ServletPortletPreferences.java | 93 --
.../result/PortletActionRedirectResult.java | 263 ----
.../struts2/portlet/result/PortletResult.java | 263 ----
.../portlet/result/PortletResultHelper.java | 64 -
.../portlet/result/PortletResultHelperJSR168.java | 72 -
.../portlet/result/PortletResultHelperJSR286.java | 70 -
.../portlet/result/PortletVelocityResult.java | 270 ----
.../portlet/servlet/PortletHttpSession.java | 212 ---
.../portlet/servlet/PortletServletConfig.java | 79 -
.../portlet/servlet/PortletServletContext.java | 385 -----
.../portlet/servlet/PortletServletInputStream.java | 134 --
.../servlet/PortletServletOutputStream.java | 97 --
.../portlet/servlet/PortletServletRequest.java | 767 ----------
.../servlet/PortletServletRequestDispatcher.java | 68 -
.../portlet/servlet/PortletServletResponse.java | 257 ----
.../servlet/PortletServletResponseJSR286.java | 182 ---
.../apache/struts2/portlet/servlet/package.html | 25 -
.../struts2/portlet/util/PortletUrlHelper.java | 346 -----
.../portlet/util/PortletUrlHelperJSR286.java | 73 -
.../views/freemarker/PortletFreemarkerResult.java | 326 ----
plugins/portlet/src/main/resources/LICENSE.txt | 174 ---
plugins/portlet/src/main/resources/NOTICE.txt | 5 -
.../portlet/src/main/resources/struts-plugin.xml | 76 -
plugins/portlet/src/site/site.xml | 56 -
.../apache/struts2/StrutsTestCasePortletTests.java | 224 ---
.../apache/struts2/components/PortletAction.java | 29 -
.../struts2/components/PortletUrlRendererTest.java | 79 -
.../struts2/portlet/PortletApplicationMapTest.java | 179 ---
.../struts2/portlet/PortletRequestMapTest.java | 107 --
.../struts2/portlet/PortletSessionMapTest.java | 122 --
.../portlet/context/PortletActionContextTest.java | 207 ---
.../portlet/dispatcher/Jsr168DispatcherTest.java | 286 ----
.../portlet/dispatcher/Jsr286DispatcherTest.java | 339 -----
.../interceptor/PortletAwareInterceptorTest.java | 86 --
.../interceptor/PortletStateInterceptorTest.java | 159 --
.../struts2/portlet/result/PortletResultTest.java | 250 ---
.../struts2/portlet/util/PortletUrlHelperTest.java | 202 ---
.../struts2/views/jsp/PortletUrlTagTest.java | 469 ------
plugins/portlet/src/test/resources/log4j2.xml | 33 -
plugins/portlet/src/test/resources/struts.xml | 36 -
135 files changed, 18811 deletions(-)
diff --git a/assembly/src/main/assembly/all.xml b/assembly/src/main/assembly/all.xml
index b91aeec30..866f60d7e 100644
--- a/assembly/src/main/assembly/all.xml
+++ b/assembly/src/main/assembly/all.xml
@@ -157,18 +157,6 @@
<directory>../plugins/osgi/target/apidocs</directory>
<outputDirectory>docs/struts2-plugins/struts2-osgi-plugin/apidocs</outputDirectory>
</fileSet>
- <fileSet>
- <directory>../plugins/plexus/target/apidocs</directory>
- <outputDirectory>docs/struts2-plugins/struts2-plexus-plugin/apidocs</outputDirectory>
- </fileSet>
- <fileSet>
- <directory>../plugins/portlet/target/apidocs</directory>
- <outputDirectory>docs/struts2-plugins/struts2-portlet-plugin/apidocs</outputDirectory>
- </fileSet>
- <fileSet>
- <directory>../plugins/portlet-tiles/target/apidocs</directory>
- <outputDirectory>docs/struts2-plugins/struts2-portlet-tiles-plugin/apidocs</outputDirectory>
- </fileSet>
<fileSet>
<directory>../plugins/rest/target/apidocs</directory>
<outputDirectory>docs/struts2-plugins/struts2-rest-plugin/apidocs</outputDirectory>
diff --git a/plugins/portlet-junit/README.md b/plugins/portlet-junit/README.md
deleted file mode 100644
index db36979ba..000000000
--- a/plugins/portlet-junit/README.md
+++ /dev/null
@@ -1,2 +0,0 @@
-# Struts 2 Portlet JUnit plugin
-The Portlet JUnit Plugin supports testing applications that use the Portlet Plugin.
diff --git a/plugins/portlet-junit/pom.xml b/plugins/portlet-junit/pom.xml
deleted file mode 100644
index f5b9c9059..000000000
--- a/plugins/portlet-junit/pom.xml
+++ /dev/null
@@ -1,58 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-/*
- * 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.
- */
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.struts</groupId>
- <artifactId>struts2-plugins</artifactId>
- <version>7.0.0-SNAPSHOT</version>
- </parent>
-
- <artifactId>struts2-portlet-junit-plugin</artifactId>
- <packaging>jar</packaging>
- <name>DEPRECATED: Struts 2 Portlet JUnit Plugin - since 6.3.0</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.struts</groupId>
- <artifactId>struts2-junit-plugin</artifactId>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.apache.struts</groupId>
- <artifactId>struts2-portlet-plugin</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.struts</groupId>
- <artifactId>struts2-portlet-mocks-plugin</artifactId>
- </dependency>
- </dependencies>
-
- <properties>
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- </properties>
-</project>
diff --git a/plugins/portlet-junit/src/main/java/org/apache/struts2/junit/StrutsPortletTestCase.java b/plugins/portlet-junit/src/main/java/org/apache/struts2/junit/StrutsPortletTestCase.java
deleted file mode 100644
index ad6fbeefa..000000000
--- a/plugins/portlet-junit/src/main/java/org/apache/struts2/junit/StrutsPortletTestCase.java
+++ /dev/null
@@ -1,107 +0,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.
- */
-package org.apache.struts2.junit;
-
-
-import com.opensymphony.xwork2.ActionContext;
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.Logger;
-import org.apache.struts2.StrutsStatics;
-import org.apache.struts2.mock.web.portlet.MockPortletContext;
-import org.apache.struts2.mock.web.portlet.MockPortletRequest;
-import org.apache.struts2.mock.web.portlet.MockPortletResponse;
-import org.apache.struts2.mock.web.portlet.MockPortletSession;
-import org.apache.struts2.mock.web.portlet.MockStateAwareResponse;
-import org.apache.struts2.portlet.PortletConstants;
-import org.apache.struts2.portlet.PortletPhase;
-
-import javax.portlet.PortletMode;
-import java.util.HashMap;
-import java.util.Map;
-
-public abstract class StrutsPortletTestCase extends StrutsTestCase {
-
- private static final Logger LOG = LogManager.getLogger(StrutsPortletTestCase.class);
-
- protected MockPortletSession portletSession;
- protected MockPortletRequest portletRequest;
- protected MockPortletResponse portletResponse;
- protected MockContext portletContext;
-
- @Override
- protected void initActionContext(ActionContext actionContext) {
- super.initActionContext(actionContext);
- initPortletContext(actionContext);
- }
-
- protected void initPortletContext(ActionContext actionContext) {
- LOG.debug("Initializing mock portlet environment");
- portletContext = new MockContext();
- portletContext.setMajorVersion(getMajorVersion());
- actionContext.put(StrutsStatics.STRUTS_PORTLET_CONTEXT, portletContext);
-
- portletRequest = new MockPortletRequest(portletContext);
- portletResponse = new MockStateAwareResponse();
- portletSession = new MockPortletSession();
- portletRequest.setSession(portletSession);
- actionContext.withSession(createSession());
- actionContext.put(PortletConstants.REQUEST, portletRequest);
- actionContext.put(PortletConstants.RESPONSE, portletResponse);
- actionContext.put(PortletConstants.MODE_NAMESPACE_MAP, new HashMap<PortletMode, String>());
- actionContext.put(PortletConstants.PHASE, PortletPhase.EVENT_PHASE);
- }
-
- /**
- * Override to define version of your portlet environment
- *
- * @return portlet version
- */
- protected int getMajorVersion() {
- return 2;
- }
-
- /**
- * Override to create your own session
- *
- * @return Map with session parameters
- */
- private Map<String, Object> createSession() {
- return new HashMap<>(portletRequest.getPortletSession().getAttributeMap());
- }
-
-}
-
-/**
- * Simple workaround to define Portlet version
- */
-class MockContext extends MockPortletContext {
-
- private int majorVersion;
-
- @Override
- public int getMajorVersion() {
- return majorVersion;
- }
-
- public void setMajorVersion(int majorVersion) {
- this.majorVersion = majorVersion;
- }
-
-}
-
diff --git a/plugins/portlet-junit/src/site/site.xml b/plugins/portlet-junit/src/site/site.xml
deleted file mode 100644
index 54fdcf4f4..000000000
--- a/plugins/portlet-junit/src/site/site.xml
+++ /dev/null
@@ -1,56 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-/*
- * 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.
- */
--->
-<project name="Apache Struts">
- <skin>
- <groupId>org.apache.maven.skins</groupId>
- <artifactId>maven-fluido-skin</artifactId>
- <version>${fluido-skin.version}</version>
- </skin>
- <bannerLeft>
- <name>Apache Software Foundation</name>
- <src>http://www.apache.org/images/asf-logo.gif</src>
- <href>http://www.apache.org/</href>
- </bannerLeft>
- <bannerRight>
- <name>Apache Struts</name>
- <src>http://struts.apache.org/img/struts-logo.svg</src>
- <href>http://struts.apache.org/</href>
- </bannerRight>
- <publishDate position="left"/>
- <version position="right"/>
- <body>
- <links>
- <item name="Apache" href="http://www.apache.org/"/>
- <item name="Struts" href="http://struts.apache.org/"/>
- </links>
-
- <menu ref="parent"/>
- <menu ref="reports"/>
-
- <footer>
- <![CDATA[<div class="row span12">
- Apache Struts, Struts, Apache, the Apache feather logo, and the Apache Struts project
- logos are trademarks of The Apache Software Foundation.
- </div>]]>
- </footer>
- </body>
-</project>
diff --git a/plugins/portlet-junit/src/test/java/org/apache/struts2/junit/StrutsPortletTestCaseTest.java b/plugins/portlet-junit/src/test/java/org/apache/struts2/junit/StrutsPortletTestCaseTest.java
deleted file mode 100644
index 22c92a0e0..000000000
--- a/plugins/portlet-junit/src/test/java/org/apache/struts2/junit/StrutsPortletTestCaseTest.java
+++ /dev/null
@@ -1,64 +0,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.
- */
-package org.apache.struts2.junit;
-
-import com.opensymphony.xwork2.Action;
-import com.opensymphony.xwork2.ActionContext;
-import com.opensymphony.xwork2.ActionProxy;
-import org.apache.struts2.StrutsStatics;
-
-import javax.portlet.PortletContext;
-
-public class StrutsPortletTestCaseTest extends StrutsPortletTestCase {
-
- String KEY = "my-param";
-
- public void testShouldPortletContextBeAvailable() throws Exception {
- // given
- assertNull(ActionContext.getContext().get(StrutsStatics.STRUTS_PORTLET_CONTEXT));
-
- // when
- ActionProxy proxy = getActionProxy("/test/testAction.action");
- String result = proxy.execute();
-
- // then
- assertEquals(Action.SUCCESS, result);
- Object portletContext = ActionContext.getContext().get(StrutsStatics.STRUTS_PORTLET_CONTEXT);
- assertNotNull(portletContext);
- assertTrue(portletContext instanceof PortletContext);
- }
-
- public void testShouldAdditionalContextParamsBeAvailable() throws Exception {
- // given
- assertNull(ActionContext.getContext().get(KEY));
-
- // when
- ActionProxy proxy = getActionProxy("/test/testAction.action");
- String result = proxy.execute();
-
- // then
- assertEquals(Action.SUCCESS, result);
- assertNotNull(ActionContext.getContext().get(KEY));
- }
-
- @Override
- protected void applyAdditionalParams(ActionContext context) {
- context.put(KEY, new Object());
- }
-}
diff --git a/plugins/portlet-junit/src/test/resources/struts.xml b/plugins/portlet-junit/src/test/resources/struts.xml
deleted file mode 100644
index e8c59512c..000000000
--- a/plugins/portlet-junit/src/test/resources/struts.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!--
-/*
- * 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.
- */
--->
-<!DOCTYPE struts PUBLIC
- "-//Apache Software Foundation//DTD Struts Configuration 2.1.7//EN"
- "https://struts.apache.org/dtds/struts-2.1.dtd">
-
-<struts>
- <package name="test" namespace="/test" extends="struts-default">
- <action name="testAction" class="com.opensymphony.xwork2.ActionSupport">
- <result name="success" type="httpheader">
- <param name="status">200</param>
- </result>
- </action>
- </package>
-</struts>
diff --git a/plugins/portlet-mocks/README.md b/plugins/portlet-mocks/README.md
deleted file mode 100644
index 550476204..000000000
--- a/plugins/portlet-mocks/README.md
+++ /dev/null
@@ -1,2 +0,0 @@
-# Struts 2 Portlet Mocks plugin
-This plugin is deprecated, and it will be removed soon, **please do not use it**!
diff --git a/plugins/portlet-mocks/pom.xml b/plugins/portlet-mocks/pom.xml
deleted file mode 100644
index d2844c004..000000000
--- a/plugins/portlet-mocks/pom.xml
+++ /dev/null
@@ -1,56 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-/*
- * 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.
- */
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.struts</groupId>
- <artifactId>struts2-plugins</artifactId>
- <version>7.0.0-SNAPSHOT</version>
- </parent>
-
- <artifactId>struts2-portlet-mocks-plugin</artifactId>
- <packaging>jar</packaging>
- <name>DEPRECATED: Struts 2 Portlet Mocks Plugin - since 6.0.0</name>
-
- <dependencies>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-test</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-web</artifactId>
- </dependency>
-
- <!-- Portlet -->
- <dependency>
- <groupId>javax.portlet</groupId>
- <artifactId>portlet-api</artifactId>
- <scope>provided</scope>
- </dependency>
- </dependencies>
-
- <properties>
- <spring.platformVersion>4.3.30.RELEASE</spring.platformVersion>
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- </properties>
-</project>
diff --git a/plugins/portlet-mocks/src/main/java/org/apache/struts2/mock/web/portlet/MockActionRequest.java b/plugins/portlet-mocks/src/main/java/org/apache/struts2/mock/web/portlet/MockActionRequest.java
deleted file mode 100644
index 390df5cda..000000000
--- a/plugins/portlet-mocks/src/main/java/org/apache/struts2/mock/web/portlet/MockActionRequest.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Copyright 2002-2009 the original author or authors.
- *
- * Licensed 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
- *
- * https://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.
- */
-
-package org.apache.struts2.mock.web.portlet;
-
-import javax.portlet.ActionRequest;
-import javax.portlet.PortalContext;
-import javax.portlet.PortletContext;
-import javax.portlet.PortletMode;
-
-/**
- * Mock implementation of the {@link javax.portlet.ActionRequest} interface.
- *
- * @author John A. Lewis
- * @author Juergen Hoeller
- * @since 2.0
- */
-public class MockActionRequest extends MockClientDataRequest implements ActionRequest {
-
- /**
- * Create a new MockActionRequest with a default {@link MockPortalContext}
- * and a default {@link MockPortletContext}.
- * @see org.springframework.mock.web.portlet.MockPortalContext
- * @see org.springframework.mock.web.portlet.MockPortletContext
- */
- public MockActionRequest() {
- super();
- }
-
- /**
- * Create a new MockActionRequest with a default {@link MockPortalContext}
- * and a default {@link MockPortletContext}.
- * @param actionName the name of the action to trigger
- */
- public MockActionRequest(String actionName) {
- super();
- setParameter(ActionRequest.ACTION_NAME, actionName);
- }
-
- /**
- * Create a new MockActionRequest with a default {@link MockPortalContext}
- * and a default {@link MockPortletContext}.
- * @param portletMode the mode that the portlet runs in
- */
- public MockActionRequest(PortletMode portletMode) {
- super();
- setPortletMode(portletMode);
- }
-
- /**
- * Create a new MockActionRequest with a default {@link MockPortalContext}.
- * @param portletContext the PortletContext that the request runs in
- */
- public MockActionRequest(PortletContext portletContext) {
- super(portletContext);
- }
-
- /**
- * Create a new MockActionRequest.
- * @param portalContext the PortalContext that the request runs in
- * @param portletContext the PortletContext that the request runs in
- */
- public MockActionRequest(PortalContext portalContext, PortletContext portletContext) {
- super(portalContext, portletContext);
- }
-
-
- @Override
- protected String getLifecyclePhase() {
- return ACTION_PHASE;
- }
-
-}
diff --git a/plugins/portlet-mocks/src/main/java/org/apache/struts2/mock/web/portlet/MockActionResponse.java b/plugins/portlet-mocks/src/main/java/org/apache/struts2/mock/web/portlet/MockActionResponse.java
deleted file mode 100644
index b120ffd87..000000000
--- a/plugins/portlet-mocks/src/main/java/org/apache/struts2/mock/web/portlet/MockActionResponse.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- * Copyright 2002-2012 the original author or authors.
- *
- * Licensed 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
- *
- * https://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.
- */
-
-package org.apache.struts2.mock.web.portlet;
-
-import java.io.IOException;
-import java.util.Map;
-import javax.portlet.ActionResponse;
-import javax.portlet.PortalContext;
-import javax.portlet.PortletMode;
-import javax.portlet.PortletModeException;
-import javax.portlet.WindowState;
-import javax.portlet.WindowStateException;
-
-import org.springframework.util.Assert;
-
-/**
- * Mock implementation of the {@link javax.portlet.ActionResponse} interface.
- *
- * @author John A. Lewis
- * @author Juergen Hoeller
- * @since 2.0
- */
-public class MockActionResponse extends MockStateAwareResponse implements ActionResponse {
-
- private boolean redirectAllowed = true;
-
- private String redirectedUrl;
-
-
- /**
- * Create a new MockActionResponse with a default {@link MockPortalContext}.
- * @see MockPortalContext
- */
- public MockActionResponse() {
- super();
- }
-
- /**
- * Create a new MockActionResponse.
- * @param portalContext the PortalContext defining the supported
- * PortletModes and WindowStates
- */
- public MockActionResponse(PortalContext portalContext) {
- super(portalContext);
- }
-
-
- @Override
- public void setWindowState(WindowState windowState) throws WindowStateException {
- if (this.redirectedUrl != null) {
- throw new IllegalStateException("Cannot set WindowState after sendRedirect has been called");
- }
- super.setWindowState(windowState);
- this.redirectAllowed = false;
- }
-
- @Override
- public void setPortletMode(PortletMode portletMode) throws PortletModeException {
- if (this.redirectedUrl != null) {
- throw new IllegalStateException("Cannot set PortletMode after sendRedirect has been called");
- }
- super.setPortletMode(portletMode);
- this.redirectAllowed = false;
- }
-
- @Override
- public void setRenderParameters(Map<String, String[]> parameters) {
- if (this.redirectedUrl != null) {
- throw new IllegalStateException("Cannot set render parameters after sendRedirect has been called");
- }
- super.setRenderParameters(parameters);
- this.redirectAllowed = false;
- }
-
- @Override
- public void setRenderParameter(String key, String value) {
- if (this.redirectedUrl != null) {
- throw new IllegalStateException("Cannot set render parameters after sendRedirect has been called");
- }
- super.setRenderParameter(key, value);
- this.redirectAllowed = false;
- }
-
- @Override
- public void setRenderParameter(String key, String[] values) {
- if (this.redirectedUrl != null) {
- throw new IllegalStateException("Cannot set render parameters after sendRedirect has been called");
- }
- super.setRenderParameter(key, values);
- this.redirectAllowed = false;
- }
-
- @Override
- public void sendRedirect(String location) throws IOException {
- if (!this.redirectAllowed) {
- throw new IllegalStateException(
- "Cannot call sendRedirect after windowState, portletMode, or renderParameters have been set");
- }
- Assert.notNull(location, "Redirect URL must not be null");
- this.redirectedUrl = location;
- }
-
- @Override
- public void sendRedirect(String location, String renderUrlParamName) throws IOException {
- sendRedirect(location);
- if (renderUrlParamName != null) {
- // NOTE: Changed since original Spring 4.3.x version.
- // Cannot call setRenderParameter(renderUrlParamName, location) here as it always results in an IllegalStateException - since a redirect has been called.
- // Due to this, we call super.setRenderParameter() directly, otherwise this method can never successfully be called.
- super.setRenderParameter(renderUrlParamName, location);
- }
- }
-
- public String getRedirectedUrl() {
- return this.redirectedUrl;
- }
-
-}
diff --git a/plugins/portlet-mocks/src/main/java/org/apache/struts2/mock/web/portlet/MockBaseURL.java b/plugins/portlet-mocks/src/main/java/org/apache/struts2/mock/web/portlet/MockBaseURL.java
deleted file mode 100644
index c0a1995e9..000000000
--- a/plugins/portlet-mocks/src/main/java/org/apache/struts2/mock/web/portlet/MockBaseURL.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
- * Copyright 2002-2012 the original author or authors.
- *
- * Licensed 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
- *
- * https://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.
- */
-
-package org.apache.struts2.mock.web.portlet;
-
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.io.Writer;
-import java.net.URLEncoder;
-import java.util.Collections;
-import java.util.LinkedHashMap;
-import java.util.Map;
-import java.util.Set;
-import javax.portlet.BaseURL;
-import javax.portlet.PortletSecurityException;
-
-import org.springframework.util.Assert;
-import org.springframework.util.StringUtils;
-
-/**
- * Mock implementation of the {@link javax.portlet.BaseURL} interface.
- *
- * @author Juergen Hoeller
- * @since 3.0
- */
-public abstract class MockBaseURL implements BaseURL {
-
- public static final String URL_TYPE_RENDER = "render";
-
- public static final String URL_TYPE_ACTION = "action";
-
- private static final String ENCODING = "UTF-8";
-
-
- protected final Map<String, String[]> parameters = new LinkedHashMap<String, String[]>();
-
- private boolean secure = false;
-
- private final Map<String, String[]> properties = new LinkedHashMap<String, String[]>();
-
-
- //---------------------------------------------------------------------
- // BaseURL methods
- //---------------------------------------------------------------------
-
- @Override
- public void setParameter(String key, String value) {
- Assert.notNull(key, "Parameter key must be null");
- Assert.notNull(value, "Parameter value must not be null");
- this.parameters.put(key, new String[] {value});
- }
-
- @Override
- public void setParameter(String key, String[] values) {
- Assert.notNull(key, "Parameter key must be null");
- Assert.notNull(values, "Parameter values must not be null");
- this.parameters.put(key, values);
- }
-
- @Override
- public void setParameters(Map<String, String[]> parameters) {
- Assert.notNull(parameters, "Parameters Map must not be null");
- this.parameters.clear();
- this.parameters.putAll(parameters);
- }
-
- public Set<String> getParameterNames() {
- return this.parameters.keySet();
- }
-
- public String getParameter(String name) {
- String[] arr = this.parameters.get(name);
- return (arr != null && arr.length > 0 ? arr[0] : null);
- }
-
- public String[] getParameterValues(String name) {
- return this.parameters.get(name);
- }
-
- @Override
- public Map<String, String[]> getParameterMap() {
- return Collections.unmodifiableMap(this.parameters);
- }
-
- @Override
- public void setSecure(boolean secure) throws PortletSecurityException {
- this.secure = secure;
- }
-
- public boolean isSecure() {
- return this.secure;
- }
-
- @Override
- public void write(Writer out) throws IOException {
- out.write(toString());
- }
-
- @Override
- public void write(Writer out, boolean escapeXML) throws IOException {
- out.write(toString());
- }
-
- @Override
- public void addProperty(String key, String value) {
- String[] values = this.properties.get(key);
- if (values != null) {
- this.properties.put(key, StringUtils.addStringToArray(values, value));
- }
- else {
- this.properties.put(key, new String[] {value});
- }
- }
-
- @Override
- public void setProperty(String key, String value) {
- this.properties.put(key, new String[] {value});
- }
-
- public Map<String, String[]> getProperties() {
- return Collections.unmodifiableMap(this.properties);
- }
-
-
- protected String encodeParameter(String name, String value) {
- try {
- return URLEncoder.encode(name, ENCODING) + "=" + URLEncoder.encode(value, ENCODING);
- }
- catch (UnsupportedEncodingException ex) {
- return null;
- }
- }
-
- protected String encodeParameter(String name, String[] values) {
- try {
- StringBuilder sb = new StringBuilder();
- for (int i = 0, n = values.length; i < n; i++) {
- sb.append(i > 0 ? ";" : "").append(URLEncoder.encode(name, ENCODING)).append("=")
- .append(URLEncoder.encode(values[i], ENCODING));
- }
- return sb.toString();
- }
- catch (UnsupportedEncodingException ex) {
- return null;
- }
- }
-
-}
diff --git a/plugins/portlet-mocks/src/main/java/org/apache/struts2/mock/web/portlet/MockCacheControl.java b/plugins/portlet-mocks/src/main/java/org/apache/struts2/mock/web/portlet/MockCacheControl.java
deleted file mode 100644
index f0ae50ac2..000000000
--- a/plugins/portlet-mocks/src/main/java/org/apache/struts2/mock/web/portlet/MockCacheControl.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright 2002-2012 the original author or authors.
- *
- * Licensed 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
- *
- * https://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.
- */
-
-package org.apache.struts2.mock.web.portlet;
-
-import javax.portlet.CacheControl;
-
-/**
- * Mock implementation of the {@link javax.portlet.CacheControl} interface.
- *
- * @author Juergen Hoeller
- * @since 3.0
- */
-public class MockCacheControl implements CacheControl {
-
- private int expirationTime = 0;
-
- private boolean publicScope = false;
-
- private String etag;
-
- private boolean useCachedContent = false;
-
-
- @Override
- public int getExpirationTime() {
- return this.expirationTime;
- }
-
- @Override
- public void setExpirationTime(int time) {
- this.expirationTime = time;
- }
-
- @Override
- public boolean isPublicScope() {
- return this.publicScope;
- }
-
- @Override
- public void setPublicScope(boolean publicScope) {
- this.publicScope = publicScope;
- }
-
- @Override
- public String getETag() {
- return this.etag;
- }
-
- @Override
- public void setETag(String token) {
- this.etag = token;
- }
-
- @Override
- public boolean useCachedContent() {
- return this.useCachedContent;
- }
-
- @Override
- public void setUseCachedContent(boolean useCachedContent) {
- this.useCachedContent = useCachedContent;
- }
-
-}
diff --git a/plugins/portlet-mocks/src/main/java/org/apache/struts2/mock/web/portlet/MockClientDataRequest.java b/plugins/portlet-mocks/src/main/java/org/apache/struts2/mock/web/portlet/MockClientDataRequest.java
deleted file mode 100644
index 44792d1de..000000000
--- a/plugins/portlet-mocks/src/main/java/org/apache/struts2/mock/web/portlet/MockClientDataRequest.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * Copyright 2002-2012 the original author or authors.
- *
- * Licensed 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
- *
- * https://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.
- */
-
-package org.apache.struts2.mock.web.portlet;
-
-import java.io.BufferedReader;
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.Reader;
-import java.io.UnsupportedEncodingException;
-import javax.portlet.ClientDataRequest;
-import javax.portlet.PortalContext;
-import javax.portlet.PortletContext;
-
-/**
- * Mock implementation of the {@link javax.portlet.ClientDataRequest} interface.
- *
- * @author Juergen Hoeller
- * @since 3.0
- */
-public class MockClientDataRequest extends MockPortletRequest implements ClientDataRequest {
-
- private String characterEncoding;
-
- private byte[] content;
-
- private String contentType;
-
- private String method;
-
-
- /**
- * Create a new MockClientDataRequest with a default {@link MockPortalContext}
- * and a default {@link MockPortletContext}.
- * @see org.springframework.mock.web.portlet.MockPortalContext
- * @see org.springframework.mock.web.portlet.MockPortletContext
- */
- public MockClientDataRequest() {
- super();
- }
-
- /**
- * Create a new MockClientDataRequest with a default {@link MockPortalContext}.
- * @param portletContext the PortletContext that the request runs in
- */
- public MockClientDataRequest(PortletContext portletContext) {
- super(portletContext);
- }
-
- /**
- * Create a new MockClientDataRequest.
- * @param portalContext the PortalContext that the request runs in
- * @param portletContext the PortletContext that the request runs in
- */
- public MockClientDataRequest(PortalContext portalContext, PortletContext portletContext) {
- super(portalContext, portletContext);
- }
-
-
- public void setContent(byte[] content) {
- this.content = content;
- }
-
- @Override
- public InputStream getPortletInputStream() throws IOException {
- if (this.content != null) {
- return new ByteArrayInputStream(this.content);
- }
- else {
- return null;
- }
- }
-
- @Override
- public void setCharacterEncoding(String characterEncoding) {
- this.characterEncoding = characterEncoding;
- }
-
- @Override
- public BufferedReader getReader() throws UnsupportedEncodingException {
- if (this.content != null) {
- InputStream sourceStream = new ByteArrayInputStream(this.content);
- Reader sourceReader = (this.characterEncoding != null) ?
- new InputStreamReader(sourceStream, this.characterEncoding) : new InputStreamReader(sourceStream);
- return new BufferedReader(sourceReader);
- }
- else {
- return null;
- }
- }
-
- @Override
- public String getCharacterEncoding() {
- return this.characterEncoding;
- }
-
- public void setContentType(String contentType) {
- this.contentType = contentType;
- }
-
- @Override
- public String getContentType() {
- return this.contentType;
- }
-
- @Override
- public int getContentLength() {
- return (this.content != null ? content.length : -1);
- }
-
- public void setMethod(String method) {
- this.method = method;
- }
-
- @Override
- public String getMethod() {
- return this.method;
- }
-
-}
\ No newline at end of file
diff --git a/plugins/portlet-mocks/src/main/java/org/apache/struts2/mock/web/portlet/MockEvent.java b/plugins/portlet-mocks/src/main/java/org/apache/struts2/mock/web/portlet/MockEvent.java
deleted file mode 100644
index 2e9a41126..000000000
--- a/plugins/portlet-mocks/src/main/java/org/apache/struts2/mock/web/portlet/MockEvent.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright 2002-2012 the original author or authors.
- *
- * Licensed 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
- *
- * https://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.
- */
-
-package org.apache.struts2.mock.web.portlet;
-
-import java.io.Serializable;
-import javax.portlet.Event;
-import javax.xml.namespace.QName;
-
-/**
- * Mock implementation of the {@link javax.portlet.Event} interface.
- *
- * @author Juergen Hoeller
- * @since 3.0
- * @see MockEventRequest
- */
-public class MockEvent implements Event {
-
- private final QName name;
-
- private final Serializable value;
-
-
- /**
- * Create a new MockEvent with the given name.
- * @param name the name of the event
- */
- public MockEvent(QName name) {
- this.name = name;
- this.value = null;
- }
-
- /**
- * Create a new MockEvent with the given name and value.
- * @param name the name of the event
- * @param value the associated payload of the event
- */
- public MockEvent(QName name, Serializable value) {
- this.name = name;
- this.value = value;
- }
-
- /**
- * Create a new MockEvent with the given name.
- * @param name the name of the event
- */
- public MockEvent(String name) {
- this.name = new QName(name);
- this.value = null;
- }
-
- /**
- * Create a new MockEvent with the given name and value.
- * @param name the name of the event
- * @param value the associated payload of the event
- */
- public MockEvent(String name, Serializable value) {
- this.name = new QName(name);
- this.value = value;
- }
-
-
- @Override
- public QName getQName() {
- return this.name;
- }
-
- @Override
- public String getName() {
- return this.name.getLocalPart();
- }
-
- @Override
- public Serializable getValue() {
- return this.value;
- }
-
-}
\ No newline at end of file
diff --git a/plugins/portlet-mocks/src/main/java/org/apache/struts2/mock/web/portlet/MockEventRequest.java b/plugins/portlet-mocks/src/main/java/org/apache/struts2/mock/web/portlet/MockEventRequest.java
deleted file mode 100644
index c05551137..000000000
--- a/plugins/portlet-mocks/src/main/java/org/apache/struts2/mock/web/portlet/MockEventRequest.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Copyright 2002-2012 the original author or authors.
- *
- * Licensed 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
- *
- * https://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.
- */
-
-package org.apache.struts2.mock.web.portlet;
-
-import javax.portlet.Event;
-import javax.portlet.EventRequest;
-import javax.portlet.PortalContext;
-import javax.portlet.PortletContext;
-
-/**
- * Mock implementation of the {@link javax.portlet.EventRequest} interface.
- *
- * @author Juergen Hoeller
- * @since 3.0
- */
-public class MockEventRequest extends MockPortletRequest implements EventRequest {
-
- private final Event event;
-
- private String method;
-
-
- /**
- * Create a new MockEventRequest with a default {@link MockPortalContext}
- * and a default {@link MockPortletContext}.
- * @param event the event that this request wraps
- * @see MockEvent
- */
- public MockEventRequest(Event event) {
- super();
- this.event = event;
- }
-
- /**
- * Create a new MockEventRequest with a default {@link MockPortalContext}.
- * @param event the event that this request wraps
- * @param portletContext the PortletContext that the request runs in
- * @see MockEvent
- */
- public MockEventRequest(Event event, PortletContext portletContext) {
- super(portletContext);
- this.event = event;
- }
-
- /**
- * Create a new MockEventRequest.
- * @param event the event that this request wraps
- * @param portalContext the PortletContext that the request runs in
- * @param portletContext the PortletContext that the request runs in
- */
- public MockEventRequest(Event event, PortalContext portalContext, PortletContext portletContext) {
- super(portalContext, portletContext);
- this.event = event;
- }
-
-
- @Override
- protected String getLifecyclePhase() {
- return EVENT_PHASE;
- }
-
- @Override
- public Event getEvent() {
- return this.event;
- }
-
- public void setMethod(String method) {
- this.method = method;
- }
-
- @Override
- public String getMethod() {
- return this.method;
- }
-
-}
\ No newline at end of file
diff --git a/plugins/portlet-mocks/src/main/java/org/apache/struts2/mock/web/portlet/MockEventResponse.java b/plugins/portlet-mocks/src/main/java/org/apache/struts2/mock/web/portlet/MockEventResponse.java
deleted file mode 100644
index 9bda32e0d..000000000
--- a/plugins/portlet-mocks/src/main/java/org/apache/struts2/mock/web/portlet/MockEventResponse.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright 2002-2012 the original author or authors.
- *
- * Licensed 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
- *
- * https://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.
- */
-
-package org.apache.struts2.mock.web.portlet;
-
-import javax.portlet.EventRequest;
-import javax.portlet.EventResponse;
-
-/**
- * Mock implementation of the {@link javax.portlet.EventResponse} interface.
- *
- * @author Juergen Hoeller
- * @since 3.0
- */
-public class MockEventResponse extends MockStateAwareResponse implements EventResponse {
-
- @Override
- public void setRenderParameters(EventRequest request) {
- setRenderParameters(request.getParameterMap());
- }
-
-}
diff --git a/plugins/portlet-mocks/src/main/java/org/apache/struts2/mock/web/portlet/MockMimeResponse.java b/plugins/portlet-mocks/src/main/java/org/apache/struts2/mock/web/portlet/MockMimeResponse.java
deleted file mode 100644
index cb654cb6c..000000000
--- a/plugins/portlet-mocks/src/main/java/org/apache/struts2/mock/web/portlet/MockMimeResponse.java
+++ /dev/null
@@ -1,259 +0,0 @@
-/*
- * Copyright 2002-2012 the original author or authors.
- *
- * Licensed 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
- *
- * https://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.
- */
-
-package org.apache.struts2.mock.web.portlet;
-
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.io.PrintWriter;
-import java.io.UnsupportedEncodingException;
-import java.io.Writer;
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.Locale;
-import javax.portlet.CacheControl;
-import javax.portlet.MimeResponse;
-import javax.portlet.PortalContext;
-import javax.portlet.PortletRequest;
-import javax.portlet.PortletURL;
-import javax.portlet.ResourceURL;
-
-import org.springframework.util.CollectionUtils;
-import org.springframework.web.util.WebUtils;
-
-/**
- * Mock implementation of the {@link javax.portlet.MimeResponse} interface.
- *
- * @author Juergen Hoeller
- * @since 3.0
- */
-public class MockMimeResponse extends MockPortletResponse implements MimeResponse {
-
- private PortletRequest request;
-
- private String contentType;
-
- private String characterEncoding = WebUtils.DEFAULT_CHARACTER_ENCODING;
-
- private PrintWriter writer;
-
- private Locale locale = Locale.getDefault();
-
- private int bufferSize = 4096;
-
- private final ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
-
- private final CacheControl cacheControl = new MockCacheControl();
-
- private boolean committed;
-
- private String includedUrl;
-
- private String forwardedUrl;
-
-
- /**
- * Create a new MockMimeResponse with a default {@link MockPortalContext}.
- * @see org.springframework.mock.web.portlet.MockPortalContext
- */
- public MockMimeResponse() {
- super();
- }
-
- /**
- * Create a new MockMimeResponse.
- * @param portalContext the PortalContext defining the supported
- * PortletModes and WindowStates
- */
- public MockMimeResponse(PortalContext portalContext) {
- super(portalContext);
- }
-
- /**
- * Create a new MockMimeResponse.
- * @param portalContext the PortalContext defining the supported
- * PortletModes and WindowStates
- * @param request the corresponding render/resource request that this response
- * is being generated for
- */
- public MockMimeResponse(PortalContext portalContext, PortletRequest request) {
- super(portalContext);
- this.request = request;
- }
-
-
- //---------------------------------------------------------------------
- // RenderResponse methods
- //---------------------------------------------------------------------
-
- @Override
- public void setContentType(String contentType) {
- if (this.request != null) {
- Enumeration<String> supportedTypes = this.request.getResponseContentTypes();
- if (!CollectionUtils.contains(supportedTypes, contentType)) {
- throw new IllegalArgumentException("Content type [" + contentType + "] not in supported list: " +
- Collections.list(supportedTypes));
- }
- }
- this.contentType = contentType;
- }
-
- @Override
- public String getContentType() {
- return this.contentType;
- }
-
- public void setCharacterEncoding(String characterEncoding) {
- this.characterEncoding = characterEncoding;
- }
-
- @Override
- public String getCharacterEncoding() {
- return this.characterEncoding;
- }
-
- @Override
- public PrintWriter getWriter() throws UnsupportedEncodingException {
- if (this.writer == null) {
- Writer targetWriter = (this.characterEncoding != null
- ? new OutputStreamWriter(this.outputStream, this.characterEncoding)
- : new OutputStreamWriter(this.outputStream));
- this.writer = new PrintWriter(targetWriter);
- }
- return this.writer;
- }
-
- public byte[] getContentAsByteArray() {
- flushBuffer();
- return this.outputStream.toByteArray();
- }
-
- public String getContentAsString() throws UnsupportedEncodingException {
- flushBuffer();
- return (this.characterEncoding != null)
- ? this.outputStream.toString(this.characterEncoding)
- : this.outputStream.toString();
- }
-
- public void setLocale(Locale locale) {
- this.locale = locale;
- }
-
- @Override
- public Locale getLocale() {
- return this.locale;
- }
-
- @Override
- public void setBufferSize(int bufferSize) {
- this.bufferSize = bufferSize;
- }
-
- @Override
- public int getBufferSize() {
- return this.bufferSize;
- }
-
- @Override
- public void flushBuffer() {
- if (this.writer != null) {
- this.writer.flush();
- }
- if (this.outputStream != null) {
- try {
- this.outputStream.flush();
- }
- catch (IOException ex) {
- throw new IllegalStateException("Could not flush OutputStream: " + ex.getMessage());
- }
- }
- this.committed = true;
- }
-
- @Override
- public void resetBuffer() {
- if (this.committed) {
- throw new IllegalStateException("Cannot reset buffer - response is already committed");
- }
- this.outputStream.reset();
- }
-
- public void setCommitted(boolean committed) {
- this.committed = committed;
- }
-
- @Override
- public boolean isCommitted() {
- return this.committed;
- }
-
- @Override
- public void reset() {
- resetBuffer();
- this.characterEncoding = null;
- this.contentType = null;
- this.locale = null;
- }
-
- @Override
- public OutputStream getPortletOutputStream() throws IOException {
- return this.outputStream;
- }
-
- @Override
- public PortletURL createRenderURL() {
- return new MockPortletURL(getPortalContext(), MockPortletURL.URL_TYPE_RENDER);
- }
-
- @Override
- public PortletURL createActionURL() {
- return new MockPortletURL(getPortalContext(), MockPortletURL.URL_TYPE_ACTION);
- }
-
- @Override
- public ResourceURL createResourceURL() {
- return new MockResourceURL();
- }
-
- @Override
- public CacheControl getCacheControl() {
- return this.cacheControl;
- }
-
-
- //---------------------------------------------------------------------
- // Methods for MockPortletRequestDispatcher
- //---------------------------------------------------------------------
-
- public void setIncludedUrl(String includedUrl) {
- this.includedUrl = includedUrl;
- }
-
- public String getIncludedUrl() {
- return this.includedUrl;
- }
-
- public void setForwardedUrl(String forwardedUrl) {
- this.forwardedUrl = forwardedUrl;
- }
-
- public String getForwardedUrl() {
- return this.forwardedUrl;
- }
-
-}
diff --git a/plugins/portlet-mocks/src/main/java/org/apache/struts2/mock/web/portlet/MockMultipartActionRequest.java b/plugins/portlet-mocks/src/main/java/org/apache/struts2/mock/web/portlet/MockMultipartActionRequest.java
deleted file mode 100644
index 396e8cfd3..000000000
--- a/plugins/portlet-mocks/src/main/java/org/apache/struts2/mock/web/portlet/MockMultipartActionRequest.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Copyright 2002-2012 the original author or authors.
- *
- * Licensed 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
- *
- * https://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.
- */
-
-package org.apache.struts2.mock.web.portlet;
-
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.springframework.util.Assert;
-import org.springframework.util.LinkedMultiValueMap;
-import org.springframework.util.MultiValueMap;
-import org.springframework.web.multipart.MultipartFile;
-import org.apache.struts2.mock.web.portlet.multipart.MultipartActionRequest;
-
-/**
- * Mock implementation of the
- * {@link org.springframework.web.portlet.multipart.MultipartActionRequest} interface.
- *
- * <p>Useful for testing application controllers that access multipart uploads.
- * The {@link org.springframework.mock.web.MockMultipartFile} can be used to
- * populate these mock requests with files.
- *
- * @author Juergen Hoeller
- * @author Arjen Poutsma
- * @since 2.0
- * @see org.springframework.mock.web.MockMultipartFile
- */
-public class MockMultipartActionRequest extends MockActionRequest implements MultipartActionRequest {
-
- private final MultiValueMap<String, MultipartFile> multipartFiles =
- new LinkedMultiValueMap<String, MultipartFile>();
-
-
- /**
- * Add a file to this request. The parameter name from the multipart
- * form is taken from the {@link org.springframework.web.multipart.MultipartFile#getName()}.
- * @param file multipart file to be added
- */
- public void addFile(MultipartFile file) {
- Assert.notNull(file, "MultipartFile must not be null");
- this.multipartFiles.add(file.getName(), file);
- }
-
- @Override
- public Iterator<String> getFileNames() {
- return this.multipartFiles.keySet().iterator();
- }
-
- @Override
- public MultipartFile getFile(String name) {
- return this.multipartFiles.getFirst(name);
- }
-
- @Override
- public List<MultipartFile> getFiles(String name) {
- List<MultipartFile> multipartFiles = this.multipartFiles.get(name);
- if (multipartFiles != null) {
- return multipartFiles;
- }
- else {
- return Collections.emptyList();
- }
- }
-
- @Override
- public Map<String, MultipartFile> getFileMap() {
- return this.multipartFiles.toSingleValueMap();
- }
-
- @Override
- public MultiValueMap<String, MultipartFile> getMultiFileMap() {
- return new LinkedMultiValueMap<String, MultipartFile>(this.multipartFiles);
- }
-
- @Override
- public String getMultipartContentType(String paramOrFileName) {
- MultipartFile file = getFile(paramOrFileName);
- if (file != null) {
- return file.getContentType();
- }
- else {
- return null;
- }
- }
-
-}
diff --git a/plugins/portlet-mocks/src/main/java/org/apache/struts2/mock/web/portlet/MockPortalContext.java b/plugins/portlet-mocks/src/main/java/org/apache/struts2/mock/web/portlet/MockPortalContext.java
deleted file mode 100644
index 0c7eccf5e..000000000
--- a/plugins/portlet-mocks/src/main/java/org/apache/struts2/mock/web/portlet/MockPortalContext.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * Copyright 2002-2012 the original author or authors.
- *
- * Licensed 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
- *
- * https://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.
- */
-
-package org.apache.struts2.mock.web.portlet;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import javax.portlet.PortalContext;
-import javax.portlet.PortletMode;
-import javax.portlet.WindowState;
-
-/**
- * Mock implementation of the {@link javax.portlet.PortalContext} interface.
- *
- * @author John A. Lewis
- * @author Juergen Hoeller
- * @since 2.0
- */
-public class MockPortalContext implements PortalContext {
-
- private final Map<String, String> properties = new HashMap<String, String>();
-
- private final List<PortletMode> portletModes;
-
- private final List<WindowState> windowStates;
-
-
- /**
- * Create a new MockPortalContext
- * with default PortletModes (VIEW, EDIT, HELP)
- * and default WindowStates (NORMAL, MAXIMIZED, MINIMIZED).
- * @see javax.portlet.PortletMode
- * @see javax.portlet.WindowState
- */
- public MockPortalContext() {
- this.portletModes = new ArrayList<PortletMode>(3);
- this.portletModes.add(PortletMode.VIEW);
- this.portletModes.add(PortletMode.EDIT);
- this.portletModes.add(PortletMode.HELP);
-
- this.windowStates = new ArrayList<WindowState>(3);
- this.windowStates.add(WindowState.NORMAL);
- this.windowStates.add(WindowState.MAXIMIZED);
- this.windowStates.add(WindowState.MINIMIZED);
- }
-
- /**
- * Create a new MockPortalContext with the given PortletModes and WindowStates.
- * @param supportedPortletModes the List of supported PortletMode instances
- * @param supportedWindowStates the List of supported WindowState instances
- * @see javax.portlet.PortletMode
- * @see javax.portlet.WindowState
- */
- public MockPortalContext(List<PortletMode> supportedPortletModes, List<WindowState> supportedWindowStates) {
- this.portletModes = new ArrayList<PortletMode>(supportedPortletModes);
- this.windowStates = new ArrayList<WindowState>(supportedWindowStates);
- }
-
-
- @Override
- public String getPortalInfo() {
- return "MockPortal/1.0";
- }
-
- public void setProperty(String name, String value) {
- this.properties.put(name, value);
- }
-
- @Override
- public String getProperty(String name) {
- return this.properties.get(name);
- }
-
- @Override
- public Enumeration<String> getPropertyNames() {
- return Collections.enumeration(this.properties.keySet());
- }
-
- @Override
- public Enumeration<PortletMode> getSupportedPortletModes() {
- return Collections.enumeration(this.portletModes);
- }
-
- @Override
- public Enumeration<WindowState> getSupportedWindowStates() {
- return Collections.enumeration(this.windowStates);
- }
-
-}
diff --git a/plugins/portlet-mocks/src/main/java/org/apache/struts2/mock/web/portlet/MockPortletConfig.java b/plugins/portlet-mocks/src/main/java/org/apache/struts2/mock/web/portlet/MockPortletConfig.java
deleted file mode 100644
index 33d7e901c..000000000
--- a/plugins/portlet-mocks/src/main/java/org/apache/struts2/mock/web/portlet/MockPortletConfig.java
+++ /dev/null
@@ -1,194 +0,0 @@
-/*
- * Copyright 2002-2012 the original author or authors.
- *
- * Licensed 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
- *
- * https://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.
- */
-
-package org.apache.struts2.mock.web.portlet;
-
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.LinkedHashMap;
-import java.util.LinkedHashSet;
-import java.util.Locale;
-import java.util.Map;
-import java.util.ResourceBundle;
-import java.util.Set;
-import javax.portlet.PortletConfig;
-import javax.portlet.PortletContext;
-import javax.xml.XMLConstants;
-import javax.xml.namespace.QName;
-
-import org.springframework.util.Assert;
-
-/**
- * Mock implementation of the {@link javax.portlet.PortletConfig} interface.
- *
- * @author John A. Lewis
- * @author Juergen Hoeller
- * @since 2.0
- */
-public class MockPortletConfig implements PortletConfig {
-
- private final PortletContext portletContext;
-
- private final String portletName;
-
- private final Map<Locale, ResourceBundle> resourceBundles = new HashMap<Locale, ResourceBundle>();
-
- private final Map<String, String> initParameters = new LinkedHashMap<String, String>();
-
- private final Set<String> publicRenderParameterNames = new LinkedHashSet<String>();
-
- private String defaultNamespace = XMLConstants.NULL_NS_URI;
-
- private final Set<QName> publishingEventQNames = new LinkedHashSet<QName>();
-
- private final Set<QName> processingEventQNames = new LinkedHashSet<QName>();
-
- private final Set<Locale> supportedLocales = new LinkedHashSet<Locale>();
-
- private final Map<String, String[]> containerRuntimeOptions = new LinkedHashMap<String, String[]>();
-
-
- /**
- * Create a new MockPortletConfig with a default {@link MockPortletContext}.
- */
- public MockPortletConfig() {
- this(null, "");
- }
-
- /**
- * Create a new MockPortletConfig with a default {@link MockPortletContext}.
- * @param portletName the name of the portlet
- */
- public MockPortletConfig(String portletName) {
- this(null, portletName);
- }
-
- /**
- * Create a new MockPortletConfig.
- * @param portletContext the PortletContext that the portlet runs in
- */
- public MockPortletConfig(PortletContext portletContext) {
- this(portletContext, "");
- }
-
- /**
- * Create a new MockPortletConfig.
- * @param portletContext the PortletContext that the portlet runs in
- * @param portletName the name of the portlet
- */
- public MockPortletConfig(PortletContext portletContext, String portletName) {
- this.portletContext = (portletContext != null ? portletContext : new MockPortletContext());
- this.portletName = portletName;
- }
-
-
- @Override
- public String getPortletName() {
- return this.portletName;
- }
-
- @Override
- public PortletContext getPortletContext() {
- return this.portletContext;
- }
-
- public void setResourceBundle(Locale locale, ResourceBundle resourceBundle) {
- Assert.notNull(locale, "Locale must not be null");
- this.resourceBundles.put(locale, resourceBundle);
- }
-
- @Override
- public ResourceBundle getResourceBundle(Locale locale) {
- Assert.notNull(locale, "Locale must not be null");
- return this.resourceBundles.get(locale);
- }
-
- public void addInitParameter(String name, String value) {
- Assert.notNull(name, "Parameter name must not be null");
- this.initParameters.put(name, value);
- }
-
- @Override
- public String getInitParameter(String name) {
- Assert.notNull(name, "Parameter name must not be null");
- return this.initParameters.get(name);
- }
-
- @Override
- public Enumeration<String> getInitParameterNames() {
- return Collections.enumeration(this.initParameters.keySet());
- }
-
- public void addPublicRenderParameterName(String name) {
- this.publicRenderParameterNames.add(name);
- }
-
- @Override
- public Enumeration<String> getPublicRenderParameterNames() {
- return Collections.enumeration(this.publicRenderParameterNames);
- }
-
- public void setDefaultNamespace(String defaultNamespace) {
- this.defaultNamespace = defaultNamespace;
- }
-
- @Override
- public String getDefaultNamespace() {
- return this.defaultNamespace;
- }
-
- public void addPublishingEventQName(QName name) {
- this.publishingEventQNames.add(name);
- }
-
- @Override
- public Enumeration<QName> getPublishingEventQNames() {
- return Collections.enumeration(this.publishingEventQNames);
- }
-
- public void addProcessingEventQName(QName name) {
- this.processingEventQNames.add(name);
- }
-
- @Override
- public Enumeration<QName> getProcessingEventQNames() {
- return Collections.enumeration(this.processingEventQNames);
- }
-
- public void addSupportedLocale(Locale locale) {
- this.supportedLocales.add(locale);
- }
-
- @Override
- public Enumeration<Locale> getSupportedLocales() {
- return Collections.enumeration(this.supportedLocales);
- }
-
- public void addContainerRuntimeOption(String key, String value) {
- this.containerRuntimeOptions.put(key, new String[] {value});
- }
-
- public void addContainerRuntimeOption(String key, String[] values) {
- this.containerRuntimeOptions.put(key, values);
- }
-
- @Override
- public Map<String, String[]> getContainerRuntimeOptions() {
- return Collections.unmodifiableMap(this.containerRuntimeOptions);
- }
-
-}
diff --git a/plugins/portlet-mocks/src/main/java/org/apache/struts2/mock/web/portlet/MockPortletContext.java b/plugins/portlet-mocks/src/main/java/org/apache/struts2/mock/web/portlet/MockPortletContext.java
deleted file mode 100644
index 3cf0a5d47..000000000
--- a/plugins/portlet-mocks/src/main/java/org/apache/struts2/mock/web/portlet/MockPortletContext.java
+++ /dev/null
@@ -1,285 +0,0 @@
-/*
- * Copyright 2002-2012 the original author or authors.
- *
- * Licensed 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
- *
- * https://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.
- */
-
-package org.apache.struts2.mock.web.portlet;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.HashSet;
-import java.util.LinkedHashMap;
-import java.util.LinkedHashSet;
-import java.util.Map;
-import java.util.Set;
-import javax.portlet.PortletContext;
-import javax.portlet.PortletRequestDispatcher;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import org.springframework.core.io.DefaultResourceLoader;
-import org.springframework.core.io.Resource;
-import org.springframework.core.io.ResourceLoader;
-import org.springframework.util.Assert;
-import org.springframework.web.util.WebUtils;
-
-/**
- * Mock implementation of the {@link javax.portlet.PortletContext} interface.
- *
- * @author John A. Lewis
- * @author Juergen Hoeller
- * @since 2.0
- */
-public class MockPortletContext implements PortletContext {
-
- private static final String TEMP_DIR_SYSTEM_PROPERTY = "java.io.tmpdir";
-
-
- private final Log logger = LogFactory.getLog(getClass());
-
- private final String resourceBasePath;
-
- private final ResourceLoader resourceLoader;
-
- private final Map<String, Object> attributes = new LinkedHashMap<String, Object>();
-
- private final Map<String, String> initParameters = new LinkedHashMap<String, String>();
-
- private String portletContextName = "MockPortletContext";
-
- private Set<String> containerRuntimeOptions = new LinkedHashSet<String>();
-
-
- /**
- * Create a new MockPortletContext with no base path and a
- * DefaultResourceLoader (i.e. the classpath root as WAR root).
- * @see org.springframework.core.io.DefaultResourceLoader
- */
- public MockPortletContext() {
- this("", null);
- }
-
- /**
- * Create a new MockPortletContext using a DefaultResourceLoader.
- * @param resourceBasePath the WAR root directory (should not end with a slash)
- * @see org.springframework.core.io.DefaultResourceLoader
- */
- public MockPortletContext(String resourceBasePath) {
- this(resourceBasePath, null);
- }
-
- /**
- * Create a new MockPortletContext, using the specified ResourceLoader
- * and no base path.
- * @param resourceLoader the ResourceLoader to use (or null for the default)
- */
- public MockPortletContext(ResourceLoader resourceLoader) {
- this("", resourceLoader);
- }
-
- /**
- * Create a new MockPortletContext.
- * @param resourceBasePath the WAR root directory (should not end with a slash)
- * @param resourceLoader the ResourceLoader to use (or null for the default)
- */
- public MockPortletContext(String resourceBasePath, ResourceLoader resourceLoader) {
- this.resourceBasePath = (resourceBasePath != null ? resourceBasePath : "");
- this.resourceLoader = (resourceLoader != null ? resourceLoader : new DefaultResourceLoader());
-
- // Use JVM temp dir as PortletContext temp dir.
- String tempDir = System.getProperty(TEMP_DIR_SYSTEM_PROPERTY);
- if (tempDir != null) {
- this.attributes.put(WebUtils.TEMP_DIR_CONTEXT_ATTRIBUTE, new File(tempDir));
- }
- }
-
- /**
- * Build a full resource location for the given path,
- * prepending the resource base path of this MockPortletContext.
- * @param path the path as specified
- * @return the full resource path
- */
- protected String getResourceLocation(String path) {
- if (!path.startsWith("/")) {
- path = "/" + path;
- }
- return this.resourceBasePath + path;
- }
-
-
- @Override
- public String getServerInfo() {
- return "MockPortal/1.0";
- }
-
- @Override
- public PortletRequestDispatcher getRequestDispatcher(String path) {
- if (!path.startsWith("/")) {
- throw new IllegalArgumentException(
- "PortletRequestDispatcher path at PortletContext level must start with '/'");
- }
- return new MockPortletRequestDispatcher(path);
- }
-
- @Override
- public PortletRequestDispatcher getNamedDispatcher(String path) {
- return null;
- }
-
- @Override
- public InputStream getResourceAsStream(String path) {
- Resource resource = this.resourceLoader.getResource(getResourceLocation(path));
- try {
- return resource.getInputStream();
- }
- catch (IOException ex) {
- logger.info("Couldn't open InputStream for " + resource, ex);
- return null;
- }
- }
-
- @Override
- public int getMajorVersion() {
- return 2;
- }
-
- @Override
- public int getMinorVersion() {
- return 0;
- }
-
- @Override
- public String getMimeType(String filePath) {
- return null;
- }
-
- @Override
- public String getRealPath(String path) {
- Resource resource = this.resourceLoader.getResource(getResourceLocation(path));
- try {
- return resource.getFile().getAbsolutePath();
- }
- catch (IOException ex) {
- logger.info("Couldn't determine real path of resource " + resource, ex);
- return null;
- }
- }
-
- @Override
- public Set<String> getResourcePaths(String path) {
- Resource resource = this.resourceLoader.getResource(getResourceLocation(path));
- try {
- File file = resource.getFile();
- String[] fileList = file.list();
- String prefix = (path.endsWith("/") ? path : path + "/");
- Set<String> resourcePaths = new HashSet<String>(fileList.length);
- for (String fileEntry : fileList) {
- resourcePaths.add(prefix + fileEntry);
- }
- return resourcePaths;
- }
- catch (IOException ex) {
- logger.info("Couldn't get resource paths for " + resource, ex);
- return null;
- }
- }
-
- @Override
- public URL getResource(String path) throws MalformedURLException {
- Resource resource = this.resourceLoader.getResource(getResourceLocation(path));
- try {
- return resource.getURL();
- }
- catch (IOException ex) {
- logger.info("Couldn't get URL for " + resource, ex);
- return null;
- }
- }
-
- @Override
- public Object getAttribute(String name) {
- return this.attributes.get(name);
- }
-
- @Override
- public Enumeration<String> getAttributeNames() {
- return Collections.enumeration(this.attributes.keySet());
- }
-
- @Override
- public void setAttribute(String name, Object value) {
- if (value != null) {
- this.attributes.put(name, value);
- }
- else {
- this.attributes.remove(name);
- }
- }
-
- @Override
- public void removeAttribute(String name) {
- this.attributes.remove(name);
- }
-
- public void addInitParameter(String name, String value) {
- Assert.notNull(name, "Parameter name must not be null");
- this.initParameters.put(name, value);
- }
-
- @Override
- public String getInitParameter(String name) {
- Assert.notNull(name, "Parameter name must not be null");
- return this.initParameters.get(name);
- }
-
- @Override
- public Enumeration<String> getInitParameterNames() {
- return Collections.enumeration(this.initParameters.keySet());
- }
-
- @Override
- public void log(String message) {
- logger.info(message);
- }
-
- @Override
- public void log(String message, Throwable t) {
- logger.info(message, t);
- }
-
- public void setPortletContextName(String portletContextName) {
- this.portletContextName = portletContextName;
- }
-
- @Override
- public String getPortletContextName() {
- return this.portletContextName;
- }
-
- public void addContainerRuntimeOption(String key) {
- this.containerRuntimeOptions.add(key);
- }
-
- @Override
- public Enumeration<String> getContainerRuntimeOptions() {
- return Collections.enumeration(this.containerRuntimeOptions);
- }
-
-}
diff --git a/plugins/portlet-mocks/src/main/java/org/apache/struts2/mock/web/portlet/MockPortletPreferences.java b/plugins/portlet-mocks/src/main/java/org/apache/struts2/mock/web/portlet/MockPortletPreferences.java
deleted file mode 100644
index 60ceca2bf..000000000
--- a/plugins/portlet-mocks/src/main/java/org/apache/struts2/mock/web/portlet/MockPortletPreferences.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * Copyright 2002-2009 the original author or authors.
- *
- * Licensed 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
- *
- * https://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.
- */
-
-package org.apache.struts2.mock.web.portlet;
-
-import java.io.IOException;
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.HashSet;
-import java.util.LinkedHashMap;
-import java.util.Map;
-import java.util.Set;
-import javax.portlet.PortletPreferences;
-import javax.portlet.PreferencesValidator;
-import javax.portlet.ReadOnlyException;
-import javax.portlet.ValidatorException;
-
-import org.springframework.util.Assert;
-
-/**
- * Mock implementation of the {@link javax.portlet.PortletPreferences} interface.
- *
- * @author John A. Lewis
- * @author Juergen Hoeller
- * @since 2.0
- */
-public class MockPortletPreferences implements PortletPreferences {
-
- private PreferencesValidator preferencesValidator;
-
- private final Map<String, String[]> preferences = new LinkedHashMap<String, String[]>();
-
- private final Set<String> readOnly = new HashSet<String>();
-
-
- public void setReadOnly(String key, boolean readOnly) {
- Assert.notNull(key, "Key must not be null");
- if (readOnly) {
- this.readOnly.add(key);
- }
- else {
- this.readOnly.remove(key);
- }
- }
-
- @Override
- public boolean isReadOnly(String key) {
- Assert.notNull(key, "Key must not be null");
- return this.readOnly.contains(key);
- }
-
- @Override
- public String getValue(String key, String def) {
- Assert.notNull(key, "Key must not be null");
- String[] values = this.preferences.get(key);
- return (values != null && values.length > 0 ? values[0] : def);
- }
-
- @Override
- public String[] getValues(String key, String[] def) {
- Assert.notNull(key, "Key must not be null");
- String[] values = this.preferences.get(key);
- return (values != null && values.length > 0 ? values : def);
- }
-
- @Override
- public void setValue(String key, String value) throws ReadOnlyException {
- setValues(key, new String[] {value});
- }
-
- @Override
- public void setValues(String key, String[] values) throws ReadOnlyException {
- Assert.notNull(key, "Key must not be null");
- if (isReadOnly(key)) {
- throw new ReadOnlyException("Preference '" + key + "' is read-only");
- }
- this.preferences.put(key, values);
- }
-
- @Override
- public Enumeration<String> getNames() {
- return Collections.enumeration(this.preferences.keySet());
- }
-
- @Override
- public Map<String, String[]> getMap() {
- return Collections.unmodifiableMap(this.preferences);
- }
-
- @Override
- public void reset(String key) throws ReadOnlyException {
- Assert.notNull(key, "Key must not be null");
- if (isReadOnly(key)) {
- throw new ReadOnlyException("Preference '" + key + "' is read-only");
- }
- this.preferences.remove(key);
- }
-
- public void setPreferencesValidator(PreferencesValidator preferencesValidator) {
- this.preferencesValidator = preferencesValidator;
- }
-
- @Override
- public void store() throws IOException, ValidatorException {
- if (this.preferencesValidator != null) {
- this.preferencesValidator.validate(this);
- }
- }
-
-}
diff --git a/plugins/portlet-mocks/src/main/java/org/apache/struts2/mock/web/portlet/MockPortletRequest.java b/plugins/portlet-mocks/src/main/java/org/apache/struts2/mock/web/portlet/MockPortletRequest.java
deleted file mode 100644
index 02ac4a3d9..000000000
--- a/plugins/portlet-mocks/src/main/java/org/apache/struts2/mock/web/portlet/MockPortletRequest.java
+++ /dev/null
@@ -1,565 +0,0 @@
-/*
- * Copyright 2002-2014 the original author or authors.
- *
- * Licensed 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
- *
- * https://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.
- */
-
-package org.apache.struts2.mock.web.portlet;
-
-import java.security.Principal;
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.HashSet;
-import java.util.LinkedHashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-import java.util.Set;
-import javax.portlet.PortalContext;
-import javax.portlet.PortletContext;
-import javax.portlet.PortletMode;
-import javax.portlet.PortletPreferences;
-import javax.portlet.PortletRequest;
-import javax.portlet.PortletSession;
-import javax.portlet.WindowState;
-import javax.servlet.http.Cookie;
-
-import org.springframework.util.Assert;
-import org.springframework.util.CollectionUtils;
-
-/**
- * Mock implementation of the {@link javax.portlet.PortletRequest} interface.
- *
- * @author John A. Lewis
- * @author Juergen Hoeller
- * @since 2.0
- */
-public class MockPortletRequest implements PortletRequest {
-
- private boolean active = true;
-
- private final PortalContext portalContext;
-
- private final PortletContext portletContext;
-
- private PortletSession session;
-
- private WindowState windowState = WindowState.NORMAL;
-
- private PortletMode portletMode = PortletMode.VIEW;
-
- private PortletPreferences portletPreferences = new MockPortletPreferences();
-
- private final Map<String, List<String>> properties = new LinkedHashMap<String, List<String>>();
-
- private final Map<String, Object> attributes = new LinkedHashMap<String, Object>();
-
- private final Map<String, String[]> parameters = new LinkedHashMap<String, String[]>();
-
- private String authType = null;
-
- private String contextPath = "";
-
- private String remoteUser = null;
-
- private Principal userPrincipal = null;
-
- private final Set<String> userRoles = new HashSet<String>();
-
- private boolean secure = false;
-
- private boolean requestedSessionIdValid = true;
-
- private final List<String> responseContentTypes = new LinkedList<String>();
-
- private final List<Locale> locales = new LinkedList<Locale>();
-
- private String scheme = "http";
-
- private String serverName = "localhost";
-
- private int serverPort = 80;
-
- private String windowID;
-
- private Cookie[] cookies;
-
- private final Set<String> publicParameterNames = new HashSet<String>();
-
-
- /**
- * Create a new MockPortletRequest with a default {@link MockPortalContext}
- * and a default {@link MockPortletContext}.
- * @see MockPortalContext
- * @see MockPortletContext
- */
- public MockPortletRequest() {
- this(null, null);
- }
-
- /**
- * Create a new MockPortletRequest with a default {@link MockPortalContext}.
- * @param portletContext the PortletContext that the request runs in
- * @see MockPortalContext
- */
- public MockPortletRequest(PortletContext portletContext) {
- this(null, portletContext);
- }
-
- /**
- * Create a new MockPortletRequest.
- * @param portalContext the PortalContext that the request runs in
- * @param portletContext the PortletContext that the request runs in
- */
- public MockPortletRequest(PortalContext portalContext, PortletContext portletContext) {
- this.portalContext = (portalContext != null ? portalContext : new MockPortalContext());
- this.portletContext = (portletContext != null ? portletContext : new MockPortletContext());
- this.responseContentTypes.add("text/html");
- this.locales.add(Locale.ENGLISH);
- this.attributes.put(LIFECYCLE_PHASE, getLifecyclePhase());
- }
-
-
- //---------------------------------------------------------------------
- // Lifecycle methods
- //---------------------------------------------------------------------
-
- /**
- * Return the Portlet 2.0 lifecycle id for the current phase.
- */
- protected String getLifecyclePhase() {
- return null;
- }
-
- /**
- * Return whether this request is still active (that is, not completed yet).
- */
- public boolean isActive() {
- return this.active;
- }
-
- /**
- * Mark this request as completed.
- */
- public void close() {
- this.active = false;
- }
-
- /**
- * Check whether this request is still active (that is, not completed yet),
- * throwing an IllegalStateException if not active anymore.
- */
- protected void checkActive() throws IllegalStateException {
- if (!this.active) {
- throw new IllegalStateException("Request is not active anymore");
- }
- }
-
-
- //---------------------------------------------------------------------
- // PortletRequest methods
- //---------------------------------------------------------------------
-
- @Override
- public boolean isWindowStateAllowed(WindowState windowState) {
- return CollectionUtils.contains(this.portalContext.getSupportedWindowStates(), windowState);
- }
-
- @Override
- public boolean isPortletModeAllowed(PortletMode portletMode) {
- return CollectionUtils.contains(this.portalContext.getSupportedPortletModes(), portletMode);
- }
-
- public void setPortletMode(PortletMode portletMode) {
- Assert.notNull(portletMode, "PortletMode must not be null");
- this.portletMode = portletMode;
- }
-
- @Override
- public PortletMode getPortletMode() {
- return this.portletMode;
- }
-
- public void setWindowState(WindowState windowState) {
- Assert.notNull(windowState, "WindowState must not be null");
- this.windowState = windowState;
- }
-
- @Override
- public WindowState getWindowState() {
- return this.windowState;
- }
-
- public void setPreferences(PortletPreferences preferences) {
- Assert.notNull(preferences, "PortletPreferences must not be null");
- this.portletPreferences = preferences;
- }
-
- @Override
- public PortletPreferences getPreferences() {
- return this.portletPreferences;
- }
-
- public void setSession(PortletSession session) {
- this.session = session;
- if (session instanceof MockPortletSession) {
- MockPortletSession mockSession = ((MockPortletSession) session);
- mockSession.access();
- }
- }
-
- @Override
- public PortletSession getPortletSession() {
- return getPortletSession(true);
- }
-
- @Override
- public PortletSession getPortletSession(boolean create) {
- checkActive();
- // Reset session if invalidated.
- if (this.session instanceof MockPortletSession && ((MockPortletSession) this.session).isInvalid()) {
- this.session = null;
- }
- // Create new session if necessary.
- if (this.session == null && create) {
- this.session = new MockPortletSession(this.portletContext);
- }
- return this.session;
- }
-
- /**
- * Set a single value for the specified property.
- * <p>If there are already one or more values registered for the given
- * property key, they will be replaced.
- */
- public void setProperty(String key, String value) {
- Assert.notNull(key, "Property key must not be null");
- List<String> list = new LinkedList<String>();
- list.add(value);
- this.properties.put(key, list);
- }
-
- /**
- * Add a single value for the specified property.
- * <p>If there are already one or more values registered for the given
- * property key, the given value will be added to the end of the list.
- */
- public void addProperty(String key, String value) {
- Assert.notNull(key, "Property key must not be null");
- List<String> oldList = this.properties.get(key);
- if (oldList != null) {
- oldList.add(value);
- }
- else {
- List<String> list = new LinkedList<String>();
- list.add(value);
- this.properties.put(key, list);
- }
- }
-
- @Override
- public String getProperty(String key) {
- Assert.notNull(key, "Property key must not be null");
- List<String> list = this.properties.get(key);
- return (list != null && list.size() > 0 ? list.get(0) : null);
- }
-
- @Override
- public Enumeration<String> getProperties(String key) {
- Assert.notNull(key, "property key must not be null");
- return Collections.enumeration(this.properties.get(key));
- }
-
- @Override
- public Enumeration<String> getPropertyNames() {
- return Collections.enumeration(this.properties.keySet());
- }
-
- @Override
- public PortalContext getPortalContext() {
- return this.portalContext;
- }
-
- public void setAuthType(String authType) {
- this.authType = authType;
- }
-
- @Override
- public String getAuthType() {
- return this.authType;
- }
-
- public void setContextPath(String contextPath) {
- this.contextPath = contextPath;
- }
-
- @Override
- public String getContextPath() {
- return this.contextPath;
- }
-
- public void setRemoteUser(String remoteUser) {
- this.remoteUser = remoteUser;
- }
-
- @Override
- public String getRemoteUser() {
- return this.remoteUser;
- }
-
- public void setUserPrincipal(Principal userPrincipal) {
- this.userPrincipal = userPrincipal;
- }
-
- @Override
- public Principal getUserPrincipal() {
- return this.userPrincipal;
- }
-
- public void addUserRole(String role) {
- this.userRoles.add(role);
- }
-
- @Override
- public boolean isUserInRole(String role) {
- return this.userRoles.contains(role);
- }
-
- @Override
- public Object getAttribute(String name) {
- checkActive();
- return this.attributes.get(name);
- }
-
- @Override
- public Enumeration<String> getAttributeNames() {
- checkActive();
- return Collections.enumeration(this.attributes.keySet());
- }
-
- public void setParameters(Map<String, String[]> parameters) {
- Assert.notNull(parameters, "Parameters Map must not be null");
- this.parameters.clear();
- this.parameters.putAll(parameters);
- }
-
- public void setParameter(String key, String value) {
- Assert.notNull(key, "Parameter key must be null");
- Assert.notNull(value, "Parameter value must not be null");
- this.parameters.put(key, new String[] {value});
- }
-
- public void setParameter(String key, String[] values) {
- Assert.notNull(key, "Parameter key must be null");
- Assert.notNull(values, "Parameter values must not be null");
- this.parameters.put(key, values);
- }
-
- public void addParameter(String name, String value) {
- addParameter(name, new String[] {value});
- }
-
- public void addParameter(String name, String[] values) {
- String[] oldArr = this.parameters.get(name);
- if (oldArr != null) {
- String[] newArr = new String[oldArr.length + values.length];
- System.arraycopy(oldArr, 0, newArr, 0, oldArr.length);
- System.arraycopy(values, 0, newArr, oldArr.length, values.length);
- this.parameters.put(name, newArr);
- }
- else {
- this.parameters.put(name, values);
- }
- }
-
- @Override
- public String getParameter(String name) {
- String[] arr = this.parameters.get(name);
- return (arr != null && arr.length > 0 ? arr[0] : null);
- }
-
- @Override
- public Enumeration<String> getParameterNames() {
- return Collections.enumeration(this.parameters.keySet());
- }
-
- @Override
- public String[] getParameterValues(String name) {
- return this.parameters.get(name);
- }
-
- @Override
- public Map<String, String[]> getParameterMap() {
- return Collections.unmodifiableMap(this.parameters);
- }
-
- public void setSecure(boolean secure) {
- this.secure = secure;
- }
-
- @Override
- public boolean isSecure() {
- return this.secure;
- }
-
- @Override
- public void setAttribute(String name, Object value) {
- checkActive();
- if (value != null) {
- this.attributes.put(name, value);
- }
- else {
- this.attributes.remove(name);
- }
- }
-
- @Override
- public void removeAttribute(String name) {
- checkActive();
- this.attributes.remove(name);
- }
-
- @Override
- public String getRequestedSessionId() {
- PortletSession session = this.getPortletSession();
- return (session != null ? session.getId() : null);
- }
-
- public void setRequestedSessionIdValid(boolean requestedSessionIdValid) {
- this.requestedSessionIdValid = requestedSessionIdValid;
- }
-
- @Override
- public boolean isRequestedSessionIdValid() {
- return this.requestedSessionIdValid;
- }
-
- public void addResponseContentType(String responseContentType) {
- this.responseContentTypes.add(responseContentType);
- }
-
- public void addPreferredResponseContentType(String responseContentType) {
- this.responseContentTypes.add(0, responseContentType);
- }
-
- @Override
- public String getResponseContentType() {
- return this.responseContentTypes.get(0);
- }
-
- @Override
- public Enumeration<String> getResponseContentTypes() {
- return Collections.enumeration(this.responseContentTypes);
- }
-
- public void addLocale(Locale locale) {
- this.locales.add(locale);
- }
-
- public void addPreferredLocale(Locale locale) {
- this.locales.add(0, locale);
- }
-
- @Override
- public Locale getLocale() {
- return this.locales.get(0);
- }
-
- @Override
- public Enumeration<Locale> getLocales() {
- return Collections.enumeration(this.locales);
- }
-
- public void setScheme(String scheme) {
- this.scheme = scheme;
- }
-
- @Override
- public String getScheme() {
- return this.scheme;
- }
-
- public void setServerName(String serverName) {
- this.serverName = serverName;
- }
-
- @Override
- public String getServerName() {
- return this.serverName;
- }
-
- public void setServerPort(int serverPort) {
- this.serverPort = serverPort;
- }
-
- @Override
- public int getServerPort() {
- return this.serverPort;
- }
-
- public void setWindowID(String windowID) {
- this.windowID = windowID;
- }
-
- @Override
- public String getWindowID() {
- return this.windowID;
- }
-
- public void setCookies(Cookie... cookies) {
- this.cookies = cookies;
- }
-
- @Override
- public Cookie[] getCookies() {
- return this.cookies;
- }
-
- @Override
- public Map<String, String[]> getPrivateParameterMap() {
- if (!this.publicParameterNames.isEmpty()) {
- Map<String, String[]> filtered = new LinkedHashMap<String, String[]>();
- for (String key : this.parameters.keySet()) {
- if (!this.publicParameterNames.contains(key)) {
- filtered.put(key, this.parameters.get(key));
- }
- }
- return filtered;
- }
- else {
- return Collections.unmodifiableMap(this.parameters);
- }
- }
-
- @Override
- public Map<String, String[]> getPublicParameterMap() {
- if (!this.publicParameterNames.isEmpty()) {
- Map<String, String[]> filtered = new LinkedHashMap<String, String[]>();
- for (String key : this.parameters.keySet()) {
- if (this.publicParameterNames.contains(key)) {
- filtered.put(key, this.parameters.get(key));
- }
- }
- return filtered;
- }
- else {
- return Collections.emptyMap();
- }
- }
-
- public void registerPublicParameter(String name) {
- this.publicParameterNames.add(name);
- }
-
-}
diff --git a/plugins/portlet-mocks/src/main/java/org/apache/struts2/mock/web/portlet/MockPortletRequestDispatcher.java b/plugins/portlet-mocks/src/main/java/org/apache/struts2/mock/web/portlet/MockPortletRequestDispatcher.java
deleted file mode 100644
index e80f774a6..000000000
--- a/plugins/portlet-mocks/src/main/java/org/apache/struts2/mock/web/portlet/MockPortletRequestDispatcher.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Copyright 2002-2012 the original author or authors.
- *
- * Licensed 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
- *
- * https://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.
- */
-
-package org.apache.struts2.mock.web.portlet;
-
-import java.io.IOException;
-import javax.portlet.PortletException;
-import javax.portlet.PortletRequest;
-import javax.portlet.PortletRequestDispatcher;
-import javax.portlet.PortletResponse;
-import javax.portlet.RenderRequest;
-import javax.portlet.RenderResponse;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import org.springframework.util.Assert;
-
-/**
- * Mock implementation of the {@link javax.portlet.PortletRequestDispatcher} interface.
- *
- * @author John A. Lewis
- * @author Juergen Hoeller
- * @since 2.0
- */
-public class MockPortletRequestDispatcher implements PortletRequestDispatcher {
-
- private final Log logger = LogFactory.getLog(getClass());
-
- private final String url;
-
-
- /**
- * Create a new MockPortletRequestDispatcher for the given URL.
- * @param url the URL to dispatch to.
- */
- public MockPortletRequestDispatcher(String url) {
- Assert.notNull(url, "URL must not be null");
- this.url = url;
- }
-
-
- @Override
- public void include(RenderRequest request, RenderResponse response) throws PortletException, IOException {
- include((PortletRequest) request, (PortletResponse) response);
- }
-
- @Override
- public void include(PortletRequest request, PortletResponse response) throws PortletException, IOException {
- Assert.notNull(request, "Request must not be null");
- Assert.notNull(response, "Response must not be null");
- if (!(response instanceof MockMimeResponse)) {
- throw new IllegalArgumentException("MockPortletRequestDispatcher requires MockMimeResponse");
- }
- ((MockMimeResponse) response).setIncludedUrl(this.url);
- if (logger.isDebugEnabled()) {
- logger.debug("MockPortletRequestDispatcher: including URL [" + this.url + "]");
- }
- }
-
- @Override
- public void forward(PortletRequest request, PortletResponse response) throws PortletException, IOException {
- Assert.notNull(request, "Request must not be null");
- Assert.notNull(response, "Response must not be null");
- if (!(response instanceof MockMimeResponse)) {
- throw new IllegalArgumentException("MockPortletRequestDispatcher requires MockMimeResponse");
- }
- ((MockMimeResponse) response).setForwardedUrl(this.url);
- if (logger.isDebugEnabled()) {
- logger.debug("MockPortletRequestDispatcher: forwarding to URL [" + this.url + "]");
- }
- }
-
-}
diff --git a/plugins/portlet-mocks/src/main/java/org/apache/struts2/mock/web/portlet/MockPortletResponse.java b/plugins/portlet-mocks/src/main/java/org/apache/struts2/mock/web/portlet/MockPortletResponse.java
deleted file mode 100644
index 1e69a5392..000000000
--- a/plugins/portlet-mocks/src/main/java/org/apache/struts2/mock/web/portlet/MockPortletResponse.java
+++ /dev/null
@@ -1,202 +0,0 @@
-/*
- * Copyright 2002-2012 the original author or authors.
- *
- * Licensed 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
- *
- * https://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.
- */
-
-package org.apache.struts2.mock.web.portlet;
-
-import java.util.Collections;
-import java.util.LinkedHashMap;
-import java.util.LinkedHashSet;
-import java.util.Map;
-import java.util.Set;
-import javax.portlet.PortalContext;
-import javax.portlet.PortletResponse;
-import javax.servlet.http.Cookie;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-import org.springframework.util.Assert;
-
-/**
- * Mock implementation of the {@link javax.portlet.PortletResponse} interface.
- *
- * @author John A. Lewis
- * @author Juergen Hoeller
- * @since 2.0
- */
-public class MockPortletResponse implements PortletResponse {
-
- private final PortalContext portalContext;
-
- private final Map<String, String[]> properties = new LinkedHashMap<String, String[]>();
-
- private String namespace = "";
-
- private final Set<Cookie> cookies = new LinkedHashSet<Cookie>();
-
- private final Map<String, Element[]> xmlProperties = new LinkedHashMap<String, Element[]>();
-
- private Document xmlDocument;
-
-
- /**
- * Create a new MockPortletResponse with a default {@link MockPortalContext}.
- * @see MockPortalContext
- */
- public MockPortletResponse() {
- this(null);
- }
-
- /**
- * Create a new MockPortletResponse.
- * @param portalContext the PortalContext defining the supported
- * PortletModes and WindowStates
- */
- public MockPortletResponse(PortalContext portalContext) {
- this.portalContext = (portalContext != null ? portalContext : new MockPortalContext());
- }
-
- /**
- * Return the PortalContext that this MockPortletResponse runs in,
- * defining the supported PortletModes and WindowStates.
- */
- public PortalContext getPortalContext() {
- return this.portalContext;
- }
-
-
- //---------------------------------------------------------------------
- // PortletResponse methods
- //---------------------------------------------------------------------
-
- @Override
- public void addProperty(String key, String value) {
- Assert.notNull(key, "Property key must not be null");
- String[] oldArr = this.properties.get(key);
- if (oldArr != null) {
- String[] newArr = new String[oldArr.length + 1];
- System.arraycopy(oldArr, 0, newArr, 0, oldArr.length);
- newArr[oldArr.length] = value;
- this.properties.put(key, newArr);
- }
- else {
- this.properties.put(key, new String[] {value});
- }
- }
-
- @Override
- public void setProperty(String key, String value) {
- Assert.notNull(key, "Property key must not be null");
- this.properties.put(key, new String[] {value});
- }
-
- public Set<String> getPropertyNames() {
- return Collections.unmodifiableSet(this.properties.keySet());
- }
-
- public String getProperty(String key) {
- Assert.notNull(key, "Property key must not be null");
- String[] arr = this.properties.get(key);
- return (arr != null && arr.length > 0 ? arr[0] : null);
- }
-
- public String[] getProperties(String key) {
- Assert.notNull(key, "Property key must not be null");
- return this.properties.get(key);
- }
-
- @Override
- public String encodeURL(String path) {
- return path;
- }
-
- public void setNamespace(String namespace) {
- this.namespace = namespace;
- }
-
- @Override
- public String getNamespace() {
- return this.namespace;
- }
-
- @Override
- public void addProperty(Cookie cookie) {
- Assert.notNull(cookie, "Cookie must not be null");
- this.cookies.add(cookie);
- }
-
- public Cookie[] getCookies() {
- return this.cookies.toArray(new Cookie[this.cookies.size()]);
- }
-
- public Cookie getCookie(String name) {
- Assert.notNull(name, "Cookie name must not be null");
- for (Cookie cookie : this.cookies) {
- if (name.equals(cookie.getName())) {
- return cookie;
- }
- }
- return null;
- }
-
- @Override
- public void addProperty(String key, Element value) {
- Assert.notNull(key, "Property key must not be null");
- Element[] oldArr = this.xmlProperties.get(key);
- if (oldArr != null) {
- Element[] newArr = new Element[oldArr.length + 1];
- System.arraycopy(oldArr, 0, newArr, 0, oldArr.length);
- newArr[oldArr.length] = value;
- this.xmlProperties.put(key, newArr);
- }
- else {
- this.xmlProperties.put(key, new Element[] {value});
- }
- }
-
-
- public Set<String> getXmlPropertyNames() {
- return Collections.unmodifiableSet(this.xmlProperties.keySet());
- }
-
- public Element getXmlProperty(String key) {
- Assert.notNull(key, "Property key must not be null");
- Element[] arr = this.xmlProperties.get(key);
- return (arr != null && arr.length > 0 ? arr[0] : null);
- }
-
- public Element[] getXmlProperties(String key) {
- Assert.notNull(key, "Property key must not be null");
- return this.xmlProperties.get(key);
- }
-
- @Override
- public Element createElement(String tagName) throws DOMException {
- if (this.xmlDocument == null) {
- try {
- this.xmlDocument = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
- }
- catch (ParserConfigurationException ex) {
- throw new DOMException(DOMException.INVALID_STATE_ERR, ex.toString());
- }
- }
- return this.xmlDocument.createElement(tagName);
- }
-
-}
diff --git a/plugins/portlet-mocks/src/main/java/org/apache/struts2/mock/web/portlet/MockPortletSession.java b/plugins/portlet-mocks/src/main/java/org/apache/struts2/mock/web/portlet/MockPortletSession.java
deleted file mode 100644
index d79a591f6..000000000
--- a/plugins/portlet-mocks/src/main/java/org/apache/struts2/mock/web/portlet/MockPortletSession.java
+++ /dev/null
@@ -1,250 +0,0 @@
-/*
- * Copyright 2002-2013 the original author or authors.
- *
- * Licensed 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
- *
- * https://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.
- */
-
-package org.apache.struts2.mock.web.portlet;
-
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import javax.portlet.PortletContext;
-import javax.portlet.PortletSession;
-import javax.servlet.http.HttpSessionBindingEvent;
-import javax.servlet.http.HttpSessionBindingListener;
-
-import org.springframework.mock.web.MockHttpSession;
-
-/**
- * Mock implementation of the {@link javax.portlet.PortletSession} interface.
- *
- * @author John A. Lewis
- * @author Juergen Hoeller
- * @since 2.0
- */
-public class MockPortletSession implements PortletSession {
-
- private static int nextId = 1;
-
-
- private final String id = Integer.toString(nextId++);
-
- private final long creationTime = System.currentTimeMillis();
-
- private int maxInactiveInterval;
-
- private long lastAccessedTime = System.currentTimeMillis();
-
- private final PortletContext portletContext;
-
- private final Map<String, Object> portletAttributes = new HashMap<String, Object>();
-
- private final Map<String, Object> applicationAttributes = new HashMap<String, Object>();
-
- private boolean invalid = false;
-
- private boolean isNew = true;
-
-
- /**
- * Create a new MockPortletSession with a default {@link MockPortletContext}.
- * @see MockPortletContext
- */
- public MockPortletSession() {
- this(null);
- }
-
- /**
- * Create a new MockPortletSession.
- * @param portletContext the PortletContext that the session runs in
- */
- public MockPortletSession(PortletContext portletContext) {
- this.portletContext = (portletContext != null ? portletContext : new MockPortletContext());
- }
-
-
- @Override
- public Object getAttribute(String name) {
- return this.portletAttributes.get(name);
- }
-
- @Override
- public Object getAttribute(String name, int scope) {
- if (scope == PortletSession.PORTLET_SCOPE) {
- return this.portletAttributes.get(name);
- }
- else if (scope == PortletSession.APPLICATION_SCOPE) {
- return this.applicationAttributes.get(name);
- }
- return null;
- }
-
- @Override
- public Enumeration<String> getAttributeNames() {
- return Collections.enumeration(this.portletAttributes.keySet());
- }
-
- @Override
- public Enumeration<String> getAttributeNames(int scope) {
- if (scope == PortletSession.PORTLET_SCOPE) {
- return Collections.enumeration(this.portletAttributes.keySet());
- }
- else if (scope == PortletSession.APPLICATION_SCOPE) {
- return Collections.enumeration(this.applicationAttributes.keySet());
- }
- return null;
- }
-
- @Override
- public long getCreationTime() {
- return this.creationTime;
- }
-
- @Override
- public String getId() {
- return this.id;
- }
-
- public void access() {
- this.lastAccessedTime = System.currentTimeMillis();
- setNew(false);
- }
-
- @Override
- public long getLastAccessedTime() {
- return this.lastAccessedTime;
- }
-
- @Override
- public int getMaxInactiveInterval() {
- return this.maxInactiveInterval;
- }
-
- /**
- * Clear all of this session's attributes.
- */
- public void clearAttributes() {
- doClearAttributes(this.portletAttributes);
- doClearAttributes(this.applicationAttributes);
- }
-
- protected void doClearAttributes(Map<String, Object> attributes) {
- for (Iterator<Map.Entry<String, Object>> it = attributes.entrySet().iterator(); it.hasNext();) {
- Map.Entry<String, Object> entry = it.next();
- String name = entry.getKey();
- Object value = entry.getValue();
- it.remove();
- if (value instanceof HttpSessionBindingListener) {
- ((HttpSessionBindingListener) value).valueUnbound(
- new HttpSessionBindingEvent(new MockHttpSession(), name, value));
- }
- }
- }
-
- @Override
- public void invalidate() {
- this.lastAccessedTime = System.currentTimeMillis();
- this.invalid = true;
- clearAttributes();
- }
-
- public boolean isInvalid() {
- return this.invalid;
- }
-
- public void setNew(boolean value) {
- this.isNew = value;
- }
-
- @Override
- public boolean isNew() {
- return this.isNew;
- }
-
- @Override
- public void removeAttribute(String name) {
- this.portletAttributes.remove(name);
- }
-
- @Override
- public void removeAttribute(String name, int scope) {
- if (scope == PortletSession.PORTLET_SCOPE) {
- this.portletAttributes.remove(name);
- }
- else if (scope == PortletSession.APPLICATION_SCOPE) {
- this.applicationAttributes.remove(name);
- }
- }
-
- @Override
- public void setAttribute(String name, Object value) {
- if (value != null) {
- this.portletAttributes.put(name, value);
- }
- else {
- this.portletAttributes.remove(name);
- }
- }
-
- @Override
- public void setAttribute(String name, Object value, int scope) {
- if (scope == PortletSession.PORTLET_SCOPE) {
- if (value != null) {
- this.portletAttributes.put(name, value);
- }
- else {
- this.portletAttributes.remove(name);
- }
- }
- else if (scope == PortletSession.APPLICATION_SCOPE) {
- if (value != null) {
- this.applicationAttributes.put(name, value);
- }
- else {
- this.applicationAttributes.remove(name);
- }
- }
- }
-
- @Override
- public void setMaxInactiveInterval(int interval) {
- this.maxInactiveInterval = interval;
- }
-
- @Override
- public PortletContext getPortletContext() {
- return this.portletContext;
- }
-
- @Override
- public Map<String, Object> getAttributeMap() {
- return Collections.unmodifiableMap(this.portletAttributes);
- }
-
- @Override
- public Map<String, Object> getAttributeMap(int scope) {
- if (scope == PortletSession.PORTLET_SCOPE) {
- return Collections.unmodifiableMap(this.portletAttributes);
- }
- else if (scope == PortletSession.APPLICATION_SCOPE) {
- return Collections.unmodifiableMap(this.applicationAttributes);
- }
- else {
- return Collections.emptyMap();
- }
- }
-
-}
diff --git a/plugins/portlet-mocks/src/main/java/org/apache/struts2/mock/web/portlet/MockPortletURL.java b/plugins/portlet-mocks/src/main/java/org/apache/struts2/mock/web/portlet/MockPortletURL.java
deleted file mode 100644
index 503807e7c..000000000
--- a/plugins/portlet-mocks/src/main/java/org/apache/struts2/mock/web/portlet/MockPortletURL.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * Copyright 2002-2012 the original author or authors.
- *
- * Licensed 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
- *
- * https://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.
- */
-
-package org.apache.struts2.mock.web.portlet;
-
-import java.util.Map;
-import javax.portlet.PortalContext;
-import javax.portlet.PortletMode;
-import javax.portlet.PortletModeException;
-import javax.portlet.PortletURL;
-import javax.portlet.WindowState;
-import javax.portlet.WindowStateException;
-
-import org.springframework.util.Assert;
-import org.springframework.util.CollectionUtils;
-
-/**
- * Mock implementation of the {@link javax.portlet.PortletURL} interface.
- *
- * @author John A. Lewis
- * @author Juergen Hoeller
- * @since 2.0
- */
-public class MockPortletURL extends MockBaseURL implements PortletURL {
-
- public static final String URL_TYPE_RENDER = "render";
-
- public static final String URL_TYPE_ACTION = "action";
-
-
- private final PortalContext portalContext;
-
- private final String urlType;
-
- private WindowState windowState;
-
- private PortletMode portletMode;
-
-
- /**
- * Create a new MockPortletURL for the given URL type.
- * @param portalContext the PortalContext defining the supported
- * PortletModes and WindowStates
- * @param urlType the URL type, for example "render" or "action"
- * @see #URL_TYPE_RENDER
- * @see #URL_TYPE_ACTION
- */
- public MockPortletURL(PortalContext portalContext, String urlType) {
- Assert.notNull(portalContext, "PortalContext is required");
- this.portalContext = portalContext;
- this.urlType = urlType;
- }
-
-
- //---------------------------------------------------------------------
- // PortletURL methods
- //---------------------------------------------------------------------
-
- @Override
- public void setWindowState(WindowState windowState) throws WindowStateException {
- if (!CollectionUtils.contains(this.portalContext.getSupportedWindowStates(), windowState)) {
- throw new WindowStateException("WindowState not supported", windowState);
- }
- this.windowState = windowState;
- }
-
- @Override
- public WindowState getWindowState() {
- return this.windowState;
- }
-
- @Override
- public void setPortletMode(PortletMode portletMode) throws PortletModeException {
- if (!CollectionUtils.contains(this.portalContext.getSupportedPortletModes(), portletMode)) {
- throw new PortletModeException("PortletMode not supported", portletMode);
- }
- this.portletMode = portletMode;
- }
-
- @Override
- public PortletMode getPortletMode() {
- return this.portletMode;
- }
-
- @Override
- public void removePublicRenderParameter(String name) {
- this.parameters.remove(name);
- }
-
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append(encodeParameter("urlType", this.urlType));
- if (this.windowState != null) {
- sb.append(";").append(encodeParameter("windowState", this.windowState.toString()));
- }
- if (this.portletMode != null) {
- sb.append(";").append(encodeParameter("portletMode", this.portletMode.toString()));
- }
- for (Map.Entry<String, String[]> entry : this.parameters.entrySet()) {
- sb.append(";").append(encodeParameter("param_" + entry.getKey(), entry.getValue()));
- }
- return (isSecure() ? "https:" : "http:") +
- "//localhost/mockportlet?" + sb.toString();
- }
-
-}
diff --git a/plugins/portlet-mocks/src/main/java/org/apache/struts2/mock/web/portlet/MockRenderRequest.java b/plugins/portlet-mocks/src/main/java/org/apache/struts2/mock/web/portlet/MockRenderRequest.java
deleted file mode 100644
index fe5c11a6c..000000000
--- a/plugins/portlet-mocks/src/main/java/org/apache/struts2/mock/web/portlet/MockRenderRequest.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Copyright 2002-2012 the original author or authors.
- *
- * Licensed 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
- *
- * https://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.
- */
-
-package org.apache.struts2.mock.web.portlet;
-
-import javax.portlet.PortalContext;
-import javax.portlet.PortletContext;
-import javax.portlet.PortletMode;
-import javax.portlet.RenderRequest;
-import javax.portlet.WindowState;
-
-/**
- * Mock implementation of the {@link javax.portlet.RenderRequest} interface.
- *
- * @author John A. Lewis
- * @author Juergen Hoeller
- * @since 2.0
- */
-public class MockRenderRequest extends MockPortletRequest implements RenderRequest {
-
- /**
- * Create a new MockRenderRequest with a default {@link MockPortalContext}
- * and a default {@link MockPortletContext}.
- * @see MockPortalContext
- * @see MockPortletContext
- */
- public MockRenderRequest() {
- super();
- }
-
- /**
- * Create a new MockRenderRequest with a default {@link MockPortalContext}
- * and a default {@link MockPortletContext}.
- * @param portletMode the mode that the portlet runs in
- */
- public MockRenderRequest(PortletMode portletMode) {
- super();
- setPortletMode(portletMode);
- }
-
- /**
- * Create a new MockRenderRequest with a default {@link MockPortalContext}
- * and a default {@link MockPortletContext}.
- * @param portletMode the mode that the portlet runs in
- * @param windowState the window state to run the portlet in
- */
- public MockRenderRequest(PortletMode portletMode, WindowState windowState) {
- super();
- setPortletMode(portletMode);
- setWindowState(windowState);
- }
-
- /**
- * Create a new MockRenderRequest with a default {@link MockPortalContext}.
- * @param portletContext the PortletContext that the request runs in
- */
- public MockRenderRequest(PortletContext portletContext) {
- super(portletContext);
- }
-
- /**
- * Create a new MockRenderRequest.
- * @param portalContext the PortletContext that the request runs in
- * @param portletContext the PortletContext that the request runs in
- */
- public MockRenderRequest(PortalContext portalContext, PortletContext portletContext) {
- super(portalContext, portletContext);
- }
-
-
- @Override
- protected String getLifecyclePhase() {
- return RENDER_PHASE;
- }
-
- @Override
- public String getETag() {
- return getProperty(RenderRequest.ETAG);
- }
-
-}
diff --git a/plugins/portlet-mocks/src/main/java/org/apache/struts2/mock/web/portlet/MockRenderResponse.java b/plugins/portlet-mocks/src/main/java/org/apache/struts2/mock/web/portlet/MockRenderResponse.java
deleted file mode 100644
index defa5e9f7..000000000
--- a/plugins/portlet-mocks/src/main/java/org/apache/struts2/mock/web/portlet/MockRenderResponse.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Copyright 2002-2012 the original author or authors.
- *
- * Licensed 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
- *
- * https://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.
- */
-
-package org.apache.struts2.mock.web.portlet;
-
-import java.util.Collection;
-import javax.portlet.PortalContext;
-import javax.portlet.PortletMode;
-import javax.portlet.RenderRequest;
-import javax.portlet.RenderResponse;
-
-/**
- * Mock implementation of the {@link javax.portlet.RenderResponse} interface.
- *
- * @author John A. Lewis
- * @author Juergen Hoeller
- * @since 2.0
- */
-public class MockRenderResponse extends MockMimeResponse implements RenderResponse {
-
- private String title;
-
- private Collection<PortletMode> nextPossiblePortletModes;
-
-
- /**
- * Create a new MockRenderResponse with a default {@link MockPortalContext}.
- * @see MockPortalContext
- */
- public MockRenderResponse() {
- super();
- }
-
- /**
- * Create a new MockRenderResponse.
- * @param portalContext the PortalContext defining the supported
- * PortletModes and WindowStates
- */
- public MockRenderResponse(PortalContext portalContext) {
- super(portalContext);
- }
-
- /**
- * Create a new MockRenderResponse.
- * @param portalContext the PortalContext defining the supported
- * PortletModes and WindowStates
- * @param request the corresponding render request that this response
- * is generated for
- */
- public MockRenderResponse(PortalContext portalContext, RenderRequest request) {
- super(portalContext, request);
- }
-
-
- //---------------------------------------------------------------------
- // RenderResponse methods
- //---------------------------------------------------------------------
-
- @Override
- public void setTitle(String title) {
- this.title = title;
- }
-
- public String getTitle() {
- return this.title;
- }
-
- @Override
- public void setNextPossiblePortletModes(Collection<PortletMode> portletModes) {
- this.nextPossiblePortletModes = portletModes;
- }
-
- public Collection<PortletMode> getNextPossiblePortletModes() {
- return this.nextPossiblePortletModes;
- }
-
-}
diff --git a/plugins/portlet-mocks/src/main/java/org/apache/struts2/mock/web/portlet/MockResourceRequest.java b/plugins/portlet-mocks/src/main/java/org/apache/struts2/mock/web/portlet/MockResourceRequest.java
deleted file mode 100644
index 421217069..000000000
--- a/plugins/portlet-mocks/src/main/java/org/apache/struts2/mock/web/portlet/MockResourceRequest.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- * Copyright 2002-2012 the original author or authors.
- *
- * Licensed 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
- *
- * https://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.
- */
-
-package org.apache.struts2.mock.web.portlet;
-
-import java.util.Collections;
-import java.util.LinkedHashMap;
-import java.util.Map;
-import javax.portlet.PortalContext;
-import javax.portlet.PortletContext;
-import javax.portlet.RenderRequest;
-import javax.portlet.ResourceRequest;
-
-/**
- * Mock implementation of the {@link javax.portlet.ResourceRequest} interface.
- *
- * @author Juergen Hoeller
- * @since 3.0
- */
-public class MockResourceRequest extends MockClientDataRequest implements ResourceRequest {
-
- private String resourceID;
-
- private String cacheability;
-
- private final Map<String, String[]> privateRenderParameterMap = new LinkedHashMap<String, String[]>();
-
-
- /**
- * Create a new MockResourceRequest with a default {@link MockPortalContext}
- * and a default {@link MockPortletContext}.
- * @see org.springframework.mock.web.portlet.MockPortalContext
- * @see org.springframework.mock.web.portlet.MockPortletContext
- */
- public MockResourceRequest() {
- super();
- }
-
- /**
- * Create a new MockResourceRequest with a default {@link MockPortalContext}
- * and a default {@link MockPortletContext}.
- * @param resourceID the resource id for this request
- */
- public MockResourceRequest(String resourceID) {
- super();
- this.resourceID = resourceID;
- }
-
- /**
- * Create a new MockResourceRequest with a default {@link MockPortalContext}
- * and a default {@link MockPortletContext}.
- * @param url the resource URL for this request
- */
- public MockResourceRequest(MockResourceURL url) {
- super();
- this.resourceID = url.getResourceID();
- this.cacheability = url.getCacheability();
- }
-
- /**
- * Create a new MockResourceRequest with a default {@link MockPortalContext}.
- * @param portletContext the PortletContext that the request runs in
- */
- public MockResourceRequest(PortletContext portletContext) {
- super(portletContext);
- }
-
- /**
- * Create a new MockResourceRequest.
- * @param portalContext the PortalContext that the request runs in
- * @param portletContext the PortletContext that the request runs in
- */
- public MockResourceRequest(PortalContext portalContext, PortletContext portletContext) {
- super(portalContext, portletContext);
- }
-
-
- @Override
- protected String getLifecyclePhase() {
- return RESOURCE_PHASE;
- }
-
- public void setResourceID(String resourceID) {
- this.resourceID = resourceID;
- }
-
- @Override
- public String getResourceID() {
- return this.resourceID;
- }
-
- public void setCacheability(String cacheLevel) {
- this.cacheability = cacheLevel;
- }
-
- @Override
- public String getCacheability() {
- return this.cacheability;
- }
-
- @Override
- public String getETag() {
- return getProperty(RenderRequest.ETAG);
- }
-
- public void addPrivateRenderParameter(String key, String value) {
- this.privateRenderParameterMap.put(key, new String[] {value});
- }
-
- public void addPrivateRenderParameter(String key, String[] values) {
- this.privateRenderParameterMap.put(key, values);
- }
-
- @Override
- public Map<String, String[]> getPrivateRenderParameterMap() {
- return Collections.unmodifiableMap(this.privateRenderParameterMap);
- }
-
-}
diff --git a/plugins/portlet-mocks/src/main/java/org/apache/struts2/mock/web/portlet/MockResourceResponse.java b/plugins/portlet-mocks/src/main/java/org/apache/struts2/mock/web/portlet/MockResourceResponse.java
deleted file mode 100644
index 06bba7a00..000000000
--- a/plugins/portlet-mocks/src/main/java/org/apache/struts2/mock/web/portlet/MockResourceResponse.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright 2002-2012 the original author or authors.
- *
- * Licensed 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
- *
- * https://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.
- */
-
-package org.apache.struts2.mock.web.portlet;
-
-import javax.portlet.ResourceResponse;
-
-/**
- * Mock implementation of the {@link javax.portlet.ResourceResponse} interface.
- *
- * @author Juergen Hoeller
- * @since 3.0
- */
-public class MockResourceResponse extends MockMimeResponse implements ResourceResponse {
-
- private int contentLength = 0;
-
-
- @Override
- public void setContentLength(int len) {
- this.contentLength = len;
- }
-
- public int getContentLength() {
- return this.contentLength;
- }
-
-}
diff --git a/plugins/portlet-mocks/src/main/java/org/apache/struts2/mock/web/portlet/MockResourceURL.java b/plugins/portlet-mocks/src/main/java/org/apache/struts2/mock/web/portlet/MockResourceURL.java
deleted file mode 100644
index e38e08986..000000000
--- a/plugins/portlet-mocks/src/main/java/org/apache/struts2/mock/web/portlet/MockResourceURL.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright 2002-2012 the original author or authors.
- *
- * Licensed 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
- *
- * https://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.
- */
-
-package org.apache.struts2.mock.web.portlet;
-
-import java.util.Map;
-import javax.portlet.ResourceURL;
-
-/**
- * Mock implementation of the {@link javax.portlet.ResourceURL} interface.
- *
- * @author Juergen Hoeller
- * @since 3.0
- */
-public class MockResourceURL extends MockBaseURL implements ResourceURL {
-
- private String resourceID;
-
- private String cacheability;
-
-
- //---------------------------------------------------------------------
- // ResourceURL methods
- //---------------------------------------------------------------------
-
- @Override
- public void setResourceID(String resourceID) {
- this.resourceID = resourceID;
- }
-
- public String getResourceID() {
- return this.resourceID;
- }
-
- @Override
- public void setCacheability(String cacheLevel) {
- this.cacheability = cacheLevel;
- }
-
- @Override
- public String getCacheability() {
- return this.cacheability;
- }
-
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append(encodeParameter("resourceID", this.resourceID));
- if (this.cacheability != null) {
- sb.append(";").append(encodeParameter("cacheability", this.cacheability));
- }
- for (Map.Entry<String, String[]> entry : this.parameters.entrySet()) {
- sb.append(";").append(encodeParameter("param_" + entry.getKey(), entry.getValue()));
- }
- return (isSecure() ? "https:" : "http:") +
- "//localhost/mockportlet?" + sb.toString();
- }
-
-}
diff --git a/plugins/portlet-mocks/src/main/java/org/apache/struts2/mock/web/portlet/MockStateAwareResponse.java b/plugins/portlet-mocks/src/main/java/org/apache/struts2/mock/web/portlet/MockStateAwareResponse.java
deleted file mode 100644
index bb085ba21..000000000
--- a/plugins/portlet-mocks/src/main/java/org/apache/struts2/mock/web/portlet/MockStateAwareResponse.java
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- * Copyright 2002-2012 the original author or authors.
- *
- * Licensed 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
- *
- * https://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.
- */
-
-package org.apache.struts2.mock.web.portlet;
-
-import java.io.Serializable;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.Map;
-import javax.portlet.PortalContext;
-import javax.portlet.PortletMode;
-import javax.portlet.PortletModeException;
-import javax.portlet.StateAwareResponse;
-import javax.portlet.WindowState;
-import javax.portlet.WindowStateException;
-import javax.xml.namespace.QName;
-
-import org.springframework.util.Assert;
-import org.springframework.util.CollectionUtils;
-
-/**
- * Mock implementation of the {@link javax.portlet.StateAwareResponse} interface.
- *
- * @author Juergen Hoeller
- * @since 3.0
- */
-public class MockStateAwareResponse extends MockPortletResponse implements StateAwareResponse {
-
- private WindowState windowState;
-
- private PortletMode portletMode;
-
- private final Map<String, String[]> renderParameters = new LinkedHashMap<String, String[]>();
-
- private final Map<QName, Serializable> events = new HashMap<QName, Serializable>();
-
-
- /**
- * Create a new MockActionResponse with a default {@link MockPortalContext}.
- * @see org.springframework.mock.web.portlet.MockPortalContext
- */
- public MockStateAwareResponse() {
- super();
- }
-
- /**
- * Create a new MockActionResponse.
- * @param portalContext the PortalContext defining the supported
- * PortletModes and WindowStates
- */
- public MockStateAwareResponse(PortalContext portalContext) {
- super(portalContext);
- }
-
-
- @Override
- public void setWindowState(WindowState windowState) throws WindowStateException {
- if (!CollectionUtils.contains(getPortalContext().getSupportedWindowStates(), windowState)) {
- throw new WindowStateException("WindowState not supported", windowState);
- }
- this.windowState = windowState;
- }
-
- @Override
- public WindowState getWindowState() {
- return this.windowState;
- }
-
- @Override
- public void setPortletMode(PortletMode portletMode) throws PortletModeException {
- if (!CollectionUtils.contains(getPortalContext().getSupportedPortletModes(), portletMode)) {
- throw new PortletModeException("PortletMode not supported", portletMode);
- }
- this.portletMode = portletMode;
- }
-
- @Override
- public PortletMode getPortletMode() {
- return this.portletMode;
- }
-
- @Override
- public void setRenderParameters(Map<String, String[]> parameters) {
- Assert.notNull(parameters, "Parameters Map must not be null");
- this.renderParameters.clear();
- this.renderParameters.putAll(parameters);
- }
-
- @Override
- public void setRenderParameter(String key, String value) {
- Assert.notNull(key, "Parameter key must not be null");
- Assert.notNull(value, "Parameter value must not be null");
- this.renderParameters.put(key, new String[] {value});
- }
-
- @Override
- public void setRenderParameter(String key, String[] values) {
- Assert.notNull(key, "Parameter key must not be null");
- Assert.notNull(values, "Parameter values must not be null");
- this.renderParameters.put(key, values);
- }
-
- public String getRenderParameter(String key) {
- Assert.notNull(key, "Parameter key must not be null");
- String[] arr = this.renderParameters.get(key);
- return (arr != null && arr.length > 0 ? arr[0] : null);
- }
-
- public String[] getRenderParameterValues(String key) {
- Assert.notNull(key, "Parameter key must not be null");
- return this.renderParameters.get(key);
- }
-
- public Iterator<String> getRenderParameterNames() {
- return this.renderParameters.keySet().iterator();
- }
-
- @Override
- public Map<String, String[]> getRenderParameterMap() {
- return Collections.unmodifiableMap(this.renderParameters);
- }
-
- @Override
- public void removePublicRenderParameter(String name) {
- this.renderParameters.remove(name);
- }
-
- @Override
- public void setEvent(QName name, Serializable value) {
- this.events.put(name, value);
- }
-
- @Override
- public void setEvent(String name, Serializable value) {
- this.events.put(new QName(name), value);
- }
-
- public Iterator<QName> getEventNames() {
- return this.events.keySet().iterator();
- }
-
- public Serializable getEvent(QName name) {
- return this.events.get(name);
- }
-
- public Serializable getEvent(String name) {
- return this.events.get(new QName(name));
- }
-
-}
\ No newline at end of file
diff --git a/plugins/portlet-mocks/src/main/java/org/apache/struts2/mock/web/portlet/ServletWrappingPortletContext.java b/plugins/portlet-mocks/src/main/java/org/apache/struts2/mock/web/portlet/ServletWrappingPortletContext.java
deleted file mode 100644
index 70f8b86db..000000000
--- a/plugins/portlet-mocks/src/main/java/org/apache/struts2/mock/web/portlet/ServletWrappingPortletContext.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
- * Copyright 2002-2016 the original author or authors.
- *
- * Licensed 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
- *
- * https://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.
- */
-
-package org.apache.struts2.mock.web.portlet;
-
-import java.io.InputStream;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.Set;
-import javax.portlet.PortletContext;
-import javax.portlet.PortletRequestDispatcher;
-import javax.servlet.ServletContext;
-
-import org.springframework.util.Assert;
-
-/**
- * Mock implementation of the {@link javax.portlet.PortletContext} interface,
- * wrapping an underlying {@link javax.servlet.ServletContext}.
- *
- * @author Juergen Hoeller
- * @since 3.0
- * @see MockPortletContext
- */
-public class ServletWrappingPortletContext implements PortletContext {
-
- private final ServletContext servletContext;
-
-
- /**
- * Create a new PortletContext wrapping the given ServletContext.
- * @param servletContext the ServletContext to wrap
- */
- public ServletWrappingPortletContext(ServletContext servletContext) {
- Assert.notNull(servletContext, "ServletContext must not be null");
- this.servletContext = servletContext;
- }
-
- /**
- * Return the underlying ServletContext that this PortletContext wraps.
- */
- public final ServletContext getServletContext() {
- return this.servletContext;
- }
-
-
- @Override
- public String getServerInfo() {
- return this.servletContext.getServerInfo();
- }
-
- @Override
- public PortletRequestDispatcher getRequestDispatcher(String path) {
- return null;
- }
-
- @Override
- public PortletRequestDispatcher getNamedDispatcher(String name) {
- return null;
- }
-
- @Override
- public InputStream getResourceAsStream(String path) {
- return this.servletContext.getResourceAsStream(path);
- }
-
- @Override
- public int getMajorVersion() {
- return 2;
- }
-
- @Override
- public int getMinorVersion() {
- return 0;
- }
-
- @Override
- public String getMimeType(String file) {
- return this.servletContext.getMimeType(file);
- }
-
- @Override
- public String getRealPath(String path) {
- return this.servletContext.getRealPath(path);
- }
-
- @Override
- public Set<String> getResourcePaths(String path) {
- return this.servletContext.getResourcePaths(path);
- }
-
- @Override
- public URL getResource(String path) throws MalformedURLException {
- return this.servletContext.getResource(path);
- }
-
- @Override
- public Object getAttribute(String name) {
- return this.servletContext.getAttribute(name);
- }
-
- @Override
- public Enumeration<String> getAttributeNames() {
- return this.servletContext.getAttributeNames();
- }
-
- @Override
- public String getInitParameter(String name) {
- return this.servletContext.getInitParameter(name);
- }
-
- @Override
- public Enumeration<String> getInitParameterNames() {
- return this.servletContext.getInitParameterNames();
- }
-
- @Override
- public void log(String msg) {
- this.servletContext.log(msg);
- }
-
- @Override
- public void log(String message, Throwable throwable) {
- this.servletContext.log(message, throwable);
- }
-
- @Override
- public void removeAttribute(String name) {
- this.servletContext.removeAttribute(name);
- }
-
- @Override
- public void setAttribute(String name, Object object) {
- this.servletContext.setAttribute(name, object);
- }
-
- @Override
- public String getPortletContextName() {
- return this.servletContext.getServletContextName();
- }
-
- @Override
- public Enumeration<String> getContainerRuntimeOptions() {
- return Collections.enumeration(Collections.<String>emptySet());
- }
-
-}
diff --git a/plugins/portlet-mocks/src/main/java/org/apache/struts2/mock/web/portlet/multipart/MultipartActionRequest.java b/plugins/portlet-mocks/src/main/java/org/apache/struts2/mock/web/portlet/multipart/MultipartActionRequest.java
deleted file mode 100644
index 6df611fe2..000000000
--- a/plugins/portlet-mocks/src/main/java/org/apache/struts2/mock/web/portlet/multipart/MultipartActionRequest.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright 2002-2008 the original author or authors.
- *
- * Licensed 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
- *
- * https://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.
- */
-
-package org.apache.struts2.mock.web.portlet.multipart;
-
-import javax.portlet.ActionRequest;
-
-import org.springframework.web.multipart.MultipartRequest;
-
-/**
- * Interface which provides additional methods for dealing with multipart
- * content within a portlet request, allowing to access uploaded files.
- * Implementations also need to override the standard ActionRequest
- * methods for parameter access, making multipart parameters available.
- *
- * <p>A concrete implementation is {@link DefaultMultipartActionRequest}.
- *
- * @author Juergen Hoeller
- * @since 2.0
- * @see PortletMultipartResolver
- * @see org.springframework.web.multipart.MultipartFile
- * @see javax.portlet.ActionRequest#getParameter
- * @see javax.portlet.ActionRequest#getParameterNames
- * @see javax.portlet.ActionRequest#getParameterMap
- */
-public interface MultipartActionRequest extends ActionRequest, MultipartRequest {
-
-}
diff --git a/plugins/portlet-mocks/src/main/java/org/apache/struts2/mock/web/portlet/multipart/package-info.java b/plugins/portlet-mocks/src/main/java/org/apache/struts2/mock/web/portlet/multipart/package-info.java
deleted file mode 100644
index 0ed9b6066..000000000
--- a/plugins/portlet-mocks/src/main/java/org/apache/struts2/mock/web/portlet/multipart/package-info.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright 2002-2016 the original author or authors.
- *
- * Licensed 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
- *
- * https://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.
- */
-/*
- * This package is a copy of the org.springframework.web.portlet.multipart package from Spring 4.3.x
- * (org.springframework, spring-webmvc-portlet, <a href="https://github.com/spring-projects/spring-framework/tree/4.3.x</a>)
- * which changes the package name to: org.apache.struts2.mock.web.portlet.multipart.
- *
- * The copyright and license notice above is reproduced from the original package's CommonsPortletMultipartResolver.java,
- * since it contained the widest year-range.
- *
- * The mock objects only have a dependency on one file from the package, MultipartActionRequest.java, so
- * it was required. The other files in the package were not retained in this copy (CommonsPortletMultipartResolver.java
- * in particular created additional dependencies that would require copying additional packages).
- *
- * With Spring 5 dropping Portlet MVC support completely [SPR-14129], copying this package should allow
- * individuals to continue using JUnit unit tests for their Struts 2 Portlet Plugin applications with
- * Spring 5.x.
- */
-/**
- * Multipart resolution framework for handling file uploads.
- * Provides a PortletMultipartResolver strategy interface,
- * and a generic extension of the ActionRequest interface
- * for accessing multipart files in web application code.
- */
-package org.apache.struts2.mock.web.portlet.multipart;
diff --git a/plugins/portlet-mocks/src/main/java/org/apache/struts2/mock/web/portlet/package-info.java b/plugins/portlet-mocks/src/main/java/org/apache/struts2/mock/web/portlet/package-info.java
deleted file mode 100644
index 982821ec1..000000000
--- a/plugins/portlet-mocks/src/main/java/org/apache/struts2/mock/web/portlet/package-info.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright 2002-2016 the original author or authors.
- *
- * Licensed 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
- *
- * https://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.
- */
-/*
- * This package is a copy of the org.springframework.mock.web.portlet package from Spring 4.3.x
- * (org.springframework, spring-test, <a href="https://github.com/spring-projects/spring-framework/tree/4.3.x</a>)
- * which changes the package name to: org.apache.struts2.mock.web.portlet.
- *
- * The copyright and license notice above is reproduced from the original package's ServletWrappingPortletContext.java,
- * since it contained the widest year-range.
- *
- * With Spring 5 dropping Portlet MVC support completely [SPR-14129], copying this package should allow
- * individuals to continue using JUnit unit tests for their Struts 2 Portlet Plugin applications with
- * Spring 5.x.
- */
-/**
- * A comprehensive set of Portlet API mock objects, targeted at usage with Spring's web MVC framework.
- * Useful for testing web contexts and controllers.
- *
- * <p>More convenient to use than dynamic mock objects (<a href="http://easymock.org/">EasyMock</a>) or
- * existing Portlet API mock objects.
- */
-package org.apache.struts2.mock.web.portlet;
\ No newline at end of file
diff --git a/plugins/portlet-mocks/src/site/site.xml b/plugins/portlet-mocks/src/site/site.xml
deleted file mode 100644
index 54fdcf4f4..000000000
--- a/plugins/portlet-mocks/src/site/site.xml
+++ /dev/null
@@ -1,56 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-/*
- * 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.
- */
--->
-<project name="Apache Struts">
- <skin>
- <groupId>org.apache.maven.skins</groupId>
- <artifactId>maven-fluido-skin</artifactId>
- <version>${fluido-skin.version}</version>
- </skin>
- <bannerLeft>
- <name>Apache Software Foundation</name>
- <src>http://www.apache.org/images/asf-logo.gif</src>
- <href>http://www.apache.org/</href>
- </bannerLeft>
- <bannerRight>
- <name>Apache Struts</name>
- <src>http://struts.apache.org/img/struts-logo.svg</src>
- <href>http://struts.apache.org/</href>
- </bannerRight>
- <publishDate position="left"/>
- <version position="right"/>
- <body>
- <links>
- <item name="Apache" href="http://www.apache.org/"/>
- <item name="Struts" href="http://struts.apache.org/"/>
- </links>
-
- <menu ref="parent"/>
- <menu ref="reports"/>
-
- <footer>
- <![CDATA[<div class="row span12">
- Apache Struts, Struts, Apache, the Apache feather logo, and the Apache Struts project
- logos are trademarks of The Apache Software Foundation.
- </div>]]>
- </footer>
- </body>
-</project>
diff --git a/plugins/portlet-mocks/src/test/java/org/apache/struts2/StrutsSpringPortletMockObjectsTest.java b/plugins/portlet-mocks/src/test/java/org/apache/struts2/StrutsSpringPortletMockObjectsTest.java
deleted file mode 100644
index 45ea12a74..000000000
--- a/plugins/portlet-mocks/src/test/java/org/apache/struts2/StrutsSpringPortletMockObjectsTest.java
+++ /dev/null
@@ -1,1604 +0,0 @@
-/*
- * Copyright 2020 Apache Software Foundation.
- *
- * Licensed 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.
- */
-package org.apache.struts2;
-
-import java.io.BufferedReader;
-import java.io.ByteArrayInputStream;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.PrintWriter;
-import java.net.MalformedURLException;
-import java.nio.charset.StandardCharsets;
-import java.security.Principal;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Enumeration;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.Locale;
-import java.util.Map;
-import java.util.ResourceBundle;
-import java.util.Set;
-import javax.portlet.ActionRequest;
-import javax.portlet.PortletMode;
-import javax.portlet.PortletPreferences;
-import javax.portlet.PortletRequest;
-import javax.portlet.PortletSession;
-import javax.portlet.PortletURL;
-import javax.portlet.PreferencesValidator;
-import javax.portlet.ReadOnlyException;
-import javax.portlet.ResourceURL;
-import javax.portlet.WindowState;
-import javax.security.auth.Subject;
-import javax.servlet.http.Cookie;
-import javax.xml.namespace.QName;
-import junit.framework.TestCase;
-import org.apache.struts2.mock.web.portlet.MockActionRequest;
-import org.apache.struts2.mock.web.portlet.MockActionResponse;
-import org.apache.struts2.mock.web.portlet.MockCacheControl;
-import org.apache.struts2.mock.web.portlet.MockClientDataRequest;
-import org.apache.struts2.mock.web.portlet.MockEvent;
-import org.apache.struts2.mock.web.portlet.MockEventRequest;
-import org.apache.struts2.mock.web.portlet.MockEventResponse;
-import org.apache.struts2.mock.web.portlet.MockMimeResponse;
-import org.apache.struts2.mock.web.portlet.MockMultipartActionRequest;
-import org.apache.struts2.mock.web.portlet.MockPortalContext;
-import org.apache.struts2.mock.web.portlet.MockPortletConfig;
-import org.apache.struts2.mock.web.portlet.MockPortletContext;
-import org.apache.struts2.mock.web.portlet.MockPortletPreferences;
-import org.apache.struts2.mock.web.portlet.MockPortletRequest;
-import org.apache.struts2.mock.web.portlet.MockPortletRequestDispatcher;
-import org.apache.struts2.mock.web.portlet.MockPortletResponse;
-import org.apache.struts2.mock.web.portlet.MockPortletSession;
-import org.apache.struts2.mock.web.portlet.MockPortletURL;
-import org.apache.struts2.mock.web.portlet.MockRenderRequest;
-import org.apache.struts2.mock.web.portlet.MockRenderResponse;
-import org.apache.struts2.mock.web.portlet.MockResourceRequest;
-import org.apache.struts2.mock.web.portlet.MockResourceResponse;
-import org.apache.struts2.mock.web.portlet.MockResourceURL;
-import org.apache.struts2.mock.web.portlet.MockStateAwareResponse;
-import org.apache.struts2.mock.web.portlet.ServletWrappingPortletContext;
-import org.springframework.mock.web.MockServletContext;
-import org.springframework.util.MultiValueMap;
-import org.springframework.web.multipart.MultipartFile;
-import org.springframework.web.util.WebUtils;
-import org.w3c.dom.Element;
-
-import static org.junit.Assert.assertArrayEquals;
-import static org.junit.Assert.assertNotEquals;
-
-/**
- * Basic test class for Portlet Mock Object testing
- *
- */
-public class StrutsSpringPortletMockObjectsTest extends TestCase {
-
- /**
- * An empty preferences validator for code coverage only
- */
- private static class BasicPreferencesValidator implements PreferencesValidator {
-
- @Override
- public void validate(PortletPreferences preferences) {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- }
-
- public void testMockActionRequest() {
- final String TEST_ACTIONNAME = "TEST_ACTIONNAME";
-
- // Call each constructor in sequence, do some basic checks
- new MockActionRequest(); // Only test is to confirm constructor completes without exception
- MockActionRequest mockActionRequest;
- mockActionRequest = new MockActionRequest(TEST_ACTIONNAME);
- assertEquals("Action name (ActionRequest.ACTION_NAME) " + TEST_ACTIONNAME + " not set ?", TEST_ACTIONNAME, mockActionRequest.getParameter(ActionRequest.ACTION_NAME));
- mockActionRequest = new MockActionRequest(PortletMode.VIEW);
- assertEquals("PortletMode.VIEW not set ?", PortletMode.VIEW, mockActionRequest.getPortletMode());
-
- final MockPortletContext mockPortletContext = new MockPortletContext();
- final MockPortalContext mockPortalContext = new MockPortalContext();
- new MockActionRequest(mockPortletContext); // Only test is to confirm constructor completes without exception
- mockActionRequest = new MockActionRequest(mockPortalContext, mockPortletContext);
- assertEquals("Portal context does not match constructor-set value ?", mockPortalContext, mockActionRequest.getPortalContext());
- }
-
- public void testMockActionResponse() {
- final String TEST_PARAM = "TEST_PARAM";
- final String TEST_PARAM2 = "TEST_PARAM2";
- final String TEST_PARAM3 = "TEST_PARAM3";
- final String TEST_PARAM_VALUE = "NORMALVALUE";
- final String[] TEST_PARAM_ARRAYVALUE = { "ARRAYVALUE1", "ARRAYVALUE2" };
- final String[] TEST_PARAM_ARRAYVALUE2 = { "ARRAYVALUE3", "ARRAYVALUE4" };
- final String TEST_REDIRECT_URL = "localhost:8080/fakeurl";
- final String TEST_RENDER_URLPARAM_NAME = "fake_render_url_param_name";
-
- // Call each constructor in sequence, do some basic checks
- MockActionResponse mockActionResponse = new MockActionResponse();
- try {
- mockActionResponse.setPortletMode(PortletMode.VIEW);
- } catch (Exception ex) {
- fail("MockActionResponse portlet mode set failed. Exception: " + ex);
- }
- assertEquals("PortletMode.VIEW not set ?", PortletMode.VIEW, mockActionResponse.getPortletMode());
-
- final MockPortalContext mockPortalContext = new MockPortalContext();
- mockActionResponse = new MockActionResponse(mockPortalContext); // Only test is to confirm constructor completes without exception
- assertEquals("Portal context does not match constructor-set value ?", mockPortalContext, mockActionResponse.getPortalContext());
- mockActionResponse.setRenderParameter(TEST_PARAM, TEST_PARAM_VALUE);
- mockActionResponse.setRenderParameter(TEST_PARAM2, TEST_PARAM_ARRAYVALUE);
- assertEquals("Portal test render parameter value not as expected ?", TEST_PARAM_VALUE, mockActionResponse.getRenderParameter(TEST_PARAM));
- assertEquals("Portal test render parameter value not as expected ?", TEST_PARAM_ARRAYVALUE[0], mockActionResponse.getRenderParameter(TEST_PARAM2));
- final Map<String, String[]> renderParametersMap = new LinkedHashMap<>();
- renderParametersMap.put(TEST_PARAM3, TEST_PARAM_ARRAYVALUE2);
- mockActionResponse.setRenderParameters(renderParametersMap);
- assertNull("Portal test render parameter value not cleared as expected ?", mockActionResponse.getRenderParameter(TEST_PARAM));
- assertNull("Portal test render parameter value not cleared as expected ?", mockActionResponse.getRenderParameter(TEST_PARAM2));
- assertEquals("Portal test render parameter map value not as expected ?", renderParametersMap, mockActionResponse.getRenderParameterMap());
-
- try {
- mockActionResponse.sendRedirect(TEST_REDIRECT_URL);
- fail("Able to redirect after windowState/portletMode/renderParameters set ?");
- } catch (IllegalStateException ise) {
- // Expected failure
- } catch (Exception ex) {
- fail("MockActionResponse sendredirect failed. Exception: " + ex);
- }
- mockActionResponse = new MockActionResponse(); // Clean mock response
- try {
- mockActionResponse.sendRedirect(TEST_REDIRECT_URL);
- } catch (Exception ex) {
- fail("MockActionResponse sendredirect failed. Exception: " + ex);
- }
- assertEquals("Redirect url not as expected ?", TEST_REDIRECT_URL, mockActionResponse.getRedirectedUrl());
- mockActionResponse = new MockActionResponse(); // Clean mock response
- try {
- // Note: The original Spring 4.3.x mock implementation always threw an IllegalStateException when calling the method below.
- mockActionResponse.sendRedirect(TEST_REDIRECT_URL, TEST_RENDER_URLPARAM_NAME);
- } catch (Exception ex) {
- fail("MockActionResponse sendredirect failed. Exception: " + ex);
- }
- assertEquals("Redirect url not as expected ?", TEST_REDIRECT_URL, mockActionResponse.getRedirectedUrl());
- assertEquals("Redirect url render parameter not as expected ?", TEST_REDIRECT_URL, mockActionResponse.getRenderParameter(TEST_RENDER_URLPARAM_NAME));
- }
-
- public void testMockCacheControl() {
- final int TEST_EXPIRATION_TIME = 30;
- final String TEST_ETAG = "TEST_ETAG";
-
- // Call each constructor in sequence, do some basic checks
- MockCacheControl mockCacheControl = new MockCacheControl();
- assertEquals("Initial expiry not as expected ?", 0, mockCacheControl.getExpirationTime());
- assertFalse("Initial scope public ?", mockCacheControl.isPublicScope());
- assertFalse("Initial use cache true ?", mockCacheControl.useCachedContent());
- mockCacheControl.setExpirationTime(TEST_EXPIRATION_TIME);
- assertEquals("Initial expiry not as expected ?", TEST_EXPIRATION_TIME, mockCacheControl.getExpirationTime());
- mockCacheControl.setPublicScope(true);
- assertTrue("Updated scope not public ?", mockCacheControl.isPublicScope());
- mockCacheControl.setPublicScope(false);
- assertFalse("Updated scope still public ?", mockCacheControl.isPublicScope());
- mockCacheControl.setETag(TEST_ETAG);
- assertEquals("ETag not not as expected ?", TEST_ETAG, mockCacheControl.getETag());
- mockCacheControl.setUseCachedContent(true);
- assertTrue("Updated use cache not true ?", mockCacheControl.useCachedContent());
- mockCacheControl.setUseCachedContent(false);
- assertFalse("Updated use cache still true ?", mockCacheControl.useCachedContent());
- }
-
- public void testMockClientDataRequest() {
- final String TEST_FAKECONTENT = "Some fake content for the test.";
- final byte[] TEST_FAKECONTENT_ASBYTES = TEST_FAKECONTENT.getBytes(StandardCharsets.UTF_8);
- final String TEST_CONTENT_TYPE = "text/html";
- final String TEST_METHOD = "POST";
-
- // Call each constructor in sequence, do some basic checks
- new MockClientDataRequest(); // Only test is to confirm constructor completes without exception
- final MockPortletContext mockPortletContext = new MockPortletContext();
- final MockPortalContext mockPortalContext = new MockPortalContext();
- new MockClientDataRequest(mockPortletContext); // Only test is to confirm constructor completes without exception
- MockClientDataRequest mockClientDataRequest = new MockClientDataRequest(mockPortalContext, mockPortletContext);
- assertEquals("Portal context does not match constructor-set value ?", mockPortalContext, mockClientDataRequest.getPortalContext());
- mockClientDataRequest.setContent(TEST_FAKECONTENT_ASBYTES);
- assertEquals("Content length not as expected ?", TEST_FAKECONTENT_ASBYTES.length, mockClientDataRequest.getContentLength());
- mockClientDataRequest.setCharacterEncoding(StandardCharsets.UTF_8.name());
- assertEquals("Charset not as expected ?", StandardCharsets.UTF_8.name(), mockClientDataRequest.getCharacterEncoding());
- mockClientDataRequest.setContentType(TEST_CONTENT_TYPE);
- assertEquals("Content-type not as expected ?", TEST_CONTENT_TYPE, mockClientDataRequest.getContentType());
- mockClientDataRequest.setMethod(TEST_METHOD);
- assertEquals("Method not as expected ?", TEST_METHOD, mockClientDataRequest.getMethod());
- try ( InputStream inputStream = mockClientDataRequest.getPortletInputStream() ) {
- final byte[] readContent = new byte[mockClientDataRequest.getContentLength()];
- inputStream.read(readContent, 0, readContent.length);
- assertArrayEquals("Read byte array does not match original ?", TEST_FAKECONTENT_ASBYTES, readContent);
- } catch (Exception ex) {
- fail("MockClientDataRequest read inputstream failed. Exception: " + ex);
- }
- try ( BufferedReader bufferedReader = mockClientDataRequest.getReader() ) {
- final String theOnlyLine = bufferedReader.readLine();
- assertEquals("Read line does not match original ?", TEST_FAKECONTENT, theOnlyLine);
- } catch (Exception ex) {
- fail("MockClientDataRequest read inputstream failed. Exception: " + ex);
- }
- }
-
- public void testMockEvent() {
- final String TEST_EVENT = "TEST_EVENT";
- final String TEST_EVENT_VALUE = "TEST_EVENT_VALUE";
- final QName TEST_QNAME = new QName(TEST_EVENT);
-
- // Call each constructor in sequence, do some basic checks
- MockEvent mockClientDataRequest = new MockEvent(TEST_EVENT);
- assertNull("Initial value not null ?", mockClientDataRequest.getValue());
- assertEquals("Event name does not match ?", TEST_EVENT, mockClientDataRequest.getName());
- assertEquals("Event QName does not match ?", new QName(TEST_EVENT), mockClientDataRequest.getQName());
- mockClientDataRequest = new MockEvent(TEST_EVENT, TEST_EVENT_VALUE);
- assertEquals("Initial value not as expected ?", TEST_EVENT_VALUE, mockClientDataRequest.getValue());
- assertEquals("Event name does not match ?", TEST_EVENT, mockClientDataRequest.getName());
- assertEquals("Event QName does not match ?", new QName(TEST_EVENT), mockClientDataRequest.getQName());
- mockClientDataRequest = new MockEvent(TEST_QNAME);
- assertNull("Initial value not null ?", mockClientDataRequest.getValue());
- assertEquals("Event name does not match ?", TEST_EVENT, mockClientDataRequest.getName());
- assertEquals("Event QName does not match ?", TEST_QNAME, mockClientDataRequest.getQName());
- mockClientDataRequest = new MockEvent(TEST_QNAME, TEST_EVENT_VALUE);
- assertEquals("Initial value not as expected ?", TEST_EVENT_VALUE, mockClientDataRequest.getValue());
- assertEquals("Event name does not match ?", TEST_EVENT, mockClientDataRequest.getName());
- assertEquals("Event QName does not match ?", TEST_QNAME, mockClientDataRequest.getQName());
- }
-
- public void testMockEventRequest() {
- final MockEvent TEST_MOCKEVENT = new MockEvent("MockEventName", "MockEventValue");
- final String TEST_METHOD = "POST";
-
- // Call each constructor in sequence, do some basic checks
- MockEventRequest mockEventRequest = new MockEventRequest(TEST_MOCKEVENT);
- assertEquals("Event not the event set ?", TEST_MOCKEVENT, mockEventRequest.getEvent());
- mockEventRequest.setMethod(TEST_METHOD);
- assertEquals("Method not the method set ?", TEST_METHOD, mockEventRequest.getMethod());
- final MockPortletContext mockPortletContext = new MockPortletContext();
- final MockPortalContext mockPortalContext = new MockPortalContext();
- new MockEventRequest(TEST_MOCKEVENT, mockPortletContext); // Only test is to confirm constructor completes without exception
- mockEventRequest = new MockEventRequest(TEST_MOCKEVENT, mockPortalContext, mockPortletContext); // Only test is to confirm constructor completes without exception
- assertEquals("Portal context does not match constructor-set value ?", mockPortalContext, mockEventRequest.getPortalContext());
- }
-
- public void testMockEventResponse() {
- // Call each constructor in sequence, do some basic checks
- try {
- new MockEventResponse(); // Only test is to confirm constructor completes without exception
- assertTrue(true);
- } catch (Throwable t) {
- fail(t.getMessage());
- }
- }
-
- public void testMockMimeResponse() {
- final String TEST_CONTENT_TYPE = "text/html";
- final int TEST_BUFFERSIZE = 8192;
- final String TEST_INCLUDED_URL = "localhost:8080/fakeincludedurl";
- final String TEST_FORWARDED_URL = "localhost:8080/fakeforwardedurl";
- final String TEST_FAKECONTENT = "Some fake content for the test.";
- final byte[] TEST_FAKECONTENT_ASBYTES = TEST_FAKECONTENT.getBytes(StandardCharsets.UTF_8);
-
- // Call each constructor in sequence, do some basic checks
- MockMimeResponse mockMimeResponse = new MockMimeResponse();
- assertEquals("Default character encoding not as expected ?", WebUtils.DEFAULT_CHARACTER_ENCODING, mockMimeResponse.getCharacterEncoding());
- assertEquals("Default locale not as expected ?", Locale.getDefault(), mockMimeResponse.getLocale());
- assertTrue("Default buffersize not as expected ?", mockMimeResponse.getBufferSize() >= 4096);
- assertFalse("Mock response already committed ?", mockMimeResponse.isCommitted());
- final MockPortalContext mockPortalContext = new MockPortalContext();
- final MockPortletContext mockPortletContext = new MockPortletContext();
- final MockPortletRequest mockPortletRequest = new MockPortletRequest(mockPortalContext, mockPortletContext);
- mockMimeResponse = new MockMimeResponse(mockPortalContext);
- assertEquals("Portal context does not match constructor-set value ?", mockPortalContext, mockMimeResponse.getPortalContext());
- mockMimeResponse = new MockMimeResponse(mockPortalContext, mockPortletRequest);
- assertEquals("Portal context does not match constructor-set value ?", mockPortalContext, mockMimeResponse.getPortalContext());
- mockMimeResponse.setContentType(TEST_CONTENT_TYPE);
- assertEquals("Content-type not as expected ?", TEST_CONTENT_TYPE, mockMimeResponse.getContentType());
- mockMimeResponse.setCharacterEncoding(StandardCharsets.UTF_8.name());
- assertEquals("Charset not as expected ?", StandardCharsets.UTF_8.name(), mockMimeResponse.getCharacterEncoding());
- mockMimeResponse.setBufferSize(TEST_BUFFERSIZE);
- assertEquals("Buffersize not as expected ?", TEST_BUFFERSIZE, mockMimeResponse.getBufferSize());
- mockMimeResponse.setCommitted(true);
- assertTrue("Response not committed ?", mockMimeResponse.isCommitted());
- mockMimeResponse.setCommitted(false);
- assertFalse("Response still committed ?", mockMimeResponse.isCommitted());
- mockMimeResponse.setIncludedUrl(TEST_INCLUDED_URL);
- assertEquals("Included URL not as expected ?", TEST_INCLUDED_URL, mockMimeResponse.getIncludedUrl());
- mockMimeResponse.setForwardedUrl(TEST_FORWARDED_URL);
- assertEquals("Forwarded URL not as expected ?", TEST_FORWARDED_URL, mockMimeResponse.getForwardedUrl());
- try {
- assertNotNull("OutputStream null ?", mockMimeResponse.getPortletOutputStream());
- } catch (Exception ex) {
- fail("MockMimeResponse get outputstream failed. Exception: " + ex);
- }
- PortletURL portletUrl = mockMimeResponse.createRenderURL();
- assertNotNull("RenderURL null ?", portletUrl);
- portletUrl = mockMimeResponse.createActionURL();
- assertNotNull("ActionURL null ?", portletUrl);
- ResourceURL resourceURL = mockMimeResponse.createResourceURL();
- assertNotNull("ResourceURL null ?", resourceURL);
- assertNotNull("CacheControl null ?", mockMimeResponse.getCacheControl());
-
- try {
- OutputStream outputStream = mockMimeResponse.getPortletOutputStream();
- assertNotNull("OutputStream null ?", outputStream);
- outputStream.write(TEST_FAKECONTENT_ASBYTES);
- final byte[] writeResult = mockMimeResponse.getContentAsByteArray();
- assertArrayEquals("Written byte array does not match original ?", TEST_FAKECONTENT_ASBYTES, writeResult);
- assertTrue("Buffer not committed after processing ?", mockMimeResponse.isCommitted());
- } catch (Exception ex) {
- fail("MockMimeResponse get/process outputstream failed. Exception: " + ex);
- }
- try {
- mockMimeResponse.resetBuffer();
- } catch (IllegalStateException ise) {
- // Expected failure
- }
-
- mockMimeResponse.setCommitted(false);
- mockMimeResponse.resetBuffer();
- try {
- PrintWriter printWriter = mockMimeResponse.getWriter();
- assertNotNull("PrintWriter null ?", printWriter);
- printWriter.print(TEST_FAKECONTENT);
- mockMimeResponse.flushBuffer();
- final byte[] writeResult = mockMimeResponse.getContentAsByteArray();
- assertArrayEquals("Written byte array does not match original ?", TEST_FAKECONTENT_ASBYTES, writeResult);
- assertTrue("Buffer not committed after processing ?", mockMimeResponse.isCommitted());
- final String writeResultAsString = mockMimeResponse.getContentAsString();
- assertEquals("Written result does not match original ?", TEST_FAKECONTENT, writeResultAsString);
- } catch (Exception ex) {
- fail("MockMimeResponse get/process printwriter failed. Exception: " + ex);
- }
- try {
- mockMimeResponse.reset();
- } catch (IllegalStateException ise) {
- // Expected failure
- }
-
- mockMimeResponse.setCommitted(false);
- mockMimeResponse.reset();
- assertNull("After reset, character encoding not null ?", mockMimeResponse.getCharacterEncoding());
- assertNull("After reset, content-type not null ?", mockMimeResponse.getContentType());
- assertNull("After reset, locale not null ?", mockMimeResponse.getLocale());
- }
-
- public void testMockMultipartActionRequest() {
- final String TEST_FILENAME = "TEST_TEMPFILE";
- final String TEST_FILENAME2 = "TEST_TEMPFILE2";
- final String TEST_CONTENT_TYPE = "text/html";
- final String TEST_FAKECONTENT = "Some fake content for the test.";
- final byte[] TEST_FAKECONTENT_ASBYTES = TEST_FAKECONTENT.getBytes(StandardCharsets.UTF_8);
-
- // Call each constructor in sequence, do some basic checks
- MockMultipartActionRequest mockMultipartActionRequest = new MockMultipartActionRequest();
- assertFalse("Initial multipartrequest has file names ?", mockMultipartActionRequest.getFileNames().hasNext());
- assertTrue("Initial multipartrequest has nonempty map ?", mockMultipartActionRequest.getFileMap().isEmpty());
- assertTrue("Initial multipartrequest has nonempty multivalue map ?", mockMultipartActionRequest.getMultiFileMap().isEmpty());
- final MultipartFile multipartFile = new TestMockMultipartFile(TEST_FILENAME, TEST_FILENAME, TEST_CONTENT_TYPE, TEST_FAKECONTENT_ASBYTES);
- final MultipartFile multipartFile2 = new TestMockMultipartFile(TEST_FILENAME2, TEST_FILENAME2, TEST_CONTENT_TYPE, TEST_FAKECONTENT_ASBYTES);
- mockMultipartActionRequest.addFile(multipartFile);
- assertTrue("Multipartrequest does not have file names ?", mockMultipartActionRequest.getFileNames().hasNext());
- assertFalse("Multipartrequest does not have nonempty map ?", mockMultipartActionRequest.getFileMap().isEmpty());
- assertFalse("Multipartrequest does not have nonempty multivalue map ?", mockMultipartActionRequest.getMultiFileMap().isEmpty());
- mockMultipartActionRequest.addFile(multipartFile2);
- assertTrue("Multipartrequest does not have file names ?", mockMultipartActionRequest.getFileNames().hasNext());
- assertFalse("Multipartrequest does not have nonempty map ?", mockMultipartActionRequest.getFileMap().isEmpty());
- assertFalse("Multipartrequest does not have nonempty multivalue map ?", mockMultipartActionRequest.getMultiFileMap().isEmpty());
- assertEquals("Retrieved file 1 not as expected ?", multipartFile, mockMultipartActionRequest.getFile(TEST_FILENAME));
- assertEquals("Retrieved file 1 content-type not as expected ?", TEST_CONTENT_TYPE, mockMultipartActionRequest.getMultipartContentType(TEST_FILENAME));
- assertEquals("Retrieved file 2 not as expected ?", multipartFile2, mockMultipartActionRequest.getFile(TEST_FILENAME2));
- assertEquals("Retrieved file 2 content-type not as expected ?", TEST_CONTENT_TYPE, mockMultipartActionRequest.getMultipartContentType(TEST_FILENAME2));
- final Map<String, MultipartFile> fileMap = mockMultipartActionRequest.getFileMap();
- assertNotNull("File map is null ?", fileMap);
- assertTrue("File 1 name not in map ?", fileMap.containsKey(TEST_FILENAME));
- assertTrue("File 2 name not in map ?", fileMap.containsKey(TEST_FILENAME2));
- assertTrue("File 1 not in map ?", fileMap.containsValue(multipartFile));
- assertTrue("File 2 not in map ?", fileMap.containsValue(multipartFile2));
- MultiValueMap<String, MultipartFile> fileMultiValueMap = mockMultipartActionRequest.getMultiFileMap();
- assertNotNull("MultiValue file map is null ?", fileMultiValueMap);
- MultipartFile retrievedFile = fileMultiValueMap.getFirst(TEST_FILENAME);
- assertNotNull("File 1 1st value is null ?", retrievedFile);
- assertEquals("File 1 not in multivalue map ?", multipartFile, retrievedFile);
- retrievedFile = fileMultiValueMap.getFirst(TEST_FILENAME2);
- assertNotNull("File 2 1st value is null ?", retrievedFile);
- assertEquals("File 2 not in multivalue map ?", multipartFile2, retrievedFile);
- }
-
- public void testMockPortalContext() {
- final String TEST_PROPERTY = "TEST_PROPERTY";
- final String TEST_PROPERTY_VALUE = "Property_Value_1";
- final String TEST_PROPERTY2 = "TEST_PROPERTY2";
- final String TEST_PROPERTY2_VALUE = "Property_Value_2";
-
- // Call each constructor in sequence, do some basic checks
- final MockPortalContext mockPortalContext = new MockPortalContext();
- assertNotNull("MockPortalContext portalInfo null ?", mockPortalContext.getPortalInfo());
- assertNotNull("MockPortalContext property names null ?", mockPortalContext.getPropertyNames());
- assertFalse("MockPortalConext initial propertyNames not empty ?", mockPortalContext.getPropertyNames().hasMoreElements());
- final Enumeration<PortletMode> supportedPortletModes = mockPortalContext.getSupportedPortletModes();
- assertNotNull("MockPortalContext supported portlet modes null ?", supportedPortletModes);
- final ArrayList<PortletMode> portletModeList = new ArrayList<>();
- while (supportedPortletModes.hasMoreElements()) {
- portletModeList.add(supportedPortletModes.nextElement());
- }
- assertEquals("MockPortalContext does not support three modes ?", 3, portletModeList.size());
- assertTrue("MockPortalContext does not contain PortletMode.VIEW ?", portletModeList.contains(PortletMode.VIEW));
- assertTrue("MockPortalContext does not contain PortletMode.EDIT ?", portletModeList.contains(PortletMode.EDIT));
- assertTrue("MockPortalContext does not contain PortletMode.HELP ?", portletModeList.contains(PortletMode.HELP));
-
- final Enumeration<WindowState> supportedWindowStates = mockPortalContext.getSupportedWindowStates();
- assertNotNull("MockPortalContext supported window modes null ?", supportedWindowStates);
- final ArrayList<WindowState> windowStateList = new ArrayList<>();
- while (supportedWindowStates.hasMoreElements()) {
- windowStateList.add(supportedWindowStates.nextElement());
- }
- assertEquals("MockPortalContext does not support three states ?", 3, windowStateList.size());
- assertTrue("MockPortalContext does not contain WindowState.NORMAL ?", windowStateList.contains(WindowState.NORMAL));
- assertTrue("MockPortalContext does not contain WindowState.MAXIMIZED ?", windowStateList.contains(WindowState.MAXIMIZED));
- assertTrue("MockPortalContext does not contain WindowState.MINIMIZED ?", windowStateList.contains(WindowState.MINIMIZED));
-
- mockPortalContext.setProperty(TEST_PROPERTY, TEST_PROPERTY_VALUE);
- mockPortalContext.setProperty(TEST_PROPERTY2, TEST_PROPERTY2_VALUE);
- final Enumeration<String> propertyNames = mockPortalContext.getPropertyNames();
- assertNotNull("MockPortalContext property names null ?", propertyNames);
- final ArrayList<String> propertyNamesList = new ArrayList<>();
- while (propertyNames.hasMoreElements()) {
- propertyNamesList.add(propertyNames.nextElement());
- }
- assertEquals("MockPortalContext does not contain two properties ?", 2, propertyNamesList.size());
- assertTrue("MockPortalContext does not contain property name " + TEST_PROPERTY + " ?", propertyNamesList.contains(TEST_PROPERTY));
- assertTrue("MockPortalContext does not contain property name " + TEST_PROPERTY2 + " ?", propertyNamesList.contains(TEST_PROPERTY2));
- assertEquals("MockPortalContext value of property name " + TEST_PROPERTY + " not as expected ?", TEST_PROPERTY_VALUE, mockPortalContext.getProperty(TEST_PROPERTY));
- assertEquals("MockPortalContext value of property name " + TEST_PROPERTY2 + " not as expected ?", TEST_PROPERTY2_VALUE, mockPortalContext.getProperty(TEST_PROPERTY2));
- }
-
- public void testMockPortletConfig() {
- final String TEST_PORTLETNAME = "TestPortletName";
- final String TEST_INITPARAM = "TEST_INITPARAM";
- final String TEST_INITPARAM_VALUE = "Init_Value_1";
- final String TEST_INITPARAM2= "TEST_INITPARAM2";
- final String TEST_INITPARAM_VALUE2 = "Init_Value_2";
- final String TEST_RENDERPARAM_NAME = "Test_RenderParam_1";
- final String TEST_RENDERPARAM_NAME2 = "Test_RenderParam_2";
- final String TEST_DEFAULTNAMESPACE = "Test_Default_Namespace";
- final QName TEST_QNAME = new QName(TEST_PORTLETNAME);
- final QName TEST_QNAME2 = new QName(TEST_DEFAULTNAMESPACE);
- final String TEST_RUNTIME_OPTION = "TEST_RUNTIME_OPTION";
- final String TEST_RUNTIME_OPTION2 = "TEST_RUNTIME_OPTION2";
- final String TEST_RUNTIME_VALUE1 = "Test_Runtime_Option1";
- final String TEST_RUNTIME_VALUE2 = "Test_Runtime_Option2";
-
- // Call each constructor in sequence, do some basic checks
- MockPortletConfig mockPortletConfig = new MockPortletConfig();
- assertNotNull("MockPortletConfig default PortletContext is null ?", mockPortletConfig.getPortletContext());
- assertEquals("MockPortletConfig default name not empty string ?", "", mockPortletConfig.getPortletName());
- mockPortletConfig = new MockPortletConfig(TEST_PORTLETNAME);
- assertNotNull("MockPortletConfig default PortletContext is null ?", mockPortletConfig.getPortletContext());
- assertEquals("MockPortletConfig name not constructor set value ?", TEST_PORTLETNAME, mockPortletConfig.getPortletName());
- final MockPortletContext mockPortletContext = new MockPortletContext();
- mockPortletConfig = new MockPortletConfig(mockPortletContext, TEST_PORTLETNAME);
- assertEquals("MockPortletConfig PortletContext constructor set value ?", mockPortletContext, mockPortletConfig.getPortletContext());
- assertEquals("MockPortletConfig name not constructor set value ?", TEST_PORTLETNAME, mockPortletConfig.getPortletName());
- assertNull("MockPortletConfig default locale resource bundle not null ?", mockPortletConfig.getResourceBundle(Locale.getDefault()));
- final ResourceBundle resourceBundle = new TetMockResourceBundle();
- mockPortletConfig.setResourceBundle(Locale.getDefault(), resourceBundle);
- assertEquals("Default locale resource bundle not set value ?", resourceBundle, mockPortletConfig.getResourceBundle(Locale.getDefault()));
-
- assertNull(TEST_INITPARAM + " present before set ?", mockPortletConfig.getInitParameter(TEST_INITPARAM));
- assertNull(TEST_INITPARAM2 + " present before set ?", mockPortletConfig.getInitParameter(TEST_INITPARAM));
- mockPortletConfig.addInitParameter(TEST_INITPARAM, TEST_INITPARAM_VALUE);
- mockPortletConfig.addInitParameter(TEST_INITPARAM2, TEST_INITPARAM_VALUE2);
- assertEquals("Retrieved init parameter 1 does not match set value ?", TEST_INITPARAM_VALUE, mockPortletConfig.getInitParameter(TEST_INITPARAM));
- assertEquals("Retrieved init parameter 2 does not match set value ?", TEST_INITPARAM_VALUE2, mockPortletConfig.getInitParameter(TEST_INITPARAM2));
- final Enumeration<String> initParameterNames = mockPortletConfig.getInitParameterNames();
- int initParameterNameCount = 0;
- assertNotNull("InitParameter names null after additions ?", initParameterNames);
- assertTrue("InitParameter names empty after additions ?", initParameterNames.hasMoreElements());
- while (initParameterNames.hasMoreElements()) {
- initParameterNameCount++;
- String currentInitParameterName = initParameterNames.nextElement();
- assertTrue("Initparam name not one of two expected matches ?", TEST_INITPARAM.equals(currentInitParameterName) ||
- TEST_INITPARAM2.equals(currentInitParameterName));
- }
- assertEquals("InitParameter names size not 2 ?", 2, initParameterNameCount);
-
- assertFalse("Initial renderparam names not empty ?", mockPortletConfig.getPublicRenderParameterNames().hasMoreElements());
- mockPortletConfig.addPublicRenderParameterName(TEST_RENDERPARAM_NAME);
- mockPortletConfig.addPublicRenderParameterName(TEST_RENDERPARAM_NAME2);
- final Enumeration<String> publicRenderParameterNames = mockPortletConfig.getPublicRenderParameterNames();
- int publicRenderParameterNameCount = 0;
- assertNotNull("PublicRenderParameter names null after additions ?", publicRenderParameterNames);
- assertTrue("PublicRenderParameter names empty after additions ?", publicRenderParameterNames.hasMoreElements());
- while (publicRenderParameterNames.hasMoreElements()) {
- publicRenderParameterNameCount++;
- String currentPublicRenderParameterName = publicRenderParameterNames.nextElement();
- assertTrue("PublicRenderParameter name not one of two expected matches ?", TEST_RENDERPARAM_NAME.equals(currentPublicRenderParameterName) ||
- TEST_RENDERPARAM_NAME2.equals(currentPublicRenderParameterName));
- }
- assertEquals("PublicRenderParameter names size not 2 ?", 2, publicRenderParameterNameCount);
- mockPortletConfig.setDefaultNamespace(TEST_DEFAULTNAMESPACE);
- assertEquals("Default namespace not set value ?", TEST_DEFAULTNAMESPACE, mockPortletConfig.getDefaultNamespace());
-
- assertFalse("Initial publishing event QNames not empty ?", mockPortletConfig.getPublishingEventQNames().hasMoreElements());
- assertFalse("Initial processing event QNames not empty ?", mockPortletConfig.getProcessingEventQNames().hasMoreElements());
- mockPortletConfig.addPublishingEventQName(TEST_QNAME);
- mockPortletConfig.addProcessingEventQName(TEST_QNAME2);
- final Enumeration<QName> publishingEventQNames = mockPortletConfig.getPublishingEventQNames();
- assertNotNull("PublishingEventQNames names null after additions ?", publishingEventQNames);
- assertTrue("PublishingEventQNames names empty after additions ?", publishingEventQNames.hasMoreElements());
- final QName firstPublishingEventQName = publishingEventQNames.nextElement();
- assertEquals("First publishing event QName not set value ?", TEST_QNAME, firstPublishingEventQName);
- final Enumeration<QName> processingEventQNames = mockPortletConfig.getProcessingEventQNames();
- assertNotNull("ProcessingEventQNames names null after additions ?", processingEventQNames);
- assertTrue("ProcessingEventQNames names empty after additions ?", processingEventQNames.hasMoreElements());
- final QName firstProcessingEventQName = processingEventQNames.nextElement();
- assertEquals("First processing event QName not set value ?", TEST_QNAME2, firstProcessingEventQName);
-
- assertFalse("Initial supported locales not empty ?", mockPortletConfig.getSupportedLocales().hasMoreElements());
- mockPortletConfig.addSupportedLocale(Locale.getDefault());
- final Enumeration<Locale> supportedLocales = mockPortletConfig.getSupportedLocales();
- assertNotNull("Supported locales null after additions ?", supportedLocales);
- assertTrue("Supported locales names empty after additions ?", supportedLocales.hasMoreElements());
- final Locale firstSupportedLocale = supportedLocales.nextElement();
- assertEquals("First supported locale not set value ?", Locale.getDefault(), firstSupportedLocale);
-
- assertTrue("Portlet runtime options not empty before set ?", mockPortletConfig.getContainerRuntimeOptions().isEmpty());
- mockPortletConfig.addContainerRuntimeOption(TEST_RUNTIME_OPTION, TEST_RUNTIME_VALUE1);
- mockPortletConfig.addContainerRuntimeOption(TEST_RUNTIME_OPTION2, TEST_RUNTIME_VALUE2);
- final Map<String, String[]> containerRuntimeOptions = mockPortletConfig.getContainerRuntimeOptions();
- assertNotNull("Runtime options null after additions ?", containerRuntimeOptions);
- assertFalse("Runtime options empty after additions ?", containerRuntimeOptions.isEmpty());
- assertTrue("Runtime option 1 not present after setting ?", containerRuntimeOptions.containsKey(TEST_RUNTIME_OPTION));
- assertTrue("Runtime option 2 not present after setting ?", containerRuntimeOptions.containsKey(TEST_RUNTIME_OPTION2));
- assertEquals("Runtime option 1 not equal to set value ?", TEST_RUNTIME_VALUE1, containerRuntimeOptions.get(TEST_RUNTIME_OPTION)[0]);
- assertEquals("Runtime option 2 not equal to set value ?", TEST_RUNTIME_VALUE2, containerRuntimeOptions.get(TEST_RUNTIME_OPTION2)[0]);
- }
-
- public void testMockPortletContext() {
- final String TEST_ATTRIBUTE = "TEST_ATTRIBUTE";
- final String TEST_ATTRIBUTE_VALUE = "Attribute_Value_1";
- final String TEST_ATTRIBUTE2 = "TEST_ATTRIBUTE2";
- final String TEST_ATTRIBUTE_VALUE2 = "Attribute_Value_2";
- final String TEST_INITPARAM = "TEST_INITPARAM";
- final String TEST_INITPARAM_VALUE = "Init_Value_1";
- final String TEST_INITPARAM2 = "TEST_INITPARAM2";
- final String TEST_INITPARAM_VALUE2 = "Init_Value_2";
- final String TEST_CONTEXT_NAME = "TEST_CONTEXT_NAME";
- final String TEST_RUNTIME_OPTION = "TEST_RUNTIME_OPTION";
- final String TEST_RUNTIME_OPTION2 = "TEST_RUNTIME_OPTION2";
-
- // Call each constructor in sequence, do some basic checks
- final MockPortletContext mockPortletContext = new MockPortletContext();
- assertNotNull("MockPortletContext serverInfo null ?", mockPortletContext.getServerInfo());
- try {
- assertNotNull("MockPortletContext PortletRequestDispatcher null ?", mockPortletContext.getRequestDispatcher("IllegalPrefix"));
- fail("PortletRequestDispatcher path must start with /");
- } catch (IllegalArgumentException iae) {
- // Expected exception
- }
- assertNotNull("MockPortletContext PortletRequestDispatcher for / null ?", mockPortletContext.getRequestDispatcher("/"));
- assertNull("MockPortletContext named PortletRequestDispatcher not null ?", mockPortletContext.getNamedDispatcher("SomeName"));
- assertNotNull("MockPortletContext resource stream for / null ?", mockPortletContext.getResourceAsStream("/"));
- assertNull("MockPortletContext resource stream for /ThisDoesNotExist not null ?", mockPortletContext.getResourceAsStream("/ThisDoesNotExist"));
- assertTrue("MockPortletContext major version not >= 2 ?", mockPortletContext.getMajorVersion() >= 2);
- assertTrue("MockPortletContext minor version not >= 0 ?", mockPortletContext.getMajorVersion() >= 0);
- assertNull("MockPortletContext MIME type for / not null ?", mockPortletContext.getMimeType("/"));
- assertNotNull("MockPortletContext real path for / null ?", mockPortletContext.getRealPath("/"));
- assertNull("MockPortletContext real path for /ThisDoesNotExist not null ?", mockPortletContext.getRealPath("/ThisDoesNotExist"));
- assertNotNull("MockPortletContext resource paths for / null ?", mockPortletContext.getResourcePaths("/"));
- assertNull("MockPortletContext resource paths for / null ?", mockPortletContext.getResourcePaths("/ThisDoesNotExist"));
- try {
- assertNotNull("MockPortletContext resource URL for / null ?", mockPortletContext.getResource("/"));
- } catch (MalformedURLException mue) {
- fail("MockPortletContext resource URL for / failed. Exception: " + mue);
- }
- try {
- assertNull("MockPortletContext resource URL for /ThisDoesNotExist not null ?", mockPortletContext.getResource("/ThisDoesNotExist"));
- } catch (MalformedURLException mue) {
- fail("MockPortletContext resource URL for /ThisDoesNotExist failed. Exception: " + mue);
- }
-
- assertNull(TEST_ATTRIBUTE + " present before set ?", mockPortletContext.getAttribute(TEST_ATTRIBUTE));
- assertNull(TEST_ATTRIBUTE2 + " present before set ?", mockPortletContext.getAttribute(TEST_ATTRIBUTE2));
- mockPortletContext.setAttribute(TEST_ATTRIBUTE, TEST_ATTRIBUTE_VALUE);
- mockPortletContext.setAttribute(TEST_ATTRIBUTE2, TEST_ATTRIBUTE_VALUE2);
- assertEquals("Retrieved atribute 1 does not match set value ?", TEST_ATTRIBUTE_VALUE, mockPortletContext.getAttribute(TEST_ATTRIBUTE));
- assertEquals("Retrieved atribute 2 does not match set value ?", TEST_ATTRIBUTE_VALUE2, mockPortletContext.getAttribute(TEST_ATTRIBUTE2));
- final Enumeration<String> attributeNames = mockPortletContext.getAttributeNames();
- int attributeNameCount = 0;
- assertNotNull("Attribute names null after additions ?", attributeNames);
- assertTrue("Attribute names empty after additions ?", attributeNames.hasMoreElements());
- while (attributeNames.hasMoreElements()) {
- attributeNameCount++;
- String currentAttibuteName = attributeNames.nextElement();
- assertTrue("Attribute name not one of two or three expected matches ?", TEST_ATTRIBUTE.equals(currentAttibuteName) ||
- TEST_ATTRIBUTE2.equals(currentAttibuteName) ||
- WebUtils.TEMP_DIR_CONTEXT_ATTRIBUTE.equals(currentAttibuteName));
- }
- assertTrue("Atribute names size not 2 or 3 ?", attributeNameCount >= 2 && attributeNameCount <= 3);
-
- assertNull(TEST_INITPARAM + " present before set ?", mockPortletContext.getInitParameter(TEST_INITPARAM));
- assertNull(TEST_INITPARAM2 + " present before set ?", mockPortletContext.getInitParameter(TEST_INITPARAM));
- mockPortletContext.addInitParameter(TEST_INITPARAM, TEST_INITPARAM_VALUE);
- mockPortletContext.addInitParameter(TEST_INITPARAM2, TEST_INITPARAM_VALUE2);
- assertEquals("Retrieved init parameter 1 does not match set value ?", TEST_INITPARAM_VALUE, mockPortletContext.getInitParameter(TEST_INITPARAM));
- assertEquals("Retrieved init parameter 2 does not match set value ?", TEST_INITPARAM_VALUE2, mockPortletContext.getInitParameter(TEST_INITPARAM2));
- final Enumeration<String> initParameterNames = mockPortletContext.getInitParameterNames();
- int initParameterNameCount = 0;
- assertNotNull("InitParameter names null after additions ?", initParameterNames);
- assertTrue("InitParameter names empty after additions ?", initParameterNames.hasMoreElements());
- while (initParameterNames.hasMoreElements()) {
- initParameterNameCount++;
- String currentInitParameterName = initParameterNames.nextElement();
- assertTrue("Initparam name not one of two expected matches ?", TEST_INITPARAM.equals(currentInitParameterName) ||
- TEST_INITPARAM2.equals(currentInitParameterName));
- }
- assertEquals("InitParameter names size not 2 ?", 2, initParameterNameCount);
-
- mockPortletContext.log("Test logging call");
- mockPortletContext.log("Test logging call", new Exception("Fake Exception"));
-
- assertEquals("Default portlet context name not as expected ?", "MockPortletContext", mockPortletContext.getPortletContextName());
- mockPortletContext.setPortletContextName(TEST_CONTEXT_NAME);
- assertEquals("Portlet context name not equal to set value ?", TEST_CONTEXT_NAME, mockPortletContext.getPortletContextName());
-
- assertFalse("Portlet runtime options not empty before set ?", mockPortletContext.getContainerRuntimeOptions().hasMoreElements());
- mockPortletContext.addContainerRuntimeOption(TEST_RUNTIME_OPTION);
- mockPortletContext.addContainerRuntimeOption(TEST_RUNTIME_OPTION2);
- final Enumeration<String> containerRuntimeOptions = mockPortletContext.getContainerRuntimeOptions();
- int containerRuntimeOptionsCount = 0;
- assertNotNull("Runtime options null after additions ?", containerRuntimeOptions);
- assertTrue("Runtime options empty after additions ?", containerRuntimeOptions.hasMoreElements());
- while (containerRuntimeOptions.hasMoreElements()) {
- containerRuntimeOptionsCount++;
- String currentRuntimeOption = containerRuntimeOptions.nextElement();
- assertTrue("Runtime option not one of two expected matches ?", TEST_RUNTIME_OPTION.equals(currentRuntimeOption) ||
- TEST_RUNTIME_OPTION2.equals(currentRuntimeOption));
- }
- assertEquals("Runtime options size not 2 ?", 2, containerRuntimeOptionsCount);
- }
-
- public void testMockPortletPreferences() {
- final String PORTLET_READONLY = "PORTLET_READONLY";
- final String PORTLET_READONLY_VALUE = "Readonly_Value_1";
- final String PORTLET_READONLY2 = "PORTLET_READONLY2";
- final String PORTLET_READONLY2_VALUE = "Readonly_Value_2";
- final String PORTLET_WRITEABLE = "PORTLET_WRITEABLE";
- final String PORTLET_WRITEABLE_VALUE = "Writeable_Value_1";
- final String PORTLET_WRITEABLE2 = "PORTLET_WRITEABLE2";
- final String PORTLET_WRITEABLE2_VALUE = "Writeable_Value_2";
- final String PORTLET_WRITEABLE_ARRAY = "PORTLET_WRITEABLE_ARRAY";
- final String[] PORTLET_WRITEABLE_ARRAY_VALUE = { "Writeable_Array_Value_1", "Writeable_Array_Value" };
-
- // Call each constructor in sequence, do some basic checks
- final MockPortletPreferences mockPortletPreferences = new MockPortletPreferences();
- assertFalse("MockPortletPreferences initial preferences names non-empty ?", mockPortletPreferences.getNames().hasMoreElements());
- assertTrue("MockPortletPreferences initial preferences non-empty ?", mockPortletPreferences.getMap().isEmpty());
-
- // Test set readonly permitted before key exists
- assertFalse(PORTLET_READONLY + " readonly before set ?", mockPortletPreferences.isReadOnly(PORTLET_READONLY));
- assertFalse(PORTLET_READONLY2 + " readonly before set ?", mockPortletPreferences.isReadOnly(PORTLET_READONLY2));
- mockPortletPreferences.setReadOnly(PORTLET_READONLY, true);
- mockPortletPreferences.setReadOnly(PORTLET_READONLY2, true);
- assertTrue(PORTLET_READONLY + " not readonly after set ?", mockPortletPreferences.isReadOnly(PORTLET_READONLY));
- assertTrue(PORTLET_READONLY2 + " not readonly after set ?", mockPortletPreferences.isReadOnly(PORTLET_READONLY2));
- mockPortletPreferences.setReadOnly(PORTLET_READONLY, false);
- mockPortletPreferences.setReadOnly(PORTLET_READONLY2, false);
- assertFalse(PORTLET_READONLY + " readonly after clear ?", mockPortletPreferences.isReadOnly(PORTLET_READONLY));
- assertFalse(PORTLET_READONLY2 + " readonly after clear ?", mockPortletPreferences.isReadOnly(PORTLET_READONLY2));
-
- try {
- // Test initial set and replace
- mockPortletPreferences.setValue(PORTLET_READONLY, PORTLET_READONLY_VALUE);
- assertEquals("Set value mismatch ?", PORTLET_READONLY_VALUE, mockPortletPreferences.getValue(PORTLET_READONLY, null));
- mockPortletPreferences.setValue(PORTLET_READONLY, PORTLET_READONLY_VALUE);
- assertEquals("Set value mismatch ?", PORTLET_READONLY_VALUE, mockPortletPreferences.getValue(PORTLET_READONLY, null));
- } catch (Exception ex) {
- fail("Setvalue failed unexpectedly: " + ex);
- }
- try {
- // Test initial set and replace
- mockPortletPreferences.setValue(PORTLET_READONLY2, PORTLET_READONLY2_VALUE);
- assertEquals("Set value mismatch ?", PORTLET_READONLY2_VALUE, mockPortletPreferences.getValue(PORTLET_READONLY2, null));
- mockPortletPreferences.setValue(PORTLET_READONLY2, PORTLET_READONLY2_VALUE);
- assertEquals("Set value mismatch ?", PORTLET_READONLY2_VALUE, mockPortletPreferences.getValue(PORTLET_READONLY2, null));
- } catch (Exception ex) {
- fail("Setvalue failed unexpectedly: " + ex);
- }
-
- mockPortletPreferences.setReadOnly(PORTLET_READONLY, true);
- mockPortletPreferences.setReadOnly(PORTLET_READONLY2, true);
- try {
- // Test set of readonly value fails
- mockPortletPreferences.setValue(PORTLET_READONLY, PORTLET_READONLY_VALUE);
- fail("Setvalue worked unexpectedly for readonly value");
- } catch (Exception ex) {
- assertTrue("Unexpected exception type failure ? Ex: " + ex, ex instanceof ReadOnlyException);
- assertTrue(PORTLET_READONLY + " is not readonly ?", mockPortletPreferences.isReadOnly(PORTLET_READONLY));
- }
- try {
- // Test reset of readonly value fails
- mockPortletPreferences.reset(PORTLET_READONLY);
- fail("Reset worked unexpectedly for readonly value");
- } catch (Exception ex) {
- assertTrue("Unexpected exception type failure ? Ex: " + ex, ex instanceof ReadOnlyException);
- assertTrue(PORTLET_READONLY + " is not readonly ?", mockPortletPreferences.isReadOnly(PORTLET_READONLY));
- }
- try {
- // Test set of readonly value fails
- mockPortletPreferences.setValue(PORTLET_READONLY2, PORTLET_READONLY2_VALUE);
- fail("Setvalue worked unexpectedly for readonly value");
- } catch (Exception ex) {
- assertTrue("Unexpected exception type failure ? Ex: " + ex, ex instanceof ReadOnlyException);
- assertTrue(PORTLET_READONLY2 + " is not readonly ?", mockPortletPreferences.isReadOnly(PORTLET_READONLY2));
- }
- try {
- // Test reset of readonly value fails
- mockPortletPreferences.reset(PORTLET_READONLY2);
- fail("Reset worked unexpectedly for readonly value");
- } catch (Exception ex) {
- assertTrue("Unexpected exception type failure ? Ex: " + ex, ex instanceof ReadOnlyException);
- assertTrue(PORTLET_READONLY2 + " is not readonly ?", mockPortletPreferences.isReadOnly(PORTLET_READONLY2));
- }
-
- try {
- // Test initial set, get and reset
- mockPortletPreferences.setValue(PORTLET_WRITEABLE, PORTLET_WRITEABLE_VALUE);
- mockPortletPreferences.setValue(PORTLET_WRITEABLE2, PORTLET_WRITEABLE2_VALUE);
- assertEquals("Set value mismatch ?", PORTLET_WRITEABLE_VALUE, mockPortletPreferences.getValue(PORTLET_WRITEABLE, null));
- assertEquals("Set value mismatch ?", PORTLET_WRITEABLE2_VALUE, mockPortletPreferences.getValue(PORTLET_WRITEABLE2, null));
- assertFalse(PORTLET_WRITEABLE + " is readonly ?", mockPortletPreferences.isReadOnly(PORTLET_WRITEABLE));
- assertFalse(PORTLET_WRITEABLE2 + " is readonly ?", mockPortletPreferences.isReadOnly(PORTLET_WRITEABLE2));
- mockPortletPreferences.reset(PORTLET_WRITEABLE);
- mockPortletPreferences.reset(PORTLET_WRITEABLE2);
- assertNull("After reset getValue with null not null ?", mockPortletPreferences.getValue(PORTLET_WRITEABLE, null));
- assertNull("After reset getValue with null not null ?", mockPortletPreferences.getValue(PORTLET_WRITEABLE2, null));
- } catch (Exception ex) {
- fail("Set/Get/Reset failed unexpectedly: " + ex);
- }
-
- try {
- // Test initial array set, get, names and map
- mockPortletPreferences.setValues(PORTLET_WRITEABLE_ARRAY, PORTLET_WRITEABLE_ARRAY_VALUE);
-
- assertEquals("Set values mismatch ?", PORTLET_WRITEABLE_ARRAY_VALUE, mockPortletPreferences.getValues(PORTLET_WRITEABLE_ARRAY, null));
- assertFalse(PORTLET_WRITEABLE_ARRAY + " is readonly ?", mockPortletPreferences.isReadOnly(PORTLET_WRITEABLE_ARRAY));
-
- // There should be two readonly attributes plus the array attribute present at this point
- final Enumeration<String> preferencesNames = mockPortletPreferences.getNames();
- assertNotNull("Preferences names null after additions ?", preferencesNames);
- assertTrue("Preferences names empty after additions ?", preferencesNames.hasMoreElements());
- int preferencesNameCount = 0;
- while (preferencesNames.hasMoreElements()) {
- preferencesNameCount++;
- String currentPreferencesName = preferencesNames.nextElement();
- assertTrue("Preferences name not one of three expected matches ?", PORTLET_WRITEABLE_ARRAY.equals(currentPreferencesName) ||
- PORTLET_READONLY.equals(currentPreferencesName) ||
- PORTLET_READONLY2.equals(currentPreferencesName));
- }
- assertEquals("Preferences names size not 3 ?", 3, preferencesNameCount);
-
- final Map<String, String[]> preferencesMap = mockPortletPreferences.getMap();
- assertNotNull("Preferences map null ?", preferencesMap);
- assertEquals("Preferences map size not 3 ?", 3, preferencesMap.size());
- assertTrue("Map does not contain expected key ?", preferencesMap.containsKey(PORTLET_WRITEABLE_ARRAY));
- assertTrue("Map does not contain expected key ?", preferencesMap.containsKey(PORTLET_READONLY));
- assertTrue("Map does not contain expected key ?", preferencesMap.containsKey(PORTLET_READONLY2));
- assertTrue("Map does not contain expected value ?", preferencesMap.containsValue(PORTLET_WRITEABLE_ARRAY_VALUE));
- assertTrue("Map does not contain expected value ?", preferencesMap.containsValue(mockPortletPreferences.getValues(PORTLET_READONLY, null)));
- assertTrue("Map does not contain expected value ?", preferencesMap.containsValue(mockPortletPreferences.getValues(PORTLET_READONLY2, null)));
- } catch (Exception ex) {
- fail("Set/Get/Names/Map failed unexpectedly: " + ex);
- }
-
- // Verify store behaviour without validator present
- try {
- mockPortletPreferences.store();
- } catch (Exception ex) {
- fail("Store without validator failed ? Exception: " + ex);
- }
- // Verify store behaviour with validator present
- try {
- mockPortletPreferences.setPreferencesValidator(new BasicPreferencesValidator());
- mockPortletPreferences.store();
- fail("Basic validator did not prevent store as expected ?");
- } catch (Exception ex) {
- assertTrue("Basic validator did not produce UnsupportedOperationException ?", ex instanceof UnsupportedOperationException);
- }
- // Verify store behaviour after validator cleared
- try {
- mockPortletPreferences.setPreferencesValidator(null);
- mockPortletPreferences.store();
- } catch (Exception ex) {
- fail("Store after clearing validator failed ? Exception: " + ex);
- }
- }
-
- public void testMockPortletRequest() {
- final String TEST_DEFAULT_CONTENT_TYPE = "text/html";
- final String TEST_CONTENT_TYPE = "text/plain";
- final String TEST_CONTENT_TYPE2 = "text/csv";
- final String TEST_PROPERTY = "TEST_PROPERTY";
- final String TEST_PROPERTY_VALUE = "Property_Value_1";
- final String TEST_PROPERTY2 = "TEST_PROPERTY2";
- final String TEST_PROPERTY2_VALUE = "Property_Value_2";
- final String TEST_AUTHTYPE = "Test_Auth_Type";
- final String TEST_FAKECONTEXTPATH = "/fakeContextPath";
- final String TEST_FAKEREMOTEUSER = "fakeRemoteUser";
- final String TEST_FAKEUSERROLE = "fakeUserRole";
- final String TEST_ATTRIBUTE = "TEST_ATTRIBUTE";
- final String TEST_ATTRIBUTE_VALUE = "Attribute_Value_1";
- final String TEST_ATTRIBUTE2 = "TEST_ATTRIBUTE2";
- final String TEST_ATTRIBUTE_VALUE2 = "Attribute_Value_2";
- final String TEST_PARAM = "TEST_PARAM";
- final String TEST_PARAM_VALUE = "Param_Value_1";
- final String TEST_PARAM2 = "TEST_PARAM2";
- final String TEST_PARAM_VALUE2 = "PARAM_Value_2";
- final String TEST_ARRAYPARAM = "TEST_ARRAYPARAM";
- final String[] TEST_PARAM_ARRAYVALUE = { "ARRAYVALUE1", "ARRAYVALUE2" };
- final String TEST_SCHEME = "file";
- final String TEST_HOST = "localhost2";
- final int TEST_PORT = 8080;
- final String TEST_WINDOWID = "TEST_WINDOWID";
- final String TEST_COOKIE_ID = "TEST_COOKIE_ID";
- final String TEST_COOKIE_ID2 = "TEST_COOKIE_ID2";
- final String TEST_COOKIE_VALUE = "Cookie_Value";
- final String TEST_COOKIE_VALUE2 = "Cookie_Value2";
- final Cookie PORLET_TEST_COOKIE = new Cookie(TEST_COOKIE_ID, TEST_COOKIE_VALUE);
- final Cookie PORLET_TEST_COOKIE2 = new Cookie(TEST_COOKIE_ID2, TEST_COOKIE_VALUE2);
-
- // Call each constructor in sequence, do some basic checks
- MockPortletRequest mockPortletRequest = new MockPortletRequest();
- assertTrue("Default active state not true ?", mockPortletRequest.isActive());
- assertEquals("Default portlet mode not as expected ?", PortletMode.VIEW, mockPortletRequest.getPortletMode());
- assertEquals("Default window state not as expected ?", WindowState.NORMAL, mockPortletRequest.getWindowState());
- assertNotNull("Default preferences is null ?", mockPortletRequest.getPreferences());
- assertNotNull("Default portlet session is null ?", mockPortletRequest.getPortletSession());
- assertNotNull("Default portal context is null ?", mockPortletRequest.getPortalContext());
- assertEquals("Default context path not empty string ?", "", mockPortletRequest.getContextPath());
- assertNull("Default remote user not null ?", mockPortletRequest.getRemoteUser());
- assertNull("Default user principal not null ?", mockPortletRequest.getUserPrincipal());
- assertFalse("Default secure state not false ?", mockPortletRequest.isSecure());
- assertTrue("Default request sessionid not valid ?", mockPortletRequest.isRequestedSessionIdValid());
- assertEquals("Default locale not as expected ?", Locale.ENGLISH, mockPortletRequest.getLocale());
- assertEquals("Default response content-type not as expected ?", TEST_DEFAULT_CONTENT_TYPE, mockPortletRequest.getResponseContentType());
- assertNull("Default lifecycle phase attribute not null ?", mockPortletRequest.getAttribute(PortletRequest.LIFECYCLE_PHASE));
- assertEquals("Default scheme not as expected ?", "http", mockPortletRequest.getScheme());
- assertEquals("Default server name not as expected ?", "localhost", mockPortletRequest.getServerName());
- assertEquals("Default server port not as expected ?", 80, mockPortletRequest.getServerPort());
- final MockPortalContext mockPortalContext = new MockPortalContext();
- final MockPortletContext mockPortletContext = new MockPortletContext();
- new MockPortletRequest(mockPortletContext); // Only test is to confirm constructor completes without exception
- mockPortletRequest = new MockPortletRequest(mockPortalContext, mockPortletContext);
- assertEquals("Portal context does not match constructor-set value ?", mockPortalContext, mockPortletRequest.getPortalContext());
- mockPortletRequest.addResponseContentType(TEST_CONTENT_TYPE);
- mockPortletRequest.addResponseContentType(TEST_CONTENT_TYPE2);
- Enumeration<String> contentTypes = mockPortletRequest.getResponseContentTypes();
- assertNotNull("MockPortletRequest content-types null ?", contentTypes);
- final ArrayList<String> contentTypesList = new ArrayList<>();
- while (contentTypes.hasMoreElements()) {
- contentTypesList.add(contentTypes.nextElement());
- }
- assertEquals("MockPortletRequest does not contain three content-types ?", 3, contentTypesList.size());
- assertTrue("MockPortletRequest does not contain content-type " + TEST_CONTENT_TYPE + " ?", contentTypesList.contains(TEST_CONTENT_TYPE));
- assertTrue("MockPortletRequest does not contain content-type " + TEST_CONTENT_TYPE2 + " ?", contentTypesList.contains(TEST_CONTENT_TYPE2));
- assertTrue("MockPortletRequest does not contain default content-type + " + TEST_DEFAULT_CONTENT_TYPE + " ?", contentTypesList.contains(TEST_DEFAULT_CONTENT_TYPE));
- assertTrue("View portlet mode not allowed ?", mockPortletRequest.isPortletModeAllowed(PortletMode.VIEW));
- assertTrue("Edit portlet mode not allowed ?", mockPortletRequest.isPortletModeAllowed(PortletMode.EDIT));
- assertTrue("Help portlet mode not allowed ?", mockPortletRequest.isPortletModeAllowed(PortletMode.HELP));
- assertTrue("Normal window state not allowed ?", mockPortletRequest.isWindowStateAllowed(WindowState.NORMAL));
- assertTrue("Maximized window state not allowed ?", mockPortletRequest.isWindowStateAllowed(WindowState.MAXIMIZED));
- assertTrue("Minimized window state not allowed ?", mockPortletRequest.isWindowStateAllowed(WindowState.MINIMIZED));
- mockPortletRequest.setPortletMode(PortletMode.EDIT);
- assertEquals("Portlet mode does not match set value ?", PortletMode.EDIT, mockPortletRequest.getPortletMode());
- mockPortletRequest.setWindowState(WindowState.MAXIMIZED);
- assertEquals("Window state does not match set value ?", WindowState.MAXIMIZED, mockPortletRequest.getWindowState());
- final MockPortletPreferences mockPortletPreferences = new MockPortletPreferences();
- mockPortletRequest.setPreferences(mockPortletPreferences);
- assertEquals("Portlet preferences does not match set value ?", mockPortletPreferences, mockPortletRequest.getPreferences());
- final MockPortletSession mockPortletSession = new MockPortletSession(mockPortletContext);
- mockPortletRequest.setSession(mockPortletSession);
- assertEquals("Portlet session does not match set value ?", mockPortletSession, mockPortletRequest.getPortletSession());
- assertTrue("Set request sessionid not valid ?", mockPortletRequest.isRequestedSessionIdValid());
- mockPortletRequest.setRequestedSessionIdValid(false);
- assertFalse("Set request sessionid still valid after set invalid ?", mockPortletRequest.isRequestedSessionIdValid());
- mockPortletRequest.setRequestedSessionIdValid(true);
- assertTrue("Set request sessionid not valid after set valid ?", mockPortletRequest.isRequestedSessionIdValid());
-
- mockPortletRequest.setProperty(TEST_PROPERTY, TEST_PROPERTY_VALUE);
- mockPortletRequest.setProperty(TEST_PROPERTY2, TEST_PROPERTY2_VALUE);
- final Enumeration<String> propertyNames = mockPortletRequest.getPropertyNames();
- assertNotNull("MockPortalContext property names null ?", propertyNames);
- final ArrayList<String> propertyNamesList = new ArrayList<>();
- while (propertyNames.hasMoreElements()) {
- propertyNamesList.add(propertyNames.nextElement());
- }
- assertEquals("MockPortletRequest does not contain two properties ?", 2, propertyNamesList.size());
- assertTrue("MockPortletRequest does not contain property name " + TEST_PROPERTY + " ?", propertyNamesList.contains(TEST_PROPERTY));
- assertTrue("MockPortletRequest does not contain property name " + TEST_PROPERTY2 + " ?", propertyNamesList.contains(TEST_PROPERTY2));
- assertEquals("MockPortletRequest value of property name " + TEST_PROPERTY + " not as expected ?", TEST_PROPERTY_VALUE, mockPortletRequest.getProperty(TEST_PROPERTY));
- assertEquals("MockPortletRequest value of property name " + TEST_PROPERTY2 + " not as expected ?", TEST_PROPERTY2_VALUE, mockPortletRequest.getProperty(TEST_PROPERTY2));
- mockPortletRequest.addProperty(TEST_PROPERTY, TEST_PROPERTY2_VALUE);
- final Enumeration<String> propertiesForName = mockPortletRequest.getProperties(TEST_PROPERTY);
- assertNotNull("MockPortletRequest properties for " + TEST_PROPERTY + " is null ?", propertiesForName);
- final ArrayList<String> propertiesForNameList = new ArrayList<>();
- while (propertiesForName.hasMoreElements()) {
- propertiesForNameList.add(propertiesForName.nextElement());
- }
- assertEquals("MockPortletRequest does not contain two values for " + TEST_PROPERTY + " ?", 2, propertiesForNameList.size());
- assertTrue("MockPortletRequest does not contain expected value for property name " + TEST_PROPERTY + " ?", propertiesForNameList.contains(TEST_PROPERTY_VALUE));
- assertTrue("MockPortletRequest does not contain expected value for propety name " + TEST_PROPERTY + " ?", propertiesForNameList.contains(TEST_PROPERTY2_VALUE));
-
- mockPortletRequest.setAuthType(TEST_AUTHTYPE);
- assertEquals("Authtype not equal to set value ?", TEST_AUTHTYPE, mockPortletRequest.getAuthType());
- mockPortletRequest.setContextPath(TEST_FAKECONTEXTPATH);
- assertEquals("Context path not equal to set value ?", TEST_FAKECONTEXTPATH, mockPortletRequest.getContextPath());
- mockPortletRequest.setRemoteUser(TEST_FAKEREMOTEUSER);
- assertEquals("Remote user not equal to set value ?", TEST_FAKEREMOTEUSER, mockPortletRequest.getRemoteUser());
- final TestMockPrincipal testMockPrincipal = new TestMockPrincipal();
- mockPortletRequest.setUserPrincipal(testMockPrincipal);
- assertEquals("User principal not equal to set value ?", testMockPrincipal, mockPortletRequest.getUserPrincipal());
- mockPortletRequest.addUserRole(TEST_FAKEUSERROLE);
- assertTrue("Usser not in added role ?", mockPortletRequest.isUserInRole(TEST_FAKEUSERROLE));
-
- assertNull(TEST_PARAM + " present before set ?", mockPortletRequest.getParameter(TEST_PARAM));
- assertNull(TEST_PARAM2 + " present before set ?", mockPortletRequest.getParameter(TEST_PARAM));
- mockPortletRequest.addParameter(TEST_PARAM, TEST_PARAM_VALUE);
- mockPortletRequest.addParameter(TEST_PARAM2, TEST_PARAM_VALUE2);
- assertEquals("Retrieved parameter 1 does not match set value ?", TEST_PARAM_VALUE, mockPortletRequest.getParameter(TEST_PARAM));
- assertEquals("Retrieved parameter 2 does not match set value ?", TEST_PARAM_VALUE2, mockPortletRequest.getParameter(TEST_PARAM2));
- final Enumeration<String> parameterNames = mockPortletRequest.getParameterNames();
- int parameterNameCount = 0;
- assertNotNull("Parameter names null after additions ?", parameterNames);
- assertTrue("Parameter names empty after additions ?", parameterNames.hasMoreElements());
- while (parameterNames.hasMoreElements()) {
- parameterNameCount++;
- String currentParameterName = parameterNames.nextElement();
- assertTrue("Param name not one of two expected matches ?", TEST_PARAM.equals(currentParameterName) ||
- TEST_PARAM2.equals(currentParameterName));
- }
- assertEquals("Parameter names size not 2 ?", 2, parameterNameCount);
- mockPortletRequest.addParameter(TEST_ARRAYPARAM, TEST_PARAM_ARRAYVALUE);
- assertArrayEquals("Array parameter value not set as expected ?", TEST_PARAM_ARRAYVALUE, mockPortletRequest.getParameterValues(TEST_ARRAYPARAM));
- final Map<String, String[]> parameterMap = mockPortletRequest.getParameterMap();
- assertNotNull("Parameter map is null ?", parameterMap);
- assertTrue("Expected parameter not present ?", parameterMap.containsKey(TEST_PARAM));
- assertTrue("Expected parameter not present ?", parameterMap.containsKey(TEST_PARAM2));
- assertTrue("Expected parameter not present ?", parameterMap.containsKey(TEST_ARRAYPARAM));
-
- assertNull(TEST_ATTRIBUTE + " present before set ?", mockPortletRequest.getAttribute(TEST_ATTRIBUTE));
- assertNull(TEST_ATTRIBUTE2 + " present before set ?", mockPortletRequest.getAttribute(TEST_ATTRIBUTE2));
- mockPortletRequest.setAttribute(TEST_ATTRIBUTE, TEST_ATTRIBUTE_VALUE);
- mockPortletRequest.setAttribute(TEST_ATTRIBUTE2, TEST_ATTRIBUTE_VALUE2);
- assertEquals("Retrieved atribute 1 does not match set value ?", TEST_ATTRIBUTE_VALUE, mockPortletRequest.getAttribute(TEST_ATTRIBUTE));
- assertEquals("Retrieved atribute 2 does not match set value ?", TEST_ATTRIBUTE_VALUE2, mockPortletRequest.getAttribute(TEST_ATTRIBUTE2));
- final Enumeration<String> attributeNames = mockPortletRequest.getAttributeNames();
- int attributeNameCount = 0;
- assertNotNull("Attribute names null after additions ?", attributeNames);
- assertTrue("Attribute names empty after additions ?", attributeNames.hasMoreElements());
- while (attributeNames.hasMoreElements()) {
- attributeNameCount++;
- String currentAttibuteName = attributeNames.nextElement();
- assertTrue("Attribute name not one of two or three expected matches ?", TEST_ATTRIBUTE.equals(currentAttibuteName) ||
- TEST_ATTRIBUTE2.equals(currentAttibuteName) ||
- PortletRequest.LIFECYCLE_PHASE.equals(currentAttibuteName));
- }
- assertTrue("Atribute names size not 2 or 3 ?", attributeNameCount >= 2 && attributeNameCount <= 3);
-
- mockPortletRequest.addPreferredLocale(Locale.FRENCH);
- assertEquals("Preferred locale not as expected ?", Locale.FRENCH, mockPortletRequest.getLocale());
- final Enumeration<Locale> locales = mockPortletRequest.getLocales();
- assertNotNull("Locales null after additions ?", locales);
- assertTrue("Locales names empty after additions ?", locales.hasMoreElements());
- final Locale firstLocale = locales.nextElement();
- assertEquals("First locale not set value ?", Locale.FRENCH, firstLocale);
- final Locale secondLocale = locales.nextElement();
- assertEquals("Second locale not default value ?", Locale.ENGLISH, secondLocale);
- mockPortletRequest.setScheme(TEST_SCHEME);
- assertEquals("Scheme not equal to set value ?", TEST_SCHEME, mockPortletRequest.getScheme());
- mockPortletRequest.setServerName(TEST_HOST);
- assertEquals("Server name not equal to set value ?", TEST_HOST, mockPortletRequest.getServerName());
- mockPortletRequest.setServerPort(TEST_PORT);
- assertEquals("Server port not equal to set value ?", TEST_PORT, mockPortletRequest.getServerPort());
- mockPortletRequest.setWindowID(TEST_WINDOWID);
- assertEquals("Window id not equal to set value ?", TEST_WINDOWID, mockPortletRequest.getWindowID());
-
- mockPortletRequest.setCookies(PORLET_TEST_COOKIE, PORLET_TEST_COOKIE2);
- final Cookie[] cookies = mockPortletRequest.getCookies();
- assertNotNull("Cookies array null ?", cookies);
- assertEquals("Cookies array length not 2 ?", 2, cookies.length);
- for (Cookie cookie : cookies) {
- assertTrue("Cookie not one of set cookies ?", PORLET_TEST_COOKIE.equals(cookie) || PORLET_TEST_COOKIE2.equals(cookie));
- }
-
- final Map<String, String[]> originalPrivateParameters = mockPortletRequest.getPrivateParameterMap();
- final Map<String, String[]> originalPublicParameters = mockPortletRequest.getPublicParameterMap();
- assertNotNull("Original private parameters map is null ?", originalPrivateParameters);
- assertFalse("Original private parameters map is empty ?", originalPrivateParameters.isEmpty());
- assertTrue("Original private parameters map does not contain " + TEST_PARAM + " ?", originalPrivateParameters.containsKey(TEST_PARAM));
- assertTrue("Original private parameters map does not contain " + TEST_PARAM2 + " ?", originalPrivateParameters.containsKey(TEST_PARAM2));
- assertNotNull("Original public parameters map is null ?", originalPublicParameters);
- assertTrue("Original public parameters map is not empty ?", originalPublicParameters.isEmpty());
- mockPortletRequest.registerPublicParameter(TEST_PARAM2);
- final Map<String, String[]> updatedPrivateParameters = mockPortletRequest.getPrivateParameterMap();
- final Map<String, String[]> updatedPublicParameters = mockPortletRequest.getPublicParameterMap();
- assertNotNull("Updated private parameters map is null ?", updatedPrivateParameters);
- assertFalse("Updated private parameters map is empty ?", updatedPrivateParameters.isEmpty());
- assertFalse("Updated private parameters map contains " + TEST_PARAM2 + " ?", updatedPrivateParameters.containsKey(TEST_PARAM2));
- assertTrue("Updated private parameters map does not contain " + TEST_PARAM + " ?", updatedPrivateParameters.containsKey(TEST_PARAM));
- assertNotNull("Updated public parameters map is null ?", updatedPublicParameters);
- assertFalse("Updated public parameters map is empty ?", updatedPublicParameters.isEmpty());
- assertFalse("Updated public parameters map contains " + TEST_PARAM + " ?", updatedPublicParameters.containsKey(TEST_PARAM));
- assertTrue("Updated public parameters map does not contain " + TEST_PARAM2 + " ?", updatedPublicParameters.containsKey(TEST_PARAM2));
- }
-
- public void testMockPortletRequestDispatcher() {
- final String TEST_DISPATCH_URL = "localhost:8080/fakeurl";
-
- // Call each constructor in sequence, do some basic checks
- MockPortletRequestDispatcher mockPortletRequestDispatcher = new MockPortletRequestDispatcher(TEST_DISPATCH_URL);
- final MockRenderRequest mockRenderRequest = new MockRenderRequest();
- final MockRenderResponse mockRenderResponse = new MockRenderResponse();
- try {
- mockPortletRequestDispatcher.include(mockRenderRequest, mockRenderResponse);
- } catch (Exception ex) {
- fail("MockPortletRequestDispatcher include (render) failed. Exception: " + ex);
- }
- final MockPortletRequest mockPortletRequest = new MockPortletRequest();
- final MockPortletResponse mockPortletResponse = new MockPortletResponse();
- final MockMimeResponse mockMimeResponse = new MockMimeResponse();
- try {
- mockPortletRequestDispatcher.include(mockPortletRequest, mockPortletResponse);
- fail("Include of non-MockMimeResponse did not throw an exception ?");
- } catch (IllegalArgumentException iae) {
- // Expected failure
- } catch (Exception ex) {
- fail("MockPortletRequestDispatcher include (portlet) failed. Exception: " + ex);
- }
- try {
- mockPortletRequestDispatcher.include(mockPortletRequest, mockMimeResponse);
- } catch (Exception ex) {
- fail("MockPortletRequestDispatcher include (portlet) failed. Exception: " + ex);
- }
- try {
- mockPortletRequestDispatcher.forward(mockPortletRequest, mockPortletResponse);
- fail("Forward of non-MockMimeResponse did not throw an exception ?");
- } catch (IllegalArgumentException iae) {
- // Expected failure
- } catch (Exception ex) {
- fail("MockPortletRequestDispatcher forward failed. Exception: " + ex);
- }
- try {
- mockPortletRequestDispatcher.forward(mockPortletRequest, mockMimeResponse);
- } catch (Exception ex) {
- fail("MockPortletRequestDispatcher forward failed. Exception: " + ex);
- }
- }
-
- public void testMockPortletResponse() {
- final String TEST_ENCODE_URL = "localhost:8080/fakeforwardedurl?param1=param with spaces";
- final String TEST_NAMESPACE = "Test_Namespace";
- final String TEST_PROPERTY = "TEST_PROPERTY";
- final String TEST_PROPERTY_VALUE = "Property_Value_1";
- final String TEST_PROPERTY2 = "TEST_PROPERTY2";
- final String TEST_PROPERTY2_VALUE = "Property_Value_2";
- final String TEST_XMLPROPERTY = "TEST_XMLPROPERTY";
- final String TEST_XML_TAGNAME = "TEST_XML_TAGNAME";
- final String TEST_COOKIE_ID = "TEST_COOKIE_ID";
-
- // Call each constructor in sequence, do some basic checks
- MockPortletResponse mockPortletResponse = new MockPortletResponse();
- assertEquals("Default namespace not as expected ?", "", mockPortletResponse.getNamespace());
- assertNotNull("Default portal context null ?", mockPortletResponse.getPortalContext());
- assertEquals("Encoded URL not as expected ?", TEST_ENCODE_URL, mockPortletResponse.encodeURL(TEST_ENCODE_URL)); // Mock URL encode does nothing
- mockPortletResponse.setNamespace(TEST_NAMESPACE);
- assertEquals("Set namespace not as expected ?", TEST_NAMESPACE, mockPortletResponse.getNamespace());
- final MockPortalContext mockPortalContext = new MockPortalContext();
- mockPortletResponse = new MockPortletResponse(mockPortalContext);
- assertEquals("Portal context does not match constructor-set value ?", mockPortalContext, mockPortletResponse.getPortalContext());
-
- mockPortletResponse.setProperty(TEST_PROPERTY, TEST_PROPERTY_VALUE);
- mockPortletResponse.setProperty(TEST_PROPERTY2, TEST_PROPERTY2_VALUE);
- final Set<String> propertyNames = mockPortletResponse.getPropertyNames();
- assertNotNull("MockPortletResponse property names null ?", propertyNames);
- assertEquals("MockPortletResponse does not contain two properties ?", 2, propertyNames.size());
- assertTrue("MockPortletResponse does not contain property name " + TEST_PROPERTY + " ?", propertyNames.contains(TEST_PROPERTY));
- assertTrue("MockPortletResponse does not contain property name " + TEST_PROPERTY2 + " ?", propertyNames.contains(TEST_PROPERTY2));
- assertEquals("MockPortletResponse value of property name " + TEST_PROPERTY + " not as expected ?", TEST_PROPERTY_VALUE, mockPortletResponse.getProperty(TEST_PROPERTY));
- assertEquals("MockPortletResponse value of property name " + TEST_PROPERTY2 + " not as expected ?", TEST_PROPERTY2_VALUE, mockPortletResponse.getProperty(TEST_PROPERTY2));
- mockPortletResponse.addProperty(TEST_PROPERTY, TEST_PROPERTY2_VALUE);
- final String[] propertiesForName = mockPortletResponse.getProperties(TEST_PROPERTY);
- assertNotNull("MockPortletResponse properties for " + TEST_PROPERTY + " is null ?", propertiesForName);
- final ArrayList<String> propertiesForNameList = new ArrayList<>();
- propertiesForNameList.addAll(Arrays.asList(propertiesForName));
- assertEquals("MockPortletResponse does not contain two values for " + TEST_PROPERTY + " ?", 2, propertiesForNameList.size());
- assertTrue("MockPortletResponse does not contain expected value for property name " + TEST_PROPERTY + " ?", propertiesForNameList.contains(TEST_PROPERTY_VALUE));
- assertTrue("MockPortletResponse does not contain expected value for propety name " + TEST_PROPERTY + " ?", propertiesForNameList.contains(TEST_PROPERTY2_VALUE));
-
- final Cookie[] cookies = mockPortletResponse.getCookies();
- assertNotNull("Cookies array null ?", cookies);
- assertEquals("Cookies array length not 0 ?", 0, cookies.length);
- assertNull("Cookie found ?", mockPortletResponse.getCookie(TEST_COOKIE_ID));
-
- Set<String> xmlPropertyNames = mockPortletResponse.getXmlPropertyNames();
- assertNotNull("MockPortletResponse XML property names null ?", xmlPropertyNames);
- assertTrue("XML properites set not empty ?", xmlPropertyNames.isEmpty());
- assertNull("XML property found ?", mockPortletResponse.getXmlProperty(TEST_XMLPROPERTY));
- Element[] xmlProperties = mockPortletResponse.getXmlProperties(TEST_XMLPROPERTY);
- assertNull("XML properties found ?", xmlProperties);
- Element element = mockPortletResponse.createElement(TEST_XML_TAGNAME);
- assertNotNull("MockPortletResponse XML element null ?", element);
- mockPortletResponse.addProperty(TEST_XMLPROPERTY, element);
- xmlPropertyNames = mockPortletResponse.getXmlPropertyNames();
- assertNotNull("MockPortletResponse XML property names null ?", xmlPropertyNames);
- assertFalse("XML properites set empty ?", xmlPropertyNames.isEmpty());
- assertNotNull("XML property not found ?", mockPortletResponse.getXmlProperty(TEST_XMLPROPERTY));
- xmlProperties = mockPortletResponse.getXmlProperties(TEST_XMLPROPERTY);
- assertNotNull("XML properties not found ?", xmlProperties);
- assertEquals("XML properties not expected size ?", 1, xmlProperties.length);
- assertEquals("XML property at index 0 not element value ?", element, xmlProperties[0]);
- }
-
- public void testMockPortletSession() {
- final String TEST_ATTRIBUTE = "TEST_ATTRIBUTE";
- final String TEST_ATTRIBUTE_VALUE = "Attribute_Value_1";
- final String TEST_ATTRIBUTE2 = "TEST_ATTRIBUTE2";
- final String TEST_ATTRIBUTE_VALUE2 = "Attribute_Value_2";
- final long TEST_START_TIME = System.currentTimeMillis();
- final int TEST_MAXINACTIVE_INTERVAL = 300;
-
- // Call each constructor in sequence, do some basic checks
- MockPortletSession mockPortletSession = new MockPortletSession();
- final String INITIAL_SESSION_ID = mockPortletSession.getId();
- assertNotNull("MockPortletSession session id null ?", INITIAL_SESSION_ID);
- assertFalse("MockPortletSession session is invalid ?", mockPortletSession.isInvalid());
- assertTrue("MockPortletSession session is not new ?", mockPortletSession.isNew());
- mockPortletSession.setNew(false);
- assertFalse("MockPortletSession session is still new ?", mockPortletSession.isNew());
- mockPortletSession.setNew(true);
- assertTrue("MockPortletSession session is not new after set ?", mockPortletSession.isNew());
- assertEquals("MockPortletSession max inactive interval not 0 ?", 0, mockPortletSession.getMaxInactiveInterval());
- assertNotNull("Default portlet context null ?", mockPortletSession.getPortletContext());
- assertTrue("MockPortletSession session creation time in past ?", mockPortletSession.getCreationTime() >= TEST_START_TIME);
- assertTrue("MockPortletSession session last accessed time in past ?", mockPortletSession.getLastAccessedTime() >= TEST_START_TIME);
- assertTrue("MockPortletSession session last accessed time older than creation time ?", mockPortletSession.getLastAccessedTime() >= mockPortletSession.getCreationTime());
- assertNotNull("Default portlet attribute map null ?", mockPortletSession.getAttributeMap());
- assertNotNull("Default portlet portletscope attribute map null ?", mockPortletSession.getAttributeMap(PortletSession.PORTLET_SCOPE));
- assertNotNull("Default portlet applicationscope attribute map null ?", mockPortletSession.getAttributeMap(PortletSession.APPLICATION_SCOPE));
- final MockPortletContext mockPortletContext = new MockPortletContext();
- mockPortletSession = new MockPortletSession(mockPortletContext);
- assertEquals("MockPortletSession portletcontext not equal to set value ?", mockPortletContext, mockPortletSession.getPortletContext());
- final String NEW_SESSION_ID = mockPortletSession.getId();
- assertNotNull("MockPortletSession session id null ?", NEW_SESSION_ID);
- assertNotEquals("Original and new session id match ?", NEW_SESSION_ID, INITIAL_SESSION_ID);
-
- assertNull(TEST_ATTRIBUTE + " present before set ?", mockPortletSession.getAttribute(TEST_ATTRIBUTE));
- assertNull(TEST_ATTRIBUTE2 + " present before set ?", mockPortletSession.getAttribute(TEST_ATTRIBUTE2));
- mockPortletSession.setAttribute(TEST_ATTRIBUTE, TEST_ATTRIBUTE_VALUE);
- mockPortletSession.setAttribute(TEST_ATTRIBUTE2, TEST_ATTRIBUTE_VALUE2);
- assertEquals("Retrieved atribute 1 does not match set value ?", TEST_ATTRIBUTE_VALUE, mockPortletSession.getAttribute(TEST_ATTRIBUTE));
- assertEquals("Retrieved atribute 2 does not match set value ?", TEST_ATTRIBUTE_VALUE2, mockPortletSession.getAttribute(TEST_ATTRIBUTE2));
- final Enumeration<String> attributeNames = mockPortletSession.getAttributeNames();
- int attributeNameCount = 0;
- assertNotNull("Attribute names null after additions ?", attributeNames);
- assertTrue("Attribute names empty after additions ?", attributeNames.hasMoreElements());
- while (attributeNames.hasMoreElements()) {
- attributeNameCount++;
- String currentAttibuteName = attributeNames.nextElement();
- assertTrue("Attribute name not one of two expected matches ?", TEST_ATTRIBUTE.equals(currentAttibuteName) ||
- TEST_ATTRIBUTE2.equals(currentAttibuteName));
- }
- assertEquals("Atribute names size not expected value ?", 2, attributeNameCount);
- assertNull(TEST_ATTRIBUTE + " present before set (application scope) ?", mockPortletSession.getAttribute(TEST_ATTRIBUTE, PortletSession.APPLICATION_SCOPE));
- assertNull(TEST_ATTRIBUTE2 + " present before set (application scope) ?", mockPortletSession.getAttribute(TEST_ATTRIBUTE2, PortletSession.APPLICATION_SCOPE));
- mockPortletSession.setAttribute(TEST_ATTRIBUTE, TEST_ATTRIBUTE_VALUE, PortletSession.APPLICATION_SCOPE);
- mockPortletSession.setAttribute(TEST_ATTRIBUTE2, TEST_ATTRIBUTE_VALUE2, PortletSession.APPLICATION_SCOPE);
- assertEquals("Retrieved atribute 1 does not match set value (application scope) ?", TEST_ATTRIBUTE_VALUE, mockPortletSession.getAttribute(TEST_ATTRIBUTE, PortletSession.APPLICATION_SCOPE));
- assertEquals("Retrieved atribute 2 does not match set value (application scope) ?", TEST_ATTRIBUTE_VALUE2, mockPortletSession.getAttribute(TEST_ATTRIBUTE2, PortletSession.APPLICATION_SCOPE));
- final Enumeration<String> attributeNamesApplication = mockPortletSession.getAttributeNames(PortletSession.APPLICATION_SCOPE);
- int attributeNameCountApplication = 0;
- assertNotNull("Attribute names null after additions (application scope) ?", attributeNamesApplication);
- assertTrue("Attribute names empty after additions (application scope) ?", attributeNamesApplication.hasMoreElements());
- while (attributeNamesApplication.hasMoreElements()) {
- attributeNameCountApplication++;
- String currentAttibuteName = attributeNamesApplication.nextElement();
- assertTrue("Attribute name not one of two expected matches (application scope) ?", TEST_ATTRIBUTE.equals(currentAttibuteName) ||
- TEST_ATTRIBUTE2.equals(currentAttibuteName));
- }
- assertEquals("Atribute names size not expected value (application scope) ?", 2, attributeNameCountApplication);
-
- assertTrue("MockPortletSession session is not new ?", mockPortletSession.isNew());
- mockPortletSession.access();
- assertFalse("MockPortletSession session is still new after access ?", mockPortletSession.isNew());
- mockPortletSession.setMaxInactiveInterval(TEST_MAXINACTIVE_INTERVAL);
- assertEquals("MockPortletSession max inactive interval not set value ?", TEST_MAXINACTIVE_INTERVAL, mockPortletSession.getMaxInactiveInterval());
- mockPortletSession.removeAttribute(TEST_ATTRIBUTE2);
- assertNull(TEST_ATTRIBUTE2 + " still present after removal ?", mockPortletSession.getAttribute(TEST_ATTRIBUTE2));
- mockPortletSession.removeAttribute(TEST_ATTRIBUTE, PortletSession.APPLICATION_SCOPE);
- assertNull(TEST_ATTRIBUTE + " still present after removal (application scope) ?", mockPortletSession.getAttribute(TEST_ATTRIBUTE, PortletSession.APPLICATION_SCOPE));
- final long BEFORE_INVALIDATE_TIME = System.currentTimeMillis();
- mockPortletSession.invalidate();
- assertTrue("MockPortletSession session is still valid after invalidate ?", mockPortletSession.isInvalid());
- assertNull(TEST_ATTRIBUTE + " still present after invalidate ?", mockPortletSession.getAttribute(TEST_ATTRIBUTE));
- assertNull(TEST_ATTRIBUTE2 + " still present after removal (application scope) ?", mockPortletSession.getAttribute(TEST_ATTRIBUTE2, PortletSession.APPLICATION_SCOPE));
- assertTrue("MockPortletSession session last accessed time older than creation time ?", mockPortletSession.getLastAccessedTime() >= mockPortletSession.getCreationTime());
- assertTrue("MockPortletSession session last accessed time older than time before invalidation ?", mockPortletSession.getLastAccessedTime() >= BEFORE_INVALIDATE_TIME);
- }
-
- public void testMockPortletURL() {
- final String TEST_PARAMETER = "TEST_PARAMETER";
-
- // Call each constructor in sequence, do some basic checks
- final MockPortalContext mockPortalContext = new MockPortalContext();
- final MockPortletURL mockPortletURL = new MockPortletURL(mockPortalContext, MockPortletURL.URL_TYPE_RENDER);
- assertNull("MockPortletURL default portlet mode not null ?", mockPortletURL.getPortletMode());
- assertNull("MockPortletURL default window state not null ?", mockPortletURL.getWindowState());
- try {
- mockPortletURL.setWindowState(WindowState.MAXIMIZED);
- } catch (Exception ex) {
- fail("MockPortletURL window state set failed. Exception: " + ex);
- }
- assertEquals("Window state does not match set value ?", WindowState.MAXIMIZED, mockPortletURL.getWindowState());
- try {
- mockPortletURL.setPortletMode(PortletMode.VIEW);
- } catch (Exception ex) {
- fail("MockPortletURL portlet mode set failed. Exception: " + ex);
- }
- assertEquals("PortletMode.VIEW not set ?", PortletMode.VIEW, mockPortletURL.getPortletMode());
- final String portletURLAsString = mockPortletURL.toString();
- assertNotNull("MockPortletURL toString() result null ?", portletURLAsString);
- assertTrue("MockPortletURL toString() result is empty ?", portletURLAsString.length() > 0);
- mockPortletURL.removePublicRenderParameter(TEST_PARAMETER); // Just confirm no exception
- }
-
- public void testMockRenderRequest() {
- final MockPortletContext mockPortletContext = new MockPortletContext();
- final MockPortalContext mockPortalContext = new MockPortalContext();
-
- // Call each constructor in sequence, do some basic checks
- MockRenderRequest mockRenderRequest = new MockRenderRequest();
- assertNull("MockRenderRequest ETag not null ?", mockRenderRequest.getETag());
- mockRenderRequest = new MockRenderRequest(PortletMode.HELP);
- assertEquals("MockRenderRequest portlet mode does not match constructor-set value ?", PortletMode.HELP, mockRenderRequest.getPortletMode());
- mockRenderRequest = new MockRenderRequest(PortletMode.HELP, WindowState.MAXIMIZED);
- assertEquals("MockRenderRequest portlet mode does not match constructor-set value ?", PortletMode.HELP, mockRenderRequest.getPortletMode());
- assertEquals("MockRenderRequest window state does not match constructor-set value ?", WindowState.MAXIMIZED, mockRenderRequest.getWindowState());
- new MockRenderRequest(mockPortletContext); // Only test is to confirm constructor completes without exception
- mockRenderRequest = new MockRenderRequest(mockPortalContext, mockPortletContext);
- assertEquals("Portal context does not match constructor-set value ?", mockPortalContext, mockRenderRequest.getPortalContext());
- }
-
- public void testMockRenderResponse() {
- final String TEST_TITLE = "TEST_TITLE";
-
- // Call each constructor in sequence, do some basic checks
- final MockPortalContext mockPortalContext = new MockPortalContext();
- final MockRenderRequest mockRenderRequest = new MockRenderRequest();
- MockRenderResponse mockRenderResponse = new MockRenderResponse();
- assertNull("MockRenderResponse title not null ?", mockRenderResponse.getTitle());
- mockRenderResponse = new MockRenderResponse(mockPortalContext); // Only test is to confirm constructor completes without exception
- assertEquals("Portal context does not match constructor-set value ?", mockPortalContext, mockRenderResponse.getPortalContext());
- mockRenderResponse = new MockRenderResponse(mockPortalContext, mockRenderRequest);
- assertEquals("Portal context does not match constructor-set value ?", mockPortalContext, mockRenderResponse.getPortalContext());
- mockRenderResponse.setTitle(TEST_TITLE);
- assertEquals("Title does not match set value ?", TEST_TITLE, mockRenderResponse.getTitle());
- final Collection<PortletMode> portletModes = new ArrayList<>();
- portletModes.add(PortletMode.EDIT);
- portletModes.add(PortletMode.VIEW);
- mockRenderResponse.setNextPossiblePortletModes(portletModes);
- assertEquals("Next possible portlet modes not equal to set value ?", portletModes, mockRenderResponse.getNextPossiblePortletModes());
- }
-
- public void testMockResourceRequest() {
- final String TEST_RESOURCEID = "TEST_RESOURCEID";
- final String TEST_CACHEABILITY = "TEST_CACHEABILITY";
- final String TEST_PARAM = "TEST_PARAM";
- final String TEST_PARAM2 = "TEST_PARAM2";
- final String TEST_PARAM_VALUE = "NORMALVALUE";
- final String[] TEST_PARAM_ARRAYVALUE = { "ARRAYVALUE1", "ARRAYVALUE2" };
-
- // Call each constructor in sequence, do some basic checks
- MockResourceRequest mockResourceRequest = new MockResourceRequest();
- assertNull("Default resource id not null ?", mockResourceRequest.getResourceID());
- assertNull("Default cacheability not null ?", mockResourceRequest.getCacheability());
- assertNull("Default ETag not null ?", mockResourceRequest.getETag());
- mockResourceRequest = new MockResourceRequest(TEST_RESOURCEID);
- assertEquals("Resource id not set value ?", TEST_RESOURCEID, mockResourceRequest.getResourceID());
- final MockPortletContext mockPortletContext = new MockPortletContext();
- final MockPortalContext mockPortalContext = new MockPortalContext();
- final MockResourceURL mockResourceURL = new MockResourceURL();
- new MockResourceRequest(mockResourceURL); // Only test is to confirm constructor completes without exception
- new MockResourceRequest(mockPortletContext); // Only test is to confirm constructor completes without exception
- mockResourceRequest = new MockResourceRequest(mockPortalContext, mockPortletContext);
- assertEquals("Portal context does not match constructor-set value ?", mockPortalContext, mockResourceRequest.getPortalContext());
- mockResourceRequest.setCacheability(TEST_CACHEABILITY);
- assertEquals("Cacheability does not match set value ?", TEST_CACHEABILITY, mockResourceRequest.getCacheability());
- mockResourceRequest.addPrivateRenderParameter(TEST_PARAM, TEST_PARAM_VALUE);
- mockResourceRequest.addPrivateRenderParameter(TEST_PARAM2, TEST_PARAM_ARRAYVALUE);
- final Map<String, String[]> privateRenderParameterMap = mockResourceRequest.getPrivateRenderParameterMap();
- assertNotNull("Parameter map is null ?", privateRenderParameterMap);
- assertTrue("Expected parameter not present ?", privateRenderParameterMap.containsKey(TEST_PARAM));
- assertTrue("Expected parameter not present ?", privateRenderParameterMap.containsKey(TEST_PARAM2));
- }
-
- public void testMockResourceResponse() {
- final int TEST_CONTENT_LENGTH = 4096;
-
- // Call each constructor in sequence, do some basic checks
- MockResourceResponse mockResourceRequest = new MockResourceResponse();
- assertEquals("MockResourceResponse initial content length not 0 ?", 0, mockResourceRequest.getContentLength());
- mockResourceRequest.setContentLength(TEST_CONTENT_LENGTH);
- assertEquals("Content length not equal to set value ?", TEST_CONTENT_LENGTH, mockResourceRequest.getContentLength());
- }
-
- public void testMockResourceURL() {
- final String TEST_RESOURCEID = "TEST_RESOURCEID";
- final String TEST_CACHEABILITY = "TEST_CACHEABILITY";
-
- // Call each constructor in sequence, do some basic checks
- MockResourceURL mockResourceURL = new MockResourceURL();
- assertNull("Default resource id not null ?", mockResourceURL.getResourceID());
- assertNull("Default cacheability not null ?", mockResourceURL.getCacheability());
- mockResourceURL.setResourceID(TEST_RESOURCEID);
- assertEquals("Resource id not set value ?", TEST_RESOURCEID, mockResourceURL.getResourceID());
- mockResourceURL.setCacheability(TEST_CACHEABILITY);
- assertEquals("Cacheability does not match set value ?", TEST_CACHEABILITY, mockResourceURL.getCacheability());
- final String resourceURLAsString = mockResourceURL.toString();
- assertNotNull("MockResourceURL toString() result null ?", resourceURLAsString);
- assertTrue("MockResourceURL toString() result is empty ?", resourceURLAsString.length() > 0);
- }
-
- public void testMockStateAwareResponse() {
- final String TEST_PORTLETNAME = "TestPortletName";
- final String TEST_DEFAULTNAMESPACE = "Test_Default_Namespace";
- final String TEST_QNAME3_STRING = "TestQname3String";
- final QName TEST_QNAME = new QName(TEST_PORTLETNAME);
- final QName TEST_QNAME2 = new QName(TEST_DEFAULTNAMESPACE);
- final String TEST_QNAME_VALUE = "Test_Qname_Value";
- final String TEST_QNAME2_VALUE = "Test_Qname2_Value";
- final String TEST_QNAME3_VALUE = "Test_Qname3_Value";
- final String TEST_PARAM = "TEST_PARAM";
- final String TEST_PARAM2 = "TEST_PARAM2";
- final String TEST_PARAM3 = "TEST_PARAM3";
- final String TEST_PARAM_VALUE = "NORMALVALUE";
- final String[] TEST_PARAM_ARRAYVALUE = { "ARRAYVALUE1", "ARRAYVALUE2" };
- final String[] TEST_PARAM_ARRAYVALUE2 = { "ARRAYVALUE3", "ARRAYVALUE4" };
-
- // Call each constructor in sequence, do some basic checks
- MockStateAwareResponse mockStateAwareResponse = new MockStateAwareResponse();
- try {
- mockStateAwareResponse.setPortletMode(PortletMode.VIEW);
- } catch (Exception ex) {
- fail("MockStateAwareResponse portlet mode set failed. Exception: " + ex);
- }
- assertEquals("PortletMode.VIEW not set ?", PortletMode.VIEW, mockStateAwareResponse.getPortletMode());
- try {
- mockStateAwareResponse.setPortletMode(PortletMode.EDIT);
- } catch (Exception ex) {
- fail("MockStateAwareResponse portlet mode set failed. Exception: " + ex);
- }
- assertEquals("Portlet mode does not match set value ?", PortletMode.EDIT, mockStateAwareResponse.getPortletMode());
- try {
- mockStateAwareResponse.setWindowState(WindowState.MAXIMIZED);
- } catch (Exception ex) {
- fail("MockStateAwareResponse portlet mode set failed. Exception: " + ex);
- }
- assertEquals("Window state does not match set value ?", WindowState.MAXIMIZED, mockStateAwareResponse.getWindowState());
- final MockPortalContext mockPortalContext = new MockPortalContext();
- mockStateAwareResponse = new MockStateAwareResponse(mockPortalContext);
- assertEquals("Portal context does not match constructor-set value ?", mockPortalContext, mockStateAwareResponse.getPortalContext());
-
- assertNull("Initial event already present ?", mockStateAwareResponse.getEvent(TEST_PORTLETNAME));
- assertNull("Initial event already present ?", mockStateAwareResponse.getEvent(TEST_QNAME));
- assertNull("Initial event already present ?", mockStateAwareResponse.getEvent(TEST_DEFAULTNAMESPACE));
- assertNull("Initial event already present ?", mockStateAwareResponse.getEvent(TEST_QNAME2));
- mockStateAwareResponse.setEvent(TEST_QNAME, TEST_QNAME_VALUE);
- mockStateAwareResponse.setEvent(TEST_QNAME2, TEST_QNAME2_VALUE);
- mockStateAwareResponse.setEvent(TEST_QNAME3_STRING, TEST_QNAME3_VALUE);
- assertEquals("First event QName not set value ?", TEST_QNAME_VALUE, mockStateAwareResponse.getEvent(TEST_QNAME));
- assertEquals("Second event QName not set value ?", TEST_QNAME2_VALUE, mockStateAwareResponse.getEvent(TEST_QNAME2));
- assertEquals("Third event QName not set value ?", TEST_QNAME3_VALUE, mockStateAwareResponse.getEvent(TEST_QNAME3_STRING));
- final Iterator<QName> eventQNames = mockStateAwareResponse.getEventNames();
- assertNotNull("Event names iterator null ?", eventQNames);
- while (eventQNames.hasNext()) {
- QName currentQName = eventQNames.next();
- assertNotNull("Iterator QName entry null ?", currentQName);
- assertTrue("Iterator QName name not one of two or three expected matches ?", currentQName.getLocalPart().equals(TEST_QNAME.getLocalPart()) ||
- currentQName.getLocalPart().equals(TEST_QNAME2.getLocalPart()) ||
- currentQName.getLocalPart().equals(TEST_QNAME3_STRING));
- }
-
- mockStateAwareResponse.setRenderParameter(TEST_PARAM, TEST_PARAM_VALUE);
- mockStateAwareResponse.setRenderParameter(TEST_PARAM2, TEST_PARAM_ARRAYVALUE);
- assertEquals("Portal test render parameter value not as expected ?", TEST_PARAM_VALUE, mockStateAwareResponse.getRenderParameter(TEST_PARAM));
- assertEquals("Portal test render parameter value not as expected ?", TEST_PARAM_ARRAYVALUE[0], mockStateAwareResponse.getRenderParameter(TEST_PARAM2));
- final Iterator<String> renderParameterNames = mockStateAwareResponse.getRenderParameterNames();
- assertNotNull("Render parameter names iterator null ?", renderParameterNames);
- while (renderParameterNames.hasNext()) {
- String currentParameter = renderParameterNames.next();
- assertNotNull("Iterator parameter entry null ?", currentParameter);
- assertTrue("Iterator parameter name not one of two or three expected matches ?", currentParameter.equals(TEST_PARAM) ||
- currentParameter.equals(TEST_PARAM2) ||
- currentParameter.equals(TEST_PARAM3));
- }
- final String[] renderParameterValuesParam2 = mockStateAwareResponse.getRenderParameterValues(TEST_PARAM2);
- assertArrayEquals("Render parameter value2 not as expected ?", TEST_PARAM_ARRAYVALUE, renderParameterValuesParam2);
- final Map<String, String[]> renderParametersMap = new LinkedHashMap<>();
- renderParametersMap.put(TEST_PARAM3, TEST_PARAM_ARRAYVALUE2);
- mockStateAwareResponse.setRenderParameters(renderParametersMap);
- assertNull("Portal test render parameter value not cleared as expected ?", mockStateAwareResponse.getRenderParameter(TEST_PARAM));
- assertNull("Portal test render parameter value not cleared as expected ?", mockStateAwareResponse.getRenderParameter(TEST_PARAM2));
- assertEquals("Portal test render parameter map value not as expected ?", renderParametersMap, mockStateAwareResponse.getRenderParameterMap());
- }
-
- public void testServletWrappingPortletContext() {
- final String TEST_ATTRIBUTE = "TEST_ATTRIBUTE";
- final String TEST_ATTRIBUTE_VALUE = "Attribute_Value_1";
- final String TEST_ATTRIBUTE2 = "TEST_ATTRIBUTE2";
- final String TEST_ATTRIBUTE_VALUE2 = "Attribute_Value_2";
- final String TEST_INITPARAM = "TEST_INITPARAM";
- final String TEST_INITPARAM2 = "TEST_INITPARAM2";
-
- // Call each constructor in sequence, do some basic checks
- final MockServletContext mockServletContext = new MockServletContext();
- final ServletWrappingPortletContext servletWrappingPortletContext = new ServletWrappingPortletContext(mockServletContext);
- assertNotNull("ServletWrappingPortletContext serverInfo null ?", servletWrappingPortletContext.getServerInfo());
- assertNull("ServletWrappingPortletContext PortletRequestDispatcher not null (illegal prefix) ?", servletWrappingPortletContext.getRequestDispatcher("IllegalPrefix"));
- assertNull("ServletWrappingPortletContext PortletRequestDispatcher not null ?", servletWrappingPortletContext.getRequestDispatcher("/"));
- assertNotNull("ServletWrappingPortletContext resource stream for / null ?", servletWrappingPortletContext.getResourceAsStream("/"));
- assertNull("ServletWrappingPortletContext resource stream for /ThisDoesNotExist not null ?", servletWrappingPortletContext.getResourceAsStream("/ThisDoesNotExist"));
- assertTrue("ServletWrappingPortletContext major version not >= 2 ?", servletWrappingPortletContext.getMajorVersion() >= 2);
- assertTrue("ServletWrappingPortletContext minor version not >= 0 ?", servletWrappingPortletContext.getMajorVersion() >= 0);
- try {
- assertNull("ServletWrappingPortletContext MIME type for / not null ?", servletWrappingPortletContext.getMimeType("/"));
- } catch (NoClassDefFoundError ncdfe) {
- // If compiled with Spring 4.x the MockServletContext has a dependency on javax.activation. This will cause a runtime failure running under JDK 9+ due to removal
- // of the javax.activation module. For that reason we will ignore the NoClassDefFoundError failure provided it is for the known FileTypeMap dependency.
- if (!ncdfe.getMessage().contains("javax/activation/FileTypeMap")) {
- fail("Unexpected exception: " + ncdfe);
- }
- }
- assertNotNull("ServletWrappingPortletContext real path for / null ?", servletWrappingPortletContext.getRealPath("/"));
- assertNull("ServletWrappingPortletContext real path for /ThisDoesNotExist not null ?", servletWrappingPortletContext.getRealPath("/ThisDoesNotExist"));
- assertNull("ServletWrappingPortletContext resource paths for / not null ?", servletWrappingPortletContext.getResourcePaths("/"));
- assertNull("ServletWrappingPortletContext resource paths for / null ?", servletWrappingPortletContext.getResourcePaths("/ThisDoesNotExist"));
- try {
- assertNotNull("ServletWrappingPortletContext resource URL for / null ?", servletWrappingPortletContext.getResource("/"));
- } catch (MalformedURLException mue) {
- fail("ServletWrappingPortletContext resource URL for / failed. Exception: " + mue);
- }
- try {
- assertNull("ServletWrappingPortletContext resource URL for /ThisDoesNotExist not null ?", servletWrappingPortletContext.getResource("/ThisDoesNotExist"));
- } catch (MalformedURLException mue) {
- fail("ServletWrappingPortletContext resource URL for /ThisDoesNotExist failed. Exception: " + mue);
- }
-
- assertNull(TEST_ATTRIBUTE + " present before set ?", servletWrappingPortletContext.getAttribute(TEST_ATTRIBUTE));
- assertNull(TEST_ATTRIBUTE2 + " present before set ?", servletWrappingPortletContext.getAttribute(TEST_ATTRIBUTE2));
- servletWrappingPortletContext.setAttribute(TEST_ATTRIBUTE, TEST_ATTRIBUTE_VALUE);
- servletWrappingPortletContext.setAttribute(TEST_ATTRIBUTE2, TEST_ATTRIBUTE_VALUE2);
- assertEquals("Retrieved atribute 1 does not match set value ?", TEST_ATTRIBUTE_VALUE, servletWrappingPortletContext.getAttribute(TEST_ATTRIBUTE));
- assertEquals("Retrieved atribute 2 does not match set value ?", TEST_ATTRIBUTE_VALUE2, servletWrappingPortletContext.getAttribute(TEST_ATTRIBUTE2));
- final Enumeration<String> attributeNames = servletWrappingPortletContext.getAttributeNames();
- int attributeNameCount = 0;
- assertNotNull("Attribute names null after additions ?", attributeNames);
- assertTrue("Attribute names empty after additions ?", attributeNames.hasMoreElements());
- while (attributeNames.hasMoreElements()) {
- attributeNameCount++;
- String currentAttibuteName = attributeNames.nextElement();
- assertTrue("Attribute name not one of two or three expected matches ?", TEST_ATTRIBUTE.equals(currentAttibuteName) ||
- TEST_ATTRIBUTE2.equals(currentAttibuteName) ||
- WebUtils.TEMP_DIR_CONTEXT_ATTRIBUTE.equals(currentAttibuteName));
- }
- assertTrue("Atribute names size not 2 or 3 ?", attributeNameCount >= 2 && attributeNameCount <= 3);
-
- assertNull(TEST_INITPARAM + " present before set ?", servletWrappingPortletContext.getInitParameter(TEST_INITPARAM));
- assertNull(TEST_INITPARAM2 + " present before set ?", servletWrappingPortletContext.getInitParameter(TEST_INITPARAM));
- servletWrappingPortletContext.log("Test logging call");
- servletWrappingPortletContext.log("Test logging call", new Exception("Fake Exception"));
- assertEquals("Default portlet context name not as expected ?", "MockServletContext", servletWrappingPortletContext.getPortletContextName());
- assertFalse("Portlet runtime options not empty before set ?", servletWrappingPortletContext.getContainerRuntimeOptions().hasMoreElements());
- }
- // -------- Continue writing tests here --------------
-
- static class TestMockMultipartFile implements MultipartFile {
- private final String name;
- private final String originalFilename;
- private final String contentType;
- private final byte[] bytes;
-
- public TestMockMultipartFile(String name, String originalFilename, String contentType, byte[] bytes) {
- this.name = name;
- this.originalFilename = originalFilename;
- this.contentType = contentType;
- if (bytes != null) {
- this.bytes = Arrays.copyOf(bytes, bytes.length);
- } else {
- this.bytes = null;
- }
- }
-
- @Override
- public String getName() {
- return name;
- }
-
- @Override
- public String getOriginalFilename() {
- return this.originalFilename;
- }
-
- @Override
- public String getContentType() {
- return contentType;
- }
-
- @Override
- public boolean isEmpty() {
- return (bytes == null || bytes.length == 0);
- }
-
- @Override
- public long getSize() {
- return (bytes != null ? bytes.length : 0);
- }
-
- @Override
- public byte[] getBytes() throws IOException {
- return bytes;
- }
-
- @Override
- public InputStream getInputStream() throws IOException {
- return new ByteArrayInputStream(bytes);
- }
-
- @Override
- public void transferTo(File file) throws IOException, IllegalStateException {
- throw new UnsupportedOperationException("Not supported yet.");
- }
- }
-
- static class TetMockResourceBundle extends ResourceBundle {
-
- @Override
- protected Object handleGetObject(String key) {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- @Override
- public Enumeration<String> getKeys() {
- throw new UnsupportedOperationException("Not supported yet.");
- }
- }
-
- class TestMockPrincipal implements Principal {
-
- @Override
- public String getName() {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- @Override
- public boolean implies(Subject subject) {
- return Principal.super.implies(subject);
- }
- }
-}
diff --git a/plugins/portlet-mocks/src/test/resources/applicationContext.xml b/plugins/portlet-mocks/src/test/resources/applicationContext.xml
deleted file mode 100644
index 106fd6cf4..000000000
--- a/plugins/portlet-mocks/src/test/resources/applicationContext.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-/*
- * 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.
- */
--->
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
-
- <bean class="org.springframework.beans.factory.config.CustomScopeConfigurer">
- <property name="scopes">
- <map>
- <entry key="session">
- <bean class="org.springframework.context.support.SimpleThreadScope"/>
- </entry>
- </map>
- </property>
- </bean>
-
-</beans>
\ No newline at end of file
diff --git a/plugins/portlet-tiles/README.md b/plugins/portlet-tiles/README.md
deleted file mode 100644
index 5cff1590b..000000000
--- a/plugins/portlet-tiles/README.md
+++ /dev/null
@@ -1,2 +0,0 @@
-# Struts 2 Portlet Tiles plugin
-This plugin is deprecated, and it will be removed soon, **please do not use it**!
diff --git a/plugins/portlet-tiles/pom.xml b/plugins/portlet-tiles/pom.xml
deleted file mode 100644
index b7c9322fa..000000000
--- a/plugins/portlet-tiles/pom.xml
+++ /dev/null
@@ -1,57 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-/*
- * 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.
- */
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.struts</groupId>
- <artifactId>struts2-plugins</artifactId>
- <version>7.0.0-SNAPSHOT</version>
- </parent>
-
- <artifactId>struts2-portlet-tiles-plugin</artifactId>
- <packaging>jar</packaging>
- <name>DEPRECATED: Struts 2 Portlet Tiles Plugin - since 6.0.0</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.struts</groupId>
- <artifactId>struts2-tiles-plugin</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.struts</groupId>
- <artifactId>struts2-portlet-plugin</artifactId>
- </dependency>
- <dependency>
- <groupId>javax.portlet</groupId>
- <artifactId>portlet-api</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.easymock</groupId>
- <artifactId>easymock</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
- <properties>
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- </properties>
-</project>
diff --git a/plugins/portlet-tiles/src/main/java/org/apache/struts2/views/tiles/PortletTilesResult.java b/plugins/portlet-tiles/src/main/java/org/apache/struts2/views/tiles/PortletTilesResult.java
deleted file mode 100644
index ef1f82f76..000000000
--- a/plugins/portlet-tiles/src/main/java/org/apache/struts2/views/tiles/PortletTilesResult.java
+++ /dev/null
@@ -1,111 +0,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.
- */
-package org.apache.struts2.views.tiles;
-
-import com.opensymphony.xwork2.ActionInvocation;
-import org.apache.struts2.portlet.PortletConstants;
-import org.apache.struts2.portlet.context.PortletActionContext;
-import org.apache.struts2.result.ServletDispatcherResult;
-import org.apache.tiles.api.TilesContainer;
-import org.apache.tiles.api.TilesException;
-import org.apache.tiles.api.access.TilesAccess;
-import org.apache.tiles.request.ApplicationContext;
-import org.apache.tiles.request.Request;
-import org.apache.tiles.request.portlet.RenderPortletRequest;
-
-import javax.portlet.ActionResponse;
-import javax.portlet.PortletContext;
-import javax.portlet.RenderRequest;
-import javax.portlet.RenderResponse;
-import java.util.Map;
-
-/**
- * Dedicated Tile result to be used in Portlet environment
- *
- * WW-2749
- */
-public class PortletTilesResult extends ServletDispatcherResult {
-
- public static final String TILES_ACTION_NAME = "tilesDirect";
-
- public PortletTilesResult() {
- super();
- }
-
- public PortletTilesResult(String location) {
- super(location);
- }
-
- public void doExecute(String location, ActionInvocation invocation) throws Exception {
- if (PortletActionContext.getPhase().isAction() || PortletActionContext.getPhase().isEvent()) {
- executeActionResult(location, invocation);
- } else {
- executeRenderResult(location);
- }
- }
-
- protected void executeRenderResult(String location) throws TilesException {
- setLocation(location);
-
- PortletContext portletContext = PortletActionContext.getPortletContext();
- RenderRequest request = PortletActionContext.getRenderRequest();
- RenderResponse response = PortletActionContext.getRenderResponse();
-
- TilesContainer container = getCurrentContainer(request, portletContext);
- ApplicationContext applicationContext = container.getApplicationContext();
- Request currentRequest = new RenderPortletRequest(applicationContext, portletContext, request, response);
-
- container.render(location, currentRequest);
- }
-
- protected void executeActionResult(String location, ActionInvocation invocation) {
- ActionResponse res = PortletActionContext.getActionResponse();
-
- res.setRenderParameter(PortletConstants.ACTION_PARAM, TILES_ACTION_NAME);
-
- Map<String, Object> sessionMap = invocation.getInvocationContext().getSession();
- sessionMap.put(PortletConstants.RENDER_DIRECT_LOCATION, location);
-
- res.setRenderParameter(PortletConstants.MODE_PARAM, PortletActionContext.getRequest().getPortletMode().toString());
- }
-
- protected TilesContainer getCurrentContainer(javax.portlet.PortletRequest request, PortletContext context) {
-
- TilesContainer container = (TilesContainer) request.getAttribute(TilesAccess.CURRENT_CONTAINER_ATTRIBUTE_NAME);
-
- if (container == null) {
- container = getContainer(context);
- request.setAttribute(TilesAccess.CURRENT_CONTAINER_ATTRIBUTE_NAME, container);
- }
-
- return container;
- }
-
- protected TilesContainer getContainer(PortletContext context) {
- return getContainer(context, TilesAccess.CONTAINER_ATTRIBUTE);
- }
-
- protected TilesContainer getContainer(PortletContext context, String key) {
- if (key == null) {
- key = TilesAccess.CONTAINER_ATTRIBUTE;
- }
- return (TilesContainer) context.getAttribute(key);
- }
-
-}
diff --git a/plugins/portlet-tiles/src/main/java/org/apache/tiles/request/portlet/PortletRequest.java b/plugins/portlet-tiles/src/main/java/org/apache/tiles/request/portlet/PortletRequest.java
deleted file mode 100644
index 6946776e4..000000000
--- a/plugins/portlet-tiles/src/main/java/org/apache/tiles/request/portlet/PortletRequest.java
+++ /dev/null
@@ -1,344 +0,0 @@
-/*
- * $Id$
- *
- * 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.
- */
-package org.apache.tiles.request.portlet;
-
-import org.apache.tiles.request.AbstractClientRequest;
-import org.apache.tiles.request.ApplicationContext;
-import org.apache.tiles.request.attribute.Addable;
-import org.apache.tiles.request.collection.HeaderValuesMap;
-import org.apache.tiles.request.collection.ReadOnlyEnumerationMap;
-import org.apache.tiles.request.collection.ScopeMap;
-import org.apache.tiles.request.portlet.delegate.RequestDelegate;
-import org.apache.tiles.request.portlet.delegate.ResponseDelegate;
-import org.apache.tiles.request.portlet.extractor.HeaderExtractor;
-import org.apache.tiles.request.portlet.extractor.RequestScopeExtractor;
-import org.apache.tiles.request.portlet.extractor.SessionScopeExtractor;
-
-import javax.portlet.PortletContext;
-import javax.portlet.PortletException;
-import javax.portlet.PortletRequestDispatcher;
-import javax.portlet.PortletResponse;
-import javax.portlet.PortletSession;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.PrintWriter;
-import java.io.Writer;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-
-/**
- * Portlet-based TilesApplicationContext implementation.
- */
-public class PortletRequest extends AbstractClientRequest {
-
- /**
- * The native available scopes.
- */
- private static final List<String> SCOPES = Collections.unmodifiableList(Arrays.asList(REQUEST_SCOPE, "portletSession", "session", APPLICATION_SCOPE));
-
- /**
- * <p>The lazily instantiated <code>Map</code> of header name-value
- * combinations (immutable).</p>
- */
- private Map<String, String> header = null;
-
-
- /**
- * <p>The lazily instantiated <code>Map</code> of header name-value
- * combinations (write-only).</p>
- */
- private Addable<String> responseHeaders = null;
-
-
- /**
- * <p>The lazily instantiated <code>Map</code> of header name-values
- * combinations (immutable).</p>
- */
- private Map<String, String[]> headerValues = null;
-
- /**
- * The <code>PortletContext</code> for this application.
- */
- protected PortletContext context;
-
- /**
- * <p>The <code>PortletRequest</code> for this request.</p>
- */
- protected javax.portlet.PortletRequest request;
-
- /**
- * The delegate to get information about parameters.
- */
- protected RequestDelegate requestDelegate;
-
-
- /**
- * <p>The lazily instantiated <code>Map</code> of request scope
- * attributes.</p>
- */
- private Map<String, Object> requestScope = null;
-
-
- /**
- * <p>The <code>PortletResponse</code> for this request.</p>
- */
- protected PortletResponse response;
-
- /**
- * The delegate to get information from a response (output stream, writer, etc.).
- */
- protected ResponseDelegate responseDelegate;
-
-
- /**
- * <p>The lazily instantiated <code>Map</code> of session scope
- * attributes.</p>
- */
- private Map<String, Object> sessionScope = null;
-
- /**
- * <p>The lazily instantiated <code>Map</code> of portlet session scope
- * attributes.</p>
- */
- private Map<String, Object> portletSessionScope = null;
-
-
- /**
- * Creates a new instance of PortletTilesRequestContext.
- *
- * @param applicationContext The Tiles application context.
- * @param context The portlet context to use.
- * @param request The request object to use.
- * @param response The response object to use.
- * @param requestDelegate The request delegate.
- * @param responseDelegate The response delegate.
- */
- public PortletRequest(ApplicationContext applicationContext,
- PortletContext context, javax.portlet.PortletRequest request,
- PortletResponse response, RequestDelegate requestDelegate, ResponseDelegate responseDelegate) {
- super(applicationContext);
-
- // Save the specified Portlet API object references
- this.context = context;
- this.request = request;
- this.response = response;
- this.requestDelegate = requestDelegate;
- this.responseDelegate = responseDelegate;
- }
-
- /**
- * <p>Return the {@link PortletRequest} for this context.</p>
- *
- * @return The used portlet request.
- */
- public javax.portlet.PortletRequest getRequest() {
- return (this.request);
- }
-
- /**
- * Returns the portlet context.
- *
- * @return The portlet context.
- */
- public PortletContext getPortletContext() {
- return context;
- }
-
- /**
- * {@inheritDoc}
- */
- public Map<String, String> getHeader() {
- if ((header == null) && (request != null)) {
- header = new ReadOnlyEnumerationMap<>(new HeaderExtractor(request, null));
- }
- return (header);
- }
-
- /**
- * {@inheritDoc}
- */
- public Addable<String> getResponseHeaders() {
- if ((responseHeaders == null) && (request != null)) {
- responseHeaders = new HeaderExtractor(null, response);
- }
- return (responseHeaders);
- }
-
- /**
- * {@inheritDoc}
- */
- public Map<String, String[]> getHeaderValues() {
- if ((headerValues == null) && (request != null)) {
- headerValues = new HeaderValuesMap(new HeaderExtractor(request, response));
- }
- return (headerValues);
- }
-
- /**
- * {@inheritDoc}
- */
- public Map<String, Object> getRequestScope() {
- if ((requestScope == null) && (request != null)) {
- requestScope = new ScopeMap(new RequestScopeExtractor(request));
- }
- return (requestScope);
- }
-
- /**
- * {@inheritDoc}
- */
- public Map<String, Object> getSessionScope() {
- if ((sessionScope == null) && (request != null)) {
- sessionScope = new ScopeMap(new SessionScopeExtractor(request,
- PortletSession.APPLICATION_SCOPE));
- }
- return (sessionScope);
- }
-
- /**
- * {@inheritDoc}
- */
- public Map<String, Object> getPortletSessionScope() {
- if ((portletSessionScope == null) && (request != null)) {
- portletSessionScope = new ScopeMap(new SessionScopeExtractor(
- request, PortletSession.APPLICATION_SCOPE));
- }
- return (portletSessionScope);
- }
-
- @Override
- public List<String> getAvailableScopes() {
- return SCOPES;
- }
-
- /**
- * {@inheritDoc}
- */
- public Locale getRequestLocale() {
- return request.getLocale();
- }
-
- @Override
- public Map<String, String> getParam() {
- return requestDelegate.getParam();
- }
-
- @Override
- public Map<String, String[]> getParamValues() {
- return requestDelegate.getParamValues();
- }
-
- /**
- * {@inheritDoc}
- */
- public boolean isUserInRole(String role) {
- return request.isUserInRole(role);
- }
-
- @Override
- public OutputStream getOutputStream() throws IOException {
- return responseDelegate.getOutputStream();
- }
-
- @Override
- public PrintWriter getPrintWriter() throws IOException {
- return responseDelegate.getPrintWriter();
- }
-
- @Override
- public Writer getWriter() throws IOException {
- return responseDelegate.getWriter();
- }
-
- @Override
- public boolean isResponseCommitted() {
- return responseDelegate.isResponseCommitted();
- }
-
- @Override
- public void setContentType(String contentType) {
- responseDelegate.setContentType(contentType);
- }
-
- /**
- * {@inheritDoc}
- */
- public void doForward(String path) throws IOException {
- if (responseDelegate.isResponseCommitted()) {
- doInclude(path);
- return;
- }
-
- try {
- PortletRequestDispatcher rd = getPortletContext()
- .getRequestDispatcher(path);
-
- if (rd == null) {
- throw new IOException(
- "No portlet request dispatcher returned for path '"
- + path + "'");
- }
-
- rd.forward(request, response);
- } catch (PortletException e) {
- throw new IOException("PortletException while including path '"
- + path + "'.", e);
- }
- }
-
- /**
- * {@inheritDoc}
- */
- public void doInclude(String path) throws IOException {
- try {
- PortletRequestDispatcher rd = getPortletContext()
- .getRequestDispatcher(path);
-
- if (rd == null) {
- throw new IOException(
- "No portlet request dispatcher returned for path '"
- + path + "'");
- }
-
- rd.include(request, response);
- } catch (PortletException e) {
- throw new IOException("PortletException while including path '"
- + path + "'.", e);
- }
- }
-
- @Override
- public Map<String, Object> getContext(String scope) {
- if (REQUEST_SCOPE.equals(scope)) {
- return getRequestScope();
- } else if ("session".equals(scope)) {
- return getSessionScope();
- } else if ("portletSession".equals(scope)) {
- return getPortletSessionScope();
- } else if (APPLICATION_SCOPE.equals(scope)) {
- return getApplicationScope();
- }
- throw new IllegalArgumentException(scope + " does not exist. Call getAvailableScopes() first to check.");
- }
-}
diff --git a/plugins/portlet-tiles/src/main/java/org/apache/tiles/request/portlet/RenderPortletRequest.java b/plugins/portlet-tiles/src/main/java/org/apache/tiles/request/portlet/RenderPortletRequest.java
deleted file mode 100644
index ea22c38a2..000000000
--- a/plugins/portlet-tiles/src/main/java/org/apache/tiles/request/portlet/RenderPortletRequest.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * $Id$
- *
- * 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.
- */
-package org.apache.tiles.request.portlet;
-
-import org.apache.tiles.request.ApplicationContext;
-import org.apache.tiles.request.portlet.delegate.MimeResponseDelegate;
-import org.apache.tiles.request.portlet.delegate.PortletRequestDelegate;
-
-import javax.portlet.PortletContext;
-import javax.portlet.RenderRequest;
-import javax.portlet.RenderResponse;
-
-/**
- * Portlet request for a {@link RenderRequest}.
- */
-public class RenderPortletRequest extends PortletRequest {
-
- /**
- * Constructor.
- *
- * @param applicationContext The application context.
- * @param context The portlet context.
- * @param request The portlet request.
- * @param response The portlet response.
- */
- public RenderPortletRequest(ApplicationContext applicationContext, PortletContext context, RenderRequest request, RenderResponse response) {
- super(applicationContext, context, request, response, new PortletRequestDelegate(request), new MimeResponseDelegate(response));
- }
-}
diff --git a/plugins/portlet-tiles/src/main/java/org/apache/tiles/request/portlet/delegate/MimeResponseDelegate.java b/plugins/portlet-tiles/src/main/java/org/apache/tiles/request/portlet/delegate/MimeResponseDelegate.java
deleted file mode 100644
index 347873cf1..000000000
--- a/plugins/portlet-tiles/src/main/java/org/apache/tiles/request/portlet/delegate/MimeResponseDelegate.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * $Id$
- *
- * 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.
- */
-package org.apache.tiles.request.portlet.delegate;
-
-import javax.portlet.MimeResponse;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.PrintWriter;
-import java.io.Writer;
-
-/**
- * Response delegate in case of {@link MimeResponse}.
- */
-public class MimeResponseDelegate implements ResponseDelegate {
-
- /**
- * The response.
- */
- private final MimeResponse response;
-
- /**
- * Constructor.
- *
- * @param response The response.
- */
- public MimeResponseDelegate(MimeResponse response) {
- this.response = response;
- }
-
- /** {@inheritDoc} */
- public OutputStream getOutputStream() throws IOException {
- return response.getPortletOutputStream();
- }
-
- /** {@inheritDoc} */
- public PrintWriter getPrintWriter() throws IOException {
- return response.getWriter();
- }
-
- /** {@inheritDoc} */
- public Writer getWriter() throws IOException {
- return response.getWriter();
- }
-
- /** {@inheritDoc} */
- public boolean isResponseCommitted() {
- return response.isCommitted();
- }
-
- /** {@inheritDoc} */
- public void setContentType(String contentType) {
- response.setContentType(contentType);
- }
-}
diff --git a/plugins/portlet-tiles/src/main/java/org/apache/tiles/request/portlet/delegate/PortletRequestDelegate.java b/plugins/portlet-tiles/src/main/java/org/apache/tiles/request/portlet/delegate/PortletRequestDelegate.java
deleted file mode 100644
index e5683d5a0..000000000
--- a/plugins/portlet-tiles/src/main/java/org/apache/tiles/request/portlet/delegate/PortletRequestDelegate.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * $Id$
- *
- * 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.
- */
-package org.apache.tiles.request.portlet.delegate;
-
-import org.apache.tiles.request.collection.ReadOnlyEnumerationMap;
-import org.apache.tiles.request.portlet.extractor.ParameterExtractor;
-
-import javax.portlet.PortletRequest;
-import java.util.Map;
-
-/**
- * Request delegate in case of simple Portlet request.
- */
-public class PortletRequestDelegate implements RequestDelegate {
-
- /**
- * The request.
- */
- private final PortletRequest request;
-
- /**
- * <p>The lazily instantiated <code>Map</code> of request
- * parameter name-value.</p>
- */
- private Map<String, String> param = null;
-
- /**
- * <p>The lazily instantiated <code>Map</code> of request
- * parameter name-values.</p>
- */
- private Map<String, String[]> paramValues = null;
-
- /**
- * Constructor.
- *
- * @param request The request.
- */
- public PortletRequestDelegate(PortletRequest request) {
- this.request = request;
- }
-
- /**
- * {@inheritDoc}
- */
- public Map<String, String> getParam() {
- if ((param == null) && (request != null)) {
- param = new ReadOnlyEnumerationMap<>(new ParameterExtractor(request));
- }
- return (param);
- }
-
- /**
- * {@inheritDoc}
- */
- public Map<String, String[]> getParamValues() {
- if ((paramValues == null) && (request != null)) {
- paramValues = request.getParameterMap();
- }
- return (paramValues);
- }
-}
diff --git a/plugins/portlet-tiles/src/main/java/org/apache/tiles/request/portlet/delegate/RequestDelegate.java b/plugins/portlet-tiles/src/main/java/org/apache/tiles/request/portlet/delegate/RequestDelegate.java
deleted file mode 100644
index 03846cc72..000000000
--- a/plugins/portlet-tiles/src/main/java/org/apache/tiles/request/portlet/delegate/RequestDelegate.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * $Id$
- *
- * 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.
- */
-package org.apache.tiles.request.portlet.delegate;
-
-import java.util.Map;
-
-/**
- * Exposes the parameters of a portlet request, if available.
- */
-public interface RequestDelegate {
-
- /**
- * The parameters, as single values.
- *
- * @return The parameters.
- */
- Map<String, String> getParam();
-
- /**
- * The parameters, with values as array of strings.
- *
- * @return The parameters.
- */
- Map<String, String[]> getParamValues();
-}
diff --git a/plugins/portlet-tiles/src/main/java/org/apache/tiles/request/portlet/delegate/ResponseDelegate.java b/plugins/portlet-tiles/src/main/java/org/apache/tiles/request/portlet/delegate/ResponseDelegate.java
deleted file mode 100644
index 92f46cef6..000000000
--- a/plugins/portlet-tiles/src/main/java/org/apache/tiles/request/portlet/delegate/ResponseDelegate.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * $Id$
- *
- * 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.
- */
-package org.apache.tiles.request.portlet.delegate;
-
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.PrintWriter;
-import java.io.Writer;
-
-/**
- * Exposes features of a response, if they are available.
- */
-public interface ResponseDelegate {
-
- /**
- * Returns the output stream.
- *
- * @return The output stream.
- * @throws IOException If the underlying response causes a problem.
- */
- OutputStream getOutputStream() throws IOException;
-
- /**
- * Returns the print writer.
- *
- * @return The print writer.
- * @throws IOException If the underlying response causes a problem.
- */
- PrintWriter getPrintWriter() throws IOException;
-
- /**
- * Returns the writer.
- *
- * @return The writer.
- * @throws IOException If the underlying response causes a problem.
- */
- Writer getWriter() throws IOException;
-
- /**
- * Sets the content type of the response.
- *
- * @param contentType The content type.
- */
- void setContentType(String contentType);
-
- /**
- * Checks if the response is committed.
- *
- * @return <code>true</code> if the response is committed.
- */
- boolean isResponseCommitted();
-}
diff --git a/plugins/portlet-tiles/src/main/java/org/apache/tiles/request/portlet/delegate/package-info.java b/plugins/portlet-tiles/src/main/java/org/apache/tiles/request/portlet/delegate/package-info.java
deleted file mode 100644
index 5080dc3e0..000000000
--- a/plugins/portlet-tiles/src/main/java/org/apache/tiles/request/portlet/delegate/package-info.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * $Id: package-info.java 1049711 2010-12-15 21:12:00Z apetrelli $
- *
- * 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.
- */
-/**
- * Delegations to map all the different types of request and responses.
- */
-package org.apache.tiles.request.portlet.delegate;
diff --git a/plugins/portlet-tiles/src/main/java/org/apache/tiles/request/portlet/extractor/ApplicationScopeExtractor.java b/plugins/portlet-tiles/src/main/java/org/apache/tiles/request/portlet/extractor/ApplicationScopeExtractor.java
deleted file mode 100644
index 590046cff..000000000
--- a/plugins/portlet-tiles/src/main/java/org/apache/tiles/request/portlet/extractor/ApplicationScopeExtractor.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * $Id$
- *
- * 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.
- */
-package org.apache.tiles.request.portlet.extractor;
-
-import org.apache.tiles.request.attribute.AttributeExtractor;
-
-import javax.portlet.PortletContext;
-import java.util.Enumeration;
-
-/**
- * Extracts attributes from portlet application scope.
- */
-public class ApplicationScopeExtractor implements AttributeExtractor {
-
- /**
- * The portlet context.
- */
- private final PortletContext context;
-
- /**
- * Constructor.
- *
- * @param context The portlet context.
- */
- public ApplicationScopeExtractor(PortletContext context) {
- this.context = context;
- }
-
- @Override
- public void setValue(String name, Object value) {
- context.setAttribute(name, value);
- }
-
- @Override
- public void removeValue(String name) {
- context.removeAttribute(name);
- }
-
- @Override
- public Enumeration<String> getKeys() {
- return context.getAttributeNames();
- }
-
- @Override
- public Object getValue(String key) {
- return context.getAttribute(key);
- }
-}
diff --git a/plugins/portlet-tiles/src/main/java/org/apache/tiles/request/portlet/extractor/HeaderExtractor.java b/plugins/portlet-tiles/src/main/java/org/apache/tiles/request/portlet/extractor/HeaderExtractor.java
deleted file mode 100644
index 0c94fa90f..000000000
--- a/plugins/portlet-tiles/src/main/java/org/apache/tiles/request/portlet/extractor/HeaderExtractor.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * $Id$
- *
- * 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.
- */
-package org.apache.tiles.request.portlet.extractor;
-
-import org.apache.tiles.request.attribute.EnumeratedValuesExtractor;
-
-import javax.portlet.PortletRequest;
-import javax.portlet.PortletResponse;
-import java.util.Enumeration;
-
-/**
- * Extracts and puts headers in portlet requests and responses.
- */
-public class HeaderExtractor implements EnumeratedValuesExtractor {
-
- /**
- * The request.
- */
- private final PortletRequest request;
-
- /**
- * The response.
- */
- private final PortletResponse response;
-
- /**
- * Constructor.
- *
- * @param request The request.
- * @param response The response.
- */
- public HeaderExtractor(PortletRequest request, PortletResponse response) {
- this.request = request;
- this.response = response;
- }
-
- @Override
- public Enumeration<String> getKeys() {
- return request.getPropertyNames();
- }
-
- @Override
- public String getValue(String key) {
- return request.getProperty(key);
- }
-
- @Override
- public Enumeration<String> getValues(String key) {
- return request.getProperties(key);
- }
-
- @Override
- public void setValue(String key, String value) {
- response.setProperty(key, value);
- }
-}
diff --git a/plugins/portlet-tiles/src/main/java/org/apache/tiles/request/portlet/extractor/InitParameterExtractor.java b/plugins/portlet-tiles/src/main/java/org/apache/tiles/request/portlet/extractor/InitParameterExtractor.java
deleted file mode 100644
index f27fdf4f1..000000000
--- a/plugins/portlet-tiles/src/main/java/org/apache/tiles/request/portlet/extractor/InitParameterExtractor.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * $Id$
- *
- * 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.
- */
-package org.apache.tiles.request.portlet.extractor;
-
-import org.apache.tiles.request.attribute.HasKeys;
-
-import javax.portlet.PortletContext;
-import java.util.Enumeration;
-
-/**
- * Extracts init parameters from a portlet context.
- */
-public class InitParameterExtractor implements HasKeys<String> {
-
- /**
- * The portlet context.
- */
- private final PortletContext context;
-
- /**
- * Constructor.
- *
- * @param context The portlet context.
- */
- public InitParameterExtractor(PortletContext context) {
- this.context = context;
- }
-
- @Override
- public Enumeration<String> getKeys() {
- return context.getInitParameterNames();
- }
-
- @Override
- public String getValue(String key) {
- return context.getInitParameter(key);
- }
-
-}
diff --git a/plugins/portlet-tiles/src/main/java/org/apache/tiles/request/portlet/extractor/ParameterExtractor.java b/plugins/portlet-tiles/src/main/java/org/apache/tiles/request/portlet/extractor/ParameterExtractor.java
deleted file mode 100644
index e412a84c6..000000000
--- a/plugins/portlet-tiles/src/main/java/org/apache/tiles/request/portlet/extractor/ParameterExtractor.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * $Id$
- *
- * 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.
- */
-package org.apache.tiles.request.portlet.extractor;
-
-import org.apache.tiles.request.attribute.HasKeys;
-
-import javax.portlet.PortletRequest;
-import java.util.Enumeration;
-
-/**
- * Extracts parameters from a portlet request.
- */
-public class ParameterExtractor implements HasKeys<String> {
-
- /**
- * The portlet request.
- */
- private final PortletRequest request;
-
- /**
- * Constructor.
- *
- * @param request The portlet request.
- */
- public ParameterExtractor(PortletRequest request) {
- this.request = request;
- }
-
- @Override
- public Enumeration<String> getKeys() {
- return request.getParameterNames();
- }
-
- @Override
- public String getValue(String key) {
- return request.getParameter(key);
- }
-}
diff --git a/plugins/portlet-tiles/src/main/java/org/apache/tiles/request/portlet/extractor/RequestScopeExtractor.java b/plugins/portlet-tiles/src/main/java/org/apache/tiles/request/portlet/extractor/RequestScopeExtractor.java
deleted file mode 100644
index edc72bc9e..000000000
--- a/plugins/portlet-tiles/src/main/java/org/apache/tiles/request/portlet/extractor/RequestScopeExtractor.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * $Id$
- *
- * 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.
- */
-package org.apache.tiles.request.portlet.extractor;
-
-import org.apache.tiles.request.attribute.AttributeExtractor;
-
-import javax.portlet.PortletRequest;
-import java.util.Enumeration;
-
-/**
- * Extracts attributes from request scope of a portlet request.
- */
-public class RequestScopeExtractor implements AttributeExtractor {
-
- /**
- * The portlet request.
- */
- private final PortletRequest request;
-
- /**
- * Constructor.
- *
- * @param request The portlet request.
- */
- public RequestScopeExtractor(PortletRequest request) {
- this.request = request;
- }
-
- @Override
- public void setValue(String name, Object value) {
- request.setAttribute(name, value);
- }
-
- @Override
- public void removeValue(String name) {
- request.removeAttribute(name);
- }
-
- @Override
- public Enumeration<String> getKeys() {
- return request.getAttributeNames();
- }
-
- @Override
- public Object getValue(String key) {
- return request.getAttribute(key);
- }
-}
diff --git a/plugins/portlet-tiles/src/main/java/org/apache/tiles/request/portlet/extractor/SessionScopeExtractor.java b/plugins/portlet-tiles/src/main/java/org/apache/tiles/request/portlet/extractor/SessionScopeExtractor.java
deleted file mode 100644
index 9801454fa..000000000
--- a/plugins/portlet-tiles/src/main/java/org/apache/tiles/request/portlet/extractor/SessionScopeExtractor.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * $Id$
- *
- * 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.
- */
-package org.apache.tiles.request.portlet.extractor;
-
-import org.apache.tiles.request.attribute.AttributeExtractor;
-
-import javax.portlet.PortletRequest;
-import javax.portlet.PortletSession;
-import java.util.Enumeration;
-
-/**
- * Extracts attributes from the session scope of a portlet request.
- */
-public class SessionScopeExtractor implements AttributeExtractor {
-
- /**
- * The portlet request.
- */
- private final PortletRequest request;
-
- /**
- * The subscope (application or portlet).
- */
- private final int scope;
-
- /**
- * Constructor.
- *
- * @param request The request.
- * @param scope The subscope (application or portlet).
- */
- public SessionScopeExtractor(PortletRequest request, int scope) {
- this.request = request;
- if (scope != PortletSession.APPLICATION_SCOPE && scope != PortletSession.PORTLET_SCOPE) {
- throw new IllegalArgumentException("The scope must be either APPLICATION_SCOPE or PORTLET_SCOPE");
- }
- this.scope = scope;
- }
-
- @Override
- public void setValue(String name, Object value) {
- request.getPortletSession().setAttribute(name, value, scope);
- }
-
- @Override
- public void removeValue(String name) {
- PortletSession session = request.getPortletSession(false);
- if (session != null) {
- session.removeAttribute(name, scope);
- }
- }
-
- @Override
- public Enumeration<String> getKeys() {
- PortletSession session = request.getPortletSession(false);
- if (session != null) {
- return session.getAttributeNames(scope);
- }
- return null;
- }
-
- @Override
- public Object getValue(String key) {
- PortletSession session = request.getPortletSession(false);
- if (session != null) {
- return session.getAttribute(key, scope);
- }
- return null;
- }
-}
diff --git a/plugins/portlet-tiles/src/main/java/org/apache/tiles/request/portlet/extractor/StateAwareParameterExtractor.java b/plugins/portlet-tiles/src/main/java/org/apache/tiles/request/portlet/extractor/StateAwareParameterExtractor.java
deleted file mode 100644
index a14f53a7b..000000000
--- a/plugins/portlet-tiles/src/main/java/org/apache/tiles/request/portlet/extractor/StateAwareParameterExtractor.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * $Id$
- *
- * 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.
- */
-package org.apache.tiles.request.portlet.extractor;
-
-import org.apache.tiles.request.attribute.HasAddableKeys;
-
-import javax.portlet.PortletRequest;
-import javax.portlet.StateAwareResponse;
-
-/**
- * Extracts parameters from a request and allows putting render parameters in a state aware response.
- */
-public class StateAwareParameterExtractor extends ParameterExtractor implements HasAddableKeys<String> {
-
- /**
- * The portlet response.
- */
- private final StateAwareResponse response;
-
- /**
- * Constructor.
- *
- * @param request The portlet request.
- * @param response The portlet response.
- */
- public StateAwareParameterExtractor(PortletRequest request, StateAwareResponse response) {
- super(request);
- this.response = response;
- }
-
- @Override
- public void setValue(String key, String value) {
- response.setRenderParameter(key, value);
- }
-}
diff --git a/plugins/portlet-tiles/src/main/java/org/apache/tiles/request/portlet/extractor/package-info.java b/plugins/portlet-tiles/src/main/java/org/apache/tiles/request/portlet/extractor/package-info.java
deleted file mode 100644
index a37ccbb9e..000000000
--- a/plugins/portlet-tiles/src/main/java/org/apache/tiles/request/portlet/extractor/package-info.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * $Id: package-info.java 1049711 2010-12-15 21:12:00Z apetrelli $
- *
- * 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.
- */
-/**
- * Extractors to get scopes from Portlet requests.
- */
-package org.apache.tiles.request.portlet.extractor;
diff --git a/plugins/portlet-tiles/src/main/java/org/apache/tiles/request/portlet/package-info.java b/plugins/portlet-tiles/src/main/java/org/apache/tiles/request/portlet/package-info.java
deleted file mode 100644
index b9eb0d168..000000000
--- a/plugins/portlet-tiles/src/main/java/org/apache/tiles/request/portlet/package-info.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * $Id: package-info.java 1049711 2010-12-15 21:12:00Z apetrelli $
- *
- * 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.
- */
-/**
- * Support of Tiles requests to portlets.
- */
-package org.apache.tiles.request.portlet;
diff --git a/plugins/portlet-tiles/src/main/resources/LICENSE.txt b/plugins/portlet-tiles/src/main/resources/LICENSE.txt
deleted file mode 100644
index c6055ec8f..000000000
--- a/plugins/portlet-tiles/src/main/resources/LICENSE.txt
+++ /dev/null
@@ -1,174 +0,0 @@
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
diff --git a/plugins/portlet-tiles/src/main/resources/NOTICE.txt b/plugins/portlet-tiles/src/main/resources/NOTICE.txt
deleted file mode 100644
index 12fa3b83d..000000000
--- a/plugins/portlet-tiles/src/main/resources/NOTICE.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-Apache Struts
-Copyright 2000-2011 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
\ No newline at end of file
diff --git a/plugins/portlet-tiles/src/main/resources/struts-plugin.xml b/plugins/portlet-tiles/src/main/resources/struts-plugin.xml
deleted file mode 100644
index 9aa82ca5d..000000000
--- a/plugins/portlet-tiles/src/main/resources/struts-plugin.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!--
-/*
- * 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.
- */
--->
-<!DOCTYPE struts PUBLIC
- "-//Apache Software Foundation//DTD Struts Configuration 6.0//EN"
- "https://struts.apache.org/dtds/struts-6.0.dtd">
-
-<struts>
-
- <package name="struts-portlet-tiles-default" extends="struts-portlet-default">
-
- <result-types>
- <result-type name="tiles" class="org.apache.struts2.views.tiles.PortletTilesResult"/>
- </result-types>
-
- <action name="tilesDirect" class="org.apache.struts2.portlet.dispatcher.DirectRenderFromEventAction">
- <result type="tiles" name="success">${location}</result>
- </action>
-
- </package>
-
-</struts>
diff --git a/plugins/portlet-tiles/src/site/site.xml b/plugins/portlet-tiles/src/site/site.xml
deleted file mode 100644
index 54fdcf4f4..000000000
--- a/plugins/portlet-tiles/src/site/site.xml
+++ /dev/null
@@ -1,56 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-/*
- * 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.
- */
--->
-<project name="Apache Struts">
- <skin>
- <groupId>org.apache.maven.skins</groupId>
- <artifactId>maven-fluido-skin</artifactId>
- <version>${fluido-skin.version}</version>
- </skin>
- <bannerLeft>
- <name>Apache Software Foundation</name>
- <src>http://www.apache.org/images/asf-logo.gif</src>
- <href>http://www.apache.org/</href>
- </bannerLeft>
- <bannerRight>
- <name>Apache Struts</name>
- <src>http://struts.apache.org/img/struts-logo.svg</src>
- <href>http://struts.apache.org/</href>
- </bannerRight>
- <publishDate position="left"/>
- <version position="right"/>
- <body>
- <links>
- <item name="Apache" href="http://www.apache.org/"/>
- <item name="Struts" href="http://struts.apache.org/"/>
- </links>
-
- <menu ref="parent"/>
- <menu ref="reports"/>
-
- <footer>
- <![CDATA[<div class="row span12">
- Apache Struts, Struts, Apache, the Apache feather logo, and the Apache Struts project
- logos are trademarks of The Apache Software Foundation.
- </div>]]>
- </footer>
- </body>
-</project>
diff --git a/plugins/portlet-tiles/src/test/java/org/apache/tiles/request/portlet/PortletRequestTest.java b/plugins/portlet-tiles/src/test/java/org/apache/tiles/request/portlet/PortletRequestTest.java
deleted file mode 100644
index 53a6bf856..000000000
--- a/plugins/portlet-tiles/src/test/java/org/apache/tiles/request/portlet/PortletRequestTest.java
+++ /dev/null
@@ -1,424 +0,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.
- */
-package org.apache.tiles.request.portlet;
-
-import org.apache.tiles.request.ApplicationContext;
-import org.apache.tiles.request.collection.HeaderValuesMap;
-import org.apache.tiles.request.collection.ReadOnlyEnumerationMap;
-import org.apache.tiles.request.collection.ScopeMap;
-import org.apache.tiles.request.portlet.delegate.RequestDelegate;
-import org.apache.tiles.request.portlet.delegate.ResponseDelegate;
-import org.apache.tiles.request.portlet.extractor.HeaderExtractor;
-import org.junit.Before;
-import org.junit.Test;
-
-import javax.portlet.PortletContext;
-import javax.portlet.PortletException;
-import javax.portlet.PortletRequestDispatcher;
-import javax.portlet.PortletResponse;
-import javax.servlet.ServletOutputStream;
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.util.Locale;
-import java.util.Map;
-
-import static org.easymock.EasyMock.createMock;
-import static org.easymock.EasyMock.expect;
-import static org.easymock.EasyMock.expectLastCall;
-import static org.easymock.EasyMock.replay;
-import static org.easymock.EasyMock.verify;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-/**
- * Tests {@link PortletRequest}.
- */
-public class PortletRequestTest {
-
- /**
- * The application context.
- */
- private ApplicationContext applicationContext;
-
- /**
- * The portlet context.
- */
- private PortletContext portletContext;
-
- /**
- * The request.
- */
- private javax.portlet.PortletRequest request;
-
- /**
- * The response.
- */
- private PortletResponse response;
-
- /**
- * The request to test.
- */
- private PortletRequest req;
-
- /**
- * The request delegate.
- */
- private RequestDelegate requestDelegate;
-
- /**
- * The response delegate.
- */
- private ResponseDelegate responseDelegate;
-
- /**
- * Sets up the test.
- */
- @Before
- public void setUp() {
- applicationContext = createMock(ApplicationContext.class);
- portletContext = createMock(PortletContext.class);
- request = createMock(javax.portlet.PortletRequest.class);
- response = createMock(PortletResponse.class);
- requestDelegate = createMock(RequestDelegate.class);
- responseDelegate = createMock(ResponseDelegate.class);
- req = new PortletRequest(applicationContext, portletContext, request,
- response, requestDelegate, responseDelegate);
- }
-
- /**
- * Test method for {@link PortletRequest#doForward(String)}.
- *
- * @throws IOException If something goes wrong.
- * @throws PortletException If something goes wrong.
- */
- @Test
- public void testDoForward() throws PortletException, IOException {
- PortletRequestDispatcher rd = createMock(PortletRequestDispatcher.class);
-
- expect(responseDelegate.isResponseCommitted()).andReturn(false);
- expect(portletContext.getRequestDispatcher("/my/path")).andReturn(rd);
- rd.forward(request, response);
-
- replay(applicationContext, portletContext, request, response, rd);
- req.doForward("/my/path");
- verify(applicationContext, portletContext, request, response, rd);
- }
-
- /**
- * Test method for {@link PortletRequest#doForward(String)}.
- *
- * @throws IOException If something goes wrong.
- */
- @Test(expected = IOException.class)
- public void testDoForwardNoDispatcher() throws IOException {
- expect(responseDelegate.isResponseCommitted()).andReturn(false);
- expect(portletContext.getRequestDispatcher("/my/path")).andReturn(null);
-
- replay(applicationContext, request, response, portletContext, requestDelegate, responseDelegate);
- try {
- req.doForward("/my/path");
- } finally {
- verify(applicationContext, request, response, portletContext, requestDelegate, responseDelegate);
- }
- }
-
- /**
- * Test method for {@link PortletRequest#doForward(String)}.
- *
- * @throws IOException If something goes wrong.
- * @throws PortletException If something goes wrong.
- */
- @Test(expected = IOException.class)
- public void testDoForwardPortletException() throws PortletException, IOException {
- PortletRequestDispatcher rd = createMock(PortletRequestDispatcher.class);
-
- expect(responseDelegate.isResponseCommitted()).andReturn(false);
- expect(portletContext.getRequestDispatcher("/my/path")).andReturn(rd);
- rd.forward(request, response);
- expectLastCall().andThrow(new PortletException());
-
- replay(applicationContext, request, response, rd, portletContext, requestDelegate, responseDelegate);
- try {
- req.doForward("/my/path");
- } finally {
- verify(applicationContext, request, response, rd, portletContext, requestDelegate, responseDelegate);
- }
- }
-
- /**
- * Test method for {@link PortletRequest#doForward(String)}.
- *
- * @throws IOException If something goes wrong.
- * @throws PortletException If something goes wrong.
- */
- @Test
- public void testDoForwardInclude() throws PortletException, IOException {
- PortletRequestDispatcher rd = createMock(PortletRequestDispatcher.class);
-
- expect(responseDelegate.isResponseCommitted()).andReturn(true);
- expect(portletContext.getRequestDispatcher("/my/path")).andReturn(rd);
- rd.include(request, response);
-
- replay(applicationContext, request, response, rd, portletContext, requestDelegate, responseDelegate);
- req.doForward("/my/path");
- verify(applicationContext, request, response, rd, portletContext, requestDelegate, responseDelegate);
- }
-
- /**
- * Test method for {@link PortletRequest#doInclude(String)}.
- *
- * @throws IOException If something goes wrong.
- * @throws PortletException If something goes wrong.
- */
- @Test
- public void testDoInclude() throws IOException, PortletException {
- PortletRequestDispatcher rd = createMock(PortletRequestDispatcher.class);
-
- expect(portletContext.getRequestDispatcher("/my/path")).andReturn(rd);
- rd.include(request, response);
-
- replay(applicationContext, request, response, rd, portletContext, requestDelegate, responseDelegate);
- req.doInclude("/my/path");
- verify(applicationContext, request, response, rd, portletContext, requestDelegate, responseDelegate);
- }
-
- /**
- * Test method for {@link PortletRequest#doInclude(String)}.
- *
- * @throws IOException If something goes wrong.
- */
- @Test(expected = IOException.class)
- public void testDoIncludeNoDispatcher() throws IOException {
- expect(portletContext.getRequestDispatcher("/my/path")).andReturn(null);
-
- replay(applicationContext, request, response, portletContext, requestDelegate, responseDelegate);
- try {
- req.doInclude("/my/path");
- } finally {
- verify(applicationContext, request, response, portletContext, requestDelegate, responseDelegate);
- }
- }
-
- /**
- * Test method for {@link PortletRequest#doInclude(String)}.
- *
- * @throws IOException If something goes wrong.
- * @throws PortletException If something goes wrong.
- */
- @Test(expected = IOException.class)
- public void testDoIncludePortletException() throws IOException, PortletException {
- PortletRequestDispatcher rd = createMock(PortletRequestDispatcher.class);
-
- expect(portletContext.getRequestDispatcher("/my/path")).andReturn(rd);
- rd.include(request, response);
- expectLastCall().andThrow(new PortletException());
-
- replay(applicationContext, request, response, rd, portletContext, requestDelegate, responseDelegate);
- try {
- req.doInclude("/my/path");
- } finally {
- verify(applicationContext, request, response, rd, portletContext, requestDelegate, responseDelegate);
- }
- }
-
- /**
- * Test method for {@link PortletRequest#getHeader()}.
- */
- @Test
- public void testGetHeader() {
- assertTrue(req.getHeader() instanceof ReadOnlyEnumerationMap);
- }
-
- /**
- * Test method for {@link PortletRequest#getResponseHeaders()}.
- */
- @Test
- public void testGetResponseHeaders() {
- assertTrue(req.getResponseHeaders() instanceof HeaderExtractor);
- }
-
- /**
- * Test method for {@link PortletRequest#getHeaderValues()}.
- */
- @Test
- public void testGetHeaderValues() {
- assertTrue(req.getHeaderValues() instanceof HeaderValuesMap);
- }
-
- /**
- * Test method for {@link PortletRequest#getParam()}.
- */
- @Test
- public void testGetParam() {
- Map<String, String> map = createMock(Map.class);
-
- expect(requestDelegate.getParam()).andReturn(map);
-
- replay(applicationContext, request, response, portletContext, requestDelegate, responseDelegate);
- assertEquals(map, req.getParam());
- verify(applicationContext, request, response, portletContext, requestDelegate, responseDelegate);
- }
-
- /**
- * Test method for {@link PortletRequest#getParamValues()}.
- */
- @Test
- public void testGetParamValues() {
- Map<String, String[]> paramMap = createMock(Map.class);
-
- expect(requestDelegate.getParamValues()).andReturn(paramMap);
-
- replay(applicationContext, request, response, paramMap, portletContext, requestDelegate, responseDelegate);
- assertEquals(paramMap, req.getParamValues());
- verify(applicationContext, request, response, paramMap, portletContext, requestDelegate, responseDelegate);
- }
-
- /**
- * Test method for {@link PortletRequest#getRequestScope()}.
- */
- @Test
- public void testGetRequestScope() {
- assertTrue(req.getRequestScope() instanceof ScopeMap);
- }
-
- /**
- * Test method for {@link PortletRequest#getSessionScope()}.
- */
- @Test
- public void testGetSessionScope() {
- assertTrue(req.getSessionScope() instanceof ScopeMap);
- }
-
- /**
- * Test method for {@link PortletRequest#getPortletSessionScope()}.
- */
- @Test
- public void testGetPortletSessionScope() {
- assertTrue(req.getPortletSessionScope() instanceof ScopeMap);
- }
-
- /**
- * Test method for {@link PortletRequest#getOutputStream()}.
- *
- * @throws IOException If something goes wrong.
- */
- @Test
- public void testGetOutputStream() throws IOException {
- ServletOutputStream os = createMock(ServletOutputStream.class);
-
- expect(responseDelegate.getOutputStream()).andReturn(os);
-
- replay(applicationContext, request, response, os, portletContext, requestDelegate, responseDelegate);
- assertEquals(req.getOutputStream(), os);
- verify(applicationContext, request, response, os, portletContext, requestDelegate, responseDelegate);
- }
-
- /**
- * Test method for {@link PortletRequest#getWriter()}.
- *
- * @throws IOException If something goes wrong.
- */
- @Test
- public void testGetWriter() throws IOException {
- PrintWriter os = createMock(PrintWriter.class);
-
- expect(responseDelegate.getWriter()).andReturn(os);
-
- replay(applicationContext, request, response, os, portletContext, requestDelegate, responseDelegate);
- assertEquals(req.getWriter(), os);
- verify(applicationContext, request, response, os, portletContext, requestDelegate, responseDelegate);
- }
-
- /**
- * Test method for {@link PortletRequest#getPrintWriter()}.
- *
- * @throws IOException If something goes wrong.
- */
- @Test
- public void testGetPrintWriter() throws IOException {
- PrintWriter os = createMock(PrintWriter.class);
-
- expect(responseDelegate.getPrintWriter()).andReturn(os);
-
- replay(applicationContext, request, response, os, portletContext, requestDelegate, responseDelegate);
- assertEquals(req.getPrintWriter(), os);
- verify(applicationContext, request, response, os, portletContext, requestDelegate, responseDelegate);
- }
-
- /**
- * Test method for {@link PortletRequest#isResponseCommitted()}.
- */
- @Test
- public void testIsResponseCommitted() {
- expect(responseDelegate.isResponseCommitted()).andReturn(true);
-
- replay(applicationContext, request, response, portletContext, requestDelegate, responseDelegate);
- assertTrue(req.isResponseCommitted());
- verify(applicationContext, request, response, portletContext, requestDelegate, responseDelegate);
- }
-
- /**
- * Test method for {@link PortletRequest#setContentType(String)}.
- */
- @Test
- public void testSetContentType() {
- responseDelegate.setContentType("text/html");
-
- replay(applicationContext, request, response, portletContext, requestDelegate, responseDelegate);
- req.setContentType("text/html");
- verify(applicationContext, request, response, portletContext, requestDelegate, responseDelegate);
- }
-
- /**
- * Test method for {@link PortletRequest#getRequestLocale()}.
- */
- @Test
- public void testGetRequestLocale() {
- Locale locale = Locale.ITALY;
-
- expect(request.getLocale()).andReturn(locale);
-
- replay(applicationContext, request, response, portletContext, requestDelegate, responseDelegate);
- assertEquals(locale, req.getRequestLocale());
- verify(applicationContext, request, response, portletContext, requestDelegate, responseDelegate);
- }
-
- /**
- * Test method for {@link PortletRequest#getRequest()}.
- */
- @Test
- public void testGetRequest() {
- replay(applicationContext, request, response, portletContext, requestDelegate, responseDelegate);
- assertEquals(request, req.getRequest());
- verify(applicationContext, request, response, portletContext, requestDelegate, responseDelegate);
- }
-
- /**
- * Test method for {@link PortletRequest#isUserInRole(String)}.
- */
- @Test
- public void testIsUserInRole() {
- expect(request.isUserInRole("myrole")).andReturn(true);
-
- replay(applicationContext, request, response, portletContext, requestDelegate, responseDelegate);
- assertTrue(req.isUserInRole("myrole"));
- verify(applicationContext, request, response, portletContext, requestDelegate, responseDelegate);
- }
-
-}
diff --git a/plugins/portlet-tiles/src/test/java/org/apache/tiles/request/portlet/RenderPortletRequestTest.java b/plugins/portlet-tiles/src/test/java/org/apache/tiles/request/portlet/RenderPortletRequestTest.java
deleted file mode 100644
index 5bba700fb..000000000
--- a/plugins/portlet-tiles/src/test/java/org/apache/tiles/request/portlet/RenderPortletRequestTest.java
+++ /dev/null
@@ -1,69 +0,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.
- */
-package org.apache.tiles.request.portlet;
-
-import org.apache.tiles.request.ApplicationContext;
-import org.apache.tiles.request.portlet.delegate.MimeResponseDelegate;
-import org.apache.tiles.request.portlet.delegate.PortletRequestDelegate;
-import org.junit.Test;
-
-import javax.portlet.PortletContext;
-import javax.portlet.RenderRequest;
-import javax.portlet.RenderResponse;
-import java.lang.reflect.Field;
-
-import static org.easymock.EasyMock.createMock;
-import static org.easymock.EasyMock.replay;
-import static org.easymock.EasyMock.verify;
-import static org.junit.Assert.assertTrue;
-
-/**
- * Tests {@link RenderPortletRequest}.
- */
-public class RenderPortletRequestTest {
-
- /**
- * Test method for
- * {@link RenderPortletRequest#RenderPortletRequest(ApplicationContext, PortletContext,
- * RenderRequest, RenderResponse)}.
- *
- * @throws NoSuchFieldException If something goes wrong.
- * @throws SecurityException If something goes wrong.
- * @throws IllegalAccessException If something goes wrong.
- * @throws IllegalArgumentException If something goes wrong.
- */
- @Test
- public void testRenderPortletRequest() throws NoSuchFieldException, IllegalAccessException {
- ApplicationContext applicationContext = createMock(ApplicationContext.class);
- PortletContext portletContext = createMock(PortletContext.class);
- RenderRequest request = createMock(RenderRequest.class);
- RenderResponse response = createMock(RenderResponse.class);
-
- replay(applicationContext, portletContext, request, response);
- RenderPortletRequest req = new RenderPortletRequest(applicationContext,
- portletContext, request, response);
- Class<? extends RenderPortletRequest> clazz = req.getClass();
- Field field = clazz.getSuperclass().getDeclaredField("requestDelegate");
- assertTrue(field.get(req) instanceof PortletRequestDelegate);
- field = clazz.getSuperclass().getDeclaredField("responseDelegate");
- assertTrue(field.get(req) instanceof MimeResponseDelegate);
- verify(applicationContext, portletContext, request, response);
- }
-
-}
diff --git a/plugins/portlet-tiles/src/test/java/org/apache/tiles/request/portlet/delegate/MimeResponseDelegateTest.java b/plugins/portlet-tiles/src/test/java/org/apache/tiles/request/portlet/delegate/MimeResponseDelegateTest.java
deleted file mode 100644
index 25d653456..000000000
--- a/plugins/portlet-tiles/src/test/java/org/apache/tiles/request/portlet/delegate/MimeResponseDelegateTest.java
+++ /dev/null
@@ -1,132 +0,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.
- */
-package org.apache.tiles.request.portlet.delegate;
-
-import org.junit.Before;
-import org.junit.Test;
-
-import javax.portlet.MimeResponse;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.PrintWriter;
-
-import static org.easymock.EasyMock.createMock;
-import static org.easymock.EasyMock.expect;
-import static org.easymock.EasyMock.replay;
-import static org.easymock.EasyMock.verify;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-/**
- * Tests {@link MimeResponseDelegate}.
- */
-public class MimeResponseDelegateTest {
-
- /**
- * The response.
- */
- private MimeResponse response;
-
- /**
- * The delegate to test.
- */
- private MimeResponseDelegate delegate;
-
- /**
- * Sets up the test.
- */
- @Before
- public void setUp() {
- response = createMock(MimeResponse.class);
- delegate = new MimeResponseDelegate(response);
- }
-
- /**
- * Test method for {@link MimeResponseDelegate#getOutputStream()}.
- *
- * @throws IOException If something goes wrong.
- */
- @Test
- public void testGetOutputStream() throws IOException {
- OutputStream os = createMock(OutputStream.class);
-
- expect(response.getPortletOutputStream()).andReturn(os);
-
- replay(response, os);
- assertEquals(os, delegate.getOutputStream());
- verify(response, os);
- }
-
- /**
- * Test method for {@link MimeResponseDelegate#getPrintWriter()}.
- *
- * @throws IOException If something goes wrong.
- */
- @Test
- public void testGetPrintWriter() throws IOException {
- PrintWriter os = createMock(PrintWriter.class);
-
- expect(response.getWriter()).andReturn(os);
-
- replay(response, os);
- assertEquals(os, delegate.getPrintWriter());
- verify(response, os);
- }
-
- /**
- * Test method for {@link MimeResponseDelegate#getWriter()}.
- *
- * @throws IOException If something goes wrong.
- */
- @Test
- public void testGetWriter() throws IOException {
- PrintWriter os = createMock(PrintWriter.class);
-
- expect(response.getWriter()).andReturn(os);
-
- replay(response, os);
- assertEquals(os, delegate.getWriter());
- verify(response, os);
- }
-
- /**
- * Test method for {@link MimeResponseDelegate#isResponseCommitted()}.
- */
- @Test
- public void testIsResponseCommitted() {
- expect(response.isCommitted()).andReturn(true);
-
- replay(response);
- assertTrue(delegate.isResponseCommitted());
- verify(response);
- }
-
- /**
- * Test method for {@link MimeResponseDelegate#setContentType(String)}.
- */
- @Test
- public void testSetContentType() {
- response.setContentType("text/html");
-
- replay(response);
- delegate.setContentType("text/html");
- verify(response);
- }
-
-}
diff --git a/plugins/portlet-tiles/src/test/java/org/apache/tiles/request/portlet/delegate/PortletRequestDelegateTest.java b/plugins/portlet-tiles/src/test/java/org/apache/tiles/request/portlet/delegate/PortletRequestDelegateTest.java
deleted file mode 100644
index ce6d4e849..000000000
--- a/plugins/portlet-tiles/src/test/java/org/apache/tiles/request/portlet/delegate/PortletRequestDelegateTest.java
+++ /dev/null
@@ -1,83 +0,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.
- */
-package org.apache.tiles.request.portlet.delegate;
-
-import org.apache.tiles.request.collection.ReadOnlyEnumerationMap;
-import org.junit.Before;
-import org.junit.Test;
-
-import javax.portlet.PortletRequest;
-import java.util.Map;
-
-import static org.easymock.EasyMock.createMock;
-import static org.easymock.EasyMock.expect;
-import static org.easymock.EasyMock.replay;
-import static org.easymock.EasyMock.verify;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-/**
- * Tests {@link PortletRequestDelegate}.
- */
-public class PortletRequestDelegateTest {
-
- /**
- * The request.
- */
- private PortletRequest request;
-
- /**
- * The delegate to test.
- */
- private PortletRequestDelegate delegate;
-
- /**
- * Sets up the test.
- */
- @Before
- public void setUp() {
- request = createMock(PortletRequest.class);
- delegate = new PortletRequestDelegate(request);
- }
-
- /**
- * Test method for {@link PortletRequestDelegate#getParam()}.
- */
- @Test
- public void testGetParam() {
- replay(request);
- assertTrue(delegate.getParam() instanceof ReadOnlyEnumerationMap);
- verify(request);
- }
-
- /**
- * Test method for {@link PortletRequestDelegate#getParamValues()}.
- */
- @Test
- public void testGetParamValues() {
- Map<String, String[]> params = createMock(Map.class);
-
- expect(request.getParameterMap()).andReturn(params);
-
- replay(request, params);
- assertEquals(params, delegate.getParamValues());
- verify(request, params);
- }
-
-}
diff --git a/plugins/portlet-tiles/src/test/java/org/apache/tiles/request/portlet/extractor/ApplicationScopeExtractorTest.java b/plugins/portlet-tiles/src/test/java/org/apache/tiles/request/portlet/extractor/ApplicationScopeExtractorTest.java
deleted file mode 100644
index 5ede84f69..000000000
--- a/plugins/portlet-tiles/src/test/java/org/apache/tiles/request/portlet/extractor/ApplicationScopeExtractorTest.java
+++ /dev/null
@@ -1,106 +0,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.
- */
-package org.apache.tiles.request.portlet.extractor;
-
-import org.apache.tiles.request.portlet.extractor.ApplicationScopeExtractor;
-import org.junit.Before;
-import org.junit.Test;
-
-import javax.portlet.PortletContext;
-import java.util.Enumeration;
-
-import static org.easymock.EasyMock.*;
-import static org.easymock.EasyMock.*;
-import static org.junit.Assert.assertEquals;
-
-/**
- * Tests {@link ApplicationScopeExtractor}.
- */
-public class ApplicationScopeExtractorTest {
-
- /**
- * The portlet context.
- */
- private PortletContext context;
-
- /**
- * The extractot to test.
- */
- private ApplicationScopeExtractor extractor;
-
- /**
- * Sets up the test.
- */
- @Before
- public void setUp() {
- context = createMock(PortletContext.class);
- extractor = new ApplicationScopeExtractor(context);
- }
-
- /**
- * Test method for {@link ApplicationScopeExtractor#setValue(String, Object)}.
- */
- @Test
- public void testSetValue() {
- context.setAttribute("attribute", "value");
-
- replay(context);
- extractor.setValue("attribute", "value");
- verify(context);
- }
-
- /**
- * Test method for {@link ApplicationScopeExtractor#removeValue(String)}.
- */
- @Test
- public void testRemoveValue() {
- context.removeAttribute("attribute");
-
- replay(context);
- extractor.removeValue("attribute");
- verify(context);
- }
-
- /**
- * Test method for {@link ApplicationScopeExtractor#getKeys()}.
- */
- @SuppressWarnings("unchecked")
- @Test
- public void testGetKeys() {
- Enumeration<String> keys = createMock(Enumeration.class);
- expect(context.getAttributeNames()).andReturn(keys);
-
- replay(context, keys);
- assertEquals(keys, extractor.getKeys());
- verify(context, keys);
- }
-
- /**
- * Test method for {@link ApplicationScopeExtractor#getValue(String)}.
- */
- @Test
- public void testGetValue() {
- expect(context.getAttribute("attribute")).andReturn("value");
-
- replay(context);
- assertEquals("value", extractor.getValue("attribute"));
- verify(context);
- }
-
-}
diff --git a/plugins/portlet-tiles/src/test/java/org/apache/tiles/request/portlet/extractor/HeaderExtractorTest.java b/plugins/portlet-tiles/src/test/java/org/apache/tiles/request/portlet/extractor/HeaderExtractorTest.java
deleted file mode 100644
index 7f5054c02..000000000
--- a/plugins/portlet-tiles/src/test/java/org/apache/tiles/request/portlet/extractor/HeaderExtractorTest.java
+++ /dev/null
@@ -1,117 +0,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.
- */
-package org.apache.tiles.request.portlet.extractor;
-
-import org.apache.tiles.request.portlet.extractor.HeaderExtractor;
-import org.junit.Before;
-import org.junit.Test;
-
-import javax.portlet.PortletRequest;
-import javax.portlet.PortletResponse;
-import java.util.Enumeration;
-
-import static org.easymock.EasyMock.*;
-import static org.easymock.EasyMock.*;
-import static org.junit.Assert.assertEquals;
-
-/**
- * Tests {@link HeaderExtractor}.
- */
-public class HeaderExtractorTest {
-
- /**
- * The request.
- */
- private PortletRequest request;
-
- /**
- * The response.
- */
- private PortletResponse response;
-
- /**
- * The extractor to test.
- */
- private HeaderExtractor extractor;
-
- /**
- * Sets up the test.
- */
- @Before
- public void setUp() {
- request = createMock(PortletRequest.class);
- response = createMock(PortletResponse.class);
- extractor = new HeaderExtractor(request, response);
- }
-
- /**
- * Test method for {@link HeaderExtractor#getKeys()}.
- */
- @SuppressWarnings("unchecked")
- @Test
- public void testGetKeys() {
- Enumeration<String> keys = createMock(Enumeration.class);
-
- expect(request.getPropertyNames()).andReturn(keys);
-
- replay(request, response, keys);
- assertEquals(keys, extractor.getKeys());
- verify(request, response, keys);
- }
-
- /**
- * Test method for {@link HeaderExtractor#getValue(String)}.
- */
- @Test
- public void testGetValue() {
- expect(request.getProperty("name")).andReturn("value");
-
- replay(request, response);
- assertEquals("value", extractor.getValue("name"));
- verify(request, response);
- }
-
- /**
- * Test method for {@link HeaderExtractor#getValues(String)}.
- */
- @SuppressWarnings("unchecked")
- @Test
- public void testGetValues() {
- Enumeration<String> keys = createMock(Enumeration.class);
-
- expect(request.getProperties("name")).andReturn(keys);
-
- replay(request, response, keys);
- assertEquals(keys, extractor.getValues("name"));
- verify(request, response, keys);
- }
-
- /**
- * Test method for {@link HeaderExtractor#setValue(String, String)}.
- */
- @Test
- public void testSetValue() {
- response.setProperty("name", "value");
-
- replay(request, response);
- extractor.setValue("name", "value");
- verify(request, response);
- }
-
-}
diff --git a/plugins/portlet-tiles/src/test/java/org/apache/tiles/request/portlet/extractor/InitParameterExtractorTest.java b/plugins/portlet-tiles/src/test/java/org/apache/tiles/request/portlet/extractor/InitParameterExtractorTest.java
deleted file mode 100644
index 66a1f9ea7..000000000
--- a/plugins/portlet-tiles/src/test/java/org/apache/tiles/request/portlet/extractor/InitParameterExtractorTest.java
+++ /dev/null
@@ -1,83 +0,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.
- */
-package org.apache.tiles.request.portlet.extractor;
-
-import org.apache.tiles.request.portlet.extractor.InitParameterExtractor;
-import org.junit.Before;
-import org.junit.Test;
-
-import javax.portlet.PortletContext;
-import java.util.Enumeration;
-
-import static org.easymock.EasyMock.*;
-import static org.easymock.EasyMock.*;
-import static org.junit.Assert.assertEquals;
-
-/**
- * Tests {@link InitParameterExtractor}.
- */
-public class InitParameterExtractorTest {
-
- /**
- * The portlet context.
- */
- private PortletContext context;
-
- /**
- * The extractor to test.
- */
- private InitParameterExtractor extractor;
-
- /**
- * Sets up the test.
- */
- @Before
- public void setUp() {
- context = createMock(PortletContext.class);
- extractor = new InitParameterExtractor(context);
- }
-
- /**
- * Test method for {@link InitParameterExtractor#getKeys()}.
- */
- @SuppressWarnings("unchecked")
- @Test
- public void testGetKeys() {
- Enumeration<String> keys = createMock(Enumeration.class);
-
- expect(context.getInitParameterNames()).andReturn(keys);
-
- replay(context, keys);
- assertEquals(keys, extractor.getKeys());
- verify(context, keys);
- }
-
- /**
- * Test method for {@link InitParameterExtractor#getValue(String)}.
- */
- @Test
- public void testGetValue() {
- expect(context.getInitParameter("name")).andReturn("value");
-
- replay(context);
- assertEquals("value", extractor.getValue("name"));
- verify(context);
- }
-
-}
diff --git a/plugins/portlet-tiles/src/test/java/org/apache/tiles/request/portlet/extractor/ParameterExtractorTest.java b/plugins/portlet-tiles/src/test/java/org/apache/tiles/request/portlet/extractor/ParameterExtractorTest.java
deleted file mode 100644
index 0e8005325..000000000
--- a/plugins/portlet-tiles/src/test/java/org/apache/tiles/request/portlet/extractor/ParameterExtractorTest.java
+++ /dev/null
@@ -1,83 +0,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.
- */
-package org.apache.tiles.request.portlet.extractor;
-
-import org.apache.tiles.request.portlet.extractor.ParameterExtractor;
-import org.junit.Before;
-import org.junit.Test;
-
-import javax.portlet.PortletRequest;
-import java.util.Enumeration;
-
-import static org.easymock.EasyMock.*;
-import static org.easymock.EasyMock.*;
-import static org.junit.Assert.assertEquals;
-
-/**
- * Tests {@link ParameterExtractor}.
- */
-public class ParameterExtractorTest {
-
- /**
- * The request.
- */
- private PortletRequest request;
-
- /**
- * The extractor to test.
- */
- private ParameterExtractor extractor;
-
- /**
- * Sets up the test.
- */
- @Before
- public void setUp() {
- request = createMock(PortletRequest.class);
- extractor = new ParameterExtractor(request);
- }
-
- /**
- * Test method for {@link ParameterExtractor#getKeys()}.
- */
- @SuppressWarnings("unchecked")
- @Test
- public void testGetKeys() {
- Enumeration<String> keys = createMock(Enumeration.class);
-
- expect(request.getParameterNames()).andReturn(keys);
-
- replay(request, keys);
- assertEquals(keys, extractor.getKeys());
- verify(request, keys);
- }
-
- /**
- * Test method for {@link ParameterExtractor#getValue(String)}.
- */
- @Test
- public void testGetValue() {
- expect(request.getParameter("name")).andReturn("value");
-
- replay(request);
- assertEquals("value", extractor.getValue("name"));
- verify(request);
- }
-
-}
diff --git a/plugins/portlet-tiles/src/test/java/org/apache/tiles/request/portlet/extractor/RequestScopeExtractorTest.java b/plugins/portlet-tiles/src/test/java/org/apache/tiles/request/portlet/extractor/RequestScopeExtractorTest.java
deleted file mode 100644
index df76a515e..000000000
--- a/plugins/portlet-tiles/src/test/java/org/apache/tiles/request/portlet/extractor/RequestScopeExtractorTest.java
+++ /dev/null
@@ -1,107 +0,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.
- */
-package org.apache.tiles.request.portlet.extractor;
-
-import org.apache.tiles.request.portlet.extractor.RequestScopeExtractor;
-import org.junit.Before;
-import org.junit.Test;
-
-import javax.portlet.PortletRequest;
-import java.util.Enumeration;
-
-import static org.easymock.EasyMock.*;
-import static org.easymock.EasyMock.*;
-import static org.junit.Assert.assertEquals;
-
-/**
- * Tests {@link RequestScopeExtractor}.
- */
-public class RequestScopeExtractorTest {
-
- /**
- * The request to test.
- */
- private PortletRequest request;
-
- /**
- * The extractor to test.
- */
- private RequestScopeExtractor extractor;
-
- /**
- * Sets up the test.
- */
- @Before
- public void setUp() {
- request = createMock(PortletRequest.class);
- extractor = new RequestScopeExtractor(request);
- }
-
- /**
- * Test method for {@link RequestScopeExtractor#setValue(String, Object)}.
- */
- @Test
- public void testSetValue() {
- request.setAttribute("name", "value");
-
- replay(request);
- extractor.setValue("name", "value");
- verify(request);
- }
-
- /**
- * Test method for {@link RequestScopeExtractor#removeValue(String)}.
- */
- @Test
- public void testRemoveValue() {
- request.removeAttribute("name");
-
- replay(request);
- extractor.removeValue("name");
- verify(request);
- }
-
- /**
- * Test method for {@link RequestScopeExtractor#getKeys()}.
- */
- @SuppressWarnings("unchecked")
- @Test
- public void testGetKeys() {
- Enumeration<String> keys = createMock(Enumeration.class);
-
- expect(request.getAttributeNames()).andReturn(keys);
-
- replay(request, keys);
- assertEquals(keys, extractor.getKeys());
- verify(request, keys);
- }
-
- /**
- * Test method for {@link RequestScopeExtractor#getValue(String)}.
- */
- @Test
- public void testGetValue() {
- expect(request.getAttribute("name")).andReturn("value");
-
- replay(request);
- assertEquals("value", extractor.getValue("name"));
- verify(request);
- }
-
-}
diff --git a/plugins/portlet-tiles/src/test/java/org/apache/tiles/request/portlet/extractor/SessionScopeExtractorTest.java b/plugins/portlet-tiles/src/test/java/org/apache/tiles/request/portlet/extractor/SessionScopeExtractorTest.java
deleted file mode 100644
index 09010ff0c..000000000
--- a/plugins/portlet-tiles/src/test/java/org/apache/tiles/request/portlet/extractor/SessionScopeExtractorTest.java
+++ /dev/null
@@ -1,154 +0,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.
- */
-package org.apache.tiles.request.portlet.extractor;
-
-import org.apache.tiles.request.portlet.extractor.SessionScopeExtractor;
-import org.junit.Before;
-import org.junit.Test;
-
-import javax.portlet.PortletRequest;
-import javax.portlet.PortletSession;
-import java.util.Enumeration;
-
-import static org.easymock.EasyMock.*;
-import static org.easymock.EasyMock.*;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
-
-/**
- * Tests {@link SessionScopeExtractor}.
- */
-public class SessionScopeExtractorTest {
-
- /**
- * The request.
- */
- private PortletRequest request;
-
- /**
- * The session.
- */
- private PortletSession session;
-
- /**
- * The scope to test.
- */
- private SessionScopeExtractor extractor;
-
- /**
- * Sets up the test.
- */
- @Before
- public void setUp() {
- request = createMock(PortletRequest.class);
- session = createMock(PortletSession.class);
- extractor = new SessionScopeExtractor(request, PortletSession.PORTLET_SCOPE);
- }
-
-
- /**
- * Tests {@link SessionScopeExtractor#SessionScopeExtractor(PortletRequest, int)}.
- */
- @Test(expected = IllegalArgumentException.class)
- public void testIllegalScope() {
- replay(request, session);
- new SessionScopeExtractor(request, 0);
- verify(request, session);
- }
-
- /**
- * Test method for {@link SessionScopeExtractor#setValue(String, Object)}.
- */
- @Test
- public void testSetValue() {
- expect(request.getPortletSession()).andReturn(session);
- session.setAttribute("name", "value", PortletSession.PORTLET_SCOPE);
-
- replay(request, session);
- extractor.setValue("name", "value");
- verify(request, session);
- }
-
- /**
- * Test method for {@link SessionScopeExtractor#removeValue(String)}.
- */
- @Test
- public void testRemoveValue() {
- expect(request.getPortletSession(false)).andReturn(session);
- session.removeAttribute("name", PortletSession.PORTLET_SCOPE);
-
- replay(request, session);
- extractor.removeValue("name");
- verify(request, session);
- }
-
- /**
- * Test method for {@link SessionScopeExtractor#getKeys()}.
- */
- @SuppressWarnings("unchecked")
- @Test
- public void testGetKeys() {
- Enumeration<String> keys = createMock(Enumeration.class);
-
- expect(request.getPortletSession(false)).andReturn(session);
- expect(session.getAttributeNames(PortletSession.PORTLET_SCOPE)).andReturn(keys);
-
- replay(request, session, keys);
- assertEquals(keys, extractor.getKeys());
- verify(request, session, keys);
- }
-
- /**
- * Test method for {@link SessionScopeExtractor#getKeys()}.
- */
- @Test
- public void testGetKeysNoSession() {
- expect(request.getPortletSession(false)).andReturn(null);
-
- replay(request, session);
- assertNull(extractor.getKeys());
- verify(request, session);
- }
-
- /**
- * Test method for {@link SessionScopeExtractor#getValue(String)}.
- */
- @Test
- public void testGetValue() {
- expect(request.getPortletSession(false)).andReturn(session);
- expect(session.getAttribute("name", PortletSession.PORTLET_SCOPE)).andReturn("value");
-
- replay(request, session);
- assertEquals("value", extractor.getValue("name"));
- verify(request, session);
- }
-
- /**
- * Test method for {@link SessionScopeExtractor#getValue(String)}.
- */
- @Test
- public void testGetValueNoSession() {
- expect(request.getPortletSession(false)).andReturn(null);
-
- replay(request, session);
- assertNull(extractor.getValue("name"));
- verify(request, session);
- }
-
-}
diff --git a/plugins/portlet-tiles/src/test/java/org/apache/tiles/request/portlet/extractor/StateAwareParameterExtractorTest.java b/plugins/portlet-tiles/src/test/java/org/apache/tiles/request/portlet/extractor/StateAwareParameterExtractorTest.java
deleted file mode 100644
index 5157b6fe6..000000000
--- a/plugins/portlet-tiles/src/test/java/org/apache/tiles/request/portlet/extractor/StateAwareParameterExtractorTest.java
+++ /dev/null
@@ -1,50 +0,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.
- */
-package org.apache.tiles.request.portlet.extractor;
-
-import org.apache.tiles.request.portlet.extractor.StateAwareParameterExtractor;
-import org.junit.Test;
-
-import javax.portlet.PortletRequest;
-import javax.portlet.StateAwareResponse;
-
-import static org.easymock.EasyMock.*;
-
-/**
- * Tests {@link StateAwareParameterExtractor}.
- */
-public class StateAwareParameterExtractorTest {
-
- /**
- * Test method for {@link StateAwareParameterExtractor#setValue(String, String)}.
- */
- @Test
- public void testSetValue() {
- PortletRequest request = createMock(PortletRequest.class);
- StateAwareResponse response = createMock(StateAwareResponse.class);
-
- response.setRenderParameter("name", "value");
-
- replay(request, response);
- StateAwareParameterExtractor extractor = new StateAwareParameterExtractor(request, response);
- extractor.setValue("name", "value");
- verify(request, response);
- }
-
-}
diff --git a/plugins/portlet/README.md b/plugins/portlet/README.md
deleted file mode 100644
index 69958edb0..000000000
--- a/plugins/portlet/README.md
+++ /dev/null
@@ -1,2 +0,0 @@
-# Struts 2 Portlet plugin
-This plugin is deprecated, and it will be removed soon, **please do not use it**!
diff --git a/plugins/portlet/pom.xml b/plugins/portlet/pom.xml
deleted file mode 100644
index db8a04f70..000000000
--- a/plugins/portlet/pom.xml
+++ /dev/null
@@ -1,101 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-/*
- * 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.
- */
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.struts</groupId>
- <artifactId>struts2-plugins</artifactId>
- <version>7.0.0-SNAPSHOT</version>
- </parent>
-
- <artifactId>struts2-portlet-plugin</artifactId>
- <packaging>jar</packaging>
- <name>DEPRECATED: Struts 2 Portlet Plugin - since 6.0.0</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.struts</groupId>
- <artifactId>struts2-portlet-mocks-plugin</artifactId>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.struts</groupId>
- <artifactId>struts2-velocity-plugin</artifactId>
- </dependency>
-
- <!-- spring-core is required for javadoc of jdk8 -->
- <!-- It is indirectly referenced by struts2-junit-plugin. -->
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-core</artifactId>
- <optional>true</optional>
- </dependency>
-
- <!-- Portlet -->
- <dependency>
- <groupId>javax.portlet</groupId>
- <artifactId>portlet-api</artifactId>
- </dependency>
-
- <dependency>
- <groupId>mockobjects</groupId>
- <artifactId>mockobjects-jdk1.3-j2ee1.3</artifactId>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.easymock</groupId>
- <artifactId>easymock</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>jmock</groupId>
- <artifactId>jmock</artifactId>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>jmock</groupId>
- <artifactId>jmock-cglib</artifactId>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>mockobjects</groupId>
- <artifactId>mockobjects-core</artifactId>
- <scope>test</scope>
- </dependency>
-
- <!-- Mocks for unit testing (by Spring) -->
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-test</artifactId>
- <optional>true</optional>
- </dependency>
- </dependencies>
-
- <properties>
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- </properties>
-
-</project>
diff --git a/plugins/portlet/src/main/java/org/apache/struts2/components/PortletUrlRenderer.java b/plugins/portlet/src/main/java/org/apache/struts2/components/PortletUrlRenderer.java
deleted file mode 100644
index 754389f83..000000000
--- a/plugins/portlet/src/main/java/org/apache/struts2/components/PortletUrlRenderer.java
+++ /dev/null
@@ -1,211 +0,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.
- */
-package org.apache.struts2.components;
-
-import com.opensymphony.xwork2.ActionInvocation;
-import com.opensymphony.xwork2.inject.Inject;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.struts2.StrutsException;
-import org.apache.struts2.dispatcher.mapper.ActionMapper;
-import org.apache.struts2.portlet.context.PortletActionContext;
-import org.apache.struts2.portlet.util.PortletUrlHelper;
-import org.apache.struts2.portlet.util.PortletUrlHelperJSR286;
-import org.apache.struts2.url.QueryStringParser;
-import org.apache.struts2.views.util.UrlHelper;
-
-import javax.portlet.PortletMode;
-import java.io.IOException;
-import java.io.Writer;
-
-/**
- * Implementation of the {@link UrlRenderer} interface that renders URLs for portlet environments.
- *
- * @see UrlRenderer
- */
-public class PortletUrlRenderer implements UrlRenderer {
-
- /**
- * The servlet renderer used when not executing in a portlet context.
- */
- private ServletUrlRenderer servletRenderer = null;
- private PortletUrlHelper portletUrlHelper = null;
-
- public PortletUrlRenderer() {
- this.servletRenderer = new ServletUrlRenderer();
-
- if (PortletActionContext.isJSR268Supported()) {
- this.portletUrlHelper = new PortletUrlHelperJSR286();
- } else {
- this.portletUrlHelper = new PortletUrlHelper();
- }
- }
-
- @Inject
- public void setActionMapper(ActionMapper actionMapper) {
- servletRenderer.setActionMapper(actionMapper);
- }
-
- @Inject
- public void setUrlHelper(UrlHelper urlHelper) {
- servletRenderer.setUrlHelper(urlHelper);
- }
-
- @Inject
- public void setQueryStringParser(QueryStringParser queryStringParser) {
- this.servletRenderer.setQueryStringParser(queryStringParser);
- }
-
- /**
- * {@inheritDoc}
- */
- public void renderUrl(Writer writer, UrlProvider urlComponent) {
- if (PortletActionContext.getPortletContext() == null) {
- servletRenderer.renderUrl(writer, urlComponent);
- return;
- }
- String result;
- if (isPortletModeChange(urlComponent, PortletActionContext.getRequest().getPortletMode())
- && StringUtils.isEmpty(urlComponent.getNamespace())) {
- String mode = urlComponent.getPortletMode();
- PortletMode portletMode = new PortletMode(mode);
- String action = urlComponent.getAction();
- if (StringUtils.isEmpty(action)) {
- action = PortletActionContext.getModeActionMap().get(portletMode).getName();
- }
- String modeNamespace = PortletActionContext.getModeNamespaceMap().get(portletMode);
- result = portletUrlHelper.buildUrl(action, modeNamespace, urlComponent.getMethod(),
- urlComponent.getParameters(), urlComponent.getPortletUrlType(), mode, urlComponent.getWindowState());
-
- } else {
- String namespace = urlComponent.determineNamespace(urlComponent.getNamespace(), urlComponent.getStack(), urlComponent.getHttpServletRequest());
- urlComponent.setNamespace(namespace);
- if (onlyActionSpecified(urlComponent)) {
- if (StringUtils.isNotEmpty(urlComponent.getAction())) {
- String action = urlComponent.findString(urlComponent.getAction());
- result = portletUrlHelper.buildUrl(action, urlComponent.getNamespace(), urlComponent.getMethod(),
- urlComponent.getParameters(), urlComponent.getPortletUrlType(), urlComponent.getPortletMode(), urlComponent.getWindowState());
- } else {
- result = portletUrlHelper.buildUrl(urlComponent.getAction(), urlComponent.getNamespace(), urlComponent.getMethod(),
- urlComponent.getParameters(), urlComponent.getPortletUrlType(), urlComponent.getPortletMode(), urlComponent.getWindowState());
- }
- } else if (onlyValueSpecified(urlComponent)) {
- result = portletUrlHelper.buildResourceUrl(urlComponent.getValue(), urlComponent.getParameters());
- } else {
- result = createDefaultUrl(urlComponent);
- }
- }
- String anchor = urlComponent.getAnchor();
- if (StringUtils.isNotEmpty(anchor)) {
- result += '#' + urlComponent.findString(anchor);
- }
-
- String var = urlComponent.getVar();
-
- if (var != null) {
- urlComponent.putInContext(result);
-
- // add to the request and page scopes as well
- urlComponent.getHttpServletRequest().setAttribute(var, result);
- } else {
- try {
- writer.write(result);
- } catch (IOException e) {
- throw new StrutsException("IOError: " + e.getMessage(), e);
- }
- }
- }
-
- boolean isPortletModeChange(UrlProvider urlComponent, PortletMode currentMode) {
- if (StringUtils.isNotEmpty(urlComponent.getPortletMode())) {
- PortletMode newPortletMode = new PortletMode(urlComponent.getPortletMode());
- return !(newPortletMode.equals(currentMode));
- }
- return false;
- }
-
- private String createDefaultUrl(UrlProvider urlComponent) {
- ActionInvocation ai = urlComponent.getStack().getActionContext().getActionInvocation();
- String action = ai.getProxy().getActionName();
- return portletUrlHelper.buildUrl(action, urlComponent.getNamespace(), urlComponent.getMethod(), urlComponent.getParameters(),
- urlComponent.getPortletUrlType(), urlComponent.getPortletMode(), urlComponent.getWindowState());
- }
-
- private boolean onlyValueSpecified(UrlProvider urlComponent) {
- return urlComponent.getValue() != null && urlComponent.getAction() == null;
- }
-
- private boolean onlyActionSpecified(UrlProvider urlComponent) {
- return urlComponent.getValue() == null && urlComponent.getAction() != null;
- }
-
- /**
- * {@inheritDoc}
- */
- public void renderFormUrl(Form formComponent) {
- if (PortletActionContext.getPortletContext() == null) {
- servletRenderer.renderFormUrl(formComponent);
- return;
- }
- String namespace = formComponent.determineNamespace(formComponent.namespace, formComponent.getStack(),
- formComponent.request);
- String action;
- if (formComponent.action != null) {
- action = formComponent.findString(formComponent.action);
- } else {
- ActionInvocation ai = formComponent.getStack().getActionContext().getActionInvocation();
- action = ai.getProxy().getActionName();
- }
-
- String type = "action";
- if (StringUtils.isNotEmpty(formComponent.method)) {
... 9779 lines suppressed ...