Examples of PortletRequestContext


Examples of org.exoplatform.webui.application.portlet.PortletRequestContext

        @Override
        public void execute(Event<UIApplicationRegistryEditMode> event) throws Exception {
            // TODO Auto-generated method stub
            UIApplicationRegistryEditMode uiForm = event.getSource();
            boolean isShowImport = uiForm.getUIFormCheckBoxInput(SHOW_IMPORT).isChecked();
            PortletRequestContext pcontext = (PortletRequestContext) WebuiRequestContext.getCurrentInstance();
            PortletPreferences pref = pcontext.getRequest().getPreferences();
            pref.setValue(SHOW_IMPORT, Boolean.toString(isShowImport));
            pref.store();
            UIPortalApplication portalApp = Util.getUIPortalApplication();
            if (portalApp.getModeState() == UIPortalApplication.NORMAL_MODE)
                pcontext.setApplicationMode(PortletMode.VIEW);

        }
View Full Code Here

Examples of org.exoplatform.webui.application.portlet.PortletRequestContext

        @Override
        public void execute(Event<UIRegisterEditMode> event) throws Exception {
            // TODO Auto-generated method stub
            UIRegisterEditMode uiForm = event.getSource();
            boolean useCaptcha = uiForm.getUIFormCheckBoxInput(USE_CAPTCHA).isChecked();
            PortletRequestContext pcontext = (PortletRequestContext) WebuiRequestContext.getCurrentInstance();
            PortletPreferences pref = pcontext.getRequest().getPreferences();
            pref.setValue(USE_CAPTCHA, Boolean.toString(useCaptcha));
            pref.store();

            // Show/hide the captcha input in UIRegisterInputSet
            UIRegisterPortlet registerPortlet = uiForm.getParent();
            UIRegisterInputSet registerInputSet = registerPortlet.findFirstComponentOfType(UIRegisterInputSet.class);

            if (useCaptcha) {
                if (!registerInputSet.getCaptchaInputAvailability()) {
                    registerInputSet.addUIFormInput(new UICaptcha(UIRegisterInputSet.CAPTCHA, UIRegisterInputSet.CAPTCHA, null)
                            .addValidator(MandatoryValidator.class).addValidator(CaptchaValidator.class));
                    registerInputSet.setCaptchaInputAvailability(true);
                }
            } else {
                if (registerInputSet.getCaptchaInputAvailability()) {
                    registerInputSet.removeChildById(UIRegisterInputSet.CAPTCHA);
                    registerInputSet.setCaptchaInputAvailability(false);
                }
            }

            UIPortalApplication portalApp = Util.getUIPortalApplication();
            if (portalApp.getModeState() == UIPortalApplication.NORMAL_MODE)
                pcontext.setApplicationMode(PortletMode.VIEW);

        }
View Full Code Here

Examples of org.exoplatform.webui.application.portlet.PortletRequestContext

        super.processAction(context);

        if (context.getProcessRender()) {
            // Invalidate the capcha
            if (context instanceof PortletRequestContext) {
                PortletRequestContext prc = (PortletRequestContext) context;
                prc.getRequest().getPortletSession().removeAttribute(Captcha.NAME);
            }
            context.addUIComponentToUpdateByAjax(getChild(UIRegisterInputSet.class));
        }
    }
View Full Code Here

Examples of org.exoplatform.webui.application.portlet.PortletRequestContext

                postRegistrationService.sendMailAfterSuccessfulRegistration(user);
            }

            // Invalidate the capcha
            if (context instanceof PortletRequestContext) {
                PortletRequestContext prc = (PortletRequestContext) context;
                prc.getRequest().getPortletSession().removeAttribute(Captcha.NAME);
            }
        }
View Full Code Here

Examples of org.exoplatform.webui.application.portlet.PortletRequestContext

            }
        }
    }

    public boolean isShowImport() {
        PortletRequestContext pcontext = (PortletRequestContext) WebuiRequestContext.getCurrentInstance();
        PortletPreferences pref = pcontext.getRequest().getPreferences();
        return Boolean.parseBoolean(pref.getValue("showImport", "true"));
    }
