Package org.rhq.enterprise.gui.legacy

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


        HttpServletRequest request, HttpServletResponse response) throws Exception {
        ServletContext ctx = getServlet().getServletContext();

        HttpSession session = request.getSession();

        WebUser user = SessionUtils.getWebUser(session);
        request.setAttribute("userId", user.getId());

        Portal portal = Portal.createPortal("start.template.title", ".portal.start.layout");
        request.setAttribute(Constants.PORTAL_KEY, portal);

        return null;
View Full Code Here


        if (0 == subject.getId()) {
            return new ArrayList();
        }

        if (resourceFavorites == null) {
            WebUser user = EnterpriseFacesContextUtility.getWebUser();
            WebUserPreferences.FavoriteResourcePortletPreferences favoriteResources = user.getWebPreferences()
                .getFavoriteResourcePortletPreferences();

            resourceFavorites = resourceManager.findResourceByIds(subject, favoriteResources.asArray(), false,
                PageControl.getUnlimitedInstance());
        }
View Full Code Here

        if (0 == subject.getId()) {
            return new ArrayList();
        }

        if (groupFavorites == null) {
            WebUser user = EnterpriseFacesContextUtility.getWebUser();
            WebUserPreferences.FavoriteGroupPortletPreferences favoriteGroups = user.getWebPreferences()
                .getFavoriteGroupPortletPreferences();

            groupFavorites = groupManager.findResourceGroupByIds(subject, favoriteGroups.asArray(),
                PageControl.getUnlimitedInstance());
        }
View Full Code Here

        }
        return groupFavorites;
    }

    public List<WebUserPreferences.ResourceVisit> getRecentVisits() {
        WebUser user = EnterpriseFacesContextUtility.getWebUser();
        return user.getWebPreferences().getRecentResourceVisits();
    }
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(),
View Full Code Here

    public String getPercentage() {
        return percentage;
    }

    public AvailabilityUIBean() {
        WebUser user = EnterpriseFacesContextUtility.getWebUser();
        MeasurementPreferences preferences = user.getMeasurementPreferences();

        EntityContext context = WebUtility.getEntityContext();
        try {
            MetricRangePreferences rangePreferences = preferences.getMetricRangePreferences();

            // adjust down so the start time of the first point equals the begin time of the metric display range prefs
            long adjust = (rangePreferences.end - rangePreferences.begin) / DefaultConstants.DEFAULT_CHART_POINTS;

            if (context.type == EntityContext.Type.Resource) {
                data = availabilityManager.findAvailabilitiesForResource(user.getSubject(), context.resourceId,
                    rangePreferences.begin - adjust, rangePreferences.end - adjust,
                    DefaultConstants.DEFAULT_CHART_POINTS, !rangePreferences.readOnly);
            } else if (context.type == EntityContext.Type.ResourceGroup) {
                data = availabilityManager.findAvailabilitiesForResourceGroup(user.getSubject(), context.groupId,
                    rangePreferences.begin - adjust, rangePreferences.end - adjust,
                    DefaultConstants.DEFAULT_CHART_POINTS, !rangePreferences.readOnly);
            } else if (context.type == EntityContext.Type.AutoGroup) {
                data = availabilityManager.findAvailabilitiesForAutoGroup(user.getSubject(), context.parentResourceId,
                    context.resourceTypeId, rangePreferences.begin - adjust, rangePreferences.end - adjust,
                    DefaultConstants.DEFAULT_CHART_POINTS, !rangePreferences.readOnly);
            }

            if (data != null) {
View Full Code Here

            super(view, beanName);
        }

        @Override
        public PageList<CallTimeDataComposite> fetchPage(PageControl pc) {
            WebUser user = EnterpriseFacesContextUtility.getWebUser();
            MeasurementPreferences preferences = user.getMeasurementPreferences();
            MetricRangePreferences rangePreferences = preferences.getMetricRangePreferences();

            /*
            Subject subject = getSubject();
            PageList<CallTimeDataComposite> results = new PageList<CallTimeDataComposite>();
View Full Code Here

    public EntityContext getContext() {
        return context;
    }

    public EventsTimelineUIBean() {
        WebUser user = EnterpriseFacesContextUtility.getWebUser();
        MeasurementPreferences preferences = user.getMeasurementPreferences();
        MetricRangePreferences rangePreferences = preferences.getMetricRangePreferences();

        long begin = rangePreferences.begin;
        long end = rangePreferences.end;
        int numberOfBuckets = DefaultConstants.DEFAULT_CHART_POINTS;
View Full Code Here

    public List<MetricDisplaySummary> getMetricSummaries() {
        if (null != metricSummaries) {
            return metricSummaries;
        }

        WebUser user = EnterpriseFacesContextUtility.getWebUser();
        MeasurementPreferences preferences = user.getMeasurementPreferences();
        MetricRangePreferences range = preferences.getMetricRangePreferences();

        if (context.type == EntityContext.Type.Resource) {
            //null -> don't filter, we want everything, false -> not only enabled
            List<MeasurementSchedule> measurementSchedules = scheduleManager.findSchedulesForResourceAndType(
                user.getSubject(), context.resourceId, DataType.MEASUREMENT, null, true);

            int[] scheduleIds = new int[measurementSchedules.size()];
            int i = 0;
            for (MeasurementSchedule sched : measurementSchedules) {
                scheduleIds[i++] = sched.getId();
            }

            metricSummaries = chartManager.getMetricDisplaySummariesForResource(user.getSubject(), context.resourceId,
                scheduleIds, range.begin, range.end);

        } else if (context.type == EntityContext.Type.ResourceGroup) {
            List<MeasurementDefinition> measurementDefinitions = definitionManager
                .findMeasurementDefinitionsByResourceType(user.getSubject(), getResourceGroup(user).getResourceType()
                    .getId(), DataType.MEASUREMENT, null);

            int[] defIds = new int[measurementDefinitions.size()];
            int i = 0;
            for (MeasurementDefinition def : measurementDefinitions) {
                defIds[i++] = def.getId();
            }

            metricSummaries = chartManager.getMetricDisplaySummariesForCompatibleGroup(user.getSubject(), context,
                defIds, range.begin, range.end, true);

        } else if (context.type == EntityContext.Type.AutoGroup) {
            List<MeasurementDefinition> measurementDefinitions = definitionManager
                .findMeasurementDefinitionsByResourceType(user.getSubject(), context.getResourceTypeId(),
                    DataType.MEASUREMENT, null);

            int[] defIds = new int[measurementDefinitions.size()];
            int i = 0;
            for (MeasurementDefinition def : measurementDefinitions) {
                defIds[i++] = def.getId();
            }

            metricSummaries = chartManager.getMetricDisplaySummariesForAutoGroup(user.getSubject(),
                context.getParentResourceId(), context.getResourceTypeId(), defIds, range.begin, range.end, true);

        } else {
            log.error(context.getUnknownContextMessage());
            // return an empty list in this unlikely scenario
View Full Code Here

            super(view, beanName);
        }

        @Override
        public PageList<ResourceHealthComposite> fetchPage(PageControl pageControl) {
            WebUser user = EnterpriseFacesContextUtility.getWebUser();

            PageList<ResourceHealthComposite> groupMemberHealthSummaries = resourceManager.findResourceHealth(user
                .getSubject(), metricsTableUIBean.getResourceGroupMemberIds(user), pageControl);

            return groupMemberHealthSummaries;
        }
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.