de.kiezatlas
Class KiezatlasPlugin

Show UML class diagram
java.lang.Object
  extended by de.deepamehta.core.osgi.PluginActivator
      extended by de.kiezatlas.KiezatlasPlugin
All Implemented Interfaces:
PluginContext, PostUpdateTopicListener, PreSendTopicListener, EventListener, PluginService, KiezatlasService, org.osgi.framework.BundleActivator

public class KiezatlasPlugin
extends PluginActivator
implements KiezatlasService, PostUpdateTopicListener, PreSendTopicListener


Field Summary
private  FacetsService facetsService
           
private  GeomapsService geomapsService
           
private  Logger logger
           
private static String ROLE_TYPE_FACET_TYPE
           
private static String ROLE_TYPE_GEOMAP
           
private static String ROLE_TYPE_WEBSITE
           
private static String TYPE_URI_GEO_OBJECT
           
private static String TYPE_URI_GEO_OBJECT_NAME
           
private static String WEBSITE_FACET_TYPES
           
private static String WEBSITE_GEOMAP
           
 
Fields inherited from class de.deepamehta.core.osgi.PluginActivator
bundle, dms
 
Constructor Summary
KiezatlasPlugin()
           
 
Method Summary
private  void enrichWithFacets(Topic geoObject, ResultList<RelatedTopic> facetTypes)
           
private  void enrichWithMultiFacet(Topic geoObject, String facetTypeUri)
           
private  void enrichWithSingleFacet(Topic geoObject, String facetTypeUri)
           
private  List<Topic> fetchAllCriteria()
          Returns all Kiezatlas ctriteria.
private  List<Topic> fetchGeoObjects(long geomapId)
           
private  AssociationDefinition getAssocDef(String facetTypeUri)
           
private  String getChildTypeUri(String facetTypeUri)
           
private  ResultList<RelatedTopic> getFacetTypes(ClientState clientState)
          Returns the facet types for the current topicmap, or null if the facet types can't be determined.
 ResultList<RelatedTopic> getFacetTypes(long websiteId)
          Returns the facet types assigned to the given Kiezatlas Website.
private  Topic getGeoObject(Topic geoObjectName)
           
 List<Topic> getGeoObjects(long geomapId)
          Returns all Geo Objects assigned to the given geomap.
 List<RelatedTopic> getGeoObjectsByCategory(long categoryId)
          Returns all Geo Objects assigned to the given category.
 Topic getWebsite(long geomapId)
          Returns the "Kiezatlas Website" topic the given geomap is assigned to.
private  boolean isGeomap(long topicmapId)
           
private  boolean isMultiFacet(String facetTypeUri)
           
 InputStream launchWebclient()
           
 void postUpdateTopic(Topic topic, TopicModel newModel, TopicModel oldModel, ClientState clientState, Directives directives)
           
 void preSendTopic(Topic topic, ClientState clientState)
           
 GroupedGeoObjects searchCategories(String searchTerm, long clock)
          Searches for categories that match the search term (case-insensitive substring search) and returns all Geo Objects of those categories, grouped by category.
 GeoObjects searchGeoObjects(String searchTerm, long clock)
          Searches for Geo Objects whose name match the search term (case-insensitive substring search).
 void serviceArrived(PluginService service)
          Note: we *wait* for the Access Control service but we don't actually *consume* it.
 void serviceGone(PluginService service)
           
private  void updateFacets(Topic geoObject, ResultList<RelatedTopic> facetTypes, TopicModel newModel, ClientState clientState, Directives directives)
           
 
Methods inherited from class de.deepamehta.core.osgi.PluginActivator
getBundleContext, getUri, init, postInstall, publishDirectory, setCoreService, shutdown, start, stop, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TYPE_URI_GEO_OBJECT

private static final String TYPE_URI_GEO_OBJECT
See Also:
Constant Field Values

TYPE_URI_GEO_OBJECT_NAME

private static final String TYPE_URI_GEO_OBJECT_NAME
See Also:
Constant Field Values

WEBSITE_GEOMAP

private static final String WEBSITE_GEOMAP
See Also:
Constant Field Values

ROLE_TYPE_WEBSITE

private static final String ROLE_TYPE_WEBSITE
See Also:
Constant Field Values

ROLE_TYPE_GEOMAP

private static final String ROLE_TYPE_GEOMAP
See Also:
Constant Field Values

WEBSITE_FACET_TYPES

private static final String WEBSITE_FACET_TYPES
See Also:
Constant Field Values

ROLE_TYPE_FACET_TYPE

private static final String ROLE_TYPE_FACET_TYPE
See Also:
Constant Field Values

