org.deepamehta.plugins.review
Class ReviewPlugin

Show UML class diagram
java.lang.Object
  extended by de.deepamehta.core.osgi.PluginActivator
      extended by org.deepamehta.plugins.review.ReviewPlugin
All Implemented Interfaces:
PluginContext, PluginService, ReviewService, org.osgi.framework.BundleActivator

public class ReviewPlugin
extends PluginActivator
implements ReviewService

A very stupid plugin for counting likes/dislikes on any kind of topics in DeepaMehta. * Counting values seperately as "Good" and "So-so", depends on introducing Migration2 to your application model. * Counting values as one accumulate "Score", depends on introducing Migration1 to your application model.

Version:
0.3.6
Author:
Malte Reißig ()

Field Summary
static String GOOD_TYPE_URI
           
private  Logger log
           
static String SCORE_TYPE_URI
           
static String SOSO_TYPE_URI
           
 
Fields inherited from class de.deepamehta.core.osgi.PluginActivator
bundle, dms
 
Constructor Summary
ReviewPlugin()
           
 
Method Summary
 Topic addToGood(long resourceId, ClientState clientState)
          Increments the number of supportive voices (yelling "Good!").
 Topic addToSoso(long resourceId, ClientState clientState)
          Increments the number of supportive voices (yelling "Well, so so.").
 Topic downvoteResourceById(long resourceId, ClientState clientState)
          Decrements the score of any given topic.
 Topic upvoteResourceById(long resourceId, ClientState clientState)
          Increments the score of any given topic.
 
Methods inherited from class de.deepamehta.core.osgi.PluginActivator
getBundleContext, getUri, init, postInstall, publishDirectory, serviceArrived, serviceGone, setCoreService, shutdown, start, stop, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

log

private Logger log

SCORE_TYPE_URI

public static final String SCORE_TYPE_URI
See Also:
Constant Field Values

GOOD_TYPE_URI

public static final String GOOD_TYPE_URI
See Also:
Constant Field Values

SOSO_TYPE_URI

public static final String SOSO_TYPE_URI
See Also:
Constant Field Values
Constructor Detail

ReviewPlugin

public ReviewPlugin()
Method Detail

addToGood

public Topic addToGood(long resourceId,
                       @HeaderParam(value="Cookie")
                       ClientState clientState)
Increments the number of supportive voices (yelling "Good!").

Specified by:
addToGood in interface ReviewService
Parameters:
resourceId -
clientState -

addToSoso

public Topic addToSoso(long resourceId,
                       @HeaderParam(value="Cookie")
                       ClientState clientState)
Increments the number of supportive voices (yelling "Well, so so.").

Specified by:
addToSoso in interface ReviewService
Parameters:
resourceId -
clientState -

upvoteResourceById

public Topic upvoteResourceById(long resourceId,
                                @HeaderParam(value="Cookie")
                                ClientState clientState)
Increments the score of any given topic.

Specified by:
upvoteResourceById in interface ReviewService
Parameters:
resourceId -
clientState -

downvoteResourceById

public Topic downvoteResourceById(long resourceId,
                                  @HeaderParam(value="Cookie")
                                  ClientState clientState)
Decrements the score of any given topic.

Specified by:
downvoteResourceById in interface ReviewService
Parameters:
resourceId -
clientState -


Copyright © 2014. All Rights Reserved.