You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jspwiki.apache.org by ju...@apache.org on 2022/03/22 11:09:29 UTC

[jspwiki] branch master updated (d7e57a3 -> 2c59187)

This is an automated email from the ASF dual-hosted git repository.

juanpablo pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/jspwiki.git.


    from d7e57a3  2.11.3-git-03 / xss protection
     new cc59143  JSPWIKI-802: move Wiki.Snips.js to modules with specific wiki syntaxes
     new c1c6955  TemplateManager now understands resources beginning with 'engine://' as keys of Engine's wiki properties
     new 93fb684  JSPWIKI-802: load specific wiki syntax Wiki.Snips file, and then Wiki.Edit.js after it
     new f3a75eb  fix typos
     new 0a0b1b8  fix sonar issue
     new 00e65d9  update xstream version to 1.4.19 - closes #177
     new f960c13  JSPWIKI-802: load Markdown's syntax Wiki.Snips file
     new e6a85dc  update test + fix sonar issue
     new 4a52372  Explicit wiki syntax / rendering properties + fix some typos
     new ab2155b  refactor working directory checks to separate methods, fixing a couple of sonarqube issues
     new d0e0d18  Update dependencies
     new 47aebdb  Update plugin dependencies
     new d331efa  Update libraries' versions
     new 8de2acb  Update tomcat portable binaries
     new 2c59187  2.11.3-git-04

The 15 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.


Summary of changes:
 ChangeLog.md                                       |  19 +++
 LICENSE                                            |  32 ++---
 .../src/main/java/org/apache/wiki/api/Release.java |   2 +-
 .../api/engine/EngineLifecycleExtensionTest.java   |   2 +-
 jspwiki-main/pom.xml                               |  19 +++
 .../src/main/java/org/apache/wiki/WikiEngine.java  |  64 +++++-----
 .../java/org/apache/wiki/render/XHTMLRenderer.java |   2 +-
 .../java/org/apache/wiki/ui/TemplateManager.java   |  26 ++--
 .../src/main/javascript/Wiki.Snips.JSPWiki.js      |   8 +-
 .../src/main/javascript}/wro.properties            |   6 +-
 .../src/main/javascript/wro.xml                    |  10 +-
 .../src/main/resources/ini/jspwiki.properties      |  27 ++++-
 .../test/java/org/apache/wiki/WikiEngineTest.java  |  59 ++++-----
 .../org/apache/wiki/ui/TemplateManagerTest.java    |  75 ++++++++++++
 jspwiki-markdown/pom.xml                           |  23 ++++
 .../MarkdownSetupEngineLifecycleExtension.java     |   1 +
 .../src/main/javascript/Wiki.Snips.Markdown.js     | 134 ++++++++++-----------
 .../src/main/javascript}/wro.properties            |   6 +-
 .../src/main/javascript/wro.xml                    |  10 +-
 .../MarkdownSetupEngineLifecycleExtensionTest.java |   4 +-
 jspwiki-portable/pom.xml                           |   2 +-
 .../tomcat/woas.app/Contents/Java/bootstrap.jar    | Bin 34698 -> 34699 bytes
 .../tomcat/woas.app/Contents/Java/tomcat-juli.jar  | Bin 46898 -> 46895 bytes
 .../src/overlay/launchers/tomcat/woas.exe          | Bin 3656529 -> 3656699 bytes
 jspwiki-war/src/main/config/wro/wro-haddock.xml    |   5 +-
 .../src/main/scripts/wiki-edit/Wiki.Edit.js        |   2 +-
 .../webapp/templates/default/editors/plain.jsp     |   2 +
 pom.xml                                            |  10 +-
 28 files changed, 360 insertions(+), 190 deletions(-)
 copy jspwiki-war/src/main/scripts/wiki-edit/Wiki.Snips.js => jspwiki-main/src/main/javascript/Wiki.Snips.JSPWiki.js (99%)
 copy {jspwiki-war/src/main/config/wro => jspwiki-main/src/main/javascript}/wro.properties (81%)
 copy jspwiki-portable/src/overlay/woas/webapps/personal/WEB-INF/groupdatabase.xml => jspwiki-main/src/main/javascript/wro.xml (78%)
 create mode 100644 jspwiki-main/src/test/java/org/apache/wiki/ui/TemplateManagerTest.java
 rename jspwiki-war/src/main/scripts/wiki-edit/Wiki.Snips.js => jspwiki-markdown/src/main/javascript/Wiki.Snips.Markdown.js (83%)
 copy {jspwiki-war/src/main/config/wro => jspwiki-markdown/src/main/javascript}/wro.properties (81%)
 copy jspwiki-portable/src/overlay/woas/webapps/personal/WEB-INF/groupdatabase.xml => jspwiki-markdown/src/main/javascript/wro.xml (77%)

[jspwiki] 12/15: Update plugin dependencies

Posted by ju...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

juanpablo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jspwiki.git

commit 47aebdbb1e3404ad6acf96f3c8b017ef4d576b19
Author: Juan Pablo Santos Rodríguez <ju...@gmail.com>
AuthorDate: Tue Mar 22 12:07:22 2022 +0100

    Update plugin dependencies
    
    * maven-jxr-plugin to 3.2.0
    * maven-dependency-plugin to 3.3.0 (closes #178)
---
 pom.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pom.xml b/pom.xml
index b9a0215..c46c6d9 100644
--- a/pom.xml
+++ b/pom.xml
@@ -85,12 +85,12 @@
     <plugin.assembly.version>3.3.0</plugin.assembly.version>
     <plugin.clean.version>3.1.0</plugin.clean.version>
     <plugin.compiler.version>3.10.1</plugin.compiler.version>
-    <plugin.dependency.version>3.2.0</plugin.dependency.version>
+    <plugin.dependency.version>3.3.0</plugin.dependency.version>
     <plugin.enforcer.version>3.0.0</plugin.enforcer.version>
     <plugin.install.version>2.5.2</plugin.install.version>
     <plugin.jar.version>3.2.2</plugin.jar.version>
     <plugin.javadoc.version>3.3.2</plugin.javadoc.version>
-    <plugin.jxr.version>3.1.1</plugin.jxr.version>
+    <plugin.jxr.version>3.2.0</plugin.jxr.version>
     <plugin.project-info-reports.version>3.2.2</plugin.project-info-reports.version>
     <plugin.release.version>3.0.0-M5</plugin.release.version>
     <plugin.resources.version>3.2.0</plugin.resources.version>

[jspwiki] 13/15: Update libraries' versions

Posted by ju...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

juanpablo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jspwiki.git

commit d331efa3262e3653ac696be5fac4dd8567b8c387
Author: Juan Pablo Santos Rodríguez <ju...@gmail.com>
AuthorDate: Tue Mar 22 12:07:49 2022 +0100

    Update libraries' versions
---
 LICENSE | 32 ++++++++++++++++----------------
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/LICENSE b/LICENSE
index e56b576..69c0329 100644
--- a/LICENSE
+++ b/LICENSE
@@ -244,27 +244,27 @@ gson-2.9.0                                  LICENSE
 httpclient-4.5.13                           LICENSE
 httpcore-4.4.13                             LICENSE
 ion-java-1.0.2                              LICENSE
-jackson-annotations-2.12.3                  LICENSE
-jackson-core-2.12.3                         LICENSE
-jackson-databind-2.12.3                     LICENSE
-jackson-dataformat-cbor-2.12.3              LICENSE
+jackson-annotations-2.12.6                  LICENSE
+jackson-core-2.12.6                         LICENSE
+jackson-databind-2.12.6                     LICENSE
+jackson-dataformat-cbor-2.12.6              LICENSE
 jaxen-1.2.0.jar                             ./jspwiki-war/src/main/config/doc/LICENSE.jaxen
 jdom2-2.0.6.jar                             ./jspwiki-war/src/main/config/doc/LICENSE.jdom
-jmespath-java-1.12.59                       LICENSE
+jmespath-java-1.12.176                      LICENSE
 joda-time-2.8.1                             LICENSE
 jstl-1.2.jar                                LICENSE
 log4j-1.2-api-2.17.2.jar                    LICENSE
 log4j-api-2.17.2.jar                        LICENSE
 log4j-core-2.17.2.jar                       LICENSE
 log4j-slf4j-impl-2.17.2                     LICENSE
-lucene-analyzers-common-8.11.0.jar          LICENSE
-lucene-backward-codecs-8.11.0.jar           LICENSE
-lucene-core-8.11.0.jar                      LICENSE
-lucene-highlighter-8.11.0.jar               LICENSE
-lucene-memory-8.11.0.jar                    LICENSE
-lucene-queries-8.11.0.jar                   LICENSE
-lucene-queryparser-8.11.0.jar               LICENSE
-lucene-sandbox-8.11.0.jar                   LICENSE
+lucene-analyzers-common-8.11.1.jar          LICENSE
+lucene-backward-codecs-8.11.1.jar           LICENSE
+lucene-core-8.11.1.jar                      LICENSE
+lucene-highlighter-8.11.1.jar               LICENSE
+lucene-memory-8.11.1.jar                    LICENSE
+lucene-queries-8.11.1.jar                   LICENSE
+lucene-queryparser-8.11.1.jar               LICENSE
+lucene-sandbox-8.11.1.jar                   LICENSE
 mail-1.4.7.jar                              ./jspwiki-war/src/main/config/doc/LICENSE.cddl
 nekohtml-2.0.2.jar (codelibs fork)          LICENSE
 org.suigeneris.jrcs.diff-0.4.2              LICENSE
@@ -287,8 +287,8 @@ hsqldb-2.6.1.jar                            ./jspwiki-war/src/main/config/doc/LI
 sqltool-2.6.1.jar                           ./jspwiki-war/src/main/config/doc/LICENSE.hsqldb
 jetty-all-9.4.45.v20220203.jar              LICENSE
 junit-5.8.2                                 ./jspwiki-war/src/main/config/doc/LICENSE.cpl
-mockito-core-4.3.1.jar                      ./jspwiki-war/src/main/config/doc/LICENSE.mit
-selenide-6.3.4.jar                          ./jspwiki-war/src/main/config/doc/LICENSE.mit
+mockito-core-4.4.0.jar                      ./jspwiki-war/src/main/config/doc/LICENSE.mit
+selenide-6.3.5.jar                          ./jspwiki-war/src/main/config/doc/LICENSE.mit
 stripes-1.7.0-async.jar                     LICENSE
 yuicompressor-2.4.7.jar                     ./jspwiki-war/src/main/config/doc/LICENSE.yui
 
@@ -304,7 +304,7 @@ SlimBox                                     ./jspwiki-war/src/main/config/doc/LI
 
 RESOURCES                                   LICENSE FILE
 =============================================================================================================
-Apache Tomcat 9.0.59                        LICENSE
+Apache Tomcat 9.0.60                        LICENSE
 Font Awesome (CSS & LESS files)             ./jspwiki-war/src/main/config/doc/LICENSE.mit
 Font Awesome (Fonts)                        ./jspwiki-war/src/main/config/doc/LICENSE.ofl
 SilkIconSet                                 ./jspwiki-war/src/main/config/doc/LICENSE.SilkIconSet

[jspwiki] 01/15: JSPWIKI-802: move Wiki.Snips.js to modules with specific wiki syntaxes

Posted by ju...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

juanpablo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jspwiki.git

commit cc59143f48810b52fbb9c35d43f4862ce70602eb
Author: Juan Pablo Santos Rodríguez <ju...@gmail.com>
AuthorDate: Tue Mar 22 11:47:08 2022 +0100

    JSPWIKI-802: move Wiki.Snips.js to modules with specific wiki syntaxes
---
 jspwiki-main/pom.xml                               |  19 +++
 .../src/main/javascript/Wiki.Snips.JSPWiki.js      |   8 +-
 jspwiki-main/src/main/javascript/wro.properties    |  24 ++++
 jspwiki-main/src/main/javascript/wro.xml           |  28 +++++
 jspwiki-markdown/pom.xml                           |  23 ++++
 .../src/main/javascript/Wiki.Snips.Markdown.js     | 134 ++++++++++-----------
 .../src/main/javascript/wro.properties             |  24 ++++
 jspwiki-markdown/src/main/javascript/wro.xml       |  28 +++++
 jspwiki-war/src/main/config/wro/wro-haddock.xml    |   5 +-
 9 files changed, 220 insertions(+), 73 deletions(-)

diff --git a/jspwiki-main/pom.xml b/jspwiki-main/pom.xml
index 0614605..00ac75f 100644
--- a/jspwiki-main/pom.xml
+++ b/jspwiki-main/pom.xml
@@ -299,6 +299,25 @@
           </includes>
         </configuration>
       </plugin>
+
+      <plugin>
+        <groupId>ro.isdc.wro4j</groupId>
+        <artifactId>wro4j-maven-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>buildPlainEditorSyntaxJS</id>
+            <phase>prepare-package</phase>
+            <goals>
+              <goal>run</goal>
+            </goals>
+            <configuration>
+              <extraConfigFile>${project.basedir}/src/main/javascript/wro.properties</extraConfigFile>
+              <jsDestinationFolder>${project.build.outputDirectory}/META-INF/resources/plain/</jsDestinationFolder>
+              <wroFile>src/main/javascript/wro.xml</wroFile>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
     </plugins>
   </build>
 </project>
diff --git a/jspwiki-war/src/main/scripts/wiki-edit/Wiki.Snips.js b/jspwiki-main/src/main/javascript/Wiki.Snips.JSPWiki.js
similarity index 99%
copy from jspwiki-war/src/main/scripts/wiki-edit/Wiki.Snips.js
copy to jspwiki-main/src/main/javascript/Wiki.Snips.JSPWiki.js
index cf57417..43f4d6b 100644
--- a/jspwiki-war/src/main/scripts/wiki-edit/Wiki.Snips.js
+++ b/jspwiki-main/src/main/javascript/Wiki.Snips.JSPWiki.js
@@ -31,7 +31,7 @@ Wiki.DirectSnips = {
     "'" : {
         snippet: "'",
         scope: {
-            "[{" : "}]"  //plugin parameters
+            "[{" : "}]"  // plugin parameters
           }
         }
 };
@@ -138,8 +138,8 @@ Wiki.Snips = {
     fontDlg: {
         scope: { "%%(":")" },
         suggest: {
-        lback: "font-family:([^;\\)\\n\\r]*)$",
-        match:"^([^;\\)\\n\\r]*)"
+          lback: "font-family:([^;\\)\\n\\r]*)$",
+          match:"^([^;\\)\\n\\r]*)"
         },
         fontDlg: [Dialog.Font, {}]
     },
@@ -620,7 +620,7 @@ Wiki.Snips = {
                 "divider-code": "",
                     "\n{{{\n/* code block */\n{code block}\n}}}\n": "<span class='small' style='font-family:monospace;'>&lt;/&gt;</span>",
                     "\n%%prettify\n{{{\n{pretiffied code block}\n}}}/%\n": "<span class='small' style='font-family:monospace;color:green;'>&lt;/&gt;</span>",
-                    "\n%%scrollable\n{{{\n{code block}\n}}}/%\n": "&darr;&uarr;"
+                    "\n%%scrollable\n{{{\n{scrollable code block}\n}}}/%\n": "&darr;&uarr;"
                 });
             }
 
