Ticket #519 (closed Task: fixed)

Opened 11 years ago

Last modified 11 years ago

Redesign the Topicmaps API

Reported by: jri Owned by: jri
Priority: Major Milestone: Release 4.2
Component: DeepaMehta Standard Distribution Version: 4.1.2
Keywords: Cc: dgf, Malte, ziegi
Complexity: 3 Area: Application Framework / API
Module: deepamehta-topicmaps

Description

The API of the Topicmaps service (and its REST interface) should be redesigned in a way it is extensible.

The API must not change when further viewmodel properties are added (by a Viewmodel Customizer, see #505). The author of a Viewmodel Customizer must not be required to provide a proprietary service (and REST interface) to store/update the proprietary viewmodel properties.

The solution is to introduce an abstraction of the viewmodel properties ("x", "y", "visibility" in the standard model). All Topicmaps service methods which deal with these properties will be affected. Note: within a TopicViewmodel? this abstraction is already effective (in form of a CompositeValueModel?) but not yet reflected in the Topicmaps service API.

Change History

comment:1 Changed 11 years ago by Jörg Richter

Topicmaps module: rename model classes (#519).

BREAKING CHANGE

"Topicmap" -> "TopicmapViewmodel?"
"TopicmapTopic?" -> "TopicViewmodel?"
"TopicmapAssociation?" -> "AssociationViewmodel?"

In preparation of redesigning the Topicmaps API.

See #519.

comment:2 Changed 11 years ago by Jörg Richter

Extensible Topicmaps API (#519).

For the sake of extensibility both, standard and custom view properties are hold in a generic "viewProps" object (a CompositeValueModel?). Thus the addition of custom view properties neither require changes in the Topicmaps API neither require the author of a Viewmodel Customizer to provide its own REST API for updating the custom view properties.

The Topicmaps API has a new method:

void updateViewProperties(long topicmapId, long topicId, CompositeValueModel viewProps)

This generic method can be used for updating both, standard and custom view properties. The methods for updating standard view properties (moveTopic() and setTopicVisibility()) remain in the Topicmaps API for convenience reasons.

BREAKING CHANGE

Changes in Topicmaps API:

The "x", "y" paramters of the addTopicToTopicmap() method are replaced by a generic "viewProps" parameter.

void addTopicToTopicmap(long topicmapId, long topicId, CompositeValueModel viewProps)

To set the standard view properties use these keys:

dm4.topicmaps.x
dm4.topicmaps.y
dm4.topicmaps.visibility

The REST API has changed accordingly:

POST /topicmap/{id}/topic/{id}

The view properties are contained in the message body.
Both CompositeValueModel? serialization formats are supported ("canonic" and "compact").

The REST client has changes accordingly:

dm4c.restc.add_topic_to_topicmap(topicmap_id, topic_id, view_props)

See #519.

comment:3 Changed 11 years ago by jri

  • Status changed from new to closed
  • Resolution set to fixed
Note: See TracTickets for help on using tickets.