Package org.exoplatform.webui.application.portlet

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


    public static final int DEFAULT_LEVEL = 2;

    public UISitemapPortlet() throws Exception {

        PortletRequestContext context = (PortletRequestContext) WebuiRequestContext.getCurrentInstance();
        PortletRequest prequest = context.getRequest();
        PortletPreferences prefers = prequest.getPreferences();
        String template = prefers.getValue("template", "system:/groovy/webui/core/UISitemapTree.gtmpl");

        UIPortalNavigation uiPortalNavigation = addChild(UIPortalNavigation.class, "UISiteMap", null);
        uiPortalNavigation.setTemplate(template);
View Full Code Here


        json.put("childs", childs);
        return json;
    }

    public boolean isUseAjax() {
        PortletRequestContext context = (PortletRequestContext) WebuiRequestContext.getCurrentInstance();
        PortletRequest prequest = context.getRequest();
        PortletPreferences prefers = prequest.getPreferences();
        return Boolean.valueOf(prefers.getValue("useAJAX", "true"));
    }
View Full Code Here

public class UIBreadcumbsPortlet extends UIPortletApplication {

    private final String template;

    public UIBreadcumbsPortlet() throws Exception {
        PortletRequestContext context = (PortletRequestContext) WebuiRequestContext.getCurrentInstance();
        PortletRequest prequest = context.getRequest();
        PortletPreferences prefers = prequest.getPreferences();
        template = prefers.getValue("template", "app:/groovy/portal/webui/component/UIBreadcumbsPortlet.gtmpl");
    }
View Full Code Here

public class UILogoEditMode extends UIForm {

    private static final String FIELD_URL = "logoUrl";

    public UILogoEditMode() {
        PortletRequestContext pcontext = (PortletRequestContext) WebuiRequestContext.getCurrentInstance();
        PortletPreferences pref = pcontext.getRequest().getPreferences();
        addUIFormInput(new UIFormStringInput(FIELD_URL, FIELD_URL, pref.getValue("url", "")));
    }
View Full Code Here

                        throwMessageException(uiForm);
                    }
                }
            }

            PortletRequestContext pcontext = (PortletRequestContext) WebuiRequestContext.getCurrentInstance();
            PortletPreferences pref = pcontext.getRequest().getPreferences();
            pref.setValue("url", uiForm.getUIStringInput(FIELD_URL).getValue());
            pref.store();

            UIPortalApplication portalApp = Util.getUIPortalApplication();
            if (portalApp.getModeState() == UIPortalApplication.NORMAL_MODE) {
                pcontext.setApplicationMode(PortletMode.VIEW);
            }
        }
View Full Code Here

    public UIIFramePortlet() throws Exception {
        addChild(UIIFrameEditMode.class, null, null);
    }

    public String getURL() {
        PortletRequestContext pcontext = (PortletRequestContext) WebuiRequestContext.getCurrentInstance();
        PortletPreferences pref = pcontext.getRequest().getPreferences();
        return pref.getValue("url", "http://www.exoplatform.org");
    }
View Full Code Here

   public static final int DEFAULT_COLUMNS = 3;

   public UIDashboardEditForm() throws Exception
   {
      PortletRequestContext pcontext = (PortletRequestContext)WebuiRequestContext.getCurrentInstance();
      PortletPreferences pref = pcontext.getRequest().getPreferences();
      addUIFormInput(new UIFormStringInput(TOTAL_COLUMNS, TOTAL_COLUMNS, null));
      addUIFormInput(new UIFormStringInput(DashboardParent.OWNER, DashboardParent.OWNER, pref.getValue(
         DashboardParent.OWNER, null)));
      addUIFormInput(new UIFormStringInput(DashboardParent.ISPRIVATE, DashboardParent.ISPRIVATE, pref.getValue(
         DashboardParent.ISPRIVATE, null)));
View Full Code Here

         {
            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("NumberFormatValidator.msg.Invalid-number", args));
         }

         uiInput = uiForm.getUIStringInput(DashboardParent.ISPRIVATE);
         pref.setValue(DashboardParent.ISPRIVATE, uiInput.getValue());

         uiInput = uiForm.getUIStringInput(DashboardParent.OWNER);
         pref.setValue(DashboardParent.OWNER, uiInput.getValue());

         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

         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

    }

    public static class DeleteTabActionListener extends EventListener<UITabPaneDashboard> {
        public void execute(Event<UITabPaneDashboard> event) throws Exception {
            UITabPaneDashboard source = event.getSource();
            PortletRequestContext context = (PortletRequestContext) event.getRequestContext();
            String nodeName = context.getRequestParameter(UIComponent.OBJECTID);
            UserNode nextNode = source.getFirstAvailableNode();
            UserNode selectedNode = source.removePageNode(nodeName);

            // If the node is removed successfully, then redirect to the node specified by tab on the left
            if (selectedNode != null) {
                nextNode = selectedNode;
            }

            PortalRequestContext prContext = Util.getPortalRequestContext();
            NodeURL nodeURL = prContext.createURL(NodeURL.TYPE).setNode(nextNode);
            context.sendRedirect(nodeURL.toString());
        }
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.