Examples of AlertsPortletPreferences


Examples of org.rhq.enterprise.gui.legacy.WebUserPreferences.AlertsPortletPreferences

        WebUser user = SessionUtils.getWebUser(request.getSession());
        WebUserPreferences preferences = user.getWebPreferences();

        String forwardStr = RetCodeConstants.SUCCESS_URL;
        if (pForm.isRemoveClicked()) {
            AlertsPortletPreferences alertPrefs = preferences.getAlertsPortletPreferences();
            for (Integer doomedResourceId : pForm.getIds()) {
                alertPrefs.removeResource(doomedResourceId);
            }
            preferences.setAlertsPortletPreferences(alertPrefs);
            forwardStr = "review";
        } else if (pForm.isOkClicked()) {
            AlertsPortletPreferences alertPrefs = preferences.getAlertsPortletPreferences();
            int[] savedResourceIds = alertPrefs.asArray();
            alertPrefs = pForm.getAlertsPortletPreferences();
            alertPrefs.setResource(ArrayUtils.wrapInList(savedResourceIds));
            preferences.setAlertsPortletPreferences(alertPrefs);
        }

        if (!pForm.isDisplayOnDash()) {
            DashboardUtils.removePortlet(user, pForm.getPortletName());
View Full Code Here

Examples of org.rhq.enterprise.gui.legacy.WebUserPreferences.AlertsPortletPreferences

        SessionUtils.removeList(request.getSession(), Constants.PENDING_RESOURCES_SES_ATTR);

        //set all the form properties
        pForm.setDisplayOnDash(true);

        AlertsPortletPreferences alertPrefs = preferences.getAlertsPortletPreferences();
        pForm.setAlertsPortletPreferences(alertPrefs);

        PageControl pageControl = WebUtility.getPageControl(request);

        ResourceManagerLocal resourceManager = LookupUtil.getResourceManager();
        PageList<Resource> resources = resourceManager.findResourceByIds(user.getSubject(), alertPrefs.asArray(), false,
            pageControl);

        PageList<DisambiguationReport<Resource>> disambiguatedResources =
            DisambiguatedResourceListUtil.disambiguate(resourceManager, resources, RESOURCE_ID_EXTRACTOR);
       
View Full Code Here

Examples of org.rhq.enterprise.gui.legacy.WebUserPreferences.AlertsPortletPreferences

            }

            WebUserPreferences preferences = user.getWebPreferences();

            // get the user's preferences for the alerts portlet
            AlertsPortletPreferences alertPrefs = preferences.getAlertsPortletPreferences();

            PageControl pageControl = new PageControl(0, alertPrefs.count);
            AlertManagerLocal alertManager = LookupUtil.getAlertManager();
            ResourceManagerLocal resourceManager = LookupUtil.getResourceManager();

            AlertCriteria criteria = new AlertCriteria();
            criteria.addFilterPriorities(AlertPriority.getByLegacyIndex(alertPrefs.priority));
            criteria.addFilterStartTime(alertPrefs.timeRange);
            criteria.addFilterResourceIds(("all".equals(alertPrefs.displayAll) ? null : ArrayUtils
                .wrapInArray(alertPrefs.asArray())));
            criteria.setPageControl(pageControl);

            PageList<Alert> alerts = alertManager.findAlertsByCriteria(user.getSubject(), criteria);

            disambiguatedAlerts = DisambiguatedResourceListUtil.disambiguate(resourceManager, alerts,
View Full Code Here

Examples of org.rhq.enterprise.gui.legacy.WebUserPreferences.AlertsPortletPreferences

        // Get the alerts
        WebUser user = getWebUser(request);
        if (user != null) {

            AlertsPortletPreferences prefs = user.getWebPreferences().getAlertsPortletPreferences();

            PageControl pageControl = new PageControl(0, prefs.count);

            AlertCriteria criteria = new AlertCriteria();
            criteria.addFilterPriorities(AlertPriority.getByLegacyIndex(prefs.priority));
            criteria.addFilterStartTime(prefs.timeRange);
            criteria.addFilterResourceIds(("all".equals(prefs.displayAll) ? null : ArrayUtils.wrapInArray(prefs
                .asArray())));
            criteria.setPageControl(pageControl);

            PageList<Alert> alerts = alertManager.findAlertsByCriteria(user.getSubject(), criteria);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.