registry.rateResource(gadgetPath, rating);
if (registry instanceof UserRegistry) {
String userId = ((UserRegistry) registry).getUserName();
// Recording Activities
ActivityManager manager = new ActivityManagerImpl();
Activity activity = new ActivityImpl();
activity.setTitle("rated gadget with rating: " + rating);
String gadgetViewUrl = "../gadgetrepo/gadget-page.jsp?gadgetPath=" + gadgetPath + "&tab=" + tabId + "&grp=" + gadgetGroup;
activity.setUrl(gadgetViewUrl);
activity.setBody(rating + "");
manager.createActivity(userId, "self", "gs", null, activity);
}
return true;
} catch (Exception e) {
log.error("Backend server error : Could not rate the resource", e);