Package org.exoplatform.webui.application.portlet

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


    }

    public static class AddDashboardActionListener extends EventListener<UITabPaneDashboard> {
        public void execute(Event<UITabPaneDashboard> event) throws Exception {
            UITabPaneDashboard tabPane = event.getSource();
            PortletRequestContext context = (PortletRequestContext) event.getRequestContext();
            String newTabLabel = context.getRequestParameter(UIComponent.OBJECTID);
            UserNode node = tabPane.getFirstAvailableNode();
            if (!tabPane.validateName(newTabLabel)) {
                Object[] args = { newTabLabel };
                context.getUIApplication().addMessage(new ApplicationMessage("UITabPaneDashboard.msg.wrongTabName", args));
            } else {
                UserNode createdNode = tabPane.createNewPageNode(newTabLabel);
                if (createdNode != null) {
                    node = createdNode;
                }
            }

            PortalRequestContext prContext = Util.getPortalRequestContext();
            NodeURL nodeURL = prContext.createURL(NodeURL.TYPE).setNode(node);
            context.sendRedirect(nodeURL.toString());
        }
View Full Code Here


    private String url;

    public UIGadgetPortlet() throws Exception {
        setId(Integer.toString(hashCode()));
        PortletRequestContext context = (PortletRequestContext) WebuiRequestContext.getCurrentInstance();
        fillUpFreeSpace = Boolean.parseBoolean(context.getRequest().getPreferences().getValue("fillUpFreeSpace", "false"));
        addChild(UIGadgetViewMode.class, null, null);
    }
View Full Code Here

    }

    public String getMetadata() {
        if (metadata == null) {
            PortletRequestContext pcontext = (PortletRequestContext) WebuiRequestContext.getCurrentInstance();
            PortletPreferences pref = pcontext.getRequest().getPreferences();
            url = getUrl(pref);
            metadata = fetchMetadata(url);
        }

        return metadata.toString();
View Full Code Here

        public static final String RENAMED_TAB_LABEL_PARAMETER = "newTabLabel";

        public void execute(Event<UITabPaneDashboard> event) throws Exception {
            UITabPaneDashboard tabPane = event.getSource();
            PortletRequestContext context = (PortletRequestContext) event.getRequestContext();
            UIApplication rootUI = context.getUIApplication();

            String newTabLabel = context.getRequestParameter(RENAMED_TAB_LABEL_PARAMETER);
            UserNode node = tabPane.getFirstAvailableNode();
            if (!tabPane.validateName(newTabLabel)) {
                Object[] args = { newTabLabel };
                rootUI.addMessage(new ApplicationMessage("UITabPaneDashboard.msg.wrongTabName", args));
            } else {
                String nodeName = context.getRequestParameter(UIComponent.OBJECTID);
                UserNode renamedNode = tabPane.renamePageNode(nodeName, newTabLabel);
                if (renamedNode != null) {
                    node = renamedNode;
                }
            }
            PortalRequestContext prContext = Util.getPortalRequestContext();
            NodeURL nodeURL = prContext.createURL(NodeURL.TYPE).setNode(node);
            context.sendRedirect(nodeURL.toString());
        }
View Full Code Here

import org.exoplatform.webui.core.lifecycle.UIApplicationLifecycle;

@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.getCurrentSite();

        //
        try {
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.