Package com.sun.syndication.feed.synd

Examples of com.sun.syndication.feed.synd.SyndContent


    }

    protected void addMessageToFeed(SyndFeed feed, MessageExchange exchange, NormalizedMessage message) throws TransformerException, MessagingException {
        List entries = feed.getEntries();
        SyndEntry entry = createEntry(exchange, message);
        SyndContent description = createEntryContent(exchange, message);
        entry.setDescription(description);
       
        // TODO this line really should work but for some reason it doesn't
        // entries.add(0, entry);
       
View Full Code Here


        entry.setPublishedDate(new Date());
        return entry;
    }

    protected SyndContent createEntryContent(MessageExchange exchange, NormalizedMessage message) throws TransformerException, MessagingException {
        SyndContent description = new SyndContentImpl();
        description.setType(contentType);
        Source content = message.getContent();

        String value = ExpressionHelper.asString(getEntryValue(), exchange, message, null);
        if (value == null && content != null) {
            value = getSourceTransformer().toString(content);
            value = encodeContent(value);
        }
        if (value != null) {
            description.setValue(value);
        }
        return description;
    }
View Full Code Here

        entry.setTitle("Changes to " + evt.getLayerName().getLocalPart());
        // entry.setLink("http://geoserver.org/a");
        entry.setPublishedDate(new Date());

        //encode the content as the wfs transcation
        SyndContent description = new SyndContentImpl();
        description.setType("text/xml");
        description.setValue(encodeTransaction( evt ));

        // attach the content to the entry
        List contents = new ArrayList();
        contents.add(description);
        entry.setContents(contents);
View Full Code Here

    public void renderMessage(PrintWriter writer, HttpServletRequest request, HttpServletResponse response, QueueBrowser browser, Message message) throws JMSException {
        SyndFeed feed = getFeed(browser, request);

        List<SyndEntry> entries = feed.getEntries();
        SyndEntry entry = createEntry(browser, message, request);
        SyndContent description = createEntryContent(browser, message, request);
        entry.setDescription(description);
        entries.add(entry);
    }
View Full Code Here

        entry.setPublishedDate(new Date());
        return entry;
    }

    protected SyndContent createEntryContent(QueueBrowser browser, Message message, HttpServletRequest request) throws JMSException {
        SyndContent description = new SyndContentImpl();
        description.setType(entryContentType);

        if (message instanceof TextMessage) {
            String text = ((TextMessage)message).getText();
            description.setValue(text);
        }
        return description;
    }
View Full Code Here

        for (Iterator i = entries.iterator(); i.hasNext();) {
            SyndEntry entry = (SyndEntry) i.next();
            String link = entry.getLink();
            if (link == null)
                continue;
            SyndContent description = entry.getDescription();

            String title = stripTags(entry.getTitleEx());
            xhtml.startElement("a", "href", link);
            xhtml.characters(title);
            xhtml.endElement("a");
            xhtml.startElement("p");
            if (description != null)
                xhtml.characters(description.getValue());
            xhtml.endElement("p");
        }

        xhtml.endDocument();
    }
View Full Code Here

            QueueBrowser browser, Message message) throws JMSException {
        SyndFeed feed = getFeed(browser, request);

        List entries = feed.getEntries();
        SyndEntry entry = createEntry(browser, message, request);
        SyndContent description = createEntryContent(browser, message, request);
        entry.setDescription(description);
        entries.add(entry);
    }
View Full Code Here

        entry.setPublishedDate(new Date());
        return entry;
    }

    protected SyndContent createEntryContent(QueueBrowser browser, Message message, HttpServletRequest request) throws JMSException {
        SyndContent description = new SyndContentImpl();
        description.setType(entryContentType);

        if (message instanceof TextMessage) {
            String text = ((TextMessage) message).getText();
            description.setValue(text);
        }
        return description;
    }
View Full Code Here

                if (link != null) {
                    xhtml.startElement("li");
                    xhtml.startElement("a", "href", link);
                    xhtml.characters(stripTags(entry.getTitleEx()));
                    xhtml.endElement("a");
                    SyndContent content = entry.getDescription();
                    if (content != null) {
                        xhtml.newline();
                        xhtml.characters(content.getValue());
                    }
                    xhtml.endElement("li");
                }
            }
            xhtml.endElement("ul");
View Full Code Here

    private List<SyndEntry> getEntries( List<RssFeedEntry> dataEntries )
    {
        List<SyndEntry> entries = new ArrayList<>();

        SyndEntry entry;
        SyndContent description;

        for ( RssFeedEntry dataEntry : dataEntries )
        {
            entry = new SyndEntryImpl();
            entry.setTitle( dataEntry.getTitle() );
            entry.setPublishedDate( dataEntry.getPublishedDate() );

            description = new SyndContentImpl();
            description.setType( "text/plain" );
            description.setValue( dataEntry.getDescription() );
            entry.setDescription( description );

            entries.add( entry );
        }
View Full Code Here

TOP

Related Classes of com.sun.syndication.feed.synd.SyndContent

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.