Package org.rhq.enterprise.gui.legacy

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


    public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request,
        HttpServletResponse response) throws Exception {
        Log log = LogFactory.getLog(AddResourcesAction.class);
        HttpSession session = request.getSession();
        WebUser user = SessionUtils.getWebUser(session);
        WebUserPreferences preferences = user.getWebPreferences();
        AddResourcesForm addForm = (AddResourcesForm) form;

        ActionForward forward = checkSubmit(request, mapping, form, Constants.USER_PARAM, user.getId());
        if (forward != null) {
            BaseValidatorForm spiderForm = (BaseValidatorForm) form;

            if (spiderForm.isCancelClicked() || spiderForm.isResetClicked()) {
                log.trace("removing pending resources list");
                SessionUtils.removeList(session, Constants.PENDING_RESOURCES_SES_ATTR);
            } else if (spiderForm.isAddClicked()) {
                log.trace("adding to pending resources list");
                SessionUtils.addToList(session, Constants.PENDING_RESOURCES_SES_ATTR, addForm.getAvailableResources());
            } else if (spiderForm.isRemoveClicked()) {
                log.trace("removing from pending resources list");
                SessionUtils.removeFromList(session, Constants.PENDING_RESOURCES_SES_ATTR, addForm
                    .getPendingResources());
            }

            return forward;
        }

        log.trace("getting pending resources list");
        List<String> pendingResourceIds = SessionUtils.getListAsListStr(request.getSession(),
            Constants.PENDING_RESOURCES_SES_ATTR);

        StringBuffer resourcesAsString = new StringBuffer();
        int count = 0;
        for (String pendingId : pendingResourceIds) {
            if (count != 0) {
                resourcesAsString.append(DashboardUtils.DASHBOARD_DELIMITER);
            }
            resourcesAsString.append(pendingId);
            count++;
        }

        SessionUtils.removeList(session, Constants.PENDING_RESOURCES_SES_ATTR);

        RequestUtils.setConfirmation(request, "admin.user.confirm.AddResource");

        preferences.setPreference(addForm.getKey(), resourcesAsString);

        return returnSuccess(request, mapping);
    }
View Full Code Here


        HttpServletResponse response) throws Exception {
        ActionForward forward = returnSuccess(request, mapping);

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

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

        return forward;
View Full Code Here

        feed.setTitle(res.getMessage("dash.home.ResourceHealth"));

        // Get the resources health
        WebUser user = getWebUser(request);
        if (user != null) {
            WebUserPreferences preferences = user.getWebPreferences();
            FavoriteResourcePortletPreferences favoriteResourcePreferences = preferences
                .getFavoriteResourcePortletPreferences();

            PageList<ResourceHealthComposite> results = manager.findResourceHealth(user.getSubject(),
                favoriteResourcePreferences.asArray(), PageControl.getUnlimitedInstance());
View Full Code Here

        HttpServletResponse response) throws Exception {

        PropertiesForm pForm = (PropertiesForm) form;

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

        String forwardStr = RetCodeConstants.SUCCESS_URL;
        if (pForm.isRemoveClicked()) {
            FavoriteResourcePortletPreferences favoriteResourcePreferences = preferences
                .getFavoriteResourcePortletPreferences();
            for (Integer doomedResourceId : pForm.getIds()) {
                favoriteResourcePreferences.removeFavorite(doomedResourceId);
            }
            preferences.setFavoriteResourcePortletPreferences(favoriteResourcePreferences);
            forwardStr = "review";
        } else if (pForm.isOkClicked()) {
            FavoriteResourcePortletPreferences favoriteResourcePreferences = preferences
                .getFavoriteResourcePortletPreferences();
            int[] savedResourceIds = favoriteResourcePreferences.asArray();
            favoriteResourcePreferences = pForm.getFavoriteResourcePortletPreferences();
            favoriteResourcePreferences.setFavorites(ArrayUtils.wrapInList(savedResourceIds));
            preferences.setFavoriteResourcePortletPreferences(favoriteResourcePreferences);
        }

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

    public ActionForward execute(ComponentContext context, ActionMapping mapping, ActionForm form,
        HttpServletRequest request, HttpServletResponse response) throws Exception {
        PropertiesForm pForm = (PropertiesForm) form;
        PageControl pc = WebUtility.getPageControl(request);
        WebUser user = SessionUtils.getWebUser(request.getSession());
        WebUserPreferences preferences = user.getWebPreferences();

        // start a new flow, overriding an previous work that the user might have abandoned
        SessionUtils.removeList(request.getSession(), Constants.PENDING_RESOURCES_SES_ATTR);

        pForm.setDisplayOnDash(true);

        FavoriteResourcePortletPreferences favoriteResourcePreferences = preferences
            .getFavoriteResourcePortletPreferences();
        pForm.setFavoriteResourcePortletPreferences(favoriteResourcePreferences);

        PageList<Resource> resources = LookupUtil.getResourceManager().findResourceByIds(user.getSubject(),
            favoriteResourcePreferences.asArray(), false, pc);
View Full Code Here

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

            WebUserPreferences preferences = user.getWebPreferences();
            PageControl pc = WebUtility.getPageControl(request);

            FavoriteResourcePortletPreferences favoriteResourcePreferences = preferences
                .getFavoriteResourcePortletPreferences();

            ResourceManagerLocal manager = LookupUtil.getResourceManager();
            PageList<ResourceHealthComposite> lst = manager.findResourceHealth(user.getSubject(), favoriteResourcePreferences.asArray(), pc);
           
View Full Code Here

        HttpServletResponse response) throws Exception {

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

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

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

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

        ProblemResourcesPortletPreferences problemResourcePreferences = pForm.getProblemResourcesPortletPreferences();
        preferences.setProblemResourcesPortletPreferences(problemResourcePreferences);

        session.removeAttribute(Constants.USERS_SES_PORTAL);

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

    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();

        pForm.setDisplayOnDash(true);

        ProblemResourcesPortletPreferences problemResourcePreferences = preferences
            .getProblemResourcesPortletPreferences();
        pForm.setProblemResourcesPortletPreferences(problemResourcePreferences);

        return null;
    }
View Full Code Here

                // session timed out, return prematurely
                return null;
            }

            Subject subject = user.getSubject();
            WebUserPreferences preferences = user.getWebPreferences();

            ProblemResourcesPortletPreferences problemResourcePreferences = preferences
                .getProblemResourcesPortletPreferences();

            long begin = 0;

            if (problemResourcePreferences.hours > 0) {
View Full Code Here

        HttpServletResponse response) throws Exception {

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

        if ((pForm.getPortlet() == null) || "bad".equals(pForm.getPortlet())) {
            return mapping.findForward(RetCodeConstants.SUCCESS_URL);
        }

        // add some portlet to the preferences
        DashboardPreferences dashboardPreferences = preferences.getDashboardPreferences();
        dashboardPreferences.addPortlet(pForm.getPortlet(), !pForm.isWide());
        preferences.setDashboardPreferences(dashboardPreferences);

        session.removeAttribute(Constants.USERS_SES_PORTAL);

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

TOP

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

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.