Package com.sun.syndication.feed.synd

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


        syndFeed.setUri(aFeed.getId());

        Content aTitle = aFeed.getTitleEx();
        if (aTitle != null) {
            SyndContent c = new SyndContentImpl();
            c.setType(aTitle.getType());
            c.setValue(aTitle.getValue());
            syndFeed.setTitleEx(c);
        }

        Content aSubtitle = aFeed.getSubtitle();
        if (aSubtitle!=null) {
            SyndContent c = new SyndContentImpl();
            c.setType(aSubtitle.getType());
            c.setValue(aSubtitle.getValue());
            syndFeed.setDescriptionEx(c);
        }

        // use first alternate links as THE link
        if (aFeed.getAlternateLinks() != null
View Full Code Here


        }
        return aFeed;
    }

    protected SyndContent createSyndContent(Content content) {
        SyndContent sContent = new SyndContentImpl();
        sContent.setType(content.getType());
        sContent.setValue(content.getValue());
        return sContent;
    }
View Full Code Here

            if (contents!=null && contents.size()>0) {
                content = (Content) contents.get(0);
            }
        }
        if (content!=null) {
            SyndContent sContent = new SyndContentImpl();
            sContent.setType(content.getType());
            sContent.setValue(content.getValue());
            syndEntry.setDescription(sContent);
        }

        List contents = entry.getContents();
        if (contents.size()>0) {
            List sContents = new ArrayList();
            for (int i=0;i<contents.size();i++) {
                content = (Content) contents.get(i);
                SyndContent sContent = new SyndContentImpl();
                sContent.setType(content.getType());
                sContent.setValue(content.getValue());
                sContent.setMode(content.getMode());
                sContents.add(sContent);
            }
            syndEntry.setContents(sContents);
        }
View Full Code Here

    protected SyndEntry createSyndEntry(Item item, boolean preserveWireItem) {
        SyndEntry syndEntry = super.createSyndEntry(item, preserveWireItem);
        Description desc = item.getDescription();

        if (desc != null) {
            SyndContent descContent = new SyndContentImpl();
            descContent.setType(desc.getType());
            descContent.setValue(desc.getValue());
            syndEntry.setDescription(descContent);
        }

        Content cont = item.getContent();

        if (cont != null) {
            SyndContent content = new SyndContentImpl();
            content.setType(cont.getType());
            content.setValue(cont.getValue());

            List syndContents = new ArrayList();
            syndContents.add(content);
            syndEntry.setContents(syndContents);
        }
View Full Code Here

            feedEntry.setUri(key.toString());
            feedEntry.setTitle(item.getTitle());
   
            String value = item.getContents();
            if (value != null) {
                SyndContent content = new SyndContentImpl();
                content.setType("text/xml");
                content.setValue(value);
                List<SyndContent> contents = new ArrayList<SyndContent>();
                contents.add(content);
                feedEntry.setContents(contents);
            }
   
            String href = item.getLink();
            if (href == null) {
                href = key.toString();
            }
            SyndLink link = new SyndLinkImpl();
            link.setRel("edit");
            link.setHref(href);
            feedEntry.getLinks().add(link);
            link = new SyndLinkImpl();
            link.setRel("alternate");
            link.setHref(href);
            feedEntry.getLinks().add(link);
            feedEntry.setLink(href);
   
            Date date = item.getDate();
            if (date == null) {
                date = new Date();
            }
            feedEntry.setPublishedDate(date);
            return feedEntry;
           
        } else if (data != null) {
            SyndEntry feedEntry = new SyndEntryImpl();
            feedEntry.setUri(key.toString());
            feedEntry.setTitle("item");
   
            // Convert the item to XML
            String value = mediator.mediate(data, itemClassType, itemXMLType, null).toString();
           
            SyndContent content = new SyndContentImpl();
            content.setType("text/xml");
            content.setValue(value);
            List<SyndContent> contents = new ArrayList<SyndContent>();
            contents.add(content);
            feedEntry.setContents(contents);
   
            SyndLink link = new SyndLinkImpl();
View Full Code Here

            SyndEntry entry = new SyndEntryImpl();
            entry.setTitle("customer " + "Jane Doe_" + String.valueOf(i));
            entry.setUri(id);

            SyndContent content = new SyndContentImpl();
            content.setValue("Jane Doe_" + String.valueOf(i));
            content.setType("text");
            entry.setContents(Collections.singletonList(content));

            List<SyndLink> links = new ArrayList<SyndLink>();
            SyndLink link = new SyndLinkImpl();
            link.setRel("edit");
View Full Code Here

    protected SyndEntry createSyndEntry(Item item, boolean preserveWireItem) {
        SyndEntry syndEntry = super.createSyndEntry(item, preserveWireItem);

        Description desc = item.getDescription();
        if (desc!=null) {
            SyndContent descContent = new SyndContentImpl();
            descContent.setType(desc.getType());
            descContent.setValue(desc.getValue());
            syndEntry.setDescription(descContent);
        }
        Content cont = item.getContent();
        if (cont!=null) {
            SyndContent contContent = new SyndContentImpl();
            contContent.setType(cont.getType());
            contContent.setValue(cont.getValue());
            List contents = new ArrayList();
            contents.add(contContent);
            syndEntry.setContents(contents);
        }
               
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

            SyndEntry entry = new SyndEntryImpl();
            entry.setTitle("customer " + "Jane Doe_" + String.valueOf(i));
            entry.setUri(id);

            SyndContent content = new SyndContentImpl();
            content.setValue("Jane Doe_" + String.valueOf(i));
            content.setType("text");
            entry.setContents(Collections.singletonList(content));

            List<SyndLink> links = new ArrayList<SyndLink>();
            SyndLink link = new SyndLinkImpl();
            link.setRel("edit");
View Full Code Here

        {
            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.SyndContentImpl

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.