Package com.sun.syndication.feed.synd

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


    public Object jsGet_author() {
        return entry.getAuthor();
    }

    public void jsSet_description(Object newdescription) {
        SyndContent description = new SyndContentImpl();
        description.setType("text/html");
        description.setValue(String.valueOf(newdescription));
        entry.setDescription(description);
    }
View Full Code Here


        entry.setDescription(description);
    }

    public String jsGet_description() {
        if (entry.getDescription() != null) {
            SyndContent description = entry.getDescription();
            return description.getValue();
        } else {
            return null;
        }

    }
View Full Code Here

        }
        return null;
    }

    public void jsSet_content(Object content) {
        SyndContent contents = new SyndContentImpl();
        contents.setType("text/html");
        contents.setValue(String.valueOf(content));

        ArrayList cont = new ArrayList();
        cont.add(contents);

        entry.setContents(cont);
View Full Code Here

        if (entry.getContents() != null) {
            ArrayList contents = (ArrayList) entry.getContents();
            Iterator iterator = contents.iterator();

            SyndContent currentContent;
            StringBuilder stringBuilder = new StringBuilder(retContent);
            while (iterator.hasNext()) {
                currentContent = (SyndContent) iterator.next();
                stringBuilder.append(" " + currentContent.getValue());
            }
            retContent = stringBuilder.toString();
        }

        if (retContent.compareTo("") == 0) {
View Full Code Here

    public Date jsGet_published() {
        return entry.getPublishedDate();
    }

    public void jsSet_summary(Object summary) {
        SyndContent summaryContent = new SyndContentImpl();
        summaryContent.setType("text/html");
        summaryContent.setValue(String.valueOf(summary));

        entry.setDescription(summaryContent);
    }
View Full Code Here

        entry.setDescription(summaryContent);
    }

    public String jsGet_summary() {
        SyndContent summaryContent = entry.getDescription();
        return summaryContent.getValue();
    }
View Full Code Here

      n = doc.createElement("link");
      itemNode.appendChild(n);
      // make sure link uses a safe URL scheme
      n.setTextContent(SaferHTMLHandler.sanitizeURL(item.getLink()));

      SyndContent sc = item.getDescription();
      if (sc != null){
        String text = sc.getValue();
        n = doc.createElement("description");
        itemNode.appendChild(n);
   
        // for now we always assume html: see Rome bug #26
  //      if (sc.getType().equals("text/html")){
View Full Code Here

            SyndEntry entry = new SyndEntryImpl();
            entry.setUri(nextBlogID());
            entry.setAuthor(blogEntry.getAuthor());
            entry.setTitle(blogEntry.getTitle());

            SyndContent content = new SyndContentImpl();
            content.setType("text");
            content.setValue(blogEntry.getContent());

            entry.setPublishedDate(blogEntry.getUpdated());
            entry.setLink(blogEntry.getLink());

            feed.getEntries().add(entry);
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

                Item item = new Item();
                item.setTitle(feedEntry.getTitle());
               
                List<?> contents = feedEntry.getContents();
                if (!contents.isEmpty()) {
                    SyndContent content = (SyndContent)contents.get(0);
                    String value = content.getValue();
                    item.setContents(value);
                }
               
                for (Object l : feedEntry.getLinks()) {
                    SyndLink link = (SyndLink)l;
                    if (link.getRel() == null || "edit".equals(link.getRel())) {
                        String href = link.getHref();
                        if (href.startsWith("null/")) {
                            href = href.substring(5);
                        }
                        item.setLink(href);
                        break;
                    }
                }
               
                item.setDate(feedEntry.getPublishedDate());
               
                return new org.apache.tuscany.sca.data.collection.Entry<Object, Object>(key, item);
               
            } else {
                String key = feedEntry.getUri();
               
                // Create the item from XML
                List<?> contents = feedEntry.getContents();
                if (contents.isEmpty()) {
                    return null;
                }
                SyndContent content = (SyndContent)contents.get(0);
                String value = content.getValue();
                Object data = mediator.mediate(value, itemXMLType, itemClassType, null);

                return new org.apache.tuscany.sca.data.collection.Entry<Object, Object>(key, data);
            }
        } else {
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.