diff --git a/src/main/kotlin/org/ro/core/aggregator/ListAggregator.kt b/src/main/kotlin/org/ro/core/aggregator/ListAggregator.kt index 5711216..0ac00e1 100644 --- a/src/main/kotlin/org/ro/core/aggregator/ListAggregator.kt +++ b/src/main/kotlin/org/ro/core/aggregator/ListAggregator.kt @@ -23,7 +23,7 @@ class ListAggregator(actionTitle: String) : BaseAggregator() { override fun update(logEntry: LogEntry, subType: String) { - //TODO duplicates should be caught earlier IMPROVE + //TODO duplicates should no be propagated to handlers at all: IMPROVE if (logEntry.state != EventState.DUPLICATE) { when (val obj = logEntry.getTransferObject()) { null -> log(logEntry) @@ -49,12 +49,11 @@ class ListAggregator(actionTitle: String) : BaseAggregator() { } private fun handleObject(obj: TObject) { - console.log("[LA.handleObject]") dsp.addData(obj) val l = obj.getLayoutLink()!! // Json.Layout is invoked first l.invokeWith(this) - // then Xml.Layout is to be called as well + // then Xml.Layout is to be invoked as well l.invokeWith(this, "xml") } @@ -64,11 +63,16 @@ class ListAggregator(actionTitle: String) : BaseAggregator() { // Eventually due to parallel invocations - only once required -> IMPROVE if (dspl.layout == null) { dspl.addLayout(layout) - } - dspl.propertyLayoutList.forEach { p -> - val l = p.link!! - if (!l.href.contains("datanucleus")) { //invoking DN links lead to an error - l.invokeWith(this) + dspl.propertyLayoutList.forEach { p -> + val l = p.link!! + val isDn = l.href.contains("datanucleus") + if (isDn) { + //invoking DN links leads to an error + val id = p.id!! + dspl.addPropertyDescription(id, id) + } else { + l.invokeWith(this) + } } } } diff --git a/src/main/kotlin/org/ro/core/model/ListDM.kt b/src/main/kotlin/org/ro/core/model/ListDM.kt index 2766c44..c791df4 100644 --- a/src/main/kotlin/org/ro/core/model/ListDM.kt +++ b/src/main/kotlin/org/ro/core/model/ListDM.kt @@ -24,16 +24,10 @@ class ListDM(override val title: String) : DisplayModel() { layout == null -> return false grid == null -> return false else -> { - val ps = propertyList.size val pls = propertyLayoutList.size val pds = propertyDescriptionList.size - val descriptionsComplete = ps >= pls - if (descriptionsComplete) { - console.log("[ListDM.canBeDisplayed] properties: $ps") - console.log("[ListDM.canBeDisplayed] propertyLayout: $pls") - console.log("[ListDM.canBeDisplayed] propertyDescriptions: $pds") - } - return descriptionsComplete //&& propertiesComplete + val descriptionsComplete = pds >= pls + return descriptionsComplete } } } @@ -41,7 +35,6 @@ class ListDM(override val title: String) : DisplayModel() { fun addLayout(layout: Layout) { this.layout = layout initPropertyLayoutList(layout) - console.log("[ListDM.addLayout] propertyLayoutList: ${propertyLayoutList.size}") } private fun initPropertyLayoutList(layout: Layout) { @@ -72,15 +65,17 @@ class ListDM(override val title: String) : DisplayModel() { } fun addPropertyDescription(p: Property) { - console.log("[DL.addPropertyDescription]") val id = p.id val e: Extensions = p.extensions!! val friendlyName = e.friendlyName - propertyDescriptionList.put(id, friendlyName) + addPropertyDescription(id, friendlyName) + } + + fun addPropertyDescription(key: String, value: String) { + propertyDescriptionList.put(key, value) } fun addProperty(property: Property) { -// console.log("[DL.addProperty]") propertyList.add(property) } diff --git a/src/main/kotlin/org/ro/to/Link.kt b/src/main/kotlin/org/ro/to/Link.kt index c9855aa..b2c13e9 100644 --- a/src/main/kotlin/org/ro/to/Link.kt +++ b/src/main/kotlin/org/ro/to/Link.kt @@ -40,7 +40,11 @@ data class Link(val rel: String = "", } fun isProperty() : Boolean { - return rel.endsWith("/property") + return type.endsWith("/object-property") + } + + fun isPropertyDescription() : Boolean { + return type.endsWith("/property-description") } fun isAction() : Boolean {