DashboardService dashboardService = new DashboardService();
response = dashboardService.addGadgetToUser(userId, tabId, url, dashboardName, gadgetGroup);
if (response) {
// Record Activities
ActivityManager manager = new ActivityManagerImpl();
Activity activity = new ActivityImpl();
activity.setTitle("added new Gadget to the Dashboard ");
String gadgetViewUrl = "../gadgetrepo/gadget-page.jsp?gadgetPath=" + gadgetPath + "&tab=" + tabId + "&grp=" + gadgetGroup.substring(0, gadgetGroup.indexOf("#"));
activity.setUrl(gadgetViewUrl);
manager.createActivity(userId, "self", "gs", null, activity);
}
} catch (Exception e) {
log.error(e);
if (registry != null) {