Examples of WebuiRequestContext


Examples of org.exoplatform.webui.application.WebuiRequestContext

            StringWriter writer = new StringWriter();
            uiPortlet_.generateRenderMarkup(portletResponse, prcontext).writeTo(writer);

            return writer.toString();
        } catch (Throwable ex) {
            WebuiRequestContext webuiRequest = WebuiRequestContext.getCurrentInstance();
            log.error("The portlet " + uiPortlet_.getName() + " could not be loaded. Check if properly deployed.",
                    ExceptionUtil.getRootCause(ex));
            return webuiRequest.getApplicationResourceBundle().getString("UIPortlet.message.RuntimeError");
        }
    }
View Full Code Here

Examples of org.exoplatform.webui.application.WebuiRequestContext

        }
    }

    public static class DeleteGadgetActionListener extends EventListener<UIPage> {
        public void execute(Event<UIPage> event) throws Exception {
            WebuiRequestContext pContext = event.getRequestContext();
            String id = pContext.getRequestParameter(UIComponent.OBJECTID);
            UIPage uiPage = event.getSource();
            List<UIGadget> uiWidgets = new ArrayList<UIGadget>();
            uiPage.findComponentOfType(uiWidgets, UIGadget.class);
            for (UIGadget uiWidget : uiWidgets) {
                if (uiWidget.getId().equals(id)) {
                    uiPage.getChildren().remove(uiWidget);
                    String userName = pContext.getRemoteUser();
                    if (userName != null && userName.trim().length() > 0) {
                        // Julien : commented as normally removing the gadget should
                        // remove the state associated with it
                        // in the MOP
                        // UserGadgetStorage widgetDataService =
View Full Code Here

Examples of org.exoplatform.webui.application.WebuiRequestContext

    public static class SaveActionListener extends EventListener<UIAccountChangePass> {
        public void execute(Event<UIAccountChangePass> event) throws Exception {
            UIAccountChangePass uiForm = event.getSource();
            OrganizationService service = uiForm.getApplicationComponent(OrganizationService.class);
            WebuiRequestContext context = WebuiRequestContext.getCurrentInstance();
            UIApplication uiApp = context.getUIApplication();
            String username = Util.getPortalRequestContext().getRemoteUser();
            User user = service.getUserHandler().findUserByName(username);
            String currentPass = uiForm.getUIStringInput("currentpass").getValue();
            String newPass = uiForm.getUIStringInput("newpass").getValue();
            String confirmnewPass = uiForm.getUIStringInput("confirmnewpass").getValue();
View Full Code Here

Examples of org.exoplatform.webui.application.WebuiRequestContext

        addChild(UIStandaloneAppContainer.class, null, null);
    }

    // Temporary need this, don't want to render UIPopupMessage
    public void renderChildren() throws Exception {
        WebuiRequestContext context = WebuiRequestContext.getCurrentInstance();
        super.renderChildren(context);
    }
View Full Code Here

Examples of org.exoplatform.webui.application.WebuiRequestContext

        w.write(StringUtils.join(scriptURLs.keySet(), ","));
        w.write("</div>");
    }

    public Map<String, Boolean> getScripts() {
        WebuiRequestContext context = WebuiRequestContext.getCurrentInstance();
        JavascriptManager jsMan = context.getJavascriptManager();

        // Need to add bootstrap as immediate since it contains the loader
        jsMan.loadScriptResource(ResourceScope.SHARED, "bootstrap");

        //
View Full Code Here

Examples of org.exoplatform.webui.application.WebuiRequestContext

        }
    }

    private static void buildUIContainer(UIContainer uiContainer, Object model, boolean dashboard) throws Exception {
        UIComponent uiComponent = null;
        WebuiRequestContext context = Util.getPortalRequestContext();

        if (model instanceof SiteBody) {
            UISiteBody uiSiteBody = uiContainer.createUIComponent(context, UISiteBody.class, null, null);
            uiSiteBody.setStorageId(((SiteBody) model).getStorageId());
            uiComponent = uiSiteBody;
View Full Code Here

Examples of org.exoplatform.webui.application.WebuiRequestContext

        public void execute(Event<UIAccountSocial> event) throws Exception {
            UIAccountSocial uiForm = event.getSource();

            OrganizationService service = uiForm.getApplicationComponent(OrganizationService.class);
            WebuiRequestContext context = WebuiRequestContext.getCurrentInstance();
            PortalRequestContext prContext = Util.getPortalRequestContext();
            UIApplication uiApp = context.getUIApplication();

            ConversationState state = ConversationState.getCurrent();
            String userName = ((User) state.getAttribute(CacheUserProfileFilter.USER_PROFILE)).getUserName();
            User user = service.getUserHandler().findUserByName(userName);
View Full Code Here

Examples of org.exoplatform.webui.application.WebuiRequestContext

     *
     * @throws Exception
     */
    public void updateWorkspaceComponent() throws Exception {
        UIPortalApplication uiApp = Util.getUIPortalApplication();
        WebuiRequestContext rcontext = WebuiRequestContext.getCurrentInstance();
        UIEditInlineWorkspace uiEditWS = uiApp.findFirstComponentOfType(UIEditInlineWorkspace.class);
        List<UIComponent> children = uiEditWS.getChildren();
        for (UIComponent child : children) {
            if (!child.isRendered() || child.getClass().equals(UIPortalComposer.class)) {
                continue;
            }
            rcontext.addUIComponentToUpdateByAjax(child);
        }
        int portalMode = uiApp.getModeState();
        if (portalMode != UIPortalApplication.NORMAL_MODE) {
            switch (portalMode) {
                case UIPortalApplication.APP_BLOCK_EDIT_MODE:
View Full Code Here

Examples of org.exoplatform.webui.application.WebuiRequestContext

        }
    }

    public static class ChangeNodeActionListener extends EventListener<UIWizardPageSetInfo> {
        public void execute(Event<UIWizardPageSetInfo> event) throws Exception {
            WebuiRequestContext context = event.getRequestContext();
            UIWizardPageSetInfo pageSetInfo = event.getSource();
            UIPageCreationWizard uiWizard = (UIPageCreationWizard) pageSetInfo.getAncestorOfType(UIPageCreationWizard.class);

            String uri = context.getRequestParameter(OBJECTID);
            UIPageNodeSelector uiPageNodeSelector = pageSetInfo.getChild(UIPageNodeSelector.class);
            try {
                uiPageNodeSelector.setSelectedURI(uri);
                if (!uiPageNodeSelector.getSelectedNode().getURI().equals(uri)) {
                    context.getUIApplication().addMessage(new ApplicationMessage("UIWizardPageSetInfo.msg.node.deleted", null));
                }
            } catch (NavigationServiceException ex) {
                context.getUIApplication().addMessage(
                        new ApplicationMessage("UIWizardPageSetInfo.msg.navigation.deleted", null));
                uiWizard.createEvent("Abort", Phase.PROCESS, context).broadcast();
                return;
            }
View Full Code Here

Examples of org.exoplatform.webui.application.WebuiRequestContext

     * Initializes a newly created <code>SaveUserPrefActionListener</code> object
     */
    public static class SaveUserPrefActionListener extends EventListener<UIGadget> {
        public void execute(Event<UIGadget> event) throws Exception {
            UIGadget uiGadget = event.getSource();
            WebuiRequestContext context = WebuiRequestContext.getCurrentInstance();

            //
            try {
                uiGadget.addUserPref(event.getRequestContext().getRequestParameter("userPref"));
                Util.getPortalRequestContext().setResponseComplete(true);
            } catch (Exception e) {
                UIPortletApplication uiPortlet = uiGadget.getAncestorOfType(UIPortletApplication.class);
                context.addUIComponentToUpdateByAjax(uiPortlet);
                context.setAttribute(UIGadget.SAVE_PREF_FAIL, true);
                throw new MessageException(new ApplicationMessage("UIDashboard.msg.ApplicationNotExisted", null,
                        ApplicationMessage.ERROR));
            }

            //
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.