Package com.sun.syndication.feed.synd

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


            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());
                sContents.add(sContent);
            }
            syndEntry.setContents(sContents);
        }
View Full Code Here


        entry.setAuthor("Marcus Aqueductum");
        entry.setLink("http://wiki.java.net/bin/view/Javawsxml/RomeAqueduct");
        entries.add(entry);

        ArrayList contents = new ArrayList();
        SyndContentImpl content = new SyndContentImpl();
        content.setType("text/xhtml");
        content.setValue("<div><b>Aqueduct + Prevayler</b><br/>Fast and furious.</div>");
        contents.add(content);
        SyndContentImpl content2 = new SyndContentImpl();
        content2.setType("text/html");
        content2.setValue("<b>Really fast to implement.");
        contents.add(content2);
        entry.setContents(contents);

        feed.setEntries(entries);
View Full Code Here

              entry.setPublishedDate(dateParser.parse("2004-11-25"));
          }
          catch (ParseException ex) {
              //
          }
          description = new SyndContentImpl();
          description.setType("text/plain");
          description.setValue("Test for RFC3229 Delta Encoding");         
          entry.setDescription(description);         
          entries.add(entry);
         
View Full Code Here

          tags.add(cat);
        }
        entry.setCategories(tags);
      }

      SyndContent content = new SyndContentImpl();
      if (StringUtils.isEmpty(entryModel.contentType)
          || entryModel.contentType.equalsIgnoreCase("text/plain")) {
        content.setType("text/html");
        content.setValue(StringUtils.breakLinesForHtml(entryModel.content));
      } else {
        content.setType(entryModel.contentType);
        content.setValue(entryModel.content);
      }
      entry.setDescription(content);

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

        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

        DateTimeFormatter df = DateTimeFormat.forPattern("yyyy-MM-dd HH:mm:ss");
        List<SyndEntry> entries = new LinkedList<SyndEntry>();
        for (int i = 0; i < 9; i++) {
            SyndEntry entry = new SyndEntryImpl();
            entry.setTitle("テスト" + i);
            SyndContent description = new SyndContentImpl();
            description.setValue("テスト説明" + i);
            entry.setDescription(description);
            entry.setLink("http://ryu22e.org/" + i);

            NicoliveModule module = new NicoliveModule();
            module.setOpenTime(datetime.minusDays(i).toString(df));
            module.setStartTime(datetime
                .minusDays(i)
                .plusMinutes(10)
                .toString(df));
            module.setType("official");
            entry.getModules().add(module);

            entries.add(entry);
        }
        // NicoliveModuleなしのデータも含める。
        SyndEntry invalidEntry = new SyndEntryImpl();
        invalidEntry.setTitle("NicoliveModuleなしデータ");
        SyndContent description = new SyndContentImpl();
        description.setValue("テスト説明");
        invalidEntry.setDescription(description);
        invalidEntry.setLink("http://ryu22e.org/");
        entries.add(invalidEntry);

        feed.setEntries(entries);
View Full Code Here

        categories.add(syndCategory);
       
        syndEntry.setCategories(categories);
       
        // description.
        SyndContent descriptionContent = new SyndContentImpl();
       
        descriptionContent.setType("text/html");
        descriptionContent.setValue(description);
        syndEntry.setDescription(descriptionContent);
       
        // title, link, author, categories.
        syndEntry.setTitle(title);
        syndEntry.setLink(link);
View Full Code Here

                        db.append("\n");
                    }
                }
                if (db.length() > 0)
                {
                    SyndContent desc = new SyndContentImpl();
                    desc.setType("text/plain");
                    desc.setValue(db.toString());
                    entry.setDescription(desc);
                }

                // This gets the authors into an ATOM feed
                DCValue authors[] = item.getMetadata(authorField);
View Full Code Here

        changeUri.append(SscfAjax.getServiceAddr(req)).append('/').append(CH_DISP_SERVLET).append('/')
          .append(feedId).append('/').append(change.getId()).append("-").append(change.getDepth());
        entry.setLink(changeUri.toString());
        entry.setPublishedDate(change.getTimestamp());
       
        description = new SyndContentImpl();
        description.setType("text/html");

        description.setValue(ChangeContent.getMessage(change.getChangeType(), change.getDepth(),
          change.getChangeValue(), labelOfFeed, change.getChangedUri(),changedRes,changeRes,rb));
        entry.setDescription(description);
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.