Package org.apache.jetspeed.util

Examples of org.apache.jetspeed.util.JetspeedClearElement


        catch (Exception e)
        {
            e.printStackTrace();
            String message = "Failed to redirect to " + url;
            logger.error(message, e);
            return new JetspeedClearElement(message);
        }
        return new JetspeedClearElement(url);
    }
View Full Code Here


    }

    /**
    */
    protected void setContent( String content ) {
        this.setContent( new JetspeedClearElement( content ),
                         CapabilityMapFactory.getDefaultCapabilityMap() );
    }
View Full Code Here

        CapabilityMap mymap = map;
        if ( mymap == null ) {
            mymap = CapabilityMapFactory.getDefaultCapabilityMap();
        }

        ConcreteElement buffer = new JetspeedClearElement( content.toString( ) );
        this.content.put( mymap.toString(), buffer );
    }
View Full Code Here

                    if( element != null ) {
                        // now we put it under our cmap
                        this.setContent( element, mymap );
                    }
                } catch (Exception e) {
                    element = new JetspeedClearElement("Error when retrieving Portlet contents");
                    if( logger.isDebugEnabled() ) {
                        logger.debug( "Error when retrieving Portlet contents", e );
                    }
                }
            } else {
                if( element == null ) {
                    //FIXME: Let's asume that the contents under "default" map are good
                    mymap = CapabilityMapFactory.getDefaultCapabilityMap();
                    element = (ConcreteElement)content.get( mymap.toString() );
                    if( element == null ) {
                        element = new JetspeedClearElement("Unknown Problem getting Contents");
                    }
                }
            }
        }
View Full Code Here

        }

       
        try {
           
            return new JetspeedClearElement( SimpleTransform.transform( url, stylesheet ) );
           
        } catch (SAXException e) {
            logger.error( "Couldn't transform content.", e );
            throw new PortletException( "Couldn't transform content.  Please see error log" );
        }
View Full Code Here

            path = this.getPortletConfig().getInitParameter("path");
        }

        if (null == path)
        {
            return new JetspeedClearElement("Path parameter not set");
        }

        ProfileLocator locator = Profiler.createLocator();
        locator.createFromPath(path);
        String id = locator.getId();

        try
        {
            Profile profile = Profiler.getProfile(locator);
            PSMLDocument doc = profile.getDocument();
            if (doc == null)
            {
                return null;
            }
            Portlets portlets = doc.getPortlets();
            //PortletContainer.aggregate(portlets);
            return new JetspeedClearElement("XXX Under Construction :)");
        }
        catch (Exception e)
        {
            logger.error("Exception",  e);
            return new JetspeedClearElement("Error in aggregation portlet: " + e.toString());
        }
    }
View Full Code Here

        }

        RunData data = (RunData) context.get("data");
        CapabilityMap map = ((JetspeedRunData) data).getCapability();
        String type = map.getPreferredType().toString();
        ConcreteElement content = new JetspeedClearElement(INVALID_TYPE);
        String stylesheet = (String) stylesheets.get(type);

        if (stylesheet != null)
        {

            try
            {
                content = new JetspeedClearElement(SimpleTransform.transform(this.document, stylesheet, this.params));

                // no caching yet // setContent( content, map );
            }
            catch (SAXException e)
            {
                logger.error("SAXException", e);
                content = new JetspeedClearElement(e.getMessage());
            }
        }
        else
        {
            content = new JetspeedClearElement("stylesheet not defined");
        }

        return content;
    }
View Full Code Here

            url = getPortletConfig().getURL();
            String content = JetspeedDiskCache.getInstance().getEntry( url ).getData();
           CapabilityMap xmap =
               CapabilityMapFactory.getCapabilityMap(CapabilityMapFactory.AGENT_XML);
            setContent( new JetspeedClearElement(content), xmap );
            InputSource isrc = new InputSource( this.cleanse( content ) );
            isrc.setSystemId( url );
            isrc.setEncoding("UTF-8");
            this.document = parser.parse( isrc );
            this.setMetainfo(document);
View Full Code Here

                logger.error("Exception",  pe);
            }
        }
        CapabilityMap map = ((JetspeedRunData)data).getCapability();
        String type = map.getPreferredType().toString();
        ConcreteElement content = new JetspeedClearElement(INVALID_TYPE);
        String stylesheet = (String)stylesheets.get(type);

        if (stylesheet != null) {
            content = getContent( data, map );
            if ( content == null ) {
                try {
                    content = new JetspeedClearElement(
                        SimpleTransform.transform( this.document,
                                                   stylesheet,
                                                   this.params ) );
                    setContent( content, map );
                } catch ( SAXException e ) {
                    logger.error("Exception",  e);
                    content = new JetspeedClearElement(e.getMessage());
                }
            }
        }
        else
        {
View Full Code Here

    private ConcreteElement getWebPageContent( RunData data, PortletConfig config )
    {   
       
        String convertedString = null// parsed and re-written HTML
        JetspeedClearElement element = null;

        String url = selectUrl( data, config );

        try
        {
            JetspeedLink jsLink = JetspeedLinkFactory.getInstance(data);           
            Reader htmlReader = getReader( url );
            convertedString = rewriter.rewrite(htmlReader, jsLink.toString());
            element = new JetspeedClearElement(convertedString);
           
            System.out.println("js link = " + jsLink.toString());           
            JetspeedLinkFactory.putInstance(jsLink);

            //FIXME: We should do a clearContent() for the media type, not ALL media types
View Full Code Here

TOP

Related Classes of org.apache.jetspeed.util.JetspeedClearElement

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.