diff --git a/jspwiki-main/src/main/javascript/wro.properties b/jspwiki-main/src/main/javascript/wro.properties
new file mode 100644
index 0000000..0a5b33b
--- /dev/null
+++ b/jspwiki-main/src/main/javascript/wro.properties
@@ -0,0 +1,24 @@
+#  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.
+
+#minimizeEnabled=false
+debug=true
+
+
+preProcessors=semicolonAppender
+postProcessors=uglifyJs
+
diff --git a/jspwiki-main/src/main/javascript/wro.xml b/jspwiki-main/src/main/javascript/wro.xml
new file mode 100644
index 0000000..76603b4
--- /dev/null
+++ b/jspwiki-main/src/main/javascript/wro.xml
@@ -0,0 +1,28 @@
+<?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.
+-->
+<groups xmlns="http://www.isdc.ro/wro"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://www.isdc.ro/wro wro.xsd">
+
+  <group name="wiki-snips-jspwiki">
+    <js>/javascript/Wiki.Snips.JSPWiki.js</js>
+  </group>
+
+</groups>
\ No newline at end of file
diff --git a/jspwiki-markdown/pom.xml b/jspwiki-markdown/pom.xml
index a81ea80..bdbc58a 100644
--- a/jspwiki-markdown/pom.xml
+++ b/jspwiki-markdown/pom.xml
@@ -133,4 +133,27 @@
       <scope>test</scope>
     </dependency>
   </dependencies>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>ro.isdc.wro4j</groupId>
+        <artifactId>wro4j-maven-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>buildPlainEditorSyntaxJS</id>
+            <phase>prepare-package</phase>
+            <goals>
+              <goal>run</goal>
+            </goals>
+            <configuration>
+              <extraConfigFile>${project.basedir}/src/main/javascript/wro.properties</extraConfigFile>
+              <jsDestinationFolder>${project.build.outputDirectory}/META-INF/resources/plain/</jsDestinationFolder>
+              <wroFile>src/main/javascript/wro.xml</wroFile>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
 </project>
\ No newline at end of file
diff --git a/jspwiki-war/src/main/scripts/wiki-edit/Wiki.Snips.js b/jspwiki-markdown/src/main/javascript/Wiki.Snips.Markdown.js
similarity index 83%
rename from jspwiki-war/src/main/scripts/wiki-edit/Wiki.Snips.js
rename to jspwiki-markdown/src/main/javascript/Wiki.Snips.Markdown.js
index cf57417..6a9f757 100644
--- a/jspwiki-war/src/main/scripts/wiki-edit/Wiki.Snips.js
+++ b/jspwiki-markdown/src/main/javascript/Wiki.Snips.Markdown.js
@@ -31,7 +31,7 @@ Wiki.DirectSnips = {
     "'" : {
         snippet: "'",
         scope: {
-            "[{" : "}]"  //plugin parameters
+            "[{" : "}]()"  // plugin parameters
           }
         }
 };