geomapsService

private GeomapsService geomapsService

facetsService

private FacetsService facetsService

logger

private Logger logger
Constructor Detail

KiezatlasPlugin

public KiezatlasPlugin()
Method Detail

launchWebclient

public InputStream launchWebclient()

getWebsite

public Topic getWebsite(long geomapId)
Description copied from interface: KiezatlasService
Returns the "Kiezatlas Website" topic the given geomap is assigned to.

Specified by:
getWebsite in interface KiezatlasService

getFacetTypes

public ResultList<RelatedTopic> getFacetTypes(long websiteId)
Description copied from interface: KiezatlasService
Returns the facet types assigned to the given Kiezatlas Website.

Specified by:
getFacetTypes in interface KiezatlasService

getGeoObjects

public List<Topic> getGeoObjects(long geomapId)
Description copied from interface: KiezatlasService
Returns all Geo Objects assigned to the given geomap.

Specified by:
getGeoObjects in interface KiezatlasService

getGeoObjectsByCategory

public List<RelatedTopic> getGeoObjectsByCategory(long categoryId)
Description copied from interface: KiezatlasService
Returns all Geo Objects assigned to the given category.

Specified by:
getGeoObjectsByCategory in interface KiezatlasService

searchGeoObjects

public GeoObjects searchGeoObjects(String searchTerm,
                                   long clock)
Description copied from interface: KiezatlasService
Searches for Geo Objects whose name match the search term (case-insensitive substring search).

Specified by:
searchGeoObjects in interface KiezatlasService
clock - The logical clock value send back to the client (contained in GeoObjects). Allows the client to order asynchronous responses.

searchCategories

public GroupedGeoObjects searchCategories(String searchTerm,
                                          long clock)
Description copied from interface: KiezatlasService
Searches for categories that match the search term (case-insensitive substring search) and returns all Geo Objects of those categories, grouped by category.

Specified by:
searchCategories in interface KiezatlasService
clock - The logical clock value send back to the client (contained in GroupedGeoObjects). Allows the client to order asynchronous responses.

serviceArrived

public void serviceArrived(PluginService service)
Note: we *wait* for the Access Control service but we don't actually *consume* it. This ensures the Kiezatlas types are properly setup for Access Control.

Specified by:
serviceArrived in interface PluginContext
Overrides:
serviceArrived in class PluginActivator

serviceGone

public void serviceGone(PluginService service)
Specified by:
serviceGone in interface PluginContext
Overrides:
serviceGone in class PluginActivator

preSendTopic

public void preSendTopic(Topic topic,
                         ClientState clientState)
Specified by:
preSendTopic in interface PreSendTopicListener

postUpdateTopic

public void postUpdateTopic(Topic topic,
                            TopicModel newModel,
                            TopicModel oldModel,
                            ClientState clientState,
                            Directives directives)
Specified by:
postUpdateTopic in interface PostUpdateTopicListener

enrichWithFacets

private void enrichWithFacets(Topic geoObject,
                              ResultList<RelatedTopic> facetTypes)

enrichWithSingleFacet

private void enrichWithSingleFacet(Topic geoObject,
                                   String facetTypeUri)

enrichWithMultiFacet

private void enrichWithMultiFacet(Topic geoObject,
                                  String facetTypeUri)

updateFacets

private void updateFacets(Topic geoObject,
                          ResultList<RelatedTopic> facetTypes,
                          TopicModel newModel,
                          ClientState clientState,
                          Directives directives)

fetchAllCriteria

private List<Topic> fetchAllCriteria()
Returns all Kiezatlas ctriteria. A Kiezatlas ctriteria is a topic type whose URI starts with ka2.criteria. but does not end with .facet.


getFacetTypes

private ResultList<RelatedTopic> getFacetTypes(ClientState clientState)
Returns the facet types for the current topicmap, or null if the facet types can't be determined. There can be several reasons for the latter: a) there is no "current topicmap". This can be the case with 3rd-party clients. b) the current topicmap is not a geomap. c) the geomap is not part of a Kiezatlas Website.

Returns:
The facet types (as a result set, may be empty), or null.

fetchGeoObjects

private List<Topic> fetchGeoObjects(long geomapId)

getGeoObject

private Topic getGeoObject(Topic geoObjectName)

isGeomap

private boolean isGeomap(long topicmapId)

isMultiFacet

private boolean isMultiFacet(String facetTypeUri)

getChildTypeUri

private String getChildTypeUri(String facetTypeUri)

getAssocDef

private AssociationDefinition getAssocDef(String facetTypeUri)


Copyright © 2014. All Rights Reserved.