de.deepamehta.plugins.facets
Class FacetsPlugin

Show UML class diagram
java.lang.Object
  extended by de.deepamehta.core.osgi.PluginActivator
      extended by de.deepamehta.plugins.facets.FacetsPlugin
All Implemented Interfaces:
PluginContext, PluginService, FacetsService, BundleActivator

public class FacetsPlugin
extends PluginActivator
implements FacetsService


Field Summary
private  Logger logger
           
 
Fields inherited from class de.deepamehta.core.osgi.PluginActivator
bundle, dms
 
Constructor Summary
FacetsPlugin()
           
 
Method Summary
 void addFacetTypeToTopic(long topicId, String facetTypeUri)
           
private  RelatedTopic fetchChildTopic(DeepaMehtaObject object, AssociationDefinition assocDef, boolean fetchComposite)
          Fetches and returns a child topic or null if no such topic extists.
private  List<RelatedTopic> fetchChildTopics(DeepaMehtaObject object, AssociationDefinition assocDef, boolean fetchComposite)
          Fetches and returns child topics.
private  AssociationDefinition getAssocDef(String facetTypeUri)
           
 Topic getFacet(DeepaMehtaObject object, String facetTypeUri)
          Retrieves a facet.
 Topic getFacet(long topicId, String facetTypeUri)
           
 List<RelatedTopic> getFacets(DeepaMehtaObject object, String facetTypeUri)
          Retrieves a multi-facet.
 boolean hasFacet(long topicId, String facetTypeUri, long facetTopicId)
           
 void updateFacet(DeepaMehtaObject object, String facetTypeUri, TopicModel facetValue, ClientState clientState, Directives directives)
          Updates a facet.
 void updateFacets(DeepaMehtaObject object, String facetTypeUri, List<? extends TopicModel> facetValues, ClientState clientState, Directives directives)
          Updates a multi-facet.
 
Methods inherited from class de.deepamehta.core.osgi.PluginActivator
getBundleContext, init, postInstall, publishDirectory, serviceArrived, serviceGone, setCoreService, start, stop, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

logger

private Logger logger
Constructor Detail

FacetsPlugin

public FacetsPlugin()
Method Detail

getFacet

public Topic getFacet(long topicId,
                      String facetTypeUri)
Specified by:
getFacet in interface FacetsService

getFacet

public Topic getFacet(DeepaMehtaObject object,
                      String facetTypeUri)
Description copied from interface: FacetsService
Retrieves a facet.

Specified by:
getFacet in interface FacetsService
Parameters:
object - The facetted object: a topic, association, a type ...
facetTypeUri - URI of the facet type.
Returns:
The retrieved facet.

getFacets

public List<RelatedTopic> getFacets(DeepaMehtaObject object,
                                    String facetTypeUri)
Description copied from interface: FacetsService
Retrieves a multi-facet.

Specified by:
getFacets in interface FacetsService
Parameters:
object - The facetted object: a topic, association, a type ...
facetTypeUri - URI of the facet type.
Returns:
The retrieved multi-facet.

addFacetTypeToTopic

public void addFacetTypeToTopic(long topicId,
                                String facetTypeUri)
Specified by:
addFacetTypeToTopic in interface FacetsService

updateFacet

public void updateFacet(DeepaMehtaObject object,
                        String facetTypeUri,
                        TopicModel facetValue,
                        ClientState clientState,
                        Directives directives)
Description copied from interface: FacetsService
Updates a facet.

Specified by:
updateFacet in interface FacetsService
Parameters:
object - The facetted object: a topic, association, a type ...
facetTypeUri - URI of the facet type.
facetValue - The new facet value.
directives - Must be not null at least for aggregated facets ### FIXME: directives are ignored

updateFacets

public void updateFacets(DeepaMehtaObject object,
                         String facetTypeUri,
                         List<? extends TopicModel> facetValues,
                         ClientState clientState,
                         Directives directives)
Description copied from interface: FacetsService
Updates a multi-facet.

Specified by:
updateFacets in interface FacetsService
Parameters:
object - The facetted object: a topic, association, a type ...
facetTypeUri - URI of the facet type.
facetValues - The new facet values.
directives - Must be not null at least for aggregated facets ### FIXME: directives are ignored

hasFacet

public boolean hasFacet(long topicId,
                        String facetTypeUri,
                        long facetTopicId)
Specified by:
hasFacet in interface FacetsService

fetchChildTopic

private RelatedTopic fetchChildTopic(DeepaMehtaObject object,
                                     AssociationDefinition assocDef,
                                     boolean fetchComposite)
Fetches and returns a child topic or null if no such topic extists.

Note: There is a principal copy in AttachedDeepaMehtaObject but here the precondition is different: The given association definition must not necessarily originate from the given object's type definition. ### TODO: meanwhile we have the ValueStorage. Can we use its method instead?


fetchChildTopics

private List<RelatedTopic> fetchChildTopics(DeepaMehtaObject object,
                                            AssociationDefinition assocDef,
                                            boolean fetchComposite)
Fetches and returns child topics.

Note: There is a principal copy in AttachedDeepaMehtaObject but here the precondition is different: The given association definition must not necessarily originate from the given object's type definition. ### TODO: meanwhile we have the ValueStorage. Can we use its method instead?


getAssocDef

private AssociationDefinition getAssocDef(String facetTypeUri)


Copyright © 2013. All Rights Reserved.