Package org.jasig.portal

Examples of org.jasig.portal.ChannelRuntimeData


    assertEquals("value_two", person.getAttribute("param_two"));
   
  }
 
  public void testDoesNotMapFormActionParameterToAttribute() {
    ChannelRuntimeData channelRuntimeData = new ChannelRuntimeData();
    channelRuntimeData.setParameter(Constants.FORMACTION, "some_value");
   
    IPerson person = converter.channelRuntimeDataToPerson(channelRuntimeData);
   
    assertNull(person.getAttribute(Constants.FORMACTION));
  }
View Full Code Here


    public void testGetRuntimeData() {

        MockXSLTChannel instance = new MockXSLTChannel();
        assertNull(instance.getRuntimeData());
       
        ChannelRuntimeData runtimeDataA = new ChannelRuntimeData();
        instance.setRuntimeData(runtimeDataA);
        assertSame(runtimeDataA, instance.getRuntimeData());
       
        ChannelRuntimeData runtimeDataB = new ChannelRuntimeData();
        instance.setRuntimeData(runtimeDataB);
       
    }
View Full Code Here

     */
    public void testRenderXMLNullDocument() throws PortalException {
        try {
            MockXSLTChannel instance = new MockXSLTChannel();
            instance.setStaticData(new ChannelStaticData());
            instance.setRuntimeData(new ChannelRuntimeData());
            instance.renderXML(new DummyContentHandler());
        } catch (IllegalStateException ise) {
            // expected
            return;
        }
View Full Code Here

    public void testRenderXMLGetXmlThrowsRuntimeException() throws PortalException {
        RuntimeException runtimeException = new RuntimeException();
       
        MockXSLTChannel mock = new MockXSLTChannel();
        mock.setStaticData(new ChannelStaticData());
        mock.setRuntimeData(new ChannelRuntimeData());
        mock.setThrownFromGetXml(runtimeException);
       
        try {
            mock.renderXML(new DummyContentHandler());
        } catch (RuntimeException rte) {
View Full Code Here

    public void testRenderXMLGetXsltUriThrowsPortalException() throws ParserConfigurationException {
        PortalException portalException = new PortalException();
       
        MockXSLTChannel mock = new MockXSLTChannel();
        mock.setStaticData(new ChannelStaticData());
        mock.setRuntimeData(new ChannelRuntimeData());
        Document blankDoc = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
        mock.setDocument(blankDoc);
        mock.setThrownFromGetXsltUri(portalException);
       
        try {
View Full Code Here

    public void testRenderXMLGetStylesheetParamsThrowsSqlException() throws ParserConfigurationException {
        SQLException sqlException = new SQLException();
       
        MockXSLTChannel mock = new MockXSLTChannel();
        mock.setStaticData(new ChannelStaticData());
        mock.setRuntimeData(new ChannelRuntimeData());
        Document blankDoc = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
        mock.setDocument(blankDoc);
        mock.setXsltUriString("anxslt.xsl");
        mock.setThrownFromGetStylesheetParams(sqlException);
       
View Full Code Here


  public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
    if (initialized) {
      // construct runtime data object
      ChannelRuntimeData rd = new ChannelRuntimeData();
      rd.setBrowserInfo(new BrowserInfo(req));

      for (Enumeration en = req.getParameterNames(); en.hasMoreElements();) {
        String pName = (String)en.nextElement();
        if (!pName.startsWith("uP_")) {
          String[] val = (String[])req.getParameterValues(pName);
          rd.put(pName, val);
        }
      }

      try {
          rd.setUPFile(new UPFileSpec(UPFileSpec.RENDER_METHOD,"servletRoot","singlet",null));
      } catch (PortalException pe) {
        LOG.error("unable to construct a UPFile !",pe);
      }

      if (channel instanceof IPrivileged) {
View Full Code Here

        final PortletMode previousPortletMode = portletWindow.getPortletMode();
       
        //Only do this stuff for the top level window
        if (delegationParentId == null) {
            //Get the channel runtime data from the request attributes, it should have been set there by the portlet adapter
            final ChannelRuntimeData channelRuntimeData = (ChannelRuntimeData)request.getAttribute(IPortletAdaptor.ATTRIBUTE__RUNTIME_DATA);
            if (channelRuntimeData == null) {
                throw new IllegalStateException("No ChannelRuntimeData was found as a request attribute for key '" + IPortletAdaptor.ATTRIBUTE__RUNTIME_DATA + "' on request '" + request + "'");
            }
           
            // Determine the base path for the URL
            // If the next state is EXCLUSIVE or there is no state change and the current state is EXCLUSIVE use the worker URL base
            if (IPortletAdaptor.EXCLUSIVE.equals(windowState) || (windowState == null && IPortletAdaptor.EXCLUSIVE.equals(previousWindowState))) {
                final String urlBase = channelRuntimeData.getBaseWorkerURL(UPFileSpec.FILE_DOWNLOAD_WORKER);
                url.append(urlBase);
            }
            //In detached, need to make sure the URL is right
            else if (IPortletAdaptor.DETACHED.equals(windowState) || (windowState == null && IPortletAdaptor.DETACHED.equals(previousWindowState))) {
                final UPFileSpec upFileSpec = new UPFileSpec(channelRuntimeData.getUPFile());
                upFileSpec.setMethodNodeId(channelSubscribeId);
                upFileSpec.setTargetNodeId(channelSubscribeId);
                final String urlBase = upFileSpec.getUPFile();
                url.append(urlBase);
            }
            //Switching back from detached to a normal state
            else if (IPortletAdaptor.DETACHED.equals(previousWindowState) && windowState != null && !previousWindowState.equals(windowState)) {
                final UPFileSpec upFileSpec = new UPFileSpec(channelRuntimeData.getUPFile());
                upFileSpec.setMethodNodeId(UPFileSpec.USER_LAYOUT_ROOT_NODE);
                final String urlBase = upFileSpec.getUPFile();
                url.append(urlBase);
            }
            //No special handling, just use the base action URL
            else {
                final String urlBase = channelRuntimeData.getBaseActionURL();
                url.append(urlBase);
            }
           
            if (this.logger.isTraceEnabled()) {
                this.logger.trace("Using root url base '" + url + "' for " + portletUrl);
View Full Code Here

     * section is desired by the user if any.
     */
    @Override
    protected void runtimeDataSet() throws PortalException
    {
        ChannelRuntimeData crd = getRuntimeData();
        // get an appropriate media path for this channel's images
        if ( mediaBase == null )
        {
            mediaBase = crd.getBaseMediaURL( this );
            String cls = getClass().getName();
            String pkg = cls.substring( 0, cls.lastIndexOf( '.' ) );
            mediaBase = mediaBase + pkg.replace( '.', '/' ) + '/';
        }
        String section = crd.getParameter("section");
       
        if (section == null || section.equals(""))
            currentSection = "1";
        else currentSection = section;
    }
View Full Code Here

  /**
   * No-argument constructor for CSnoop.
   */
  public CSnoop () {
    this.runtimeData = new ChannelRuntimeData ();
  }
View Full Code Here

TOP

Related Classes of org.jasig.portal.ChannelRuntimeData

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.