public class WebclientPlugin extends PluginActivator implements AllPluginsActiveListener, IntroduceTopicTypeListener, IntroduceAssociationTypeListener, PreUpdateTopicListener, PostUpdateTopicListener
Modifier and Type | Field and Description |
---|---|
private boolean |
hasWebclientLaunched |
private Logger |
logger |
private static String |
VIEW_CONFIG_LABEL |
bundle, dm4, mf
Constructor and Description |
---|
WebclientPlugin() |
Modifier and Type | Method and Description |
---|---|
void |
allPluginsActive() |
private Topic |
createSearchTopic(String searchTerm,
Collection<Topic> resultItems)
Creates a "Search" topic.
|
private Set<Topic> |
findSearchableUnits(List<? extends Topic> topics) |
List<RelatedTopic> |
getRelatedTopics(long topicId) |
Topic |
getTopics(String typeUri)
Performs a by-type search and creates a search result topic.
|
private Object |
getViewConfig(TopicType topicType,
String setting)
Read out a view configuration setting.
|
private String |
getWebclientUrl() |
private boolean |
hasAssocDef(Topic parentTopic,
RelatedTopic childTopic) |
void |
introduceAssociationType(AssociationType assocType) |
void |
introduceTopicType(TopicType topicType) |
private boolean |
isDirectModelledChildTopic(RelatedTopic childTopic,
Topic parentTopic) |
void |
postUpdateTopic(Topic topic,
TopicModel newModel,
TopicModel oldModel)
Once a view configuration is updated in the DB we must update the cached view configuration model.
|
void |
preUpdateTopic(Topic topic,
TopicModel newModel) |
private boolean |
searchableAsUnit(Topic topic) |
Topic |
searchTopics(String searchTerm,
String fieldUri)
Performs a fulltext search and creates a search result topic.
|
private void |
setConfigTopicLabel(Topic viewConfig) |
private void |
setViewConfigLabel(ViewConfiguration viewConfig) |
private void |
updateAssociationType(Topic type,
Topic viewConfig) |
private void |
updateTopicType(Topic type,
Topic viewConfig) |
private void |
updateType(Topic viewConfig) |
private void |
updateViewConfig(DeepaMehtaType type,
Topic viewConfig) |
getBundleContext, getPluginName, getStaticResource, getUri, init, preInstall, publishFileSystem, serviceArrived, serviceGone, setCoreService, shutdown, start, stop, toString
private static final String VIEW_CONFIG_LABEL
private boolean hasWebclientLaunched
public WebclientPlugin()
public Topic searchTopics(String searchTerm, String fieldUri)
public Topic getTopics(String typeUri)
Note: this resource method is actually part of the Type Search plugin. TODO: proper modularization. Either let the Type Search plugin provide its own REST resource (with another namespace again) or make the Type Search plugin an integral part of the Webclient plugin.
public List<RelatedTopic> getRelatedTopics(long topicId)
public void allPluginsActive()
allPluginsActive
in interface AllPluginsActiveListener
public void preUpdateTopic(Topic topic, TopicModel newModel)
preUpdateTopic
in interface PreUpdateTopicListener
public void postUpdateTopic(Topic topic, TopicModel newModel, TopicModel oldModel)
postUpdateTopic
in interface PostUpdateTopicListener
public void introduceTopicType(TopicType topicType)
introduceTopicType
in interface IntroduceTopicTypeListener
public void introduceAssociationType(AssociationType assocType)
introduceAssociationType
in interface IntroduceAssociationTypeListener
private Set<Topic> findSearchableUnits(List<? extends Topic> topics)
private Topic createSearchTopic(String searchTerm, Collection<Topic> resultItems)
private boolean searchableAsUnit(Topic topic)
private Object getViewConfig(TopicType topicType, String setting)
Compare to client-side counterpart: function get_view_config() in webclient.js
topicType
- The topic type whose view configuration is read out.setting
- Last component of the setting URI, e.g. "icon".null
if there is no such settingprivate void updateType(Topic viewConfig)
private void updateTopicType(Topic type, Topic viewConfig)
private void updateAssociationType(Topic type, Topic viewConfig)
private void updateViewConfig(DeepaMehtaType type, Topic viewConfig)
private void setViewConfigLabel(ViewConfiguration viewConfig)
private void setConfigTopicLabel(Topic viewConfig)
private String getWebclientUrl()
private boolean isDirectModelledChildTopic(RelatedTopic childTopic, Topic parentTopic)
private boolean hasAssocDef(Topic parentTopic, RelatedTopic childTopic)
Copyright © 2016. All Rights Reserved.