Package org.jasig.portal.url

Examples of org.jasig.portal.url.IPortalUrlBuilder


        final DocumentFragment headFragment = doc.createDocumentFragment();
       
        final MockHttpServletRequest request = new MockHttpServletRequest();
        final MockHttpServletResponse response = new MockHttpServletResponse();
       
        final IPortalUrlBuilder portalUrlBuilder = mock(IPortalUrlBuilder.class);
        final IPortletUrlBuilder portletUrlBuilder = mock(IPortletUrlBuilder.class);
       
        when(portalUrlBuilder.getUrlString()).thenReturn("URL_PLACEHOLDER");
        when(portalUrlBuilder.getTargetedPortletUrlBuilder()).thenReturn(portletUrlBuilder);
       
        when(this.resourcesElementsProvider
                .getResourcesXmlFragment(any(HttpServletRequest.class), eq("/media/skins/universality/uportal3/skin.xml")))
                .thenReturn(headFragment.getChildNodes());
        when(this.resourcesElementsProvider
View Full Code Here


    IUserInstance userInstance = this.userInstanceManager.getUserInstance(httpRequest);
    if(hasAdminPrivileges(userInstance)) {
      IPortletWindow window = this.portletWindowRegistry.getPortletWindow(httpRequest, currentFailedPortletWindowId);
      window.setRenderParameters(new ParameterMap());
      IPortalUrlBuilder adminRetryUrl = this.portalUrlProvider.getPortalUrlBuilderByPortletWindow(httpRequest, currentFailedPortletWindowId, UrlType.RENDER);
      model.addAttribute("adminRetryUrl", adminRetryUrl.getUrlString());
     
      final IPortletWindow portletWindow = portletWindowRegistry.getPortletWindow(httpRequest, currentFailedPortletWindowId);
            final IPortletEntity parentPortletEntity = portletWindow.getPortletEntity();
            final IPortletDefinition parentPortletDefinition = parentPortletEntity.getPortletDefinition();
            model.addAttribute("channelDefinition", parentPortletDefinition);
View Full Code Here

      IPortletWindowId portletWindowId = this.portletWindowRegistry.getPortletWindowId(httpRequest, windowId);

      HttpServletResponse httpResponse = this.portalRequestUtils.getOriginalPortalResponse(request);
      this.portletRenderer.doReset(portletWindowId, httpRequest, httpResponse);

      IPortalUrlBuilder builder = this.portalUrlProvider.getPortalUrlBuilderByPortletWindow(httpRequest, portletWindowId, UrlType.RENDER);

      response.sendRedirect(builder.getUrlString());
    }
  }
View Full Code Here

     */
    @Override
    public PortletURLProvider getPortletURLProvider(TYPE type) {
        final IPortletWindowId portletWindowId = this.portletWindow.getPortletWindowId();
        final UrlType urlType = UrlType.fromPortletUrlType(type);
        final IPortalUrlBuilder portalUrlBuilder = this.portalUrlProvider.getPortalUrlBuilderByPortletWindow(containerRequest, portletWindowId, urlType);
        final IPortletUrlBuilder portletUrlBuilder = portalUrlBuilder.getPortletUrlBuilder(portletWindowId);
        return new PortletURLProviderImpl(portletUrlBuilder);
    }
View Full Code Here

     *
     * @param request the current http request.
     * @return the portlet link
     */
    public String getFragmentAdminURL(HttpServletRequest request) {
        IPortalUrlBuilder builder = urlProvider.getPortalUrlBuilderByPortletFName(request, PORTLET_FNAME_FRAGMENT_ADMIN_PORTLET, UrlType.RENDER);
        IPortletUrlBuilder portletUrlBuilder = builder.getTargetedPortletUrlBuilder();
        portletUrlBuilder.setPortletMode(PortletMode.VIEW);
        portletUrlBuilder.setWindowState(WindowState.MAXIMIZED);

        return builder.getUrlString();
    }
View Full Code Here

            else {
                urlType = UrlType.valueOfIngoreCase(type);
            }
           
            if (StringUtils.isNotEmpty(fname)) {
                final IPortalUrlBuilder portalUrlBuilderByPortletFName = this.portalUrlProvider.getPortalUrlBuilderByPortletFName(request, fname, urlType);
                return portalUrlBuilderByPortletFName;
            }
           
            if (StringUtils.isNotEmpty(layoutId)) {
                final IPortalUrlBuilder portalUrlBuilderByLayoutNode = this.portalUrlProvider.getPortalUrlBuilderByLayoutNode(request, layoutId, urlType);
                return portalUrlBuilderByLayoutNode;
            }
           
            return this.portalUrlProvider.getDefaultUrl(request);
        }
