Package org.rhq.enterprise.gui.legacy

Examples of org.rhq.enterprise.gui.legacy.WebUserPreferences$ResourceVisit


            if (user == null) {
                // session timed out, return prematurely
                return null;
            }

            WebUserPreferences preferences = user.getWebPreferences();
            DashboardPreferences dashboardPreferences = preferences.getDashboardPreferences();

            String userPortlets = null;

            Boolean wide = new Boolean((String) context.getAttribute("wide"));
View Full Code Here


    @Override
    public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request,
        HttpServletResponse response) throws Exception {
        PropertiesForm pForm = (PropertiesForm) form;
        WebUser user = SessionUtils.getWebUser(request.getSession());
        WebUserPreferences preferences = user.getWebPreferences();

        SummaryCountPortletPreferences counts = preferences.getSummaryCounts();
        pForm.setSummaryCounts(counts);

        return null;
    }
View Full Code Here

            WebUser user = SessionUtils.getWebUser(request.getSession());
            if (user == null) {
                // session timed out, return prematurely
                return null;
            }
            WebUserPreferences preferences = user.getWebPreferences();

            ResourceBossLocal resourceBoss = LookupUtil.getResourceBoss();
            summary = resourceBoss.getInventorySummary(user.getSubject());
            counts = preferences.getSummaryCounts();
        } catch (Exception e) {
            if (log.isDebugEnabled()) {
                log.debug("Dashboard Portlet [SummaryCounts] experienced an error: " + e.getMessage(), e);
            } else {
                log.error("Dashboard Portlet [SummaryCounts] experienced an error: " + e.getMessage());
View Full Code Here

        if (forward != null) {
            return forward;
        }

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

        if (!pForm.isDisplayOnDash()) {
            DashboardUtils.removePortlet(user, pForm.getPortletName());
        }

        SummaryCountPortletPreferences counts = pForm.getSummaryCounts();
        preferences.setSummaryCounts(counts);

        request.getSession().removeAttribute(Constants.USERS_SES_PORTAL);
        return mapping.findForward(RetCodeConstants.SUCCESS_URL);
    }
View Full Code Here

import org.rhq.enterprise.gui.legacy.action.resource.hub.HubView;
import org.rhq.enterprise.gui.legacy.taglib.display.StringUtil;

public class HubUtils {
    public static void initView(HubForm hubForm, WebUser user) throws Exception {
        WebUserPreferences preferences = user.getWebPreferences();

        HubView prefView = HubView.valueOf(preferences.getResourceBrowserViewMode());

        String viewStr = hubForm.getView();
        if (viewStr == null) {
            hubForm.setView(prefView.name());
        }

        HubView view = HubView.valueOf(hubForm.getView().toUpperCase());
        if (view != prefView) {
            preferences.setResourceBrowserViewMode(view.name()); // Save new preference.
        }
    }
View Full Code Here

*/
public class DashboardUtils {
    public static final String DASHBOARD_DELIMITER = "|";

    public static void removePortlet(WebUser user, String portletName) throws Exception {
        WebUserPreferences preferences = user.getWebPreferences();
        DashboardPreferences dashboardPreferences = preferences.getDashboardPreferences();
        dashboardPreferences.removePortlet(portletName);
        preferences.setDashboardPreferences(dashboardPreferences);
    }
View Full Code Here

    public ActionForward execute(ComponentContext context, ActionMapping mapping, ActionForm form,
        HttpServletRequest request, HttpServletResponse response) throws Exception {

        HttpSession session = request.getSession();
        WebUser user = SessionUtils.getWebUser(session);
        WebUserPreferences preferences = user.getWebPreferences();
        DashboardPreferences dashboardPreferences = preferences.getDashboardPreferences();

        int refreshPeriod = preferences.getPageRefreshPeriod();
        if (UIConstants.DONT_REFRESH_PAGE != refreshPeriod) {
            request.setAttribute("refreshPeriod", String.valueOf(refreshPeriod));
        }

        Portal portal = (Portal) session.getAttribute(Constants.USERS_SES_PORTAL);
View Full Code Here

public class ModifyAction extends BaseAction {
    @Override
    public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request,
        HttpServletResponse response) throws Exception {
        WebUser user = SessionUtils.getWebUser(request.getSession());
        WebUserPreferences preferences = user.getWebPreferences();

        ActionForward forward = checkSubmit(request, mapping, form);

        if (forward != null) {
            return forward;
        }

        PropertiesForm pForm = (PropertiesForm) form;

        if (!pForm.isDisplayOnDash()) {
            DashboardUtils.removePortlet(user, pForm.getPortletName());
        }

        OperationPortletPreferences prefs = pForm.getOperationPortletPreferences();
        preferences.setOperationPortletPreferences(prefs);

        request.getSession().removeAttribute(Constants.USERS_SES_PORTAL);

        return mapping.findForward(RetCodeConstants.SUCCESS_URL);
    }
View Full Code Here

    public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request,
        HttpServletResponse response) throws Exception {
        PropertiesForm pForm = (PropertiesForm) form;

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

        OperationPortletPreferences prefs = preferences.getOperationPortletPreferences();
        pForm.setOperationPortletPreferences(prefs);

        return null;
    }
View Full Code Here

public class ModifyAction extends BaseAction {
    @Override
    public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request,
        HttpServletResponse response) throws Exception {
        WebUser user = SessionUtils.getWebUser(request.getSession());
        WebUserPreferences preferences = user.getWebPreferences();
        PropertiesForm pForm = (PropertiesForm) form;
        ActionForward forward = checkSubmit(request, mapping, form);
        String returnString = RetCodeConstants.SUCCESS_URL;
        if (forward != null) {
            return forward;
        }

        if (!pForm.isDisplayOnDash()) {
            DashboardUtils.removePortlet(user, pForm.getPortletName());
        }

        String[] charts = pForm.getCharts();

        if (charts != null) {
            SavedChartsPortletPreferences savedCharts = preferences.getSavedChartsPortletPreferences();
            for (String chartToRemove : charts) {
                savedCharts.removeByTuple(chartToRemove);
            }
            preferences.setSavedChartsPortletPreferences(savedCharts);

            returnString = "remove";
        }

        return mapping.findForward(returnString);
View Full Code Here

TOP

Related Classes of org.rhq.enterprise.gui.legacy.WebUserPreferences$ResourceVisit

Copyright © 2018 www.massapicom. 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.