|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.uka.ipd.consensus.foundation.AbstractConsensusFoundationModule de.uka.ipd.consensus.impl.TM4JRatingManagerImpl
TODO
Field Summary | |
static String |
NEUTRAL
Deprecated. |
static String |
NO
Deprecated. |
static String |
YES
Deprecated. |
Constructor Summary | |
TM4JRatingManagerImpl()
Deprecated. |
Method Summary | |
void |
addRating(Association rated,
Rating rating)
Deprecated. Adds the given rating to the given association. |
void |
addRating(Attribute rated,
Rating rating)
Deprecated. Adds the given rating to the given attribute. |
void |
addRating(Topic rated,
Rating rating)
Deprecated. Adds the given rating to the given topic. |
void |
addRating(User rated,
Rating rating)
Deprecated. Adds the given rating to the given user. |
void |
addRatingListener(RatingListener listener)
Deprecated. Registers a new RatingListener. |
boolean |
changesAllowed()
Deprecated. With this method the RatingManager signals if ratings, once added, can be changed afterwards. |
Rating |
createRating(User creator,
double value)
Deprecated. Creates a new rating with the given user as the creator ("owner" of the rating). |
void |
deleteRatings(Association association)
Deprecated. If an association is deleted permanently from the ontology, this method can be used to remove the ratings that were added to the association, too (including historical values). |
void |
deleteRatings(Attribute attribute)
Deprecated. If an attribute is deleted permanently from the ontology, this method can be used to remove the ratings that were added to the attribute, too (including historical values). |
void |
deleteRatings(Topic topic)
Deprecated. If a topic is deleted permanently from the ontology, this method can be used to remove the ratings that were added to the topic, too (including historical values). |
void |
deleteRatings(User user)
Deprecated. If a user is deleted permanently from the ontology and user database, this method can be used to remove the ratings that were added to the user, too (including historical values). |
protected void |
fireRatingChanged(Rating source,
Rateable rated,
double oldRatingValue)
Deprecated. |
protected void |
fireRatingSet(Rating source,
Rateable rated)
Deprecated. |
double |
getAverageRatingValue(Association association)
Deprecated. Returns the average (arithmetic mean) of all ratings for the given association. |
double |
getAverageRatingValue(Attribute attribute)
Deprecated. Returns the average (arithmetic mean) of all ratings for the given attribute. |
double |
getAverageRatingValue(Topic topic)
Deprecated. Returns the average (arithmetic mean) of all ratings for the given topic. |
double |
getAverageRatingValue(User user)
Deprecated. Returns the average (arithmetic mean) of all ratings that other users have added to the given user. |
protected Rateable |
getRateable(TM4JRatingImpl rating)
Deprecated. |
protected org.tm4j.topicmap.Topic |
getRateableTopicType()
Deprecated. |
Rating |
getRating(Association association,
User rater)
Deprecated. Returns the rating object that the given user has added to the given association (or null if the user hasn't rated the association yet). |
Rating |
getRating(Attribute attribute,
User rater)
Deprecated. Returns the rating object that the given user has added to the given attribute (or null if the user hasn't rated the attribute yet). |
Rating |
getRating(Topic topic,
User rater)
Deprecated. Returns the rating object that the given user has added to the given topic (or null if the user hasn't rated the topic yet). |
Rating |
getRating(User user,
User rater)
Deprecated. Returns the rating object that the given user (parameter "rater") has added to another user (parameter "user") - or null if the user hasn't rated the other user yet. |
Collection |
getRatings(Association association)
Deprecated. Returns a collection of all Rating objects that have been added to the given association. |
Collection |
getRatings(Attribute attribute)
Deprecated. Returns a collection of all Rating objects that have been added to the given attribute. |
Collection |
getRatings(Topic topic)
Deprecated. Returns a collection of all Rating objects that have been added to the given topic. |
Collection |
getRatings(User user)
Deprecated. Returns a collection of all Rating objects that have been added by other users to the given user. |
int |
getRatingsCount(Association association)
Deprecated. Returns the number of ratings that have been added to the given association. |
int |
getRatingsCount(Attribute attribute)
Deprecated. Returns the number of ratings that have been added to the given attribute. |
int |
getRatingsCount(Topic topic)
Deprecated. Returns the number of ratings that have been added to the given topic. |
int |
getRatingsCount(User user)
Deprecated. Returns the number of ratings that have been added by other users to the given user. |
protected org.tm4j.topicmap.Topic |
getRatingTopicType()
Deprecated. |
double |
getUsersAverageOwnRatingsValue(User user)
Deprecated. Returns the average (arithmetic mean) of all ratings that the given user has added to other rateable elements. |
Collection |
getUsersOwnRatings(User user)
Deprecated. Returns a collection of all Rating objects that the given user has added to other rateable elements. |
int |
getUsersOwnRatingsCount(User user)
Deprecated. Returns the number of ratings that the given user has added to other rateable elements. |
String |
getVersion()
Deprecated. Returns a version string of the implementation of this module. |
void |
init(Properties config,
LoggingManager logging,
UserManager users,
OntologyManager ontology)
Deprecated. This method is called by the ConsensusFoundation constructor to initialize the RatingManager. |
void |
initCompleted(Properties config,
ConsensusFoundationManager cfm)
Deprecated. This method is called by the ConsensusFoundation constructor after all available modules have
been initialized (i.e. their init() method has been called). |
String |
ratingValueToString(double value)
Deprecated. As applications will have to store rating values as strings (e.g. in the presentation layer), this method converts a rating value into a string. |
void |
removeRating(User remover,
Rating rating)
Deprecated. Removes a rating and its history if it is assigned to a rateable element (otherwise this call is ignored). |
void |
removeRatingListener(RatingListener listener)
Deprecated. Removes a RatingListener, if it is registered with the RatingManager (otherwise this call is ignored). |
void |
shutdown()
Deprecated. Called by ConsensusFoundation.shutdown() when the application shuts down.
|
double |
stringToRatingValue(String str)
Deprecated. Converts a string returned by ratingValueToString() back into a rating value.
|
Methods inherited from class de.uka.ipd.consensus.foundation.AbstractConsensusFoundationModule |
finalize, getConsensusFoundationManager, getDynamicRightsManager, getEvolutionManager, getIncentiveManager, getLoggingManager, getOntologyManager, getRatingManager, getUserManager |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface de.uka.ipd.consensus.foundation.ConsensusFoundationModule |
getConsensusFoundationManager |
Field Detail |
public static final String NO
public static final String YES
public static final String NEUTRAL
Constructor Detail |
public TM4JRatingManagerImpl()
Method Detail |
public void init(Properties config, LoggingManager logging, UserManager users, OntologyManager ontology) throws Exception
RatingManager
This method is called by the ConsensusFoundation
constructor to initialize the RatingManager.
init
in interface RatingManager
config
- all entries from ConsensusFoundation.properties
logging
- the successfully initialized LoggingManager instanceusers
- the the successfully initialized UserManager instanceontology
- the the successfully initialized OntologyManager instance
Exception
- if any error occurs (startup of the application is aborted in this case)ConsensusFoundation.ConsensusFoundation()
public void initCompleted(Properties config, ConsensusFoundationManager cfm) throws Exception
ConsensusFoundationModule
ConsensusFoundation
constructor after all available modules have
been initialized (i.e. their init()
method has been called). Here a module can perform some final
initialization that is dependant on other modules.
initCompleted
in interface ConsensusFoundationModule
initCompleted
in class AbstractConsensusFoundationModule
Exception
public void shutdown()
ConsensusFoundationModule
ConsensusFoundation.shutdown()
when the application shuts down.
When implementing this method make sure that the shutdown code is executed only once even if this method is called multiple times.
shutdown
in interface ConsensusFoundationModule
shutdown
in class AbstractConsensusFoundationModule
public boolean changesAllowed()
RatingManager
changesAllowed
in interface RatingManager
true
if existing ratings can be changed, false
otherwisepublic String ratingValueToString(double value)
RatingManager
The values are intended to be valid until application shutdown only and may not be compatible between different implementations of the RatingManager interface!
return the given rating value converted to a suitable string
ratingValueToString
in interface RatingManager
Rating.getValue()
,
RatingManager.stringToRatingValue(String)
public double stringToRatingValue(String str)
RatingManager
ratingValueToString()
back into a rating value.
If an unknown string is given, Rating.NEUTRAL
should be returned.
stringToRatingValue
in interface RatingManager
str
- the string to be converted
Rating.setValue(double)
,
Rating.NEUTRAL
,
RatingManager.ratingValueToString(double)
public Rating createRating(User creator, double value) throws RatingManagerException, DynamicRightsManagerException
RatingManager
addRating()
methods
or - better - the Rateable
interface.
createRating
in interface RatingManager
creator
- the user who wants to create the ratingvalue
- the value for the newly created rating (-1..1, including both values)
RatingManagerException
- if the rating could not be created
DynamicRightsManagerException
- if the user is not allowed to create ratingsRateable.addRating(User, double)
,
DynamicRightsManager.mayCreateRating(User)
protected Rateable getRateable(TM4JRatingImpl rating)
public void addRating(Topic rated, Rating rating) throws RatingManagerException, DynamicRightsManagerException
RatingManager
The implementation must ensure that each rating can be added to one rateable element only, that each user can rate each topic only once and that historical ratings cannot be added at all.
addRating
in interface RatingManager
rated
- the topic to which the rating will be addedrating
- the rating to be added
DynamicRightsManagerException
- if the user is not allowed to add the rating
RatingManagerException
- if the rating cannot be added to the given topicRating.isHistorical()
,
DynamicRightsManager.mayAddRating(Rating, Rateable)
,
Rateable.addRating(User, double)
public void addRating(User rated, Rating rating) throws RatingManagerException, DynamicRightsManagerException
RatingManager
The implementation must ensure that each rating can be added to one rateable element only, that each user can rate each other user only once and that historical ratings cannot be added at all.
addRating
in interface RatingManager
rated
- the user to which the rating will be addedrating
- the rating to be added
RatingManagerException
- if the rating cannot be added to the given user
DynamicRightsManagerException
- if the user (who created the rating) is not allowed to add the rating to the given userRating.isHistorical()
,
DynamicRightsManager.mayAddRating(Rating, Rateable)
,
Rateable.addRating(User, double)
public void addRating(Attribute rated, Rating rating) throws RatingManagerException, DynamicRightsManagerException
RatingManager
The implementation must ensure that each rating can be added to one rateable element only, that each user can rate each attribute only once and that historical ratings cannot be added at all.
addRating
in interface RatingManager
rated
- the attribute to which the rating will be addedrating
- the rating to be added
DynamicRightsManagerException
- if the user is not allowed to add the rating
RatingManagerException
- if the rating cannot be added to the given attributeRating.isHistorical()
,
DynamicRightsManager.mayAddRating(Rating, Rateable)
,
Rateable.addRating(User, double)
public void addRating(Association rated, Rating rating) throws RatingManagerException, DynamicRightsManagerException
RatingManager
The implementation must ensure that each rating can be added to one rateable element only, that each user can rate each association only once and that historical ratings cannot be added at all.
addRating
in interface RatingManager
rated
- the association to which the rating will be addedrating
- the rating to be added
RatingManagerException
- if the rating cannot be added to the given association
DynamicRightsManagerException
- if the user is not allowed to add the ratingRating.isHistorical()
,
DynamicRightsManager.mayAddRating(Rating, Rateable)
,
Rateable.addRating(User, double)
public void removeRating(User remover, Rating rating) throws RatingManagerException, DynamicRightsManagerException
RatingManager
removeRating
in interface RatingManager
remover
- the user who wants to remove the ratingrating
- the rating to be removed
RatingManagerException
- if the rating could not be removed
DynamicRightsManagerException
- if the user is not allowed to remove the ratingRating.getRateable()
,
DynamicRightsManager.mayRemoveRating(User, Rating)
public Collection getRatings(Topic topic)
RatingManager
Only current ratings are taken into account, not historical ones.
getRatings
in interface RatingManager
topic
- the topic for which the ratings are returned
null
Rating
,
Rateable.getRatings()
public Rating getRating(Topic topic, User rater)
RatingManager
null
if the user hasn't rated the topic yet).
getRating
in interface RatingManager
topic
- the topic from which the rating is returnedrater
- the user who added the rating
null
Rateable.getRating(User)
public Collection getRatings(User user)
RatingManager
Only current ratings are taken into account, not historical ones.
getRatings
in interface RatingManager
user
- the user for whom the ratings are returned
null
Rating
,
Rateable.getRatings()
public Rating getRating(User user, User rater)
RatingManager
null
if the user hasn't rated the other user yet.
getRating
in interface RatingManager
user
- the user from which the rating is returnedrater
- the user who added the rating
null
Rateable.getRating(User)
public Collection getRatings(Attribute attribute)
RatingManager
Only current ratings are taken into account, not historical ones.
getRatings
in interface RatingManager
attribute
- the attribute for which the ratings are returned
null
Rating
,
Rateable.getRatings()
public Rating getRating(Attribute attribute, User rater)
RatingManager
null
if the user hasn't rated the attribute yet).
getRating
in interface RatingManager
attribute
- the attribute from which the rating is returnedrater
- the user who added the rating
null
Rateable.getRating(User)
public Collection getRatings(Association association)
RatingManager
Only current ratings are taken into account, not historical ones.
getRatings
in interface RatingManager
association
- the association for which the ratings are returned
null
Rating
,
Rateable.getRatings()
public Rating getRating(Association association, User rater)
RatingManager
null
if the user hasn't rated the association yet).
getRating
in interface RatingManager
association
- the association from which the rating is returnedrater
- the user who added the rating
null
Rateable.getRating(User)
public int getRatingsCount(Association association)
RatingManager
Only current ratings are taken into account, not historical ones.
getRatingsCount
in interface RatingManager
association
- the association for which the number of ratings shall be returned
Rateable.getRatingsCount()
public int getRatingsCount(Attribute attribute)
RatingManager
Only current ratings are taken into account, not historical ones.
getRatingsCount
in interface RatingManager
attribute
- the attribute for which the number of ratings shall be returned
Rateable.getRatingsCount()
public int getRatingsCount(Topic topic)
RatingManager
Only current ratings are taken into account, not historical ones.
getRatingsCount
in interface RatingManager
topic
- the topic for which the number of ratings shall be returned
Rateable.getRatingsCount()
public int getRatingsCount(User user)
RatingManager
Only current ratings are taken into account, not historical ones.
getRatingsCount
in interface RatingManager
user
- the user for whom the number of ratings shall be returned
Rateable.getRatingsCount()
public double getAverageRatingValue(Association association)
RatingManager
Only current ratings are taken into account, not historical ones.
getAverageRatingValue
in interface RatingManager
association
- the association for which the average rating value shall be computed
Rating.NEUTRAL
if the association isn't rated yetRating.NEUTRAL
,
Rateable.getAverageRatingValue()
public double getAverageRatingValue(Attribute attribute)
RatingManager
Only current ratings are taken into account, not historical ones.
getAverageRatingValue
in interface RatingManager
attribute
- the attribute for which the average rating value shall be computed
Rating.NEUTRAL
if the attribute isn't rated yetRating.NEUTRAL
,
Rateable.getAverageRatingValue()
public double getAverageRatingValue(Topic topic)
RatingManager
Only current ratings are taken into account, not historical ones.
getAverageRatingValue
in interface RatingManager
topic
- the topic for which the average rating value shall be computed
Rating.NEUTRAL
if the topic isn't rated yetRating.NEUTRAL
,
Rateable.getAverageRatingValue()
public double getAverageRatingValue(User user)
RatingManager
Only current ratings are taken into account, not historical ones.
getAverageRatingValue
in interface RatingManager
user
- the user for whom the average rating value shall be computed
Rating.NEUTRAL
if the user isn't rated yetRating.NEUTRAL
,
Rateable.getAverageRatingValue()
public Collection getUsersOwnRatings(User user)
RatingManager
Only current ratings are taken into account, not historical ones.
getUsersOwnRatings
in interface RatingManager
user
- the user from whom the ratings are returned
null
Rating
,
User.getOwnRatings()
public double getUsersAverageOwnRatingsValue(User user)
RatingManager
Only current ratings are taken into account, not historical ones.
getUsersAverageOwnRatingsValue
in interface RatingManager
user
- the user from whose ratings the average rating value shall be computed
Rating.NEUTRAL
if the user hasn't rated other elements yetRating.NEUTRAL
,
User.getAverageOwnRatingsValue()
public int getUsersOwnRatingsCount(User user)
RatingManager
Only current ratings are taken into account, not historical ones.
getUsersOwnRatingsCount
in interface RatingManager
user
- the user from whom the number of ratings shall be returned
User.getOwnRatingsCount()
public void deleteRatings(Topic topic) throws RatingManagerException
RatingManager
This method will be used by the EvolutionManager.
deleteRatings
in interface RatingManager
topic
- the topic object for which the corresponding ratings shall be deleted
RatingManagerException
- if the ratings could not be deletedEvolutionManager.deleteTopic(User, Topic)
,
EvolutionManager.deleteTopicAndSubtopics(User, Topic)
public void deleteRatings(Attribute attribute) throws RatingManagerException
RatingManager
This method will be used by the EvolutionManager.
deleteRatings
in interface RatingManager
attribute
- the attribute object for which the corresponding ratings shall be deleted
RatingManagerException
- if the ratings could not be deletedEvolutionManager.deleteAttribute(User, Topic, Attribute)
public void deleteRatings(Association association) throws RatingManagerException
RatingManager
This method will be used by the EvolutionManager.
deleteRatings
in interface RatingManager
association
- the association object for which the corresponding ratings shall be deleted
RatingManagerException
- if the ratings could not be deletedEvolutionManager.deleteAssociation(User, Association)
public void deleteRatings(User user) throws RatingManagerException
RatingManager
This method will be used by the UserManager.
deleteRatings
in interface RatingManager
user
- the user object for which the corresponding ratings shall be deleted
RatingManagerException
- if the ratings could not be deletedUserManager.deleteUser(User, String)
public void addRatingListener(RatingListener listener)
RatingManager
addRatingListener
in interface RatingManager
listener
- the RatingListener to be addedpublic void removeRatingListener(RatingListener listener)
RatingManager
removeRatingListener
in interface RatingManager
listener
- the RatingListener to be removedprotected void fireRatingSet(Rating source, Rateable rated)
protected void fireRatingChanged(Rating source, Rateable rated, double oldRatingValue)
protected org.tm4j.topicmap.Topic getRatingTopicType()
protected org.tm4j.topicmap.Topic getRateableTopicType()
public String getVersion()
ConsensusFoundationModule
getVersion
in interface ConsensusFoundationModule
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |