Package org.rhq.enterprise.gui.legacy

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


        return EnterpriseFacesContextUtility.getWebUser().getWebPreferences()
            .getPreference(LEFT_RESOURCE_NAV_SHOWING, "30");
    }

    public void setLeftResourceNavState(String state) {
        WebUserPreferences preferences = getWebUser().getWebPreferences();
        preferences.setPreference(LEFT_RESOURCE_NAV_SHOWING, state);
    }
View Full Code Here


        }
        setPageRefresh(refresh, path);
    }

    public void setPageRefresh(int refresh, String path) {
        WebUserPreferences preferences = getWebUser().getWebPreferences();

        preferences.setPreference("PATH_REFRESH." + path, refresh);
    }
View Full Code Here

        preferences.setPreference("PATH_REFRESH." + path, refresh);
    }

    public int getPageRefresh() {
        WebUserPreferences preferences = getWebUser().getWebPreferences();

        String path = (String) FacesContextUtility.getRequest().getAttribute("javax.servlet.forward.request_uri");
        if (path == null) {
            path = FacesContextUtility.getRequest().getParameter("originalPath");
        }
        if (path == null) {
            path = FacesContextUtility.getRequest().getRequestURI();
        }

        return preferences.getPreference("PATH_REFRESH." + path, 0);
    }
View Full Code Here

    public String getSummaryPanelDisplayState() {
        return getWebUser().getWebPreferences().getPreference(SUMMARY_PANEL_DISPLAY_STATE, "true");
    }

    public void setSummaryPanelDisplayState(String state) {
        WebUserPreferences preferences = getWebUser().getWebPreferences();
        preferences.setPreference(SUMMARY_PANEL_DISPLAY_STATE, state);
    }
View Full Code Here

    public void updateRecentVisits() {
        String resourceId = FacesContextUtility.getOptionalRequestParameter(ParamConstants.RESOURCE_ID_PARAM);
        String groupId = FacesContextUtility.getOptionalRequestParameter(ParamConstants.GROUP_ID_PARAM);

        WebUser user = EnterpriseFacesContextUtility.getWebUser();
        WebUserPreferences prefs = user.getWebPreferences();
        WebUserPreferences.ResourceVisit visit = null;

        if (resourceId != null) {
            Resource res = resourceManager.getResourceById(getSubject(), Integer.parseInt(resourceId));
            visit = new WebUserPreferences.ResourceVisit(Integer.parseInt(resourceId), res.getName(),
                WebUserPreferences.ResourceVisit.Kind.valueOf(res.getResourceType().getCategory().name()));
        } else if (groupId != null) {
            ResourceGroup group = groupManager.getResourceGroupById(getSubject(), Integer.parseInt(groupId), null);
            visit = new WebUserPreferences.ResourceVisit(Integer.parseInt(groupId), group.getName(),
                (group.getResourceType() != null ? WebUserPreferences.ResourceVisit.Kind.COMPATIBLE_GROUP
                    : WebUserPreferences.ResourceVisit.Kind.MIXED_GROUP));
        }

        if (visit != null) {
            prefs.addRecentResource(visit);
        }
    }
View Full Code Here

    public PageControl getDefaultPageControl(WebUser user, PageControlView view) {
        return user.getWebPreferences().getDefaultPageControl(view, getMinimumPageSize());
    }

    public void setPageControl(WebUser user, PageControlView view, PageControl pageControl) {
        WebUserPreferences preferences = user.getWebPreferences();
        preferences.setPageControl(view, pageControl);
        this.pageControl = pageControl;
    }
View Full Code Here

            log.debug("accessing PageControl." + methodName);
            // allows simple misspellings for developer productivity
            if ("pagesize".equals(lowerCaseMethodName)) {
                // find the user for this session-based operation
                WebUser user = EnterpriseFacesContextUtility.getWebUser();
                WebUserPreferences preferences = user.getWebPreferences();
                // get it
                PageControl pc = preferences.getPageControl(view);
                if (log.isDebugEnabled()) {
                    log.debug("Getting PageControlView[" + view + "] to " + pc);
                }
                result = pc.getPageSize();
            } else if ("pagenumber".equals(lowerCaseMethodName)) {
                // find the user for this session-based operation
                WebUser user = EnterpriseFacesContextUtility.getWebUser();
                WebUserPreferences preferences = user.getWebPreferences();
                // get it
                PageControl pc = preferences.getPageControl(view);
                if (log.isDebugEnabled()) {
                    log.debug("Getting PageControlView[" + view + "] to " + pc);
                }
                result = pc.getPageNumber() + 1; // RF data table is 1-based, our PageControl is 0-based
            } else if ("unlimited".equals(lowerCaseMethodName)) {
View Full Code Here

            // allows simple mispellings for developer productivity
            if ("pagesize".equals(lowerCaseMethodName)) {
                if (value != null) {
                    // find the user for this session-based operation
                    WebUser user = EnterpriseFacesContextUtility.getWebUser();
                    WebUserPreferences preferences = user.getWebPreferences();

                    // update it
                    PageControl pc = preferences.getPageControl(view);
                    int pageSize = (Integer) value;
                    if (pc.getPageSize() == pageSize) {
                        // nothing to do
                        if (log.isDebugEnabled()) {
                            log.debug("PageControlView[" + view + "] needs no changes " + pc);
                        }
                    } else {
                        pc.setPageSize(pageSize);
                        pc.setPageNumber(0); // reset the page number too

                        if (log.isDebugEnabled()) {
                            log.debug("Setting PageControlView[" + view + "] to " + pc);
                        }
                        preferences.setPageControl(view, pc);
                    }
                }

                // don't let other resolvers touch this
                context.setPropertyResolved(true);
            } else if ("pagenumber".equals(lowerCaseMethodName)) {
                if (value != null) {
                    // find the user for this session-based operation
                    WebUser user = EnterpriseFacesContextUtility.getWebUser();
                    WebUserPreferences preferences = user.getWebPreferences();

                    // update it
                    PageControl pc = preferences.getPageControl(view);
                    int pageNumber = (Integer) value;
                    pc.setPageNumber(pageNumber - 1); // RF data table is 1-based, our PageControl is 0-based

                    if (log.isDebugEnabled()) {
                        log.debug("Setting PageControlView[" + view + "] to " + pc);
                    }
                    preferences.setPageControl(view, pc);
                }

                // don't let other resolvers touch this
                context.setPropertyResolved(true);
            } else {
View Full Code Here

*/
public class UserDateTimeConverter implements Converter {

    public SimpleDateFormat getFormatter() {
        WebUser user = EnterpriseFacesContextUtility.getWebUser();
        WebUserPreferences preferences = user.getWebPreferences();
        DateTimeDisplayPreferences displayPreferences = preferences.getDateTimeDisplayPreferences();

        String pattern = displayPreferences.dateTimeFormat;
        SimpleDateFormat df = new SimpleDateFormat(pattern);

        return df;
View Full Code Here

            UIComponent facet = enclosingTable.getFacet("PageControlView");
            String viewName = facet.getId();

            PageControlView currentView = PageControlView.valueOf(viewName);
            WebUser user = EnterpriseFacesContextUtility.getWebUser();
            WebUserPreferences preferences = user.getWebPreferences();

            return preferences.getPageControl(currentView);
        } catch (Throwable t) {
            // be tolerant of JSF
            return new PageControl(0, 15); // return something reasonable
        }
    }
View Full Code Here

TOP

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

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.