You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by jo...@apache.org on 2021/01/17 16:11:38 UTC
[isis] branch ISIS-2465_Kroviz-Demo_Menu_Actions_Show_No_Output
updated: ISIS-2465 DomainTypesHandler does not recursively load anymore,
thereby reducing the number of requests by ~ 1500
This is an automated email from the ASF dual-hosted git repository.
joergrade pushed a commit to branch ISIS-2465_Kroviz-Demo_Menu_Actions_Show_No_Output
in repository https://gitbox.apache.org/repos/asf/isis.git
The following commit(s) were added to refs/heads/ISIS-2465_Kroviz-Demo_Menu_Actions_Show_No_Output by this push:
new d00dc65 ISIS-2465 DomainTypesHandler does not recursively load anymore, thereby reducing the number of requests by ~ 1500
d00dc65 is described below
commit d00dc65ffa9e9f884877a13c8231221e4a92a50c
Author: Jörg Rade <jo...@kuehne-nagel.com>
AuthorDate: Sun Jan 17 17:10:50 2021 +0100
ISIS-2465 DomainTypesHandler does not recursively load anymore, thereby reducing the number of requests by ~ 1500
---
.../SampleChartModel.kt | 31 +--
.../client/kroviz/handler/DomainTypesHandler.kt | 8 +-
.../apache/isis/client/kroviz/ui/PumlBuilder.kt | 13 +-
.../apache/isis/client/kroviz/ui/kv/EventChart.kt | 10 +-
.../isis/client/kroviz/ui/kv/EventChartModel.kt | 25 +--
.../apache/isis/client/kroviz/ui/kv/RoMenuBar.kt | 1 +
.../kroviz/src/main/resources/img/claever.svg | 181 +++++++++++++++++
.../kroviz/src/main/resources/img/favicon.svg | 222 +++++++++++++++++++++
incubator/clients/kroviz/src/main/web/index.html | 2 +-
.../apache/isis/client/kroviz/PumlBuilderTest.kt | 51 ++++-
10 files changed, 493 insertions(+), 51 deletions(-)
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/SampleChartModel.kt b/incubator/clients/kroviz/src/main/kotlin/org.apache.isis.client.kroviz.ui.samples/SampleChartModel.kt
similarity index 62%
rename from incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/SampleChartModel.kt
rename to incubator/clients/kroviz/src/main/kotlin/org.apache.isis.client.kroviz.ui.samples/SampleChartModel.kt
index 0a6ee54..9cc66db 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/SampleChartModel.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org.apache.isis.client.kroviz.ui.samples/SampleChartModel.kt
@@ -1,23 +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
+ * 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
+ * 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.
+ * 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.isis.client.kroviz.ui.kv
+package org.apache.isis.client.kroviz.ui.samples
+import org.apache.isis.client.kroviz.ui.kv.ChartModel
import pl.treksoft.kvision.chart.DataSets
import pl.treksoft.kvision.core.Color
import pl.treksoft.kvision.i18n.I18n
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/handler/DomainTypesHandler.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/handler/DomainTypesHandler.kt
index ce552c4..d732a1c 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/handler/DomainTypesHandler.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/handler/DomainTypesHandler.kt
@@ -20,7 +20,6 @@ package org.apache.isis.client.kroviz.handler
import kotlinx.serialization.UnstableDefault
import kotlinx.serialization.json.Json
-import org.apache.isis.client.kroviz.core.aggregator.DomainTypesAggregator
import org.apache.isis.client.kroviz.to.DomainTypes
import org.apache.isis.client.kroviz.to.TransferObject
@@ -32,9 +31,10 @@ class DomainTypesHandler : org.apache.isis.client.kroviz.handler.BaseHandler() {
}
override fun doHandle() {
- val url = logEntry.url
- logEntry.addAggregator(DomainTypesAggregator(url))
- update()
+ //setting the Aggregator leads to cascading loads of all Domaintypes (~ 1500 requests for Demo)
+// val url = logEntry.url
+// logEntry.addAggregator(DomainTypesAggregator(url))
+// update()
}
}
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/PumlBuilder.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/PumlBuilder.kt
index 02739c4..380bafd 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/PumlBuilder.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/PumlBuilder.kt
@@ -27,6 +27,7 @@ import org.apache.isis.client.kroviz.to.DomainType
import org.apache.isis.client.kroviz.to.HasLinks
import org.apache.isis.client.kroviz.to.Link
import org.apache.isis.client.kroviz.to.RelType
+import org.apache.isis.client.kroviz.ui.kv.UiManager
class PumlBuilder {
@@ -87,8 +88,6 @@ class PumlBuilder {
var code = "$Q@startuml$NL"
code += iterateOverChildren(rootLE)
code += "@enduml$Q"
- console.log("[PumlBuilder.withLogEntry]")
- console.log(code)
return code
}
@@ -108,10 +107,14 @@ class PumlBuilder {
}
private fun amendWithChild(parentUrl: String, child: Link): String {
+ // kroki.io can not handle / (slash) in strings; escaping doesn't work either
+ val baseUrl = UiManager.getUrl()
+ var source = parentUrl.replace(baseUrl, "")
+ source = source.replace("/" , "_")
val childUrl = child.href
- val source = parentUrl.replace("http://localhost:8080/restful", "")
- val target = childUrl.replace("http://localhost:8080/restful", "")
- var code = "$Q$source$Q -> $Q$target$Q $NL"
+ var target = childUrl.replace(baseUrl, "")
+ target = target.replace("/" , "_")
+ var code = "$source -> $target $NL"
val rs = ResourceSpecification(childUrl)
val childLE = EventStore.find(rs)
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/EventChart.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/EventChart.kt
index 19c6880..57280fd 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/EventChart.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/EventChart.kt
@@ -29,7 +29,7 @@ class EventChart(model: ChartModel) : SimplePanel() {
private val font = "'Open Sans Bold', sans-serif"
private val yAxes = listOf(obj {
- scaleLabel = { ScaleTitleOptions(display = true, labelString = "duration (ms)") }
+ scaleLabel = { ScaleTitleOptions(display = true, labelString = "duration (ms)", fontFamily = font) }
gridLines = { GridLineOptions(visible = true) }
ticks = obj {
fontFamily = font
@@ -40,10 +40,10 @@ class EventChart(model: ChartModel) : SimplePanel() {
private val tickFormatter = "function(tick) {return tick.split('\\n')[1]}"
private val xAxes = listOf(obj {
- scaleLabel = { ScaleTitleOptions(display = true, labelString = "start offset (ms)") }
+ scaleLabel = { ScaleTitleOptions(display = true, labelString = "start offset (sec)", fontFamily = font) }
gridLines = { GridLineOptions(visible = true) }
ticks = obj {
- beginAtZero = true
+ beginAtZero = false
fontFamily = font
fontSize = 11.px
//WHAT A HACK
@@ -57,9 +57,7 @@ class EventChart(model: ChartModel) : SimplePanel() {
legend = LegendOptions(display = true),
scales = ChartScales(
yAxes = yAxes,
- xAxes = xAxes,
- display = true,
- type = ScalesType.TIME),
+ xAxes = xAxes),
showLines = true,
title = TitleOptions(display = true))
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/EventChartModel.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/EventChartModel.kt
index 5f76dcd..5b61a06 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/EventChartModel.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/EventChartModel.kt
@@ -18,11 +18,9 @@
*/
package org.apache.isis.client.kroviz.ui.kv
-import org.apache.isis.client.kroviz.core.event.EventStore
import org.apache.isis.client.kroviz.core.event.LogEntry
import pl.treksoft.kvision.chart.DataSets
import pl.treksoft.kvision.core.Color
-import kotlin.math.max
import kotlin.js.Date
class EventChartModel(log: List<LogEntry>) : ChartModel {
@@ -44,17 +42,16 @@ class EventChartModel(log: List<LogEntry>) : ChartModel {
private var startTime = Date()
init {
- val maxResponseLength = EventStore.maxResponseLength()
var i = 0
log.forEach { le ->
i += 1
if (i == 1) startTime = le.createdAt
- val q = le.responseLength.div(maxResponseLength)
+ val q = le.responseLength
when {
- (q >= 0) && (q <= 0.2) -> bgColorList.add(blue)
- (q > 0.2) && (q <= 0.4) -> bgColorList.add(green)
- (q > 0.4) && (q <= 0.6) -> bgColorList.add(yellow)
- (q > 0.6) && (q <= 0.8) -> bgColorList.add(red)
+ (q >= 0) && (q <= 1024) -> bgColorList.add(blue)
+ (q > 1024) && (q <= 2048) -> bgColorList.add(green)
+ (q > 2048) && (q <= 4096) -> bgColorList.add(yellow)
+ (q > 4096) && (q <= 8192) -> bgColorList.add(red)
else -> bgColorList.add(violett)
}
labelList.add(le.toLabel(i))
@@ -70,19 +67,13 @@ class EventChartModel(log: List<LogEntry>) : ChartModel {
}
fun LogEntry.toLabel(index: Int): String {
+ val relativeStarTime = ((this.createdAt.getTime() - startTime.getTime()) / 1000).toString()
+ val sec_1 = relativeStarTime.substring(0, relativeStarTime.length -2)
return index.toString() + "\n" +
- (this.createdAt.getTime() - startTime.getTime()).toString() + "\n" +
+ sec_1 + "\n" +
this.title + "\n" +
"start: " + this.createdAt.toISOString() + "\n" +
"rsp.len: " + this.responseLength
}
- fun EventStore.maxResponseLength(): Int {
- var maxRL = 0
- log.forEach { le ->
- maxRL = max(maxRL, le.responseLength)
- }
- return maxRL
- }
-
}
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/RoMenuBar.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/RoMenuBar.kt
index ed089d3..09318c9 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/RoMenuBar.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/RoMenuBar.kt
@@ -21,6 +21,7 @@ package org.apache.isis.client.kroviz.ui.kv
import org.apache.isis.client.kroviz.core.event.EventStore
import org.apache.isis.client.kroviz.to.mb.Menubars
import org.apache.isis.client.kroviz.ui.samples.GeoMap
+import org.apache.isis.client.kroviz.ui.samples.SampleChartModel
import org.apache.isis.client.kroviz.ui.samples.SvgInline
import org.apache.isis.client.kroviz.ui.samples.SvgMap
import org.apache.isis.client.kroviz.utils.IconManager
diff --git a/incubator/clients/kroviz/src/main/resources/img/claever.svg b/incubator/clients/kroviz/src/main/resources/img/claever.svg
new file mode 100644
index 0000000..be4826f
--- /dev/null
+++ b/incubator/clients/kroviz/src/main/resources/img/claever.svg
@@ -0,0 +1,181 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="756.36981"
+ height="756.36981"
+ id="svg2"
+ version="1.1"
+ inkscape:version="0.92.2 (5c3e80d, 2017-08-06)"
+ sodipodi:docname="Clover_symbol.svg">
+ <defs
+ id="defs4">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 526.18109 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="744.09448 : 526.18109 : 1"
+ inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+ id="perspective10" />
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="0.47417135"
+ inkscape:cx="-354.94387"
+ inkscape:cy="418.63076"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="false"
+ inkscape:window-width="2880"
+ inkscape:window-height="1495"
+ inkscape:window-x="3827"
+ inkscape:window-y="67"
+ inkscape:window-maximized="1" />
+ <metadata
+ id="metadata7">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title></dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(81.788246,-188.44201)">
+ <g
+ id="g2834"
+ transform="translate(4.2180348,-244.97944)"
+ style="fill:#339900">
+ <rect
+ transform="rotate(45)"
+ y="128.81105"
+ x="540.95331"
+ height="228.57143"
+ width="228.57143"
+ id="rect2816"
+ style="fill:#339900;fill-opacity:1;fill-rule:nonzero;stroke:none" />
+ <circle
+ transform="translate(-81.952479,151.13084)"
+ id="path2820"
+ style="fill:#339900;fill-opacity:1;fill-rule:nonzero;stroke:none"
+ cx="294.28571"
+ cy="400.93362"
+ r="117.14286" />
+ <circle
+ style="fill:#339900;fill-opacity:1;fill-rule:nonzero;stroke:none"
+ id="path2822"
+ transform="translate(77.738331,149.63069)"
+ cx="294.28571"
+ cy="400.93362"
+ r="117.14286" />
+ </g>
+ <!-- green -->
+ <g
+ transform="matrix(1,0,0,-1,4.2180347,1378.2333)"
+ id="g2839"
+ style="fill:#9BBB59">
+ <rect
+ style="fill:#9BBB59;fill-opacity:1;fill-rule:nonzero;stroke:none"
+ id="rect2841"
+ width="228.57143"
+ height="228.57143"
+ x="540.95331"
+ y="128.81105"
+ transform="rotate(45)" />
+ <circle
+ style="fill:#9BBB59;fill-opacity:1;fill-rule:nonzero;stroke:none"
+ id="path2843"
+ transform="translate(-81.952479,151.13084)"
+ cx="294.28571"
+ cy="400.93362"
+ r="117.14286" />
+ <circle
+ transform="translate(77.738331,149.63069)"
+ id="path2845"
+ style="fill:#9BBB59;fill-opacity:1;fill-rule:nonzero;stroke:none"
+ cx="294.28571"
+ cy="400.93362"
+ r="117.14286" />
+ </g>
+ <!-- yellow -->
+ <g
+ transform="rotate(90,416.77735,691.22564)"
+ id="g2859"
+ style="fill:#F79646">
+ <rect
+ style="fill:#F79646;fill-opacity:1;fill-rule:nonzero;stroke:none"
+ id="rect2861"
+ width="228.57143"
+ height="228.57143"
+ x="540.95331"
+ y="128.81105"
+ transform="rotate(45)" />
+ <circle
+ style="fill:#F79646;fill-opacity:1;fill-rule:nonzero;stroke:none"
+ id="path2863"
+ transform="translate(-81.952479,151.13084)"
+ cx="294.28571"
+ cy="400.93362"
+ r="117.14286" />
+ <circle
+ transform="translate(77.738331,149.63069)"
+ id="path2865"
+ style="fill:#F79646;fill-opacity:1;fill-rule:nonzero;stroke:none"
+ cx="294.28571"
+ cy="400.93362"
+ r="117.14286" />
+ </g>
+ <!-- blue -->
+ <g
+ id="g2867"
+ transform="matrix(0,1,1,0,-515.2097,274.44829)"
+ style="fill:#4F81BD">
+ <rect
+ transform="rotate(45)"
+ y="128.81105"
+ x="540.95331"
+ height="228.57143"
+ width="228.57143"
+ id="rect2869"
+ style="fill:#4F81BD;fill-opacity:1;fill-rule:nonzero;stroke:none" />
+ <circle
+ transform="translate(-81.952479,151.13084)"
+ id="path2871"
+ style="fill:#4F81BD;fill-opacity:1;fill-rule:nonzero;stroke:none"
+ cx="294.28571"
+ cy="400.93362"
+ r="117.14286" />
+ <circle
+ style="fill:#4F81BD;fill-opacity:1;fill-rule:nonzero;stroke:none"
+ id="path2873"
+ transform="translate(77.738331,149.63069)"
+ cx="294.28571"
+ cy="400.93362"
+ r="117.14286" />
+ </g>
+ <path
+ style="fill:#C0504D;fill-opacity:1;stroke-width:2.10894227"
+ d="m 292.44409,276.24527 c -46.08028,-46.09678 -85.57389,-86.1849 -87.76358,-89.0847 -13.6553,-18.08364 -21.56331,-43.21984 -21.56331,-68.54062 0,-50.917837 30.6962,-93.441035 79.2077,-109.7258122 35.18508,-11.8112416 76.41069,-5.2901011 104.93851,16.5993602 l 10.01748,7.686432 9.83234,-7.5052 c 46.81235,-35.732676 111.3974,-31.6665489 152.55621,9.604593 22.42968,22.490876 33.67123,49.601489 33.71804,81.315837 0.0306,20.77227 -4.06498,37.22126 -13.95305,56.0383 -6.5524,12.46921 -1 [...]
+ id="path829"
+ inkscape:connector-curvature="0"
+ transform="translate(-81.788246,188.44201)" />
+ </g>
+</svg>
diff --git a/incubator/clients/kroviz/src/main/resources/img/favicon.svg b/incubator/clients/kroviz/src/main/resources/img/favicon.svg
new file mode 100644
index 0000000..3a43b99
--- /dev/null
+++ b/incubator/clients/kroviz/src/main/resources/img/favicon.svg
@@ -0,0 +1,222 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Generator: Adobe Illustrator 15.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ version="1.1"
+ id="Livello_1"
+ x="0px"
+ y="0px"
+ width="588px"
+ height="588px"
+ viewBox="20.267 102.757 588 588"
+ enable-background="new 20.267 102.757 588 588"
+ xml:space="preserve"
+ sodipodi:docname="favicon.svg"
+ inkscape:version="0.92.2 (5c3e80d, 2017-08-06)"><metadata
+ id="metadata58"><rdf:RDF><cc:Work
+ rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage"/></cc:Work></rdf:RDF></metadata>
+ <defs
+ id="defs56"/>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="3840"
+ inkscape:window-height="2035"
+ id="namedview54"
+ showgrid="false"
+ inkscape:zoom="0.40136054"
+ inkscape:cx="291.50847"
+ inkscape:cy="294"
+ inkscape:window-x="-13"
+ inkscape:window-y="67"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="Livello_1"/>
+ <g
+ id="g51"><path
+ fill="#FFFFFF"
+ stroke="#F1F2F2"
+ stroke-width="3"
+ stroke-miterlimit="10"
+ d="M314.267,104.257h-0.006H314.267z"
+ id="path2" />
+ <path
+ fill="#FFFFFF"
+ stroke="#F1F2F2"
+ stroke-width="3"
+ stroke-miterlimit="10"
+ d="M593.641,309.856 c7.779,25.038,12.282,51.518,13.015,78.938C606.627,360.895,602.006,334.259,593.641,309.856z"
+ id="path4"/>
+ <path
+ fill="#FFFFFF"
+ stroke="#F1F2F2"
+ stroke-width="3"
+ stroke-miterlimit="10"
+ d="M320.269,689.182 c-1.997,0.04-3.995,0.076-6.002,0.076C316.274,689.258,318.274,689.229,320.269,689.182z"
+ id="path6"/>
+ <path
+ fill="#FFFFFF"
+ stroke="#F1F2F2"
+ stroke-width="3"
+ stroke-miterlimit="10"
+ d="M314.267,689.258 c-2.007,0-4.005-0.036-6.002-0.076C310.259,689.229,312.259,689.258,314.267,689.258z"
+ id="path8"/>
+ <path
+ fill="#FFFFFF"
+ stroke="#F1F2F2"
+ stroke-width="3"
+ stroke-miterlimit="10"
+ d="M308.266,104.333 c1.995-0.04,3.991-0.076,5.995-0.076C312.256,104.257,310.258,104.286,308.266,104.333z"
+ id="path10"/>
+ <path
+ fill="#FFFFFF"
+ stroke="#F1F2F2"
+ stroke-width="3"
+ stroke-miterlimit="10"
+ d="M314.268,104.257 C314.268,104.257,314.268,104.257,314.268,104.257c2.007,0,4.005,0.036,6.003,0.076 C318.275,104.286,316.275,104.257,314.268,104.257z"
+ id="path12"/>
+ <!-- red -->
+ <linearGradient
+ id="SVGID_1_"
+ gradientUnits="userSpaceOnUse"
+ x1="241.3174"
+ y1="737.666"
+ x2="389.318"
+ y2="5.6631"
+ gradientTransform="matrix(1 0 0 -1 -6 797)">
+ <stop
+ offset="0"
+ style="stop-color:#C0504D"
+ id="stop14"/>
+ <stop
+ offset="1"
+ style="stop-color:#C0504D"
+ id="stop16"/></linearGradient>
+ <path
+ fill="url(#SVGID_1_)"
+ stroke="#F1F2F2"
+ stroke-width="3"
+ stroke-miterlimit="10"
+ d="M497.885,194.197 c-35.951-52.42-101.821-88.07-177.614-89.864c-1.998-0.041-3.996-0.076-6.004-0.076c-0.002,0-0.004,0-0.006,0 c-2.004,0-4,0.036-5.995,0.076c-127.188,2.562-234.438,86.301-272.078,201.532c18.136-49.932,52.107-90.06,94.523-111.756 c22.219-11.365,46.75-17.683,72.544-17.683c41.792,0,80.278,16.559,110.958,44.369c31.15,28.237,54.245,68.078,64.56,113.999 c3.892,17.322,5.973,35.505,5.973,54.259c0,24.827-3.645,48.653-10.319,70.803c43.404-10.909,81.033-33.316 [...]
+ id="path19"/>
+ <g
+ id="g35">
+ <!-- yellow ???-->
+ <linearGradient
+ id="SVGID_2_"
+ gradientUnits="userSpaceOnUse"
+ x1="309.9668"
+ y1="107.8887"
+ x2="314.2646"
+ y2="107.8887"
+ gradientTransform="matrix(1 0 0 -1 -6 797)">
+ <stop
+ offset="0"
+ style="stop-color:#F79646"
+ id="stop23"/>
+ <stop
+ offset="1"
+ style="stop-color:#F79646"
+ id="stop25"/>
+ </linearGradient>
+ <!-- border around yellow area -->
+ <path
+ fill="url(#SVGID_2_)"
+ stroke="#F1F2F2"
+ stroke-width="3"
+ stroke-miterlimit="10"
+ d="M606.655,388.794 c-0.732-27.42-5.235-53.9-13.015-78.938c-36.443-117.287-144.715-202.931-273.37-205.523 c75.793,1.793,141.663,37.444,177.614,89.864c18.433,26.877,29.009,58.156,29.009,91.548c0,41.817-16.578,80.324-44.418,111.013 c-27.017,29.781-64.646,52.188-108.05,63.098c-19.077,4.795-39.263,7.38-60.159,7.38c-20.939,0-41.165-2.596-60.276-7.41 c11.732,38.949,32.869,72.69,60.221,97.485c30.68,27.81,69.165,44.369,110.956,44.369c31.125,0,60.417-9.186,86.018-25.35 [...]
+ id="path21"/>
+
+ <!-- blue -->
+ <linearGradient
+ id="SVGID_3_"
+ gradientUnits="userSpaceOnUse"
+ x1="27.7671"
+ y1="364.2666"
+ x2="384.7725"
+ y2="364.2666"
+ gradientTransform="matrix(1 0 0 -1 -6 797)">
+ <stop
+ offset="0"
+ style="stop-color:#4F81BD"
+ id="stop28"/>
+ <stop
+ offset="1"
+ style="stop-color:#4F81BD"
+ id="stop30"/>
+ </linearGradient>
+ <path
+ fill="url(#SVGID_3_)"
+ stroke="#F1F2F2"
+ stroke-width="3"
+ stroke-miterlimit="10"
+ d="M249.646,334.825 c20.38-5.543,42.089-8.545,64.622-8.545c22.49,0,44.159,2.99,64.505,8.513c-10.314-45.92-33.409-85.761-64.56-113.999 c-30.68-27.81-69.166-44.369-110.958-44.369c-25.794,0-50.325,6.318-72.544,17.683c-42.417,21.696-76.387,61.824-94.523,111.756 c-8.998,27.543-14.013,56.882-14.375,87.344c-0.014,1.183-0.045,2.361-0.045,3.547c0,158.094,125.431,286.855,282.199,292.285 c-84.513-3.441-156.088-48.998-186.572-112.624c-10.147-21.179-15.754-44.354-15.75 [...]
+ id="path33"/></g>
+ <!-- green-->
+ <linearGradient
+ id="SVGID_4_"
+ gradientUnits="userSpaceOnUse"
+ x1="282.7324"
+ y1="647.4258"
+ x2="404.7324"
+ y2="161.4258"
+ gradientTransform="matrix(1 0 0 -1 -6 797)"><stop
+ offset="0"
+ style="stop-color:#9BBB59"
+ id="stop37" />
+ <stop
+ offset="1"
+ style="stop-color:#9BBB59"
+ id="stop39"/></linearGradient>
+ <path
+ fill="url(#SVGID_4_)"
+ stroke="#F1F2F2"
+ stroke-width="3"
+ stroke-miterlimit="10"
+ d="M606.767,396.756 c0-2.662-0.04-5.315-0.111-7.961c0,0.086,0.003,0.172,0.003,0.259c0,80.965-38.63,151.355-95.473,187.267 c-25.601,16.174-54.893,25.359-86.018,25.359c-41.791,0-80.276-16.56-110.956-44.369c-27.353-24.795-48.489-58.536-60.221-97.485 c-6.669-22.141-10.311-45.956-10.311-70.772c0-18.743,2.079-36.915,5.965-54.228c-41.521,11.294-77.5,33.176-103.587,61.933 c-27.84,30.688-44.418,69.193-44.418,111.01c0,24.296,5.607,47.471,15.754,68.649c31,64.702,104.491,110. [...]
+ id="path42"/>
+ <!-- inner hole -->
+ <linearGradient
+ id="SVGID_5_"
+ gradientUnits="userSpaceOnUse"
+ x1="249.6802"
+ y1="400.2422"
+ x2="390.7451"
+ y2="400.2422"
+ gradientTransform="matrix(1 0 0 -1 -6 797)"><stop
+ offset="0"
+ style="stop-color:#FFFFFF"
+ id="stop44" />
+ <stop
+ offset="1"
+ style="stop-color:#000000"
+ id="stop46"/></linearGradient>
+ <path
+ fill="url(#SVGID_5_)"
+ fill-opacity="0"
+ d="M378.772,334.793c-20.346-5.523-42.015-8.513-64.505-8.513 c-22.533,0-44.242,3.002-64.622,8.545c-3.887,17.313-5.965,35.485-5.965,54.228c0,24.816,3.641,48.631,10.311,70.772 c19.111,4.814,39.337,7.41,60.276,7.41c20.896,0,41.082-2.585,60.159-7.38c6.675-22.15,10.319-45.977,10.319-70.803 C384.745,370.298,382.664,352.115,378.772,334.793z"
+ id="path49"/></g>
+ <path
+ style="opacity:1;fill:#ffffff;fill-opacity:0;stroke-width:2.49152541"
+ d="M 384.16132,494.88402 C 326.94137,486.2101 277.22048,446.98577 249.48456,388.63885 c -11.59841,-24.39909 -12.96285,-29.72873 -7.02783,-27.45125 9.3675,3.59464 49.05273,6.79172 65.99412,5.31654 44.88129,-3.90806 81.95698,-15.78327 113.43646,-36.3333 55.87667,-36.47667 86.09693,-87.41095 86.2585,-145.38307 0.081,-29.05609 -3.88755,-46.14479 -17.09784,-73.62438 C 481.18939,90.655892 476.47539,84.32144 455.35548,63.201529 441.97192,49.817976 431.62833,38.867797 432.36971,38.86 [...]
+ id="path4554"
+ transform="translate(20.267,102.757)"/>
+ <path
+ style="fill:#ffcc00;fill-opacity:1;stroke-width:2.49152541"
+ d="M 384.16132,494.88402 C 326.94137,486.2101 277.22048,446.98577 249.48456,388.63885 c -11.59841,-24.39909 -12.96285,-29.72873 -7.02783,-27.45125 9.3675,3.59464 49.05273,6.79172 65.99412,5.31654 44.88129,-3.90806 81.95698,-15.78327 113.43646,-36.3333 55.87667,-36.47667 86.09693,-87.41095 86.2585,-145.38307 0.081,-29.05609 -3.88755,-46.14479 -17.09784,-73.62438 C 481.18939,90.655892 476.47539,84.32144 455.35548,63.201529 441.97192,49.817976 431.62833,38.867797 432.36971,38.86 [...]
+ id="path4556"
+ transform="translate(20.267,102.757)"/>
+</svg>
diff --git a/incubator/clients/kroviz/src/main/web/index.html b/incubator/clients/kroviz/src/main/web/index.html
index da606f7..d420ab9 100644
--- a/incubator/clients/kroviz/src/main/web/index.html
+++ b/incubator/clients/kroviz/src/main/web/index.html
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html lang="en">
<head>
- <link rel="icon" type="image/svg+xml" href="img/kroviz-logo.svg" sizes="any">
+ <link rel="icon" type="image/svg+xml" href="img/claever.svg" sizes="any">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
diff --git a/incubator/clients/kroviz/src/test/kotlin/org/apache/isis/client/kroviz/PumlBuilderTest.kt b/incubator/clients/kroviz/src/test/kotlin/org/apache/isis/client/kroviz/PumlBuilderTest.kt
index 281276e..7b000bc 100644
--- a/incubator/clients/kroviz/src/test/kotlin/org/apache/isis/client/kroviz/PumlBuilderTest.kt
+++ b/incubator/clients/kroviz/src/test/kotlin/org/apache/isis/client/kroviz/PumlBuilderTest.kt
@@ -19,32 +19,77 @@
package org.apache.isis.client.kroviz
import kotlinx.serialization.UnstableDefault
+import org.apache.isis.client.kroviz.core.event.EventStore
+import org.apache.isis.client.kroviz.core.event.LogEntry
+import org.apache.isis.client.kroviz.core.event.ResourceSpecification
import org.apache.isis.client.kroviz.handler.DomainTypeHandler
+import org.apache.isis.client.kroviz.handler.ResponseHandler
+import org.apache.isis.client.kroviz.snapshots.Response
+import org.apache.isis.client.kroviz.snapshots.simpleapp1_16_0.RESTFUL
+import org.apache.isis.client.kroviz.snapshots.simpleapp1_16_0.RESTFUL_MENUBARS
+import org.apache.isis.client.kroviz.snapshots.simpleapp1_16_0.RESTFUL_SERVICES
import org.apache.isis.client.kroviz.snapshots.simpleapp1_16_0.SO
import org.apache.isis.client.kroviz.to.DomainType
+import org.apache.isis.client.kroviz.to.Method
import org.apache.isis.client.kroviz.ui.PumlBuilder
+import org.apache.isis.client.kroviz.ui.kv.UiManager
+import kotlin.test.BeforeTest
import kotlin.test.Test
+import kotlin.test.assertEquals
import kotlin.test.assertTrue
class PumlBuilderTest {
- val pkg = "domainapp.modules.simple.dom.impl"
- val cls = "SimpleObject"
+ @BeforeTest
+ fun setup() {
+ val user = "sven"
+ val pw = "pass"
+ val url = "http://${user}:${pw}@localhost:8080/restful/"
+ UiManager.login(url, user, pw)
+ }
@UnstableDefault
@Test
fun testSimpleObject() {
//given
+ val pkg = "domainapp.modules.simple.dom.impl"
+ val cls = "SimpleObject"
+
val jsonStr = SO.str
val domainType = DomainTypeHandler().parse(jsonStr) as DomainType
//when
val actual = PumlBuilder().with(domainType)
- //
+ //then
assertTrue(actual.startsWith("\"@startuml"))
assertTrue(actual.endsWith("@enduml\""))
assertTrue(actual.contains("package $pkg {\\n"))
assertTrue(actual.contains("class $cls\\n"))
}
+ //@Test //TODO IntegrationTest ?
+ fun testSequenceDiagram() {
+ //given
+ val rootLe = fillEventStoreWith(RESTFUL)
+ fillEventStoreWith(RESTFUL_SERVICES)
+ fillEventStoreWith(RESTFUL_MENUBARS)
+ //when
+ val actual = PumlBuilder().withLogEntry(rootLe)
+ //then
+ assertEquals(3, EventStore.log.size)
+ console.log("[PBT.testSequenceDiagram]")
+ console.log(actual)
+ assertTrue(actual.startsWith("\"@startuml"))
+ assertTrue(actual.endsWith("@enduml\""))
+ assertTrue(actual.contains("-> restful_services"))
+ }
+
+ private fun fillEventStoreWith(r: Response): LogEntry {
+ val rs = ResourceSpecification(r.url)
+ EventStore.start(rs, Method.GET.operation)
+ val logEntry = EventStore.end(rs, r.str)!!
+ ResponseHandler.handle(logEntry)
+ return logEntry
+ }
+
}