Package org.exoplatform.webui.application.portlet

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


      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


            if (label.charAt(label.length() - 1) == ':') {
                label = label.substring(0, label.length() - 1);
            }
            Object[] args = { label, String.valueOf(1), String.valueOf(MAX_COLUMNS) };

            PortletRequestContext pcontext = (PortletRequestContext) WebuiRequestContext.getCurrentInstance();
            PortletPreferences pref = pcontext.getRequest().getPreferences();
            String lastValue = pref.getValue(TOTAL_COLUMNS, "" + DEFAULT_COLUMNS);

            if (uiInput.getValue() == null || uiInput.getValue().length() == 0) {
                uiInput.setValue(lastValue);
                throw new MessageException(new ApplicationMessage("EmptyFieldValidator.msg.empty-input", args));
            }

            int totalCols = 0;
            try {
                totalCols = Integer.parseInt(uiInput.getValue());
                if (totalCols < 1 || totalCols > MAX_COLUMNS)
                    throw new Exception();
            } catch (Exception e) {
                uiInput.setValue(lastValue);
                throw new MessageException(new ApplicationMessage("NumberRangeValidator.msg.Invalid-number", args));
            }

            UIDashboardContainer uiDashboardContainer = ((UIContainer) uiForm.getParent()).getChild(UIDashboard.class)
                    .getChild(UIDashboardContainer.class);
            uiDashboardContainer.setColumns(totalCols);
            uiDashboardContainer.save();
            if (Util.getUIPortalApplication().getModeState() == UIPortalApplication.NORMAL_MODE)
                pcontext.setApplicationMode(PortletMode.VIEW);
        }
View Full Code Here

        public final void execute(final Event<UIDashboard> event) throws Exception {
            UIDashboard uiDashboard = (UIDashboard) event.getSource();
            if (!uiDashboard.canEdit()) {
                return;
            }
            PortletRequestContext pcontext = (PortletRequestContext) event.getRequestContext();
            boolean isShow = Boolean.parseBoolean(pcontext.getRequestParameter("isShow"));
            uiDashboard.setShowSelectPopup(isShow);
            String windowId = uiDashboard.getChild(UIDashboardContainer.class).getWindowId();
            event.getRequestContext().addUIComponentToUpdateByAjax(uiDashboard.getChild(UIPopupWindow.class));
            if (isShow) {
                event.getRequestContext().getJavascriptManager().require("SHARED/dashboard", "dashboard")
View Full Code Here

        public final void execute(final Event<UIDashboard> event) throws Exception {
            UIDashboard uiDashboard = (UIDashboard) event.getSource();
            if (!uiDashboard.canEdit()) {
                return;
            }
            PortletRequestContext pcontext = (PortletRequestContext) event.getRequestContext();
            boolean isShow = Boolean.parseBoolean(pcontext.getRequestParameter("isShow"));
            uiDashboard.setShowSelectPopup(isShow);
            String windowId = uiDashboard.getChild(UIDashboardContainer.class).getWindowId();
            event.getRequestContext().addUIComponentToUpdateByAjax(uiDashboard.getChild(UIPopupWindow.class));
            if (isShow) {
                event.getRequestContext().getJavascriptManager().require("SHARED/dashboard", "dashboard")
View Full Code Here

        // Never use captcha if skipCaptcha is true. Otherwise read value from portlet property
        boolean useCaptcha;
        if (skipCaptcha) {
            useCaptcha = false;
        } else {
            PortletRequestContext pcontext = (PortletRequestContext) WebuiRequestContext.getCurrentInstance();
            PortletPreferences pref = pcontext.getRequest().getPreferences();
            useCaptcha = Boolean.parseBoolean(pref.getValue(UIRegisterEditMode.USE_CAPTCHA, "true"));
        }

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

        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

                postRegistrationService.sendMailAfterSuccessfulRegistration(user);
            }

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

   private String getKey(WebuiRequestContext webuiRC)
   {
      if (webuiRC instanceof PortletRequestContext)
      {
         PortletRequestContext portletRC = (PortletRequestContext)webuiRC;
         return portletRC.getApplication().getApplicationId() + "/" + portletRC.getWindowId();
      }
      else
      {
         PortalRequestContext portalRC = (PortalRequestContext)webuiRC;
         String portalOwner = portalRC.getPortalOwner();
View Full Code Here

   private HttpSession getSession(WebuiRequestContext webuiRC)
   {
      PortalRequestContext portalRC;
      if (webuiRC instanceof PortletRequestContext)
      {
         PortletRequestContext portletRC = (PortletRequestContext)webuiRC;
         portalRC = (PortalRequestContext) portletRC.getParentAppRequestContext();
      }
      else
      {
         portalRC = (PortalRequestContext)webuiRC;
      }
View Full Code Here

   private final String id;

   public UIGroovyPortlet() throws Exception
   {
      PortletRequestContext context = (PortletRequestContext)WebuiRequestContext.getCurrentInstance();
      PortletRequest prequest = context.getRequest();
      template_ = prequest.getPreferences().getValue("template", DEFAULT_TEMPLATE);
      windowId = prequest.getWindowID();
      id = windowId + "-portlet";
   }
View Full Code Here

TOP

Related Classes of org.exoplatform.webui.application.portlet.PortletRequestContext

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.