Package org.rhq.enterprise.gui.legacy

Examples of org.rhq.enterprise.gui.legacy.WebUser


     * @param  request
     *
     * @return
     */
    public static Subject getSubject(HttpServletRequest request) {
        WebUser user = SessionUtils.getWebUser(request.getSession());
        Subject subject = user.getSubject();
        return subject;
    }
View Full Code Here


    public ResourceMetricsTableUIBean() {
        super();

        Subject subject = EnterpriseFacesContextUtility.getSubject();
        Resource resource = EnterpriseFacesContextUtility.getResource();
        WebUser user = EnterpriseFacesContextUtility.getWebUser();
        MeasurementPreferences.MetricRangePreferences range = user.getMeasurementPreferences()
            .getMetricRangePreferences();

        List<MeasurementSchedule> traitSchedules = scheduleManager.findSchedulesForResourceAndType(subject,
            resource.getId(), DataType.TRAIT, null, true); //null -> don't filter, we want everything, false -> not only enabled
View Full Code Here

    public void sessionCreated(HttpSessionEvent event) {
        // ignore the create event
    }

    public void sessionDestroyed(HttpSessionEvent event) {
        WebUser webUser = SessionUtils.getWebUser(event.getSession());
        if (webUser != null) {
            Subject subject = webUser.getSubject();
            if (subject != null) {
                LookupUtil.getSubjectPreferencesCache().clearConfiguration(subject.getId());
            }
        }
    }
View Full Code Here

            String lowerCaseMethodName = methodName.toLowerCase();
            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);
                }
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
View Full Code Here

        this.toTime = toTime;
    }

    public void execute() {
        FacesContext facesContext = FacesContextUtility.getFacesContext();
        WebUser user = EnterpriseFacesContextUtility.getWebUser();
        MeasurementPreferences preferences = user.getMeasurementPreferences();
        MetricRangePreferences rangePreferences = preferences.getMetricRangePreferences();

        String metricType = "";
        if (this.getIntervalType() == null) {
            metricType = getDurationType();
View Full Code Here

        }
        preferences.setMetricRangePreferences(rangePreferences);
    }

    public void init() {
        WebUser user = EnterpriseFacesContextUtility.getWebUser();
        MeasurementPreferences preferences = user.getMeasurementPreferences();
        MetricRangePreferences rangePreferences = preferences.getMetricRangePreferences();
        if (rangePreferences.readOnly) {
            this.setDurationType(null);
            this.setIntervalType("interval");
            this.setUnit(null);
View Full Code Here

* @author Joseph Marques
*/
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);

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

    public String getFamily() {
        return COMPONENT_FAMILY;
    }

    private void loadPreferences() {
        WebUser user = EnterpriseFacesContextUtility.getWebUser();
        MeasurementPreferences preferences = user.getMeasurementPreferences();
        this.rangePreferences = preferences.getMetricRangePreferences();
    }
View Full Code Here

TOP

Related Classes of org.rhq.enterprise.gui.legacy.WebUser

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.