Package org.exoplatform.webui.application.portlet

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


         45).addValidator(MandatoryValidator.class));
     
      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


{
   public static final String USE_CAPTCHA = "useCaptcha";
  
   public UIRegisterEditMode() throws Exception
   {
      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

      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

@ComponentConfig(lifecycle = UIApplicationLifecycle.class, template = "app:/groovy/dashboard/webui/component/UIDashboardPortlet.gtmpl", events = {})
public class UIDashboardPortlet extends UIPortletApplication implements DashboardParent
{
   public UIDashboardPortlet() throws Exception
   {
      PortletRequestContext context = (PortletRequestContext)WebuiRequestContext.getCurrentInstance();

      UIDashboard dashboard = addChild(UIDashboard.class, null, null);
      addChild(UIDashboardEditForm.class, null, null);

      PortletPreferences pref = context.getRequest().getPreferences();
      String containerTemplate = pref.getValue("template", "three-columns");
      dashboard.setContainerTemplate(containerTemplate);

      String aggregatorId = pref.getValue("aggregatorId", "rssAggregator");
      dashboard.setAggregatorId(aggregatorId);
View Full Code Here

    * The implementation returns true if the current user has edit permission on the page owning the dashboard
    * portlet. Later it will be implemented with a finer granilarity.
    */
   public boolean canEdit()
   {
      PortletRequestContext context = (PortletRequestContext)WebuiRequestContext.getCurrentInstance();
      PortalRequestContext prc = (PortalRequestContext)context.getParentAppRequestContext();
      UIPortalApplication portalApp = (UIPortalApplication)prc.getUIApplication();
      UIPortal portal = portalApp.getShowedUIPortal();

      //
      try
View Full Code Here

   @ComponentConfig(type = UIPortalNavigation2.class, id = "UIHorizontalNavigation", events = @EventConfig(listeners = UIPortalNavigation2.SelectNodeActionListener.class))})
public class UIPortalNavigationPortlet extends UIPortletApplication
{
   public UIPortalNavigationPortlet() throws Exception
   {
      PortletRequestContext context = (PortletRequestContext)WebuiRequestContext.getCurrentInstance();
      PortletRequest prequest = context.getRequest();
      PortletPreferences prefers = prequest.getPreferences();
      String template = prefers.getValue("template", "app:/groovy/portal/webui/component/UIPortalNavigation2.gtmpl");

      UIPortalNavigation2 portalNavigation = addChild(UIPortalNavigation2.class, "UIHorizontalNavigation", null);
      portalNavigation.setUseAjax(Boolean.valueOf(prefers.getValue("useAJAX", "true")));
View Full Code Here

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

   public String getUrl()
   {
      PortletRequestContext pcontext = (PortletRequestContext)WebuiRequestContext.getCurrentInstance();
      PortletPreferences pref = pcontext.getRequest().getPreferences();
      String urlPref = pref.getValue("url", "http://www.google.com/ig/modules/horoscope.xml");
      if (urlPref.startsWith(LOCAL_STRING))
      {
         try
         {
View Full Code Here

         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)
         {
View Full Code Here

        // For now do nothing....
    }

    private String getKey(WebuiRequestContext webuiRC) {
        if (webuiRC instanceof PortletRequestContext) {
            PortletRequestContext portletRC = (PortletRequestContext) webuiRC;
            return portletRC.getApplication().getApplicationId() + "/" + portletRC.getWindowId();
        } else {
            return PortalApplication.PORTAL_APPLICATION_ID;
        }
    }
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;
        }
        HttpServletRequest req = portalRC.getRequest();
        return req.getSession(false);
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.