use of org.xwiki.extension.repository.rating.Ratable in project xwiki-platform by xwiki.
the class ExtensionRatingScriptService method getRating.
/**
* @param extensionId the extension id
* @param extensionVersion the extension version
* @return the rating of an extension
*/
public ExtensionRating getRating(String extensionId, String extensionVersion) {
setError(null);
Collection<ExtensionRepository> repositories = getRepositories();
for (ExtensionRepository repository : repositories) {
if (repository instanceof Ratable) {
try {
setError(null);
return ((Ratable) repository).getRating(extensionId, extensionVersion);
} catch (ResolveException e) {
setError(e);
// Keep looking. Maybe there's another repository with the same extension.
continue;
}
}
}
return null;
}
Aggregations