de.deepamehta.plugins.topicmaps.model
Class TopicmapViewmodel
java.lang.Object
de.deepamehta.plugins.topicmaps.model.TopicmapViewmodel
- All Implemented Interfaces:
- JSONEnabled
public class TopicmapViewmodel
- extends Object
- implements JSONEnabled
A topicmap viewmodel: a collection of topics and associations plus their view properties.
Features:
- load from DB (by constructor).
- Serialization to JSON.
topicmapTopic
private Topic topicmapTopic
topics
private Map<Long,TopicViewmodel> topics
assocs
private Map<Long,AssociationViewmodel> assocs
dms
private DeepaMehtaService dms
customizers
private List<ViewmodelCustomizer> customizers
logger
private Logger logger
TopicmapViewmodel
public TopicmapViewmodel(long topicmapId,
DeepaMehtaService dms,
List<ViewmodelCustomizer> customizers)
- Loads a topicmap from the DB.
getId
public long getId()
getTopics
public Iterable<TopicViewmodel> getTopics()
getAssociations
public Iterable<AssociationViewmodel> getAssociations()
toJSON
public JSONObject toJSON()
- Specified by:
toJSON
in interface JSONEnabled
toString
public String toString()
- Overrides:
toString
in class Object
loadTopics
private void loadTopics()
loadAssociations
private void loadAssociations()
invokeViewmodelCustomizers
private void invokeViewmodelCustomizers(Topic topic,
CompositeValueModel viewProps)
invokeViewmodelCustomizer
private void invokeViewmodelCustomizer(ViewmodelCustomizer customizer,
Topic topic,
CompositeValueModel viewProps)
addTopic
private void addTopic(TopicViewmodel topic)
addAssociation
private void addAssociation(AssociationViewmodel assoc)
Copyright © 2013. All Rights Reserved.