Package org.rhq.enterprise.gui.legacy

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


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

        pForm.setDisplayOnDash(true);

        request.setAttribute("charts", savedCharts.chartList);
        request.setAttribute("chartsize", String.valueOf(savedCharts.chartList.size()));
View Full Code Here


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

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

        String portlet = request.getParameter("portletName");
        DashboardPreferences dashboardPreferences = preferences.getDashboardPreferences();
        dashboardPreferences.moveUp(portlet);
        preferences.setDashboardPreferences(dashboardPreferences);

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

        return mapping.findForward(Constants.AJAX_URL);
    }
View Full Code Here

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

            WebUserPreferences preferences = user.getWebPreferences();
            SavedChartsPortletPreferences savedCharts = preferences.getSavedChartsPortletPreferences();

            charts = savedCharts.chartList;
            /*for (Tuple<String, String> chart : savedCharts.chartList) {
                charts.put(chart.lefty, chart.righty);
            }*/
 
View Full Code Here

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

            WebUserPreferences preferences = user.getWebPreferences();

            OperationPortletPreferences operationPreferences = preferences.getOperationPortletPreferences();

            displayLastCompleted = operationPreferences.useLastCompleted;
            displayNextScheduled = operationPreferences.useNextScheduled;

            OperationManagerLocal manager = LookupUtil.getOperationManager();
View Full Code Here

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

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

        String portlet = request.getParameter("portletName");
        DashboardPreferences dashboardPreferences = preferences.getDashboardPreferences();
        dashboardPreferences.moveDown(portlet);
        preferences.setDashboardPreferences(dashboardPreferences);

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

        return mapping.findForward(Constants.AJAX_URL);
    }
View Full Code Here

public class QuickFavoritesAction 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();

        int resourceId = WebUtility.getResourceId(request);
        Boolean isFavorite = QuickFavoritesUtil.isFavorite(user, resourceId);

        Map<String, Object> forwardParams = new HashMap<String, Object>(1);
        forwardParams.put(ParamConstants.RESOURCE_ID_PARAM, resourceId);

        String mode = request.getParameter("mode");
        if (mode == null) {
            return returnFailure(request, mapping, forwardParams);
        }

        if (mode.equals("add")) {
            if (isFavorite.booleanValue()) {
                // already in the favorites list - should not happen but just return, it's already there
                return returnSuccess(request, mapping, forwardParams, BaseAction.YES_RETURN_PATH);
            }

            // Add to favorites and save
            FavoriteResourcePortletPreferences favoriteResourcePreferences = preferences
                .getFavoriteResourcePortletPreferences();
            favoriteResourcePreferences.addFavorite(resourceId);
            preferences.setFavoriteResourcePortletPreferences(favoriteResourcePreferences);
        } else if (mode.equals("remove")) {
            if (!isFavorite.booleanValue()) {
                // not already a favorite - should not happen but just return, it's already gone
                return returnSuccess(request, mapping, forwardParams, BaseAction.YES_RETURN_PATH);
            }

            // Remove from favorites and save
            FavoriteResourcePortletPreferences favoriteResourcePreferences = preferences
                .getFavoriteResourcePortletPreferences();
            favoriteResourcePreferences.removeFavorite(resourceId);
            preferences.setFavoriteResourcePortletPreferences(favoriteResourcePreferences);
        } else {
            return returnFailure(request, mapping, forwardParams);
        }

        return returnSuccess(request, mapping, forwardParams, BaseAction.YES_RETURN_PATH);
View Full Code Here

        // a user can only edit his own configuration
        WebUser currentUser = RequestUtils.getWebUser(request);
        if (currentUser.getId().equals(userForm.getId())) {
            // update the in-memory preferences of the webuser so it takes effect for this session
            try {
                WebUserPreferences webPreferences = currentUser.getWebPreferences();
                int pageRefreshPeriod = Integer.valueOf(userForm.getPageRefreshPeriod());
                webPreferences.setPageRefreshPeriod(pageRefreshPeriod);
            } catch (NumberFormatException e) {
                throw new RuntimeException(
                    "pageRefreshPeriod is not an integer, this should have been caught earlier by the form validation.");
            }
View Full Code Here

    public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request,
        HttpServletResponse response) throws Exception {
        PropertiesForm propsForm = (PropertiesForm) form;
        HttpSession session = request.getSession();
        WebUser user = SessionUtils.getWebUser(request.getSession());
        WebUserPreferences preferences = user.getWebPreferences();
        String range = propsForm.getRange().toString();

        ActionForward forward = checkSubmit(request, mapping, form);
        if (forward != null) {
            return forward;
        }

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

        preferences.setAutoDiscoveryRange(Integer.parseInt(range));

        session.removeAttribute(Constants.USERS_SES_PORTAL);

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

        HttpServletResponse response) throws Exception {
        PropertiesForm propsForm = (PropertiesForm) form;

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

        propsForm.setRange(preferences.getAutoDiscoveryRange());

        return null;
    }
View Full Code Here

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

            WebUserPreferences preferences = user.getWebPreferences();
            Subject subject = user.getSubject();
            AIQueueForm queueForm = (AIQueueForm) form;
            PageControl pageControl;

            try {
                int size = preferences.getAutoDiscoveryRange();
                if (size < 1) {
                    pageControl = PageControl.getUnlimitedInstance();
                } else {
                    pageControl = new PageControl(0, size);
                }
View Full Code Here

TOP

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

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.