@Component @Singleton @Named(value="ratings") @Unstable public class RatingsScriptService extends AbstractScriptRatingsManager implements org.xwiki.component.phase.Initializable, org.xwiki.script.service.ScriptService
RatingsManagerFactory.DEFAULT_APP_HINT
), but it can be used with the hint of a custom application e.g.
$services.ratings.foo
will call the methods for a RatingsManager
identified by foo
.
For more information, see the documentation of RatingsManagerFactory
.Constructor and Description |
---|
RatingsScriptService() |
Modifier and Type | Method and Description |
---|---|
DefaultScriptRatingsManager |
get(String managerHint)
Retrieve a specific
DefaultScriptRatingsManager for the given hint. |
void |
initialize() |
getAverageRating, getConfiguration, getCurrentUserRatings, getRating, getRatings, getRatings, isExcludedFromRatings, setRating, setRating
public void initialize() throws org.xwiki.component.phase.InitializationException
initialize
in interface org.xwiki.component.phase.Initializable
org.xwiki.component.phase.InitializationException
public DefaultScriptRatingsManager get(String managerHint)
DefaultScriptRatingsManager
for the given hint.
This method will in fact instantiate the right RatingsManager
for the given hint, and create a
DefaultScriptRatingsManager
around it to allow performing all script service calls on it.
Note that the method also caches the instantiated DefaultScriptRatingsManager
in the
ExecutionContext
so that it's kept during the execution of a script.managerHint
- the hint of a RatingsManager
to use. See RatingsManagerFactory
for more
information.RatingsManager
to perform the script service calls.Copyright © 2004–2021 XWiki. All rights reserved.