Oscar Scholten pushed to branch release/2.2 at cms-community / hippo-testsuite


Commits:
a0f6ccf9 by Oscar Scholten at 2017-09-21T11:32:54+02:00
HSTTWO-4136 Add test mechanism for URI encoding

(cherry picked from commit 0524e697799dd40bd8eeac80f96f8cdb56c0d436)

- - - - -
dbe4b33c by Oscar Scholten at 2017-09-21T12:19:03+02:00
HSTTWO-1003 Bump release version

- - - - -


4 changed files:

- components/src/main/java/org/hippoecm/hst/demo/components/Home.java
- content/src/main/resources/hstconfiguration/demosite/templates.xml
- pom.xml
- + site/src/main/webapp/WEB-INF/hst-config.properties


Changes:

=====================================
components/src/main/java/org/hippoecm/hst/demo/components/Home.java
=====================================
--- a/components/src/main/java/org/hippoecm/hst/demo/components/Home.java
+++ b/components/src/main/java/org/hippoecm/hst/demo/components/Home.java
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2008-2013 Hippo B.V. (http://www.onehippo.com)
+ *  Copyright 2008-2017 Hippo B.V. (http://www.onehippo.com)
  * 
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
@@ -15,6 +15,8 @@
  */
 package org.hippoecm.hst.demo.components;
 
+import java.util.Map;
+
 import org.hippoecm.hst.component.support.bean.BaseHstComponent;
 import org.hippoecm.hst.configuration.hosting.Mount;
 import org.hippoecm.hst.content.beans.ObjectBeanManagerException;
@@ -25,6 +27,7 @@ import org.hippoecm.hst.core.component.HstResponse;
 import org.hippoecm.hst.core.request.HstRequestContext;
 import org.hippoecm.hst.demo.channel.DemoChannelInfo;
 import org.hippoecm.hst.site.HstServices;
+import org.hippoecm.hst.util.HstRequestUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -62,9 +65,11 @@ public class Home extends BaseHstComponent {
 
         request.setAttribute("document", n);
 
-        // test parametere from mount property
+        // test parameter from mount property
         request.setAttribute("testParamFromMount", 
getComponentParameter("testParamFromMount"));
-    }
 
-
-}
\ No newline at end of file
+        // parameter to test query string parsing
+        final Map<String, String[]> parameters = 
HstRequestUtils.parseQueryString(request.getRequestContext().getServletRequest());
+        request.setAttribute("paramsMap", parameters);
+    }
+}


=====================================
content/src/main/resources/hstconfiguration/demosite/templates.xml
=====================================
--- a/content/src/main/resources/hstconfiguration/demosite/templates.xml
+++ b/content/src/main/resources/hstconfiguration/demosite/templates.xml
@@ -109,7 +109,7 @@
 RESOURCE URL: &lt;@hst.resourceURL&gt;&lt;@hst.param name="a" 
value="one"/&gt;&lt;@hst.param name="b" 
value="two"/&gt;&lt;/@hst.resourceURL&gt;&#xd;
 COMPONENT RENDERING URL: &lt;@hst.componentRenderingURL&gt;&lt;@hst.param 
name="a" value="one"/&gt;&lt;@hst.param name="b" 
value="two"/&gt;&lt;/@hst.componentRenderingURL&gt;&#xd;
 ACTION URL: &lt;@hst.actionURL&gt;&lt;@hst.param name="a" 
value="one"/&gt;&lt;@hst.param name="b" 
value="two"/&gt;&lt;/@hst.actionURL&gt;&#xd;
-LINK URL: &lt;@hst.link path="/news"&gt;&lt;@hst.param name="a" 
value="one"/&gt;&lt;@hst.param name="b" 
value="two"/&gt;&lt;/@hst.link&gt;&lt;/xmp&gt;&lt;/pre&gt;&#xd;
+LINK URL: &lt;@hst.link path="/news"&gt;&lt;@hst.param name="a" 
value="one"/&gt;&lt;@hst.param name="key-人" value="value-人"/&gt;&lt;@hst.param 
name="b" value="two"/&gt;&lt;/@hst.link&gt;&lt;/xmp&gt;&lt;/pre&gt;&#xd;
 &#xd;
     &lt;hr/&gt;&#xd;
     &lt;p&gt;Test Example HST URLs (not escaped by 
escapeXml="false")&lt;/p&gt;&#xd;
@@ -117,7 +117,13 @@ LINK URL: &lt;@hst.link path="/news"&gt;&lt;@hst.param 
name="a" value="one"/&gt;
 RESOURCE URL: &lt;@hst.resourceURL escapeXml=false&gt;&lt;@hst.param name="a" 
