Ticket #574 (closed Defect: fixed)
Updating an aggregated composite fails
Reported by: | jri | Owned by: | jri |
---|---|---|---|
Priority: | Major | Milestone: | Release 4.1.3 |
Component: | DeepaMehta Standard Distribution | Version: | 4.1.2 |
Keywords: | Cc: | dgf, Malte, JuergeN | |
Complexity: | 3 | Area: | |
Module: | deepamehta-core |
Description
When updating a topic which has an aggregated child (via Aggregation Definition) which is a composite a server-side error occurs:
java.lang.RuntimeException: Updating topic failed (topic (id=4169, ...)) at de.deepamehta.core.impl.EmbeddedService.updateTopic(EmbeddedService.java:182) ... Caused by: java.lang.RuntimeException: Updating composite value of topic 4169 failed (...) at de.deepamehta.core.impl.AttachedCompositeValue.update(AttachedCompositeValue.java:278) at de.deepamehta.core.impl.AttachedDeepaMehtaObject.update(AttachedDeepaMehtaObject.java:192) at de.deepamehta.core.impl.AttachedTopic.update(AttachedTopic.java:95) at de.deepamehta.core.impl.EmbeddedService.updateTopic(EmbeddedService.java:176) ... Caused by: java.lang.NullPointerException at de.deepamehta.core.impl.ValueStorage.isReferenceByUri(ValueStorage.java:183) at de.deepamehta.core.impl.ValueStorage.isReference(ValueStorage.java:175) at de.deepamehta.core.impl.AttachedCompositeValue.updateAggregationOne(AttachedCompositeValue.java:430) at de.deepamehta.core.impl.AttachedCompositeValue.updateChildTopics(AttachedCompositeValue.java:298) at de.deepamehta.core.impl.AttachedCompositeValue.update(AttachedCompositeValue.java:272) ...
This happens regardless of cardinality.
Thanks, Malte, for reporting (see #569).
Change History
comment:2 Changed 11 years ago by Jörg Richter
Core: fix updating aggregated composites (#574).
When updating an aggregated composite no error occurs.
As a by-product of that fix you can now have aggregated composites in your model and edit such a complex topic via the Webclient. This works now for the first time with the Webclient's standard renderers (see #30).
So a first version of what we called a "Editor for aggregated composites" (see #337) is now available. However it is just in its first incarnation that will possibly not survive for long. In its current form it realizes the most cautious approach in regard of unwanted semantic side effects (see comments in #30): every time an aggregated composite is edited a new instance of the composite is created. Thus a lot of possibly useless (because unassigned) topics remain in the DB.
CHANGES
Core API: there is a new model class:
de.deepamehta.core.model.TopicReferenceModel
A reference to a topic, either by ID, or by URI.
BREAKING CHANGES
The Core Service's composite object update logic does not rely on a fallible heuristic to detect weather a TopicModel? represents actually a topic reference (based on ID and URI) but utilizes explicit TopicReferenceModel? instances for that purpose (analogous to TopicDeletionModel?).
When your plugin creates a TopicModel? object to represent a reference (e.g. to pass it to the Facet Service's updateFacet() call) you must now create a TopicReferenceModel? instead. Otherwise your update call will throw an error resp. have unexpected results.
See #574.