You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by ah...@apache.org on 2019/07/04 14:35:36 UTC
[isis] branch v2 updated: ISIS-2139 DemoApp: make the 'spring'
profile activate by default
This is an automated email from the ASF dual-hosted git repository.
ahuber pushed a commit to branch v2
in repository https://gitbox.apache.org/repos/asf/isis.git
The following commit(s) were added to refs/heads/v2 by this push:
new 7717a0d ISIS-2139 DemoApp: make the 'spring' profile activate by default
7717a0d is described below
commit 7717a0d3bd9f2b951270ebfbe10c4fcde9006224
Author: Andi Huber <ah...@apache.org>
AuthorDate: Thu Jul 4 16:35:29 2019 +0200
ISIS-2139 DemoApp: make the 'spring' profile activate by default
- also refine/cleanup syntax-highlighting
---
examples/apps/demo/pom.xml | 23 ++-
.../java/domainapp/dom/events/EventLogMenu.java | 2 +-
.../java/domainapp/dom/events/EventSubscriber.java | 2 +-
.../apps/demo/src/main/webapp/css/application.css | 161 +--------------------
.../main/webapp/css/{application.css => prism.css} | 20 ---
.../extensions/asciidoc/AsciiDocConverter.java | 13 +-
.../asciidoc/src/main/resources/prism.css | 20 ---
.../fixtures/src/main/resources/prism.css | 20 ---
.../fixtures/src/main/resources/prism1.14.js | 8 +
.../extensions/markdown/MarkdownConverter.java | 13 +-
10 files changed, 47 insertions(+), 235 deletions(-)
diff --git a/examples/apps/demo/pom.xml b/examples/apps/demo/pom.xml
index d50cbe2..f7df9f9 100644
--- a/examples/apps/demo/pom.xml
+++ b/examples/apps/demo/pom.xml
@@ -30,7 +30,7 @@
<properties>
- <packaging.type>war</packaging.type>
+ <packaging.type>jar</packaging.type>
<compiler-plugin.source>1.8</compiler-plugin.source>
<compiler-plugin.target>1.8</compiler-plugin.target>
@@ -52,7 +52,7 @@
<dependencies>
<!-- ISIS WEB-APP BUNDLE -->
-
+
<dependency>
<groupId>org.apache.isis.mavendeps</groupId>
<artifactId>isis-mavendeps-webapp</artifactId>
@@ -80,15 +80,15 @@
<groupId>org.apache.isis.core</groupId>
<artifactId>isis-plugins-jaxrs-resteasy-4</artifactId>
</dependency>
-
+
<!-- ISIS EXTENSIONS -->
-
+
<dependency>
<groupId>org.apache.isis.extensions</groupId>
<artifactId>isis-extensions-viewer-wicket-excel</artifactId>
<version>${isis.version}</version>
</dependency>
-
+
<dependency>
<groupId>org.apache.isis.extensions</groupId>
<artifactId>isis-extensions-asciidoc</artifactId>
@@ -155,6 +155,10 @@
<value>tomcat</value>
</property>
</activation>
+ <properties>
+ <packaging.type>war</packaging.type>
+ <skip.spring>true</skip.spring>
+ </properties>
<dependencies>
<!-- add flavor specific here -->
</dependencies>
@@ -168,18 +172,21 @@
<value>payara</value>
</property>
</activation>
+ <properties>
+ <packaging.type>war</packaging.type>
+ <skip.spring>true</skip.spring>
+ </properties>
<dependencies>
<!-- add flavor specific here -->
</dependencies>
</profile>
- <!-- building: mvn clean install -Dspring -->
- <!-- running: mvn spring-boot:run -Dspring -->
+ <!-- running: mvn spring-boot:run -->
<profile>
<id>spring</id>
<activation>
<property>
- <name>spring</name>
+ <name>!skip.spring</name>
</property>
</activation>
<properties>
diff --git a/examples/apps/demo/src/main/java/domainapp/dom/events/EventLogMenu.java b/examples/apps/demo/src/main/java/domainapp/dom/events/EventLogMenu.java
index e040889..09979d3 100644
--- a/examples/apps/demo/src/main/java/domainapp/dom/events/EventLogMenu.java
+++ b/examples/apps/demo/src/main/java/domainapp/dom/events/EventLogMenu.java
@@ -30,7 +30,7 @@ import org.apache.isis.applib.annotation.NatureOfService;
import org.apache.isis.applib.events.domain.ActionDomainEvent;
import org.apache.isis.applib.services.eventbus.EventBusService;
-@DomainService(nature=NatureOfService.VIEW_MENU_ONLY)
+@DomainService(nature=NatureOfService.VIEW)
@DomainObjectLayout(named="Event Demo")
public class EventLogMenu {
diff --git a/examples/apps/demo/src/main/java/domainapp/dom/events/EventSubscriber.java b/examples/apps/demo/src/main/java/domainapp/dom/events/EventSubscriber.java
index 08efdf7..b1a4f39 100644
--- a/examples/apps/demo/src/main/java/domainapp/dom/events/EventSubscriber.java
+++ b/examples/apps/demo/src/main/java/domainapp/dom/events/EventSubscriber.java
@@ -50,7 +50,7 @@ public class EventSubscriber {
@PostConstruct
public void init() {
- log.info(emphasize("init"));
+ log.info(emphasize("EventSubscriber - PostConstruct"));
eventBusService.post(new EventSubscriberEvent());
}
diff --git a/examples/apps/demo/src/main/webapp/css/application.css b/examples/apps/demo/src/main/webapp/css/application.css
index de6c28b..0646355 100644
--- a/examples/apps/demo/src/main/webapp/css/application.css
+++ b/examples/apps/demo/src/main/webapp/css/application.css
@@ -1,3 +1,5 @@
+@import "prism.css";
+
/* fix brand icon */
.navbar-header a.navbar-brand {
margin-top: -14px;
@@ -7,164 +9,5 @@
font-size: 16px;
}
-.version-reference {
- font-style: italic;
- color: grey;
- font-family: monospace;
-}
-
-
-/* SECTION prism.js for syntax highlighting */
-/*****************************************************************************************/
-/* PrismJS 1.14.0
-http://prismjs.com/download.html#themes=prism-solarizedlight&languages=markup+css+clike+javascript+java */
-/*
- Solarized Color Schemes originally by Ethan Schoonover
- http://ethanschoonover.com/solarized
-
- Ported for PrismJS by Hector Matos
- Website: https://krakendev.io
- Twitter Handle: https://twitter.com/allonsykraken)
-*/
-
-/*
-SOLARIZED HEX
---------- -------
-base03 #002b36
-base02 #073642
-base01 #586e75
-base00 #657b83
-base0 #839496
-base1 #93a1a1
-base2 #eee8d5
-base3 #fdf6e3
-yellow #b58900
-orange #cb4b16
-red #dc322f
-magenta #d33682
-violet #6c71c4
-blue #268bd2
-cyan #2aa198
-green #859900
-*/
-
-code[class*="language-"],
-pre[class*="language-"] {
- color: #657b83; /* base00 */
- font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
- text-align: left;
- white-space: pre;
- word-spacing: normal;
- word-break: normal;
- word-wrap: normal;
-
- line-height: 1.5;
-
- -moz-tab-size: 4;
- -o-tab-size: 4;
- tab-size: 4;
-
- -webkit-hyphens: none;
- -moz-hyphens: none;
- -ms-hyphens: none;
- hyphens: none;
-}
-
-pre[class*="language-"]::-moz-selection, pre[class*="language-"] ::-moz-selection,
-code[class*="language-"]::-moz-selection, code[class*="language-"] ::-moz-selection {
- background: #073642; /* base02 */
-}
-
-pre[class*="language-"]::selection, pre[class*="language-"] ::selection,
-code[class*="language-"]::selection, code[class*="language-"] ::selection {
- background: #073642; /* base02 */
-}
-
-/* Code blocks */
-pre[class*="language-"] {
- padding: 1em;
- margin: .5em 0;
- overflow: auto;
- border-radius: 0.3em;
-}
-:not(pre) > code[class*="language-"],
-pre[class*="language-"] {
- background-color: #fdf6e3; /* base3 */
-}
-
-/* Inline code */
-:not(pre) > code[class*="language-"] {
- padding: .1em;
- border-radius: .3em;
-}
-
-.token.comment,
-.token.prolog,
-.token.doctype,
-.token.cdata {
- color: #93a1a1; /* base1 */
-}
-
-.token.punctuation {
- color: #586e75; /* base01 */
-}
-
-.namespace {
- opacity: .7;
-}
-
-.token.property,
-.token.tag,
-.token.boolean,
-.token.number,
-.token.constant,
-.token.symbol,
-.token.deleted {
- color: #268bd2; /* blue */
-}
-
-.token.selector,
-.token.attr-name,
-.token.string,
-.token.char,
-.token.builtin,
-.token.url,
-.token.inserted {
- color: #2aa198; /* cyan */
-}
-
-.token.entity {
- color: #657b83; /* base00 */
- background: #eee8d5; /* base2 */
-}
-
-.token.atrule,
-.token.attr-value,
-.token.keyword {
- color: #859900; /* green */
-}
-
-.token.function {
- color: #b58900; /* yellow */
-}
-
-.token.regex,
-.token.important,
-.token.variable {
- color: #cb4b16; /* orange */
-}
-
-.token.important,
-.token.bold {
- font-weight: bold;
-}
-.token.italic {
- font-style: italic;
-}
-
-.token.entity {
- cursor: help;
-}
-/*****************************************************************************************/
diff --git a/examples/apps/demo/src/main/webapp/css/application.css b/examples/apps/demo/src/main/webapp/css/prism.css
similarity index 86%
copy from examples/apps/demo/src/main/webapp/css/application.css
copy to examples/apps/demo/src/main/webapp/css/prism.css
index de6c28b..2a760d2 100644
--- a/examples/apps/demo/src/main/webapp/css/application.css
+++ b/examples/apps/demo/src/main/webapp/css/prism.css
@@ -1,21 +1,3 @@
-/* fix brand icon */
-.navbar-header a.navbar-brand {
- margin-top: -14px;
-}
-
-.welcome {
- font-size: 16px;
-}
-
-.version-reference {
- font-style: italic;
- color: grey;
- font-family: monospace;
-}
-
-
-/* SECTION prism.js for syntax highlighting */
-/*****************************************************************************************/
/* PrismJS 1.14.0
http://prismjs.com/download.html#themes=prism-solarizedlight&languages=markup+css+clike+javascript+java */
/*
@@ -166,5 +148,3 @@ pre[class*="language-"] {
.token.entity {
cursor: help;
}
-/*****************************************************************************************/
-
diff --git a/extensions/asciidoc/src/main/java/org/apache/isis/extensions/asciidoc/AsciiDocConverter.java b/extensions/asciidoc/src/main/java/org/apache/isis/extensions/asciidoc/AsciiDocConverter.java
index 628ef80..cd67784 100644
--- a/extensions/asciidoc/src/main/java/org/apache/isis/extensions/asciidoc/AsciiDocConverter.java
+++ b/extensions/asciidoc/src/main/java/org/apache/isis/extensions/asciidoc/AsciiDocConverter.java
@@ -28,9 +28,10 @@ public final class AsciiDocConverter {
/**
* For syntax highlighting to work, the client/browser needs to load specific
- * java-script. To enable load it with your {@code application.js}
+ * java-script and css.
* <p>
- * eg. like the one bundled with {@code src/main/resources/prism1.14.js}.
+ * 1) In your web-app's {@code scripts/application.js} include the bundled
+ * {@code src/main/resources/prism1.14.js}.
* <pre>
* function includeJs(jsFilePath) {
* var js = document.createElement("script");
@@ -41,8 +42,14 @@ public final class AsciiDocConverter {
*
* includeJs("/scripts/prism1.14.js");
* </pre>
+ * <p>
+ * 2) In your web-app's {@code css/application.css} include the bundled
+ * {@code src/main/resources/prism.css}.
+ * <pre>
+ * {@code @import "prism.css"}.
+ * </pre>
*
- * @param adoc - asciidoc formated input to be converted to HTML
+ * @param adoc - formated input to be converted to HTML
*/
public static String adocToHtml(String adoc) {
if(asciidoctor==null) {
diff --git a/examples/apps/demo/src/main/webapp/css/application.css b/extensions/asciidoc/src/main/resources/prism.css
similarity index 86%
copy from examples/apps/demo/src/main/webapp/css/application.css
copy to extensions/asciidoc/src/main/resources/prism.css
index de6c28b..2a760d2 100644
--- a/examples/apps/demo/src/main/webapp/css/application.css
+++ b/extensions/asciidoc/src/main/resources/prism.css
@@ -1,21 +1,3 @@
-/* fix brand icon */
-.navbar-header a.navbar-brand {
- margin-top: -14px;
-}
-
-.welcome {
- font-size: 16px;
-}
-
-.version-reference {
- font-style: italic;
- color: grey;
- font-family: monospace;
-}
-
-
-/* SECTION prism.js for syntax highlighting */
-/*****************************************************************************************/
/* PrismJS 1.14.0
http://prismjs.com/download.html#themes=prism-solarizedlight&languages=markup+css+clike+javascript+java */
/*
@@ -166,5 +148,3 @@ pre[class*="language-"] {
.token.entity {
cursor: help;
}
-/*****************************************************************************************/
-
diff --git a/examples/apps/demo/src/main/webapp/css/application.css b/extensions/fixtures/src/main/resources/prism.css
similarity index 86%
copy from examples/apps/demo/src/main/webapp/css/application.css
copy to extensions/fixtures/src/main/resources/prism.css
index de6c28b..2a760d2 100644
--- a/examples/apps/demo/src/main/webapp/css/application.css
+++ b/extensions/fixtures/src/main/resources/prism.css
@@ -1,21 +1,3 @@
-/* fix brand icon */
-.navbar-header a.navbar-brand {
- margin-top: -14px;
-}
-
-.welcome {
- font-size: 16px;
-}
-
-.version-reference {
- font-style: italic;
- color: grey;
- font-family: monospace;
-}
-
-
-/* SECTION prism.js for syntax highlighting */
-/*****************************************************************************************/
/* PrismJS 1.14.0
http://prismjs.com/download.html#themes=prism-solarizedlight&languages=markup+css+clike+javascript+java */
/*
@@ -166,5 +148,3 @@ pre[class*="language-"] {
.token.entity {
cursor: help;
}
-/*****************************************************************************************/
-
diff --git a/extensions/fixtures/src/main/resources/prism1.14.js b/extensions/fixtures/src/main/resources/prism1.14.js
new file mode 100644
index 0000000..2d22f87
--- /dev/null
+++ b/extensions/fixtures/src/main/resources/prism1.14.js
@@ -0,0 +1,8 @@
+/* PrismJS 1.14.0
+http://prismjs.com/download.html#themes=prism&languages=markup+css+clike+javascript+java */
+var _self="undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{},Prism=function(){var e=/\blang(?:uage)?-([\w-]+)\b/i,t=0,n=_self.Prism={manual:_self.Prism&&_self.Prism.manual,disableWorkerMessageHandler:_self.Prism&&_self.Prism.disableWorkerMessageHandler,util:{encode:function(e){return e instanceof r?new r(e.type,n.util.encode(e.content),e.alias):"Array"===n.util.type(e)?e.map(n.util.encode):e.replace(/&/g,"&").replace(/</ [...]
+Prism.languages.markup={comment:/<!--[\s\S]*?-->/,prolog:/<\?[\s\S]+?\?>/,doctype:/<!DOCTYPE[\s\S]+?>/i,cdata:/<!\[CDATA\[[\s\S]*?]]>/i,tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s'">=]+))?)*\s*\/?>/i,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/i,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"attr-value":{pattern:/=(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s'">=]+)/i,inside:{punctuation:[/^=/,{pattern:/(^|[^\\])["']/,lookbehin [...]
+Prism.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:/@[\w-]+?.*?(?:;|(?=\s*\{))/i,inside:{rule:/@[\w-]+/}},url:/url\((?:(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1|.*?)\)/i,selector:/[^{}\s][^{};]*?(?=\s*\{)/,string:{pattern:/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},property:/[-_a-z\xA0-\uFFFF][-\w\xA0-\uFFFF]*(?=\s*:)/i,important:/\B!important\b/i,"function":/[-a-z0-9]+(?=\()/i,punctuation:/[(){};:]/},Prism.languages.css.atrule.inside.rest=Prism.languages [...]
+Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/((?:\b(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|conti [...]
+Prism.languages.javascript=Prism.languages.extend("clike",{keyword:/\b(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|var|void|while|with|yield)\b/,number:/\b(?:0[xX][\dA-Fa-f]+|0[bB][01]+|0[oO][0-7]+|NaN|Infinity)\b|(?:\b\d+\.?\d*|\B\.\d+)(?:[Ee][+-]?\d+ [...]
+Prism.languages.java=Prism.languages.extend("clike",{keyword:/\b(?:abstract|continue|for|new|switch|assert|default|goto|package|synchronized|boolean|do|if|private|this|break|double|implements|protected|throw|byte|else|import|public|throws|case|enum|instanceof|return|transient|catch|extends|int|short|try|char|final|interface|static|void|class|finally|long|strictfp|volatile|const|float|native|super|while)\b/,number:/\b0b[01]+\b|\b0x[\da-f]*\.?[\da-fp-]+\b|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d [...]
\ No newline at end of file
diff --git a/extensions/markdown/src/main/java/org/apache/isis/extensions/markdown/MarkdownConverter.java b/extensions/markdown/src/main/java/org/apache/isis/extensions/markdown/MarkdownConverter.java
index eb34ec8..2cd24f1 100644
--- a/extensions/markdown/src/main/java/org/apache/isis/extensions/markdown/MarkdownConverter.java
+++ b/extensions/markdown/src/main/java/org/apache/isis/extensions/markdown/MarkdownConverter.java
@@ -30,9 +30,10 @@ public final class MarkdownConverter {
/**
* For syntax highlighting to work, the client/browser needs to load specific
- * java-script. To enable load it with your {@code application.js}
+ * java-script and css.
* <p>
- * eg. like the one bundled with {@code src/main/resources/prism1.14.js}.
+ * 1) In your web-app's {@code scripts/application.js} include the bundled
+ * {@code src/main/resources/prism1.14.js}.
* <pre>
* function includeJs(jsFilePath) {
* var js = document.createElement("script");
@@ -43,8 +44,14 @@ public final class MarkdownConverter {
*
* includeJs("/scripts/prism1.14.js");
* </pre>
+ * <p>
+ * 2) In your web-app's {@code css/application.css} include the bundled
+ * {@code src/main/resources/prism.css}.
+ * <pre>
+ * {@code @import "prism.css"}.
+ * </pre>
*
- * @param markdown - markdown formated input to be converted to HTML
+ * @param markdown - formated input to be converted to HTML
*/
public static String mdToHtml(String markdown) {
if(markdownSupport==null) {