@@ -62,7 +62,7 @@ Wiki.Snips = {
     // Simple shortcuts
     br: {
         key: "shift+enter",
-        snippet: "\\\\\n"
+        snippet: "&nbsp;&nbsp;\n"
     },
     hr: "\n----\n",
     lorem: "This is just some sample. Don’t even bother reading it; you will just waste your time. Why do you keep reading? Do I have to use Lorem Ipsum to stop you? OK, here goes: Lorem ipsum dolor sit amet, consectetur adipi sicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Still reading? Gosh, you’re impossible. I’ll stop here to spare you.",
@@ -70,26 +70,26 @@ Wiki.Snips = {
 
 
     // simple inline tab completion commands
-    bold:   { key: "b", snippet: "__{bold}__" },
-    italic: { key: "i", snippet: "''{italic}''" },
+    bold:   { key: "b", snippet: "**{bold}**" },
+    italic: { key: "i", snippet: "_{italic}_" },
 
-    mono:   { key: "m", snippet: "{{{monospaced text}}} " },
-    sub:    "%%sub {subscript text}/% ",
-    sup:    "%%sup {superscript text}/% ",
-    strike: "%%strike {strikethrough text}/% ",
+    mono:   { key: "m", snippet: "``monospaced text`` " },
+    sub:    "<!----> {subscript text}{.sub} ",
+    sup:    "<!----> {superscript text}{.sup} ",
+    strike: "<!----> {strikethrough text}{.strike} ",
 
     // simple block tab completion commands
-    quote:  "\n%%quote\n{Quoted text}\n/%\n",
-    dl:     "\n;{term}:definition-text ",
+    quote:  "\n> {Quoted text}\n",
+    dl:     "\n{term}\n: definition-text ",
     def: { alias: "dl" },
-    pre:    "\n{{{\n{some preformatted block}\n}}}\n",
-    code:   "\n%%prettify \n{{{\n{/* some code block */}\n}}}\n/%\n",
-    table:  "\n||{heading-1} ||heading-2\n|cell11     |cell12\n|cell21     |cell22\n",
+    pre:    "\n```\n{some preformatted block}\n```\n",
+    code:   "\n```\n{/* some code block */}\n```{.prettify}\n/%\n",
+    table:  "\n|{heading-1} |heading-2\n|--- |---\n|cell11     |cell12\n|cell21     |cell22\n",
 
     me: { alias: "sign"},
     sign: function(){
         var name = Wiki.UserName || 'UserName';
-        return "\n%%signature\n" + name + ", "+ new Date().toISOString() + "\n/%\n";
+        return "\n<!----> " + name + ", "+ new Date().toISOString() + "{.signature}\n";
     },
 
     now: { alias: "date" },
@@ -104,50 +104,50 @@ Wiki.Snips = {
 
     tabs: {
         nScope: {
-            "%%(":")",
-            "%%tabs":"/%"
+            "\n":" { style='\\w+' }",
+            "\n":"{.tabs}"
         },
-        snippet:"%%tabs\n!tab-1\ntab-1 content 1\n!tab-2\ntab-2 content \n/%\n "
+        snippet:"\n\n!tab-1\ntab-1 content 1\n!tab-2\ntab-2 content \n{.tabs}\n "
     },
 
     insertPageDlg:{
-        scope: { "[{InsertPage":"}]" },
+        scope: { "[{InsertPage":"}]()" },
         suggest: { lback:"page='([^']*)'?$", match: "^([^']*)" },
         insertPageDlg: Wiki.pageDialog("Insert Page", "/search/suggestions")
     },
 
-    img: "\n[{Image src='{img.jpg}' width='400px' height='300px' align='left' }]\n ",
+    img: "\n[{Image src='{img.jpg}' width='400px' height='300px' align='left' }]()\n ",
 
     imgSrcDlg:{
-        scope: { "[{Image":"}]" },
+        scope: { "[{Image":"}]()" },
         suggest: { lback:"src='([^']*)'?$", match: "^([^']*)" },
         imgSrcDlg: Wiki.pageDialog("Image", "/search/suggestions")
     },
 
     imgAlignDlg: {
-        scope: { "[{Image":"}]" },
+        scope: { "[{Image":"}]()" },
         suggest: "align='\\w+'",
         imgAlignDlg: "left|center|right"
     },
 
     font: {
-        nScope: { "%%(":")" },
-        snippet: "%%(font-family:{font};) body /% "
+        nScope: { "<!---->":" { style='font-family:\\w+;' }" },
+        snippet: "\n body { style='font-family:'{font};' } "
     },
 
     fontDlg: {
-        scope: { "%%(":")" },
+        scope: { "<!---->":" { style='font-family:\\w+;' }" },
         suggest: {
-        lback: "font-family:([^;\\)\\n\\r]*)$",
-        match:"^([^;\\)\\n\\r]*)"
+          lback: "font-family:([^;\\)\\n\\r]*)$",
+          match:"^([^;\\)\\n\\r]*)"
         },
         fontDlg: [Dialog.Font, {}]
     },
 
-    color: "%%(color:{#000000}; background:#ffffff;) ${some text} /%",
+    color: "<!----> ${some text} { style='color:{#000000}; background:#ffffff;' }'",
 
     colorDlg: {
-        scope: { '%%(': ')' },
+        scope: { '<!---->': " { style='color:\\w+;' }" },
         //  /\B#(?:[0-9a-f]{3}){1,2}\b/i
         suggest:"\B#(?:[0-9a-f]{3}){1,2}\b",
         colorDlg: [ Dialog.Color , {} ]
@@ -166,9 +166,9 @@ Wiki.Snips = {
         }]
     },
 
-    icon: "%%icon-{!search} /%",
+    icon: "<!----> {.icon-{!search} }",
     iconDlg: {
-        scope: { "%%":"/%" },
+        scope: { "<!---->":"{.icon-\\w+ }" },
         suggest: "icon-\\S*",
         iconDlg: [Dialog.Selection, {
         cssClass:".dialog-horizontal.icons",
@@ -186,7 +186,7 @@ Wiki.Snips = {
     },
 
     textDlg: {
-        scope: { "%%":" " },
+        scope: { "{.":"}" },
         suggest: {
             lback: /(:?%%|\.)text-(\w*)$/,
             //match: "^default|success|info|warning|danger|capitalize|lowercase|uppercase|smallcaps"
@@ -222,7 +222,7 @@ Wiki.Snips = {
     },
 
     contextBG: {
-        scope: { "%%":" " },
+        scope: { "{.":"}" },
         suggest: {
             //lback: /%%(default|success|info|warning|error)$/,
             //match: /^\w+/
@@ -242,7 +242,7 @@ Wiki.Snips = {
     },
 
     bgColorDlg: {
-        scope: { "%%":" " },
+        scope: { "{.":"}" },
         suggest: {
         lback: /(:?%%|\.)bg-(\w*)$/,
         match: /^\w*/
@@ -280,7 +280,7 @@ Wiki.Snips = {
     },
 
     bgDlg: {
-        scope: { "%%bg.":" " },
+        scope: { "{.bg.":"}" },
         suggest: {
         lback: /(:%%bg\.|\.?)(\w*)$/,
         //match: "^default|success|info|warning|danger"
@@ -307,7 +307,7 @@ Wiki.Snips = {
     },
 
     labelDlg: {
-        scope: { "%%":"/%" },
+        scope: { "{.":"}" },
         suggest: {
         lback: /%%label-(\w*)$/,
         //match: "^default|success|info|warning|danger"
@@ -327,7 +327,7 @@ Wiki.Snips = {
     },
 
     listDlg: {
-        scope: { "%%list-":"/%" },
+        scope: { "{.list-":"}" },
         suggest: {lback: "list-(?:[\\w-]+-)?(\\w*)$", match: "^\\w*" },
         listDlg: [Dialog.Selection, {
         cssClass:".dialog-horizontal",
@@ -336,7 +336,7 @@ Wiki.Snips = {
     },
 
     tableDlg: {
-        scope: { "%%table-":"/%" },
+        scope: { "{.table-":"}" },
         suggest: {lback: "table-(?:[\\w-]+-)?(\\w*)$", match: "^\\w*" },
         tableDlg: [Dialog.Selection, {
         cssClass:".dialog-horizontal",
@@ -345,7 +345,7 @@ Wiki.Snips = {
     },
 
     cssDlg: {
-        scope: { "%%":" " },
+        scope: { "{.":"}" },
         suggest: {lback:"(:?%%|\\.)([\\da-zA-Z-_]*)$", match:"^[\\da-zA-Z-_]*"},
         cssDlg: [Dialog.Selection, {
         caption: "dialog.styles".localize(),
@@ -392,7 +392,7 @@ Wiki.Snips = {
     link: {
         key:'l',
         wysiwyg:'createlink',
-        snippet: "[description|{pagename or url}|link-attributes] "
+        snippet: "[description](pagename or url){link-attributes} "
     },
 
 
@@ -444,17 +444,17 @@ Wiki.Snips = {
 
 
     variableDlg: {
-        scope:{ '[{$':'}]'},
+        scope:{ '[{$':'}]()'},
         suggest: "\\w+",
         variableDlg: "applicationname|baseurl|encoding|inlinedimages|interwikilinks|jspwikiversion|loginstatus|uptime|pagename|pageprovider|pageproviderdescription|page-styles|requestcontext|totalpages|username"
     },
 
     // Page access rights
     allow: { alias: "acl" },
-    acl: "\n[{ALLOW {permission} principal }]\n",
+    acl: "\n[{ALLOW {permission} principal }]()\n",
 
     permission: {
-        scope:{ '[{ALLOW':'}]'},
+        scope:{ '[{ALLOW':'}]()'},
         suggest: { lback:"ALLOW (\\w*)$", match:"^\\w+" },
         permission: [Dialog.Selection, {
             caption: "dialog.permission".localize(),
@@ -463,7 +463,7 @@ Wiki.Snips = {
         }]
     },
     principal: {
-        scope:{ '[{ALLOW':'}]'},
+        scope:{ '[{ALLOW':'}]()'},
         suggest: { lback:"ALLOW \\w+ (?:[\\w,]+,)?(\\w*)$", match:"^\\w*" },
 
         principal: [ Dialog.Selection, {
@@ -473,7 +473,7 @@ Wiki.Snips = {
 
             new Request({
             url: Wiki.XHRPreview,
-            data: { page: Wiki.PageName, wikimarkup: "[{Groups}]" },
+            data: { page: Wiki.PageName, wikimarkup: "[{Groups}]()" },
             onSuccess: function(responseText){
 
                 var body = "Anonymous|Asserted|Authenticated|All";
@@ -491,12 +491,12 @@ Wiki.Snips = {
     },
 
     toc: {
-        nScope: { "[{":"}]" },
-        snippet:"\n[~{TableOfContents }]\n"
+        nScope: { "[{":"}]()" },
+        snippet:"\n[~{TableOfContents }]()\n"
     },
 
     tocParams: {
-        scope:{ '[{TableOfContents':'}]'},
+        scope:{ '[{TableOfContents':'}]()'},
         suggest: "\\s",
         tocParams: [Dialog.Selection, {
             caption: "dialog.toc.options".localize(),
@@ -508,7 +508,7 @@ Wiki.Snips = {
         }]
     },
 
-    plugin: "\n[{{plugin} \n{=body}\n}]\n",
+    plugin: "\n[{{plugin} \n{=body}\n}]()\n",
 
     pluginDlg: {
         //match [{plugin}]  do not match [[{
@@ -562,7 +562,7 @@ Wiki.Snips = {
 
         key: "control+enter",
         snippet: "{format}",
-        nscope: { "[":"]" },
+        nscope: { "[":"]()" },
 
         suggest: function(textarea, caret /*, fromStart*/){
 
@@ -582,35 +582,35 @@ Wiki.Snips = {
 
             if( textarea.isCaretAtStartOfLine() ){
                 Object.append(body, {
-                    "\n{!!!}": "<span title='header'>H<span class='sub'>1</span></span>",
-                    "\n{!!}": "<span title='title'>H<span class='sub'>2</span></span>",
-                    "\n{!}": "<span title='sub-title'>H<span class='sub'>3</span></span>",
+                    "\n{# }": "<span title='header'>H<span class='sub'>1</span></span>",
+                    "\n{## }": "<span title='title'>H<span class='sub'>2</span></span>",
+                    "\n{### }": "<span title='sub-title'>H<span class='sub'>3</span></span>",
                     "\n* {list item}": "<span class='icon-list-ul'/>",
-                    "\n# {list-item}": "<span class='icon-list-ol'/>",
+                    "\n1. {list-item}": "<span class='icon-list-ol'/>",
                     "divider-sol": ""
                 });
             }
 
             Object.append(body, {
-                "__{bold}__": "<span style='font-family:serif;'><b>B</b></span>",
-                "''{italic}''": "<span style='font-family:serif;'><i>I</i></span>",
-                "{{{monospaced}}} ": "<tt title='inline monospaced'>&lt;&gt;</tt>",
-                "{{{{code}}}}": "<span title='code' class='small' style='font-family:monospace;'>code</span>",
+                "**{bold}**": "<span style='font-family:serif;'><b>B</b></span>",
+                "_{italic}_": "<span style='font-family:serif;'><i>I</i></span>",
+                "``{monospaced}`` ": "<tt title='inline monospaced'>&lt;&gt;</tt>",
+                "```{code}```": "<span title='code' class='small' style='font-family:monospace;'>code</span>",
                 "divider1": "",
-                "[{link}]": "<span class='icon-link' title='Insert a link'/>",
+                "[link]()": "<span class='icon-link' title='Insert a link'/>",
                 //"[description|{link}|options]": "<span class='icon-link'/>",
-                "[{Image src='{image.jpg}'}]": "<span class='icon-picture' title='Insert an image'/>",
-                "[{{plugin}}]": "<span class='icon-puzzle-piece' title='Insert a Plugin'></span>",
-                "%%style {body} /%":"<span style='font-family:monospace;letter-spacing:-.2em;' title='Add a Style'>%%</span>",
+                "[{Image src='{image.jpg}'}]()": "<span class='icon-picture' title='Insert an image'/>",
+                "[{{plugin}}]()": "<span class='icon-puzzle-piece' title='Insert a Plugin'></span>",
+                "<!----> {body} { style='' }":"<span style='font-family:monospace;letter-spacing:-.2em;' title='Add a Style'>%%</span>",
                 "divider2": "",
-                "%%(font-family:{font};) body /%":"<span title='Change the Font'><span style='font-family:serif;'>A</span><span style='font-family:sans-serif'>a</span></span>",
+                "<!----> {body} { style='font-family:{font};' }":"<span title='Change the Font'><span style='font-family:serif;'>A</span><span style='font-family:sans-serif'>a</span></span>",
                 "&{entity};" : "<span style='font-family:cursive;' title='Insert a Special Character'>&amp;</span>",
                 //"%%sub {subscript}/% ": "a<span class='sub'>n</span>",
                 //"%%sup {superscript}/% ": "a<span class='sup'>m</span>",
                 //"%%strike {strikethrough}/% ":"<span class='strike'>S</span>",
                 //"divider3": "",
-                "[{ALLOW {permission} principal }]":"<span class='icon-unlock-alt' title='Add a page ACL'></span>",
-                "\\\\\n":"<b title='Insert a New Line'>&para;</b>"
+                "[{ALLOW {permission} principal }]()":"<span class='icon-unlock-alt' title='Add a page ACL'></span>",
+                "&nbsp;&nbsp;\n":"<b title='Insert a New Line'>&para;</b>"
             });
 
             if( textarea.isCaretAtStartOfLine()
@@ -618,9 +618,9 @@ Wiki.Snips = {
             &&  textarea.slice(caret.start,caret.end-1).indexOf("\n") > -1 ){
                 Object.append(body, {
                 "divider-code": "",
-                    "\n{{{\n/* code block */\n{code block}\n}}}\n": "<span class='small' style='font-family:monospace;'>&lt;/&gt;</span>",
-                    "\n%%prettify\n{{{\n{pretiffied code block}\n}}}/%\n": "<span class='small' style='font-family:monospace;color:green;'>&lt;/&gt;</span>",
-                    "\n%%scrollable\n{{{\n{code block}\n}}}/%\n": "&darr;&uarr;"
+                    "\n```\n/* code block */\n{code block}\n```\n": "<span class='small' style='font-family:monospace;'>&lt;/&gt;</span>",
+                    "\n```\n{pretiffied code block}\n```{.prettify}\n": "<span class='small' style='font-family:monospace;color:green;'>&lt;/&gt;</span>",
+                    "\n```\n{scrollable code block}\n```{.scrollable}\n": "&darr;&uarr;"
                 });
             }
 
diff --git a/jspwiki-markdown/src/main/javascript/wro.properties b/jspwiki-markdown/src/main/javascript/wro.properties
new file mode 100644
index 0000000..0a5b33b
--- /dev/null
+++ b/jspwiki-markdown/src/main/javascript/wro.properties
@@ -0,0 +1,24 @@
+#  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.
+
+#minimizeEnabled=false
+debug=true
+
+
+preProcessors=semicolonAppender
+postProcessors=uglifyJs
+
diff --git a/jspwiki-markdown/src/main/javascript/wro.xml b/jspwiki-markdown/src/main/javascript/wro.xml
new file mode 100644
index 0000000..02008a3
--- /dev/null
+++ b/jspwiki-markdown/src/main/javascript/wro.xml
@@ -0,0 +1,28 @@
+<?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.
+-->
+<groups xmlns="http://www.isdc.ro/wro"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://www.isdc.ro/wro wro.xsd">
+
+  <group name="wiki-snips-markdown">
+    <js>/javascript/Wiki.Snips.Markdown.js</js>
+  </group>
+
+</groups>
\ No newline at end of file
diff --git a/jspwiki-war/src/main/config/wro/wro-haddock.xml b/jspwiki-war/src/main/config/wro/wro-haddock.xml
index 623a99d..b36f512 100644
--- a/jspwiki-war/src/main/config/wro/wro-haddock.xml
+++ b/jspwiki-war/src/main/config/wro/wro-haddock.xml
@@ -116,9 +116,10 @@
     <js>/scripts/wiki-edit/Snipe.Snips.js</js>
     <js>/scripts/wiki-edit/Snipe.Commands.js</js>
     <js>/scripts/wiki-edit/Snipe.Sections.js</js>
-    <js>/scripts/wiki-edit/Wiki.Snips.js</js>
-    <js>/scripts/wiki-edit/Wiki.Edit.js</js>
+  </group>
 
+  <group name="haddock-wiki-edit">
+    <js>/scripts/wiki-edit/Wiki.Edit.js</js>
   </group>
 
 </groups>
\ No newline at end of file

[jspwiki] 06/15: update xstream version to 1.4.19 - closes #177

Posted by ju...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

juanpablo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jspwiki.git

commit 00e65d9b8c1214bb547fc41c15b2fa8b25de2962
Author: Juan Pablo Santos Rodríguez <ju...@gmail.com>
AuthorDate: Tue Mar 22 11:51:58 2022 +0100

    update xstream version to 1.4.19 - closes #177
---
 jspwiki-portable/pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/jspwiki-portable/pom.xml b/jspwiki-portable/pom.xml
index 1f6e8d1..c8b8c55 100644
--- a/jspwiki-portable/pom.xml
+++ b/jspwiki-portable/pom.xml
@@ -330,7 +330,7 @@
               <dependency><!-- enable support with JDK >= 9, see https://sourceforge.net/p/launch4j/bugs/172/ and https://sourceforge.net/p/launch4j/bugs/206/ -->
                 <groupId>com.thoughtworks.xstream</groupId>
                 <artifactId>xstream</artifactId>
-                <version>1.4.18</version>
+                <version>1.4.19</version>
               </dependency>
             </dependencies>
           </plugin>

[jspwiki] 08/15: update test + fix sonar issue

Posted by ju...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

juanpablo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jspwiki.git

commit e6a85dcb8101c33531c3226549a36733b28ac050
Author: Juan Pablo Santos Rodríguez <ju...@gmail.com>
AuthorDate: Tue Mar 22 11:54:17 2022 +0100

    update test + fix sonar issue
---
 .../wiki/markdown/MarkdownSetupEngineLifecycleExtensionTest.java      | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/jspwiki-markdown/src/test/java/org/apache/wiki/markdown/MarkdownSetupEngineLifecycleExtensionTest.java b/jspwiki-markdown/src/test/java/org/apache/wiki/markdown/MarkdownSetupEngineLifecycleExtensionTest.java
index 6c2aecb..769b84b 100644
--- a/jspwiki-markdown/src/test/java/org/apache/wiki/markdown/MarkdownSetupEngineLifecycleExtensionTest.java
+++ b/jspwiki-markdown/src/test/java/org/apache/wiki/markdown/MarkdownSetupEngineLifecycleExtensionTest.java
@@ -23,7 +23,7 @@ import org.junit.jupiter.api.Test;
 
 import java.util.Properties;
 
-public class MarkdownSetupEngineLifecycleExtensionTest {
+class MarkdownSetupEngineLifecycleExtensionTest {
 
     @Test
     void shouldSetUpMarkdownSupportIfJspwikiSyntaxPropertyIsGiven() {
@@ -31,7 +31,7 @@ public class MarkdownSetupEngineLifecycleExtensionTest {
         properties.put( "jspwiki.syntax", "markdown" );
         final MarkdownSetupEngineLifecycleExtension sut = new MarkdownSetupEngineLifecycleExtension();
         sut.onInit( properties );
-        Assertions.assertEquals( 5, properties.size() );
+        Assertions.assertEquals( 6, properties.size() );
         Assertions.assertEquals( "org.apache.wiki.parser.markdown.MarkdownParser", properties.getProperty( "jspwiki.renderingManager.markupParser" ) );
 
         properties.clear();

[jspwiki] 07/15: JSPWIKI-802: load Markdown's syntax Wiki.Snips file

Posted by ju...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

juanpablo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jspwiki.git

commit f960c13d2f5bb5e3a39c7119fa4584aa2745b30e
Author: Juan Pablo Santos Rodríguez <ju...@gmail.com>
AuthorDate: Tue Mar 22 11:53:17 2022 +0100

    JSPWIKI-802: load Markdown's syntax Wiki.Snips file
---
 .../org/apache/wiki/markdown/MarkdownSetupEngineLifecycleExtension.java  | 1 +
 1 file changed, 1 insertion(+)

diff --git a/jspwiki-markdown/src/main/java/org/apache/wiki/markdown/MarkdownSetupEngineLifecycleExtension.java b/jspwiki-markdown/src/main/java/org/apache/wiki/markdown/MarkdownSetupEngineLifecycleExtension.java
index 76f3b43..169b3a3 100644
--- a/jspwiki-markdown/src/main/java/org/apache/wiki/markdown/MarkdownSetupEngineLifecycleExtension.java
+++ b/jspwiki-markdown/src/main/java/org/apache/wiki/markdown/MarkdownSetupEngineLifecycleExtension.java
@@ -41,6 +41,7 @@ public class MarkdownSetupEngineLifecycleExtension implements EngineLifecycleExt
             setWikiProperty( properties, "jspwiki.renderingManager.renderer", "org.apache.wiki.render.markdown.MarkdownRenderer" );
             setWikiProperty( properties, "jspwiki.renderingManager.renderer.wysiwyg", "org.apache.wiki.render.markdown.MarkdownRenderer" );
             setWikiProperty( properties, "jspwiki.syntax.decorator", "org.apache.wiki.htmltowiki.syntax.markdown.MarkdownSyntaxDecorator" );
+            setWikiProperty( properties, "jspwiki.syntax.plain", "plain/wiki-snips-markdown.js" );
         }
     }
 

[jspwiki] 02/15: TemplateManager now understands resources beginning with 'engine://' as keys of Engine's wiki properties

Posted by ju...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

juanpablo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jspwiki.git

commit c1c6955cf0ad2c3b472425d82ba91f4008ce842c
Author: Juan Pablo Santos Rodríguez <ju...@gmail.com>
AuthorDate: Tue Mar 22 11:47:36 2022 +0100

    TemplateManager now understands resources beginning with 'engine://' as keys of Engine's wiki properties
---
 .../java/org/apache/wiki/ui/TemplateManager.java   | 26 +++++---
 .../org/apache/wiki/ui/TemplateManagerTest.java    | 75 ++++++++++++++++++++++
 2 files changed, 92 insertions(+), 9 deletions(-)

diff --git a/jspwiki-main/src/main/java/org/apache/wiki/ui/TemplateManager.java b/jspwiki-main/src/main/java/org/apache/wiki/ui/TemplateManager.java
index 8c457a2..b1fa47c 100644
--- a/jspwiki-main/src/main/java/org/apache/wiki/ui/TemplateManager.java
+++ b/jspwiki-main/src/main/java/org/apache/wiki/ui/TemplateManager.java
@@ -18,6 +18,7 @@
  */
 package org.apache.wiki.ui;
 
+import org.apache.commons.lang3.StringUtils;
 import org.apache.logging.log4j.LogManager;
 import org.apache.wiki.api.core.Context;
 import org.apache.wiki.i18n.InternationalizationManager;
@@ -102,7 +103,7 @@ public interface TemplateManager extends ModuleManager {
     boolean templateExists( String templateName );
 
     /**
-     *  An utility method for finding a JSP page.  It searches only under either current context or by the absolute name.
+     *  A utility method for finding a JSP page.  It searches only under either current context or by the absolute name.
      *
      *  @param pageContext the JSP PageContext
      *  @param name The name of the JSP page to look for (e.g "Wiki.jsp")
@@ -249,7 +250,7 @@ public interface TemplateManager extends ModuleManager {
     }
 
     /**
-     *  Returns the include resources marker for a given type.  This is in a
+     *  Returns the include resources marker for a given type.  This is in an
      *  HTML or Javascript comment format.
      *
      *  @param context the wiki context
@@ -298,7 +299,7 @@ public interface TemplateManager extends ModuleManager {
      *  Adds a resource request to the current request context. The content will be added at the resource-type marker
      *  (see IncludeResourcesTag) in WikiJSPFilter.
      *  <p>
-     *  The resources can be of different types.  For RESOURCE_SCRIPT and RESOURCE_STYLESHEET this is an URI path to the resource
+     *  The resources can be of different types.  For RESOURCE_SCRIPT and RESOURCE_STYLESHEET this is a URI path to the resource
      *  (a script file or an external stylesheet) that needs to be included.  For RESOURCE_INLINECSS the resource should be something
      *  that can be added between &lt;style>&lt;/style> in the header file (commonheader.jsp).  For RESOURCE_JSFUNCTION it is the name
      *  of the Javascript function that should be run at page load.
@@ -311,7 +312,7 @@ public interface TemplateManager extends ModuleManager {
      *  rendered.  It's thus a good idea to make this request only once during the page life cycle.
      *
      *  @param ctx The current wiki context
-     *  @param type What kind of a request should be added?
+     *  @param type What kind of resource should be added?
      *  @param resource The resource to add.
      */
     static void addResourceRequest( final Context ctx, final String type, final String resource ) {
@@ -324,21 +325,28 @@ public interface TemplateManager extends ModuleManager {
         if( resources == null ) {
             resources = new Vector<>();
         }
+        String resolvedResource = resource;
+        if( StringUtils.startsWith( resource, "engine://" ) ) {
+            final String val = ctx.getEngine().getWikiProperties().getProperty( resource.substring( 9 ) ); // "engine//:".length() == 9
+            if( StringUtils.isNotBlank( val ) ) {
+                resolvedResource = val;
+            }
+        }
 
         String resourceString = null;
         switch( type ) {
         case RESOURCE_SCRIPT:
-            resourceString = "<script type='text/javascript' src='" + resource + "'></script>";
+            resourceString = "<script type='text/javascript' src='" + resolvedResource + "'></script>";
             break;
         case RESOURCE_STYLESHEET:
-            resourceString = "<link rel='stylesheet' type='text/css' href='" + resource + "' />";
+            resourceString = "<link rel='stylesheet' type='text/css' href='" + resolvedResource + "' />";
             break;
         case RESOURCE_INLINECSS:
-            resourceString = "<style type='text/css'>\n" + resource + "\n</style>\n";
+            resourceString = "<style type='text/css'>\n" + resolvedResource + "\n</style>\n";
             break;
         case RESOURCE_JSFUNCTION:
         case RESOURCE_HTTPHEADER:
-            resourceString = resource;
+            resourceString = resolvedResource;
             break;
         }
 
@@ -346,7 +354,7 @@ public interface TemplateManager extends ModuleManager {
             resources.add( resourceString );
         }
 
-        LogManager.getLogger( TemplateManager.class ).debug( "Request to add a resource: " + resourceString );
+        LogManager.getLogger( TemplateManager.class ).debug( "Request to add a resource: {}", resourceString );
 
         resourcemap.put( type, resources );
         ctx.setVariable( RESOURCE_INCLUDES, resourcemap );
diff --git a/jspwiki-main/src/test/java/org/apache/wiki/ui/TemplateManagerTest.java b/jspwiki-main/src/test/java/org/apache/wiki/ui/TemplateManagerTest.java
new file mode 100644
index 0000000..03f8506
--- /dev/null
+++ b/jspwiki-main/src/test/java/org/apache/wiki/ui/TemplateManagerTest.java
@@ -0,0 +1,75 @@
+/*
+    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.wiki.ui;
+
+import org.apache.wiki.api.core.Context;
+import org.apache.wiki.api.core.Engine;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.extension.ExtendWith;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.Arguments;
+import org.junit.jupiter.params.provider.MethodSource;
+import org.mockito.Mock;
+import org.mockito.Mockito;
+import org.mockito.junit.jupiter.MockitoExtension;
+
+import java.util.HashMap;
+import java.util.Properties;
+import java.util.Vector;
+import java.util.stream.Stream;
+
+
+@ExtendWith( MockitoExtension.class )
+class TemplateManagerTest {
+
+    @Mock
+    Context ctx;
+
+    @Mock
+    Engine engine;
+
+    @ParameterizedTest
+    @MethodSource( "provideArgumentsForAddResourceRequest" )
+    void shouldCheckAddResourceRequest( final String type, final String res, final String expected ) {
+        if( TemplateManager.RESOURCE_SCRIPT.equals( type ) || TemplateManager.RESOURCE_STYLESHEET.equals( type ) ) {
+            final Properties properties = new Properties();
+            properties.setProperty( "jspwiki.syntax.plain", "plain/wiki-snips-jspwiki.js" );
+            Mockito.doReturn( engine ).when( ctx ).getEngine();
+            Mockito.doReturn( properties ).when( engine ).getWikiProperties();
+        }
+
+        Mockito.doAnswer( invocationOnMock -> {
+            final HashMap< String, Vector< String > > map = invocationOnMock.getArgument( 1, HashMap.class );
+            Assertions.assertEquals( expected, map.get( type ).get( 0 ) );
+            return null;
+        } ).when( ctx ).setVariable( Mockito.eq( TemplateManager.RESOURCE_INCLUDES ), Mockito.any( HashMap.class ) );
+
+        TemplateManager.addResourceRequest( ctx, type, res );
+    }
+
+    static Stream< Arguments > provideArgumentsForAddResourceRequest() {
+        return Stream.of(
+                Arguments.of( TemplateManager.RESOURCE_SCRIPT, "engine://jspwiki.syntax.plain", "<script type='text/javascript' src='plain/wiki-snips-jspwiki.js'></script>" ),
+                Arguments.of( TemplateManager.RESOURCE_STYLESHEET, "engine://jspwiki.whatever.not.exists", "<link rel='stylesheet' type='text/css' href='engine://jspwiki.whatever.not.exists' />" ),
+                Arguments.of( TemplateManager.RESOURCE_INLINECSS, "color: white", "<style type='text/css'>\ncolor: white\n</style>\n" ),
+                Arguments.of( TemplateManager.RESOURCE_JSFUNCTION, "function whatever() {}", "function whatever() {}" )
+        );
+    }
+
+}

[jspwiki] 04/15: fix typos

Posted by ju...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

juanpablo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jspwiki.git

commit f3a75eb3d7b9383be80098ff0f4c8e6abb728035
Author: Juan Pablo Santos Rodríguez <ju...@gmail.com>
AuthorDate: Tue Mar 22 11:50:42 2022 +0100

    fix typos
---
 jspwiki-main/src/main/java/org/apache/wiki/render/XHTMLRenderer.java | 2 +-
 jspwiki-war/src/main/scripts/wiki-edit/Wiki.Edit.js                  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/jspwiki-main/src/main/java/org/apache/wiki/render/XHTMLRenderer.java b/jspwiki-main/src/main/java/org/apache/wiki/render/XHTMLRenderer.java
index da5e145..93f0afa 100644
--- a/jspwiki-main/src/main/java/org/apache/wiki/render/XHTMLRenderer.java
+++ b/jspwiki-main/src/main/java/org/apache/wiki/render/XHTMLRenderer.java
@@ -27,7 +27,7 @@ import java.io.IOException;
 import java.io.StringWriter;
 
 /**
- *  Implements a WikiRendered that outputs XHTML.  Because the internal DOM  representation is in XHTML already, this just basically
+ *  Implements a WikiRenderer that outputs XHTML.  Because the internal DOM  representation is in XHTML already, this just basically
  *  dumps out everything out in a non-prettyprinted format.
  *
  *  @since  2.4
diff --git a/jspwiki-war/src/main/scripts/wiki-edit/Wiki.Edit.js b/jspwiki-war/src/main/scripts/wiki-edit/Wiki.Edit.js
index 35b284d..e6bf49b 100644
--- a/jspwiki-war/src/main/scripts/wiki-edit/Wiki.Edit.js
+++ b/jspwiki-war/src/main/scripts/wiki-edit/Wiki.Edit.js
@@ -21,7 +21,7 @@
 /*
 Class: Wiki.Edit
     Wiki.Edit implements the JSPWiki plain editor, with support
-    for JSPWIki's markup, suggestion popups, ajax based page preview, etc...
+    for JSPWiki's markup, suggestion popups, ajax based page preview, etc...
 
     It uses [Snipe] to enhance the plain textarea.
 */

[jspwiki] 05/15: fix sonar issue

Posted by ju...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

juanpablo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jspwiki.git

commit 0a0b1b803e63ff7beec35d535da9e942a9b1d616
Author: Juan Pablo Santos Rodríguez <ju...@gmail.com>
AuthorDate: Tue Mar 22 11:51:17 2022 +0100

    fix sonar issue
---
 .../java/org/apache/wiki/api/engine/EngineLifecycleExtensionTest.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/jspwiki-api/src/test/java/org/apache/wiki/api/engine/EngineLifecycleExtensionTest.java b/jspwiki-api/src/test/java/org/apache/wiki/api/engine/EngineLifecycleExtensionTest.java
index e9589f4..bde83ac 100644
--- a/jspwiki-api/src/test/java/org/apache/wiki/api/engine/EngineLifecycleExtensionTest.java
+++ b/jspwiki-api/src/test/java/org/apache/wiki/api/engine/EngineLifecycleExtensionTest.java
@@ -30,7 +30,7 @@ import java.util.Properties;
 
 
 @ExtendWith( MockitoExtension.class )
-public class EngineLifecycleExtensionTest {
+class EngineLifecycleExtensionTest {
 
     @Mock Engine engine;
 

[jspwiki] 10/15: refactor working directory checks to separate methods, fixing a couple of sonarqube issues

Posted by ju...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

juanpablo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jspwiki.git

commit ab2155b70e37c4eafa26b82dc9e610fcabfdc25e
Author: Juan Pablo Santos Rodríguez <ju...@gmail.com>
AuthorDate: Tue Mar 22 12:04:19 2022 +0100

    refactor working directory checks to separate methods, fixing a couple of sonarqube issues
---
 .../src/main/java/org/apache/wiki/WikiEngine.java  | 64 +++++++++++-----------
 .../test/java/org/apache/wiki/WikiEngineTest.java  | 59 ++++++++++----------
 2 files changed, 63 insertions(+), 60 deletions(-)

diff --git a/jspwiki-main/src/main/java/org/apache/wiki/WikiEngine.java b/jspwiki-main/src/main/java/org/apache/wiki/WikiEngine.java
index f2506a5..c1d1212 100644
--- a/jspwiki-main/src/main/java/org/apache/wiki/WikiEngine.java
+++ b/jspwiki-main/src/main/java/org/apache/wiki/WikiEngine.java
@@ -259,42 +259,13 @@ public class WikiEngine implements Engine {
 
         LOG.debug( "Configuring WikiEngine..." );
 
-        //  Create and find the default working directory.
-        m_workDir = TextUtil.getStringProperty( props, PROP_WORKDIR, null );
-
-        if( m_workDir == null ) {
-            m_workDir = System.getProperty( "java.io.tmpdir", "." ) +  File.separator + Release.APPNAME + "-" + m_appid;
-        }
-
-        try {
-            final File f = new File( m_workDir );
-            f.mkdirs();
+        createAndFindWorkingDirectory( props );
 
-            //  A bunch of sanity checks
-            if( !f.exists() ) {
-                throw new WikiException( "Work directory does not exist: " + m_workDir );
-            }
-            if( !f.canRead() ) {
-                throw new WikiException( "No permission to read work directory: " + m_workDir );
-            }
-            if( !f.canWrite() ) {
-                throw new WikiException( "No permission to write to work directory: " + m_workDir );
-            }
-            if( !f.isDirectory() ) {
-                throw new WikiException( "jspwiki.workDir does not point to a directory: " + m_workDir );
-            }
-        } catch( final SecurityException e ) {
-            LOG.fatal( "Unable to find or create the working directory: {}", m_workDir, e );
-            throw new WikiException( "Unable to find or create the working dir: " + m_workDir, e );
-        }
-
-        LOG.info( "JSPWiki working directory is '{}'", m_workDir );
-
-        m_saveUserInfo   = TextUtil.getBooleanProperty( props, PROP_STOREUSERNAME, m_saveUserInfo );
         m_useUTF8        = StandardCharsets.UTF_8.name().equals( TextUtil.getStringProperty( props, PROP_ENCODING, StandardCharsets.ISO_8859_1.name() ) );
+        m_saveUserInfo   = TextUtil.getBooleanProperty( props, PROP_STOREUSERNAME, m_saveUserInfo );
+        m_frontPage      = TextUtil.getStringProperty( props, PROP_FRONTPAGE, "Main" );
         m_templateDir    = TextUtil.getStringProperty( props, PROP_TEMPLATEDIR, "default" );
         enforceValidTemplateDirectory();
-        m_frontPage      = TextUtil.getStringProperty( props, PROP_FRONTPAGE,   "Main" );
 
         //
         //  Initialize the important modules.  Any exception thrown by the managers means that we will not start up.
@@ -375,6 +346,35 @@ public class WikiEngine implements Engine {
         m_isConfigured = true;
     }
 
+    void createAndFindWorkingDirectory( final Properties props ) throws WikiException {
+        m_workDir = TextUtil.getStringProperty( props, PROP_WORKDIR, null );
+        if( StringUtils.isBlank( m_workDir ) ) {
+            m_workDir = System.getProperty( "java.io.tmpdir", "." ) +  File.separator + Release.APPNAME + "-" + m_appid;
+        }
+
+        final File f = new File( m_workDir );
+        try {
+            f.mkdirs();
+        } catch( final SecurityException e ) {
+            LOG.fatal( "Unable to find or create the working directory: {}", m_workDir, e );
+            throw new WikiException( "Unable to find or create the working dir: " + m_workDir, e );
+        }
+
+        //  A bunch of sanity checks
+        checkWorkingDirectory( !f.exists(), "Work directory does not exist: " + m_workDir );
+        checkWorkingDirectory( !f.canRead(), "No permission to read work directory: " + m_workDir );
+        checkWorkingDirectory( !f.canWrite(), "No permission to write to work directory: " + m_workDir );
+        checkWorkingDirectory( !f.isDirectory(), "jspwiki.workDir does not point to a directory: " + m_workDir );
+
+        LOG.info( "JSPWiki working directory is '{}'", m_workDir );
+    }
+
+    void checkWorkingDirectory( final boolean condition, final String errMsg ) throws WikiException {
+        if( condition ) {
+            throw new WikiException( errMsg );
+        }
+    }
+
     void initExtraComponents( final Map< String, String > extraComponents ) {
         for( final Map.Entry< String, String > extraComponent : extraComponents.entrySet() ) {
             try {
diff --git a/jspwiki-main/src/test/java/org/apache/wiki/WikiEngineTest.java b/jspwiki-main/src/test/java/org/apache/wiki/WikiEngineTest.java
index 4a6dc03..402e52d 100644
--- a/jspwiki-main/src/test/java/org/apache/wiki/WikiEngineTest.java
+++ b/jspwiki-main/src/test/java/org/apache/wiki/WikiEngineTest.java
@@ -16,13 +16,13 @@
     specific language governing permissions and limitations
     under the License.
  */
-
 package org.apache.wiki;
 
 import org.apache.wiki.api.core.Attachment;
 import org.apache.wiki.api.core.Context;
 import org.apache.wiki.api.core.Page;
 import org.apache.wiki.api.engine.RenderApi;
+import org.apache.wiki.api.exceptions.WikiException;
 import org.apache.wiki.api.spi.Wiki;
 import org.apache.wiki.attachment.AttachmentManager;
 import org.apache.wiki.cache.CachingManager;
@@ -34,7 +34,6 @@ import org.apache.wiki.references.ReferenceManager;
 import org.apache.wiki.render.RenderingManager;
 import org.junit.jupiter.api.AfterEach;
 import org.junit.jupiter.api.Assertions;
-import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
 
 import java.io.File;
@@ -43,21 +42,18 @@ import java.util.Collection;
 import java.util.Iterator;
 import java.util.Properties;
 
-public class WikiEngineTest {
+import static org.apache.wiki.TestEngine.with;
 
-    public static final String NAME1 = "Test1";
 
-    Properties props = TestEngine.getTestProperties();
-    TestEngine m_engine;
+class WikiEngineTest {
 
-    @BeforeEach
-    public void setUp() {
-        props.setProperty( WikiEngine.PROP_MATCHPLURALS, "true" );
-        m_engine = TestEngine.build( props );
-    }
+    static final String NAME1 = "Test1";
+
+    Properties props = TestEngine.getTestProperties();
+    TestEngine m_engine = TestEngine.build( with( WikiEngine.PROP_MATCHPLURALS, "true" ) );
 
     @AfterEach
-    public void tearDown() {
+    void tearDown() {
         final String files = m_engine.getWikiProperties().getProperty( FileSystemProvider.PROP_PAGEDIR );
 
         if( files != null ) {
@@ -70,7 +66,7 @@ public class WikiEngineTest {
     }
 
     @Test
-    public void testNonExistentDirectory() throws Exception {
+    void testNonExistentDirectory() throws Exception {
         final String newdir = "." + File.separator + "target" + File.separator + "non-existent-directory";
 
         props.setProperty( FileSystemProvider.PROP_PAGEDIR, newdir );
@@ -84,7 +80,7 @@ public class WikiEngineTest {
     }
 
     @Test
-    public void testFinalPageName() throws Exception {
+    void testFinalPageName() throws Exception {
         m_engine.saveText( "Foobar", "1" );
         m_engine.saveText( "Foobars", "2" );
 
@@ -93,7 +89,7 @@ public class WikiEngineTest {
     }
 
     @Test
-    public void testFinalPageNameSingular() throws Exception {
+    void testFinalPageNameSingular() throws Exception {
         m_engine.saveText( "Foobar", "1" );
 
         Assertions.assertEquals( "Foobar", m_engine.getFinalPageName( "Foobars" ), "plural mistake" );
@@ -101,7 +97,7 @@ public class WikiEngineTest {
     }
 
     @Test
-    public void testFinalPageNamePlural() throws Exception {
+    void testFinalPageNamePlural() throws Exception {
         m_engine.saveText( "Foobars", "1" );
 
         Assertions.assertEquals( "Foobars", m_engine.getFinalPageName( "Foobars" ), "plural mistake" );
@@ -109,13 +105,13 @@ public class WikiEngineTest {
     }
 
     @Test
-    public void testEncodeNameLatin1() {
+    void testEncodeNameLatin1() {
         final String name = "abc\u00e5\u00e4\u00f6";
         Assertions.assertEquals( "abc%E5%E4%F6", m_engine.encodeName(name) );
     }
 
     @Test
-    public void testEncodeNameUTF8() throws Exception {
+    void testEncodeNameUTF8() throws Exception {
         final String name = "\u0041\u2262\u0391\u002E";
         props.setProperty( WikiEngine.PROP_ENCODING, StandardCharsets.UTF_8.name() );
         final WikiEngine engine = new TestEngine( props );
@@ -127,7 +123,7 @@ public class WikiEngineTest {
      *  Checks, if ReferenceManager is informed of new attachments.
      */
     @Test
-    public void testAttachmentRefs() throws Exception {
+    void testAttachmentRefs() throws Exception {
         final ReferenceManager refMgr = m_engine.getManager( ReferenceManager.class );
         final AttachmentManager attMgr = m_engine.getManager( AttachmentManager.class );
         m_engine.saveText( NAME1, "fooBar");
@@ -170,7 +166,7 @@ public class WikiEngineTest {
     */
 
     @Test
-    public void testAttachmentRefs2() throws Exception {
+    void testAttachmentRefs2() throws Exception {
         final ReferenceManager refMgr = m_engine.getManager( ReferenceManager.class );
         final AttachmentManager attMgr = m_engine.getManager( AttachmentManager.class );
 
@@ -211,7 +207,7 @@ public class WikiEngineTest {
      *  Checks, if ReferenceManager is informed if a link to an attachment is added.
      */
     @Test
-    public void testAttachmentRefs3() throws Exception {
+    void testAttachmentRefs3() throws Exception {
         final ReferenceManager refMgr = m_engine.getManager( ReferenceManager.class );
         final AttachmentManager attMgr = m_engine.getManager( AttachmentManager.class );
 
@@ -236,7 +232,7 @@ public class WikiEngineTest {
      *  Checks, if ReferenceManager is informed if a third page references an attachment.
      */
     @Test
-    public void testAttachmentRefs4() throws Exception {
+    void testAttachmentRefs4() throws Exception {
         final ReferenceManager refMgr = m_engine.getManager( ReferenceManager.class );
         final AttachmentManager attMgr = m_engine.getManager( AttachmentManager.class );
 
@@ -260,7 +256,7 @@ public class WikiEngineTest {
      *  Tests BugReadingOfVariableNotWorkingForOlderVersions
      */
     @Test
-    public void testOldVersionVars() throws Exception {
+    void testOldVersionVars() throws Exception {
         final Properties props = TestEngine.getTestProperties("/jspwiki-vers-custom.properties");
         props.setProperty( CachingManager.PROP_CACHE_ENABLE, "true" );
         final TestEngine engine = new TestEngine( props );
@@ -277,13 +273,13 @@ public class WikiEngineTest {
     }
 
     @Test
-    public void testSpacedNames1() throws Exception {
+    void testSpacedNames1() throws Exception {
         m_engine.saveText("This is a test", "puppaa");
         Assertions.assertEquals( "puppaa", m_engine.getManager( PageManager.class ).getText("This is a test").trim(), "normal" );
     }
 
     @Test
-    public void testParsedVariables() throws Exception {
+    void testParsedVariables() throws Exception {
         m_engine.saveText( "TestPage", "[{SET foo=bar}][{SamplePlugin text='{$foo}'}]");
         final String res = m_engine.getManager( RenderingManager.class ).getHTML( "TestPage" );
 
@@ -294,7 +290,7 @@ public class WikiEngineTest {
      * Tests BugReferenceToRenamedPageNotCleared
      */
     @Test
-    public void testRename() throws Exception {
+    void testRename() throws Exception {
         m_engine.saveText( "RenameBugTestPage", "Mary had a little generic object" );
         m_engine.saveText( "OldNameTestPage", "Linked to RenameBugTestPage" );
 
@@ -313,7 +309,7 @@ public class WikiEngineTest {
     }
 
     @Test
-    public void testChangeNoteOldVersion2() throws Exception {
+    void testChangeNoteOldVersion2() throws Exception {
         final Page p = Wiki.contents().page( m_engine, NAME1 );
         final Context context = Wiki.context().create( m_engine,p );
         context.getPage().setAttribute( Page.CHANGENOTE, "Test change" );
@@ -331,7 +327,7 @@ public class WikiEngineTest {
     }
 
     @Test
-    public void testGetManagers() {
+    void testGetManagers() {
         Assertions.assertNull( m_engine.getManager( String.class ) );
         Assertions.assertNotNull( m_engine.getManager( RenderApi.class ) );
         Assertions.assertNotNull( m_engine.getManager( PageManager.class ) );
@@ -343,4 +339,11 @@ public class WikiEngineTest {
         Assertions.assertEquals( 4, m_engine.getManagers( ModuleManager.class ).size() );
     }
 
+    @Test
+    void testCheckWorkingDirectory() {
+        Assertions.assertDoesNotThrow( () -> m_engine.checkWorkingDirectory( false, "boo" ) );
+        final WikiException we = Assertions.assertThrows( WikiException.class, () -> m_engine.checkWorkingDirectory( true, "boo" ) );
+        Assertions.assertEquals( "boo", we.getMessage() );
+    }
+
 }

[jspwiki] 14/15: Update tomcat portable binaries

Posted by ju...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

juanpablo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jspwiki.git

commit 8de2acb1cd641ebba7b6fd12104d032523a114ef
Author: Juan Pablo Santos Rodríguez <ju...@gmail.com>
AuthorDate: Tue Mar 22 12:08:22 2022 +0100

    Update tomcat portable binaries
---
 .../tomcat/woas.app/Contents/Java/bootstrap.jar    | Bin 34698 -> 34699 bytes
 .../tomcat/woas.app/Contents/Java/tomcat-juli.jar  | Bin 46898 -> 46895 bytes
 .../src/overlay/launchers/tomcat/woas.exe          | Bin 3656529 -> 3656699 bytes
 3 files changed, 0 insertions(+), 0 deletions(-)

diff --git a/jspwiki-portable/src/overlay/launchers/tomcat/woas.app/Contents/Java/bootstrap.jar b/jspwiki-portable/src/overlay/launchers/tomcat/woas.app/Contents/Java/bootstrap.jar
index d3c9270..7da41bb 100644
Binary files a/jspwiki-portable/src/overlay/launchers/tomcat/woas.app/Contents/Java/bootstrap.jar and b/jspwiki-portable/src/overlay/launchers/tomcat/woas.app/Contents/Java/bootstrap.jar differ
diff --git a/jspwiki-portable/src/overlay/launchers/tomcat/woas.app/Contents/Java/tomcat-juli.jar b/jspwiki-portable/src/overlay/launchers/tomcat/woas.app/Contents/Java/tomcat-juli.jar
index 5fa4903..40b9415 100644
Binary files a/jspwiki-portable/src/overlay/launchers/tomcat/woas.app/Contents/Java/tomcat-juli.jar and b/jspwiki-portable/src/overlay/launchers/tomcat/woas.app/Contents/Java/tomcat-juli.jar differ
diff --git a/jspwiki-portable/src/overlay/launchers/tomcat/woas.exe b/jspwiki-portable/src/overlay/launchers/tomcat/woas.exe
index c8b0962..96d3a6c 100644
Binary files a/jspwiki-portable/src/overlay/launchers/tomcat/woas.exe and b/jspwiki-portable/src/overlay/launchers/tomcat/woas.exe differ

[jspwiki] 09/15: Explicit wiki syntax / rendering properties + fix some typos

Posted by ju...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

juanpablo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jspwiki.git

commit 4a523726811c138ce033023ac51ec8eddf2e7bd4
Author: Juan Pablo Santos Rodríguez <ju...@gmail.com>
AuthorDate: Tue Mar 22 11:55:34 2022 +0100

    Explicit wiki syntax / rendering properties + fix some typos
---
 .../src/main/resources/ini/jspwiki.properties      | 27 +++++++++++++++++-----
 1 file changed, 21 insertions(+), 6 deletions(-)

diff --git a/jspwiki-main/src/main/resources/ini/jspwiki.properties b/jspwiki-main/src/main/resources/ini/jspwiki.properties
index 2c4bcff..c0876bf 100644
--- a/jspwiki-main/src/main/resources/ini/jspwiki.properties
+++ b/jspwiki-main/src/main/resources/ini/jspwiki.properties
@@ -448,18 +448,33 @@ jspwiki.plugin.externalJars =
 
 #############################################################################
 #
-# Rendering
-#
-# At this time, entries here are strictly for development and testing.
+# Rendering & wiki syntax
 #
 
 # Markup parser class name; it must be a subclass of org.apache.wiki.parser.MarkupParser
 jspwiki.renderingManager.markupParser=org.apache.wiki.parser.JSPWikiMarkupParser
 
+# Wiki renderer that outputs XHTML; it must be a subclass of org.apache.wiki.render.WikiRenderer
+jspwiki.renderingManager.renderer=org.apache.wiki.render.XHTMLRenderer
+
+# Wiki renderer that outputs XHTML in a format that is suitable for use by a WYSIWYG XHTML editor; it must be a subclass of org.apache.wiki.render.WikiRenderer
+jspwiki.renderingManager.renderer.wysiwyg=org.apache.wiki.render.WysiwygEditingRenderer
+
+# HTML to specific wiki syntax decorator
+jspwiki.syntax.decorator=org.apache.wiki.htmltowiki.syntax.jspwiki.JSPWikiSyntaxDecorator
+
+# Location inside .jar of code snippets for plain editor, specific to a given wiki syntax
+jspwiki.syntax.plain=plain/wiki-snips-jspwiki.js
+
+# As a shorcut to enable Markdown syntax, the following property
+# jspwiki.syntax=markdown
+# can be enabled, which will overwrite last 5 previous keys to their appropiate values in order to enable Markdown syntax
+# See https://jspwiki-wiki.apache.org/Wiki.jsp?page=Markdown%20Support for details
+
 # Response encoding
 #
 # Whether WikiJSPFilter should use encoding for the response.
-# Most servers don't need this settings, but if your non-Latin chars are not displayed
+# Most servers don't need this setting, but if your non-Latin chars are not displayed
 # properly, try setting this to true.
 # jspwiki.nofilterencoding = false
 
@@ -651,7 +666,7 @@ jspwiki.aclManager = org.apache.wiki.auth.acl.DefaultAclManager
 # multiple times to get multiple references).  Page references should
 # appear in format : [wiki:wikipage].
 #
-# This is the JSPWiki home.  In future, JSPWiki will probably rely on this
+# This is the JSPWiki home.  In the future, JSPWiki will probably rely on this
 # for error messages, so I don't recommend that you change it.
 jspwiki.interWikiRef.JSPWiki = http://jspwiki-wiki.apache.org/Wiki.jsp?page=%s
 
@@ -1006,7 +1021,7 @@ jspwiki.defaultprefs.template.orientation =fav-left
 jspwiki.defaultprefs.template.sidebar =active
 
 # Set layout of the template
-# Possible values: fluid (use full screen-estate) or fixed (fixed max-width)
+# Possible values: fluid (use full screen estate) or fixed (fixed max-width)
 jspwiki.defaultprefs.template.layout =fluid
 
 # Set editor type : plain, WikiWizard, FCK

[jspwiki] 15/15: 2.11.3-git-04

Posted by ju...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

juanpablo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jspwiki.git

commit 2c59187acc209e33e1db4201964971652fb2038d
Author: Juan Pablo Santos Rodríguez <ju...@gmail.com>
AuthorDate: Tue Mar 22 12:09:07 2022 +0100

    2.11.3-git-04
---
 ChangeLog.md                                          | 19 +++++++++++++++++++
 .../src/main/java/org/apache/wiki/api/Release.java    |  2 +-
 2 files changed, 20 insertions(+), 1 deletion(-)

diff --git a/ChangeLog.md b/ChangeLog.md
index 161da52..a76fa6f 100644
--- a/ChangeLog.md
+++ b/ChangeLog.md
@@ -17,6 +17,25 @@ specific language governing permissions and limitations
 under the License.
 -->
 
+**2022-03-22  Juan Pablo Santos (juanpablo AT apache DOT org)**
+
+* _2.11.3-git-04_
+
+* [JSPWIKI-802](https://issues.apache.org/jira/browse/JSPWIKI-802) - Markdown syntax Support: initial Markdown support for plain editor.
+    * Currently, can be activated by setting the `jspwiki.syntax.plain` property to `plain/wiki-snips-markdown.js`.
+    * Alternatively, as of 2.11.3-git-02, whole Markdown support configuration can be set up by setting the `jspwiki.syntax` property to `markdown`.
+    * Details at [Markdown support page](https://jspwiki-wiki.apache.org/Wiki.jsp?page=Markdown%20Support).
+
+* `TemplateManager` now understands resources beginning with `engine://` to be keys of `Engine`'s wiki properties. In those cases, if the key and its associated value exist, the latter will be used to as the requested resource.
+
+* Dependency updates
+    * Mockito to 4.4.0 - closes [#176](https://github.com/apache/jspwiki/pull/176), thanks to dependabot
+    * Selenide to 6.3.5
+    * Tomcat to 9.0.60
+    * XStream to 1.4.19 - closes [#177](https://github.com/apache/jspwiki/pull/177), thanks to dependabot
+    * Maven JXR plugin to 3.2.0, dependency plugin to 3.3.0 - closes [#178](https://github.com/apache/jspwiki/pull/178), thanks to dependabot
+
+
 **2022-03-15  Dirk Frederickx (brushed AT apache DOT org)**
 
 * _2.11.3-git-03_
diff --git a/jspwiki-api/src/main/java/org/apache/wiki/api/Release.java b/jspwiki-api/src/main/java/org/apache/wiki/api/Release.java
index 0a3fb2e..1e01d18 100644
--- a/jspwiki-api/src/main/java/org/apache/wiki/api/Release.java
+++ b/jspwiki-api/src/main/java/org/apache/wiki/api/Release.java
@@ -69,7 +69,7 @@ public final class Release {
      *  <p>
      *  If the build identifier is empty, it is not added.
      */
-    public static final String     BUILD         = "03";
+    public static final String     BUILD         = "04";
 
     /**
      *  This is the generic version string you should use when printing out the version.  It is of

[jspwiki] 03/15: JSPWIKI-802: load specific wiki syntax Wiki.Snips file, and then Wiki.Edit.js after it

Posted by ju...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

juanpablo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jspwiki.git

commit 93fb6847acc5546088b6ba911b7cf015a5ba5d88
Author: Juan Pablo Santos Rodríguez <ju...@gmail.com>
AuthorDate: Tue Mar 22 11:49:36 2022 +0100

    JSPWIKI-802: load specific wiki syntax Wiki.Snips file, and then Wiki.Edit.js after it
---
 jspwiki-war/src/main/webapp/templates/default/editors/plain.jsp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/jspwiki-war/src/main/webapp/templates/default/editors/plain.jsp b/jspwiki-war/src/main/webapp/templates/default/editors/plain.jsp
index 18f1246..7b10ced 100644
--- a/jspwiki-war/src/main/webapp/templates/default/editors/plain.jsp
+++ b/jspwiki-war/src/main/webapp/templates/default/editors/plain.jsp
@@ -42,6 +42,8 @@
    String usertext = EditorManager.getEditedText( pageContext );
 %>
 <wiki:RequestResource type="script" resource="scripts/haddock-edit.js" />
+<wiki:RequestResource type="script" resource="engine://jspwiki.syntax.plain" />
+<wiki:RequestResource type="script" resource="scripts/haddock-wiki-edit.js" />
 <c:set var='context'><wiki:Variable var='requestcontext' /></c:set>
 <wiki:CheckRequestContext context="edit">
 <wiki:NoSuchPage> <%-- this is a new page, check if we're cloning --%>

[jspwiki] 11/15: Update dependencies

Posted by ju...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

juanpablo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jspwiki.git

commit d0e0d1880140286014a4c7a80b7e16756ca9ecb3
Author: Juan Pablo Santos Rodríguez <ju...@gmail.com>
AuthorDate: Tue Mar 22 12:06:24 2022 +0100

    Update dependencies
    
    * Mockito to 4.4.0 (closes #176)
    * Selenide to 6.3.5
    * Tomcat to 9.0.60
---
 pom.xml | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/pom.xml b/pom.xml
index 1ab01f5..b9a0215 100644
--- a/pom.xml
+++ b/pom.xml
@@ -69,15 +69,15 @@
     <junit.version>5.8.2</junit.version>
     <log4j2.version>2.17.2</log4j2.version>
     <lucene.version>8.11.1</lucene.version> <!-- 9.0.0 and above require JDK >= 11 to execute -->
-    <mockito.version>4.3.1</mockito.version>
+    <mockito.version>4.4.0</mockito.version>
     <nekohtml.version>2.0.2</nekohtml.version> <!-- 2.1.0 and above require JDK >= 11 to execute -->
     <oro.version>2.0.8</oro.version>
     <sandler.version>0.5</sandler.version>
-    <selenide.version>6.3.4</selenide.version>
+    <selenide.version>6.3.5</selenide.version>
     <slf4j.version>1.7.36</slf4j.version>
     <stripes.version>1.7.0-async-beta</stripes.version>
     <tika.version>2.3.0</tika.version>
-    <tomcat.version>9.0.59</tomcat.version>
+    <tomcat.version>9.0.60</tomcat.version>
     <wro4j.version>1.8.0</wro4j.version> <!-- 1.9.0 and above require JDK >= 9 to execute -->
     <xmlrpc.version>2.0.1</xmlrpc.version>