001 package de.deepamehta.plugins.facets.service;
002
003 import de.deepamehta.core.DeepaMehtaObject;
004 import de.deepamehta.core.RelatedTopic;
005 import de.deepamehta.core.Topic;
006 import de.deepamehta.core.model.TopicModel;
007 import de.deepamehta.core.service.ClientState;
008 import de.deepamehta.core.service.Directives;
009 import de.deepamehta.core.service.PluginService;
010
011 import java.util.List;
012
013
014
015 public interface FacetsService extends PluginService {
016
017 Topic getFacet(long topicId, String facetTypeUri);
018
019 /**
020 * Retrieves a facet.
021 *
022 * @param object The facetted object: a topic, association, a type ...
023 * @param facetTypeUri URI of the facet type.
024 *
025 * @return The retrieved facet.
026 */
027 Topic getFacet(DeepaMehtaObject object, String facetTypeUri);
028
029 // ---
030
031 /**
032 * Retrieves a multi-facet.
033 *
034 * @param object The facetted object: a topic, association, a type ...
035 * @param facetTypeUri URI of the facet type.
036 *
037 * @return The retrieved multi-facet.
038 */
039 List<RelatedTopic> getFacets(DeepaMehtaObject object, String facetTypeUri);
040
041 // ---
042
043 void addFacetTypeToTopic(long topicId, String facetTypeUri);
044
045 // ---
046
047 /**
048 * Updates a facet.
049 *
050 * @param object The facetted object: a topic, association, a type ...
051 * @param facetTypeUri URI of the facet type.
052 * @param facetValue The new facet value.
053 * @param directives Must be not null at least for aggregated facets ### FIXME: directives are ignored
054 */
055 void updateFacet(DeepaMehtaObject object, String facetTypeUri, TopicModel facetValue,
056 ClientState clientState, Directives directives);
057
058 /**
059 * Updates a multi-facet.
060 *
061 * @param object The facetted object: a topic, association, a type ...
062 * @param facetTypeUri URI of the facet type.
063 * @param facetValues The new facet values.
064 * @param directives Must be not null at least for aggregated facets ### FIXME: directives are ignored
065 */
066 void updateFacets(DeepaMehtaObject object, String facetTypeUri, List<? extends TopicModel> facetValues,
067 ClientState clientState, Directives directives);
068
069 // ---
070
071 boolean hasFacet(long topicId, String facetTypeUri, long facetTopicId);
072 }