Package org.rhq.enterprise.gui.legacy

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


        setResource(request, requiresResourceToBeConfigured);
    }

    protected void setResource(HttpServletRequest request, boolean requiresResourceToBeConfigured) throws Exception {
        int resourceId = RequestUtils.getIntParameter(request, "id");
        WebUser webUser = RequestUtils.getWebUser(request);
        try {
            log.info("finding resource with ID " + resourceId + "...");

            Resource resource = LookupUtil.getResourceManager().getResourceById(webUser.getSubject(), resourceId);

            // TODO (ips): Check if resource has been configured successfully yet.
            //InventoryHelper helper = InventoryHelper.getHelper(null);
            //helper.isResourceConfigured(request, ctx, !config);
View Full Code Here


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

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

        if (forward != null) {
            return forward;
View Full Code Here

    @Override
    public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request,
        HttpServletResponse response) throws Exception {
        PropertiesForm pForm = (PropertiesForm) form;

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

        OperationPortletPreferences prefs = preferences.getOperationPortletPreferences();
        pForm.setOperationPortletPreferences(prefs);

        return null;
View Full Code Here

public class ModifyAction 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();
        PropertiesForm pForm = (PropertiesForm) form;
        ActionForward forward = checkSubmit(request, mapping, form);
        String returnString = RetCodeConstants.SUCCESS_URL;
        if (forward != null) {
            return forward;
View Full Code Here

public class PrepareAction extends TilesAction {
    @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);
View Full Code Here

    @Override
    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);
View Full Code Here

        PageList<GroupOperationLastCompletedComposite> lastCompletedGroupOps = new PageList<GroupOperationLastCompletedComposite>();
        PageList<DisambiguationReport<ResourceOperationScheduleComposite>> disambiguatedNextScheduledResourceOps = new PageList<DisambiguationReport<ResourceOperationScheduleComposite>>();
        PageList<GroupOperationScheduleComposite> nextScheduledGroupOps = new PageList<GroupOperationScheduleComposite>();

        try {
            WebUser user = SessionUtils.getWebUser(request.getSession());
            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();
            ResourceManagerLocal resourceManager = LookupUtil.getResourceManager();
           
            if (operationPreferences.useLastCompleted) {
                PageControl pageControl = new PageControl(0, operationPreferences.lastCompleted);
                pageControl.initDefaultOrderingField("ro.createdTime", PageOrdering.DESC);
                PageList<ResourceOperationLastCompletedComposite> lastCompletedResourceOps =
                    manager.findRecentlyCompletedResourceOperations(user.getSubject(), null, pageControl);

                disambiguatedLastCompletedResourceOps = DisambiguatedResourceListUtil.disambiguate(
                    resourceManager, lastCompletedResourceOps, RESOURCE_OPERATION_RESOURCE_ID_EXTRACTOR);
               
                pageControl = new PageControl(0, operationPreferences.lastCompleted);
                pageControl.initDefaultOrderingField("go.createdTime", PageOrdering.DESC);
                lastCompletedGroupOps = manager.findRecentlyCompletedGroupOperations(user.getSubject(), pageControl);
            }

            if (operationPreferences.useNextScheduled) {
                PageControl pageControl = new PageControl(0, operationPreferences.nextScheduled);
                PageList<ResourceOperationScheduleComposite> nextScheduledResourceOps =
                    manager.findCurrentlyScheduledResourceOperations(user.getSubject(),
                    pageControl);

                disambiguatedNextScheduledResourceOps = DisambiguatedResourceListUtil.disambiguate(
                    resourceManager, nextScheduledResourceOps, RESOURCE_OPERATION_SCHEDULE_RESOURCE_ID_EXTRACTOR);
               
                pageControl = new PageControl(0, operationPreferences.nextScheduled);
                nextScheduledGroupOps = manager.findCurrentlyScheduledGroupOperations(user.getSubject(), pageControl);
            }
        } catch (Exception e) {
            if (log.isDebugEnabled()) {
                log.debug("Dashboard Portlet [ControlActions] experienced an error: " + e.getMessage(), e);
            } else {
View Full Code Here

        HttpServletRequest request, HttpServletResponse response) throws Exception {

        List<Tuple<String, String>> charts = new ArrayList<Tuple<String, String>>();

        try {
            WebUser user = SessionUtils.getWebUser(request.getSession());
            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

    @Override
    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);
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);
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.