value="one"/&gt;&lt;@hst.param name="b" 
value="two"/&gt;&lt;/@hst.resourceURL&gt;&#xd;
 COMPONENT RENDERING URL: &lt;@hst.componentRenderingURL 
escapeXml=false&gt;&lt;@hst.param name="a" value="one"/&gt;&lt;@hst.param 
name="b" value="two"/&gt;&lt;/@hst.componentRenderingURL&gt;&#xd;
 ACTION URL: &lt;@hst.actionURL escapeXml=false&gt;&lt;@hst.param name="a" 
value="one"/&gt;&lt;@hst.param name="b" 
value="two"/&gt;&lt;/@hst.actionURL&gt;&#xd;
-LINK URL: &lt;@hst.link path="/news" escapeXml=false&gt;&lt;@hst.param 
name="a" value="one"/&gt;&lt;@hst.param name="b" 
value="two"/&gt;&lt;/@hst.link&gt;&lt;/xmp&gt;&lt;/pre&gt;&#xd;
+LINK URL: &lt;@hst.link path="/news" escapeXml=false&gt;&lt;@hst.param 
name="a" value="one"/&gt;&lt;@hst.param name="key-人" 
value="value-人"/&gt;&lt;@hst.param name="b" 
value="two"/&gt;&lt;/@hst.link&gt;&lt;/xmp&gt;&lt;/pre&gt;&#xd;
+&#xd;
+    &lt;hr/&gt;&#xd;
+    &lt;p&gt;Parameters (key=[comma separated array of values]):&lt;/p&gt;&#xd;
+    &lt;#list paramsMap?keys as key&gt;&#xd;
+        &lt;p&gt;${key}=[${paramsMap[key]!?join(",")}]&lt;/p&gt;&#xd;
+    &lt;/#list&gt;&#xd;
 &#xd;
     &lt;br/&gt;&lt;br/&gt;&#xd;
 &#xd;


=====================================
pom.xml
=====================================
--- a/pom.xml
+++ b/pom.xml
@@ -19,7 +19,7 @@
   <parent>
     <groupId>org.onehippo.cms7</groupId>
     <artifactId>hippo-cms7-release</artifactId>
-    <version>10.2.6</version>
+    <version>10.2.8-SNAPSHOT</version>
   </parent>
 
 


=====================================
site/src/main/webapp/WEB-INF/hst-config.properties
=====================================
--- /dev/null
+++ b/site/src/main/webapp/WEB-INF/hst-config.properties
@@ -0,0 +1,7 @@
+# this file is used to be able to override defaults from
+# org/hippoecm/hst/site/container/SpringComponentManager.properties
+
+# comment these out to use the same settings as v12
+# uriencoding.use.container = false
+# uriencoding.use.body.charset = false
+# uriencoding.default.charset = UTF-8



View it on GitLab: 
https://code.onehippo.org/cms-community/hippo-testsuite/compare/27c7cefb4948653febf862c467047d09eb83c36d...dbe4b33cc4b13aaad05368463bfb5c808c87ad41

---
View it on GitLab: 
https://code.onehippo.org/cms-community/hippo-testsuite/compare/27c7cefb4948653febf862c467047d09eb83c36d...dbe4b33cc4b13aaad05368463bfb5c808c87ad41
You're receiving this email because of your account on code.onehippo.org.
_______________________________________________
Hippocms-svn mailing list
Hippocms-svn@lists.onehippo.org
https://lists.onehippo.org/mailman/listinfo/hippocms-svn

Reply via email to