View Full Code Here

    public void actionRequest(HttpServletRequest request, HttpServletResponse response) throws IOException {
        final IPortalRequestInfo portalRequestInfo = this.urlSyntaxProvider.getPortalRequestInfo(request);
        final IPortletRequestInfo portletRequestInfo = portalRequestInfo.getTargetedPortletRequestInfo();
       
       
        final IPortalUrlBuilder actionRedirectUrl;
        if (portletRequestInfo != null) {
            final IPortletWindowId targetWindowId = portletRequestInfo.getPortletWindowId();
            actionRedirectUrl = this.portalUrlProvider.getPortalUrlBuilderByPortletWindow(request, targetWindowId, UrlType.RENDER);
        }
        else {
            final String targetedLayoutNodeId = portalRequestInfo.getTargetedLayoutNodeId();
           
            if (targetedLayoutNodeId != null) {
                actionRedirectUrl = this.portalUrlProvider.getPortalUrlBuilderByLayoutNode(request, targetedLayoutNodeId, UrlType.RENDER);
            }
            else {
                actionRedirectUrl = this.portalUrlProvider.getDefaultUrl(request);
            }
        }
       
        //Stuff the action-redirect URL builder into the request so other code can use it during request processing
        this.portalUrlProvider.convertToPortalActionUrlBuilder(request, actionRedirectUrl);

        if (portletRequestInfo != null) {
            final IPortletWindowId targetWindowId = portletRequestInfo.getPortletWindowId();
           
           
            try {
                this.portletExecutionManager.doPortletAction(targetWindowId, request, response);
            }
            catch (RuntimeException e) {
                this.logger.error("Exception thrown while executing portlet action for: " + portletRequestInfo, e);
               
                //TODO this should be a constant right?
                actionRedirectUrl.setParameter("portletActionError", targetWindowId.toString());
            }
        }
       
        sendRedirect(actionRedirectUrl, response);
    }
View Full Code Here

             * We will pass them  along after authentication.
             */
            String targetFname = request.getParameter("uP_fname");

            if (targetFname == null) {
                final IPortalUrlBuilder defaultUrl = this.portalUrlProvider.getDefaultUrl(request);
                redirectTarget = defaultUrl.getUrlString();
            }
            else {
                try {
                    final IPortalUrlBuilder urlBuilder = this.portalUrlProvider.getPortalUrlBuilderByPortletFName(request, targetFname, UrlType.RENDER);
                   
                    @SuppressWarnings("unchecked")
                    Enumeration<String> e = request.getParameterNames();
                    while (e.hasMoreElements()) {
                        String paramName = e.nextElement();
                        if (!paramName.equals("uP_fname")) {
                            urlBuilder.addParameter(paramName, request.getParameterValues(paramName));
                        }
                    }
                   
                    redirectTarget = urlBuilder.getUrlString();
                }
                catch (IllegalArgumentException e) {
                    final IPortalUrlBuilder defaultUrl = this.portalUrlProvider.getDefaultUrl(request);
                    redirectTarget = defaultUrl.getUrlString();
                }
            }
        }
       
        IPerson person = null;
View Full Code Here

                    if (iconParam != null) {
                        portlet.setIconUrl(iconParam.getValue());                       
                    }
                   
                    // get the maximized URL for this portlet
                    final IPortalUrlBuilder portalUrlBuilder = urlProvider.getPortalUrlBuilderByLayoutNode(request, attributes.getNamedItem("ID").getNodeValue(), UrlType.RENDER);
                    final IPortletWindowId targetPortletWindowId = portalUrlBuilder.getTargetPortletWindowId();
                    if (targetPortletWindowId != null) {
                        final IPortletUrlBuilder portletUrlBuilder = portalUrlBuilder.getPortletUrlBuilder(targetPortletWindowId);
                        portletUrlBuilder.setWindowState(WindowState.MAXIMIZED);
                    }
                    portlet.setUrl(portalUrlBuilder.getUrlString());
                    portlets.add(portlet);

                } catch (Exception e) {
                    log.warn("Exception construction JSON representation of mobile portlet", e);
                }
View Full Code Here

    /* (non-Javadoc)
     * @see org.apache.pluto.container.PortletURLProvider#getType()
     */
    @Override
    public TYPE getType() {
        final IPortalUrlBuilder portalUrlBuilder = this.portletUrlBuilder.getPortalUrlBuilder();
        final UrlType urlType = portalUrlBuilder.getUrlType();
        return urlType.getPortletUrlType();
    }
View Full Code Here

TOP

Related Classes of org.jasig.portal.url.IPortalUrlBuilder

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.