View Full Code Here

Examples of org.exoplatform.webui.application.portlet.PortletRequestContext

    protected static final int DEFAULT_LEVEL = 2;

    public BasePartialUpdateToolbar() throws Exception {
        int level = DEFAULT_LEVEL;
        try {
            PortletRequestContext context = (PortletRequestContext) WebuiRequestContext.getCurrentInstance();
            PortletRequest prequest = context.getRequest();
            PortletPreferences prefers = prequest.getPreferences();

            level = Integer.valueOf(prefers.getValue("level", String.valueOf(DEFAULT_LEVEL)));
        } catch (Exception ex) {
            log.warn("Preference for navigation level can only be integer");
View Full Code Here

Examples of org.exoplatform.webui.application.portlet.PortletRequestContext

@ComponentConfig(lifecycle = UIApplicationLifecycle.class)
public class UIGroupNavigationPortlet extends UIPortletApplication {
    public static final int DEFAULT_LEVEL = 2;

    public UIGroupNavigationPortlet() throws Exception {
        PortletRequestContext context = (PortletRequestContext) WebuiRequestContext.getCurrentInstance();
        PortletRequest prequest = context.getRequest();
        PortletPreferences prefers = prequest.getPreferences();
        int level = DEFAULT_LEVEL;
        try {
            level = Integer.valueOf(prefers.getValue("level", String.valueOf(DEFAULT_LEVEL)));
        } catch (Exception ex) {
View Full Code Here

Examples of org.exoplatform.webui.application.portlet.PortletRequestContext

                        UserConfigurableValidator.KEY_PREFIX + "displayname", false));

        addUIFormInput(new UIFormStringInput(EMAIL_ADDRESS, EMAIL_ADDRESS, null).addValidator(MandatoryValidator.class)
                .addValidator(EmailAddressValidator.class));

        PortletRequestContext pcontext = (PortletRequestContext) WebuiRequestContext.getCurrentInstance();
        PortletPreferences pref = pcontext.getRequest().getPreferences();
        boolean useCaptcha = Boolean.parseBoolean(pref.getValue(UIRegisterEditMode.USE_CAPTCHA, "true"));

        if (useCaptcha) {
            addUIFormInput(new UICaptcha(CAPTCHA, CAPTCHA, null).addValidator(MandatoryValidator.class).addValidator(
                    CaptchaValidator.class));
View Full Code Here

Examples of org.exoplatform.webui.application.portlet.PortletRequestContext

@Serialized
public class UIRegisterEditMode extends UIForm {
    public static final String USE_CAPTCHA = "useCaptcha";

    public UIRegisterEditMode() {
        PortletRequestContext pcontext = (PortletRequestContext) WebuiRequestContext.getCurrentInstance();
        PortletPreferences pref = pcontext.getRequest().getPreferences();
        boolean useCaptcha = Boolean.parseBoolean(pref.getValue(USE_CAPTCHA, "true"));
        addUIFormInput(new UIFormCheckBoxInput<Boolean>(USE_CAPTCHA, USE_CAPTCHA, useCaptcha).setValue(useCaptcha));
    }
View Full Code Here

Examples of org.exoplatform.webui.application.portlet.PortletRequestContext

@ComponentConfig(lifecycle = UIApplicationLifecycle.class)
public class UIPortalNavigationPortlet extends UIPortletApplication {
    public static final int DEFAULT_LEVEL = 2;

    public UIPortalNavigationPortlet() throws Exception {
        PortletRequestContext context = (PortletRequestContext) WebuiRequestContext.getCurrentInstance();
        PortletRequest prequest = context.getRequest();
        PortletPreferences prefers = prequest.getPreferences();
        int level = DEFAULT_LEVEL;
        try {
            level = Integer.valueOf(prefers.getValue("level", String.valueOf(DEFAULT_LEVEL)));
        } catch (Exception ex) {
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.