description.setType( "text/plain" ); description.setValue( desc ); entry.setDescription( description );
/** * Creates a new {@link SyndContent} instance for the given content type and value. * * @param type content type * @param value the content * @return a new {@link SyndContent} instance */ protected SyndContent getSyndContent(String type, String value) { SyndContent content = new SyndContentImpl(); content.setType(type); content.setValue(value); return content; }
protected SyndContent buildDescription(NexusArtifactEvent event) { SyndContent content = new SyndContentImpl(); content.setType(MediaType.TEXT_PLAIN.toString()); StringBuilder msg = new StringBuilder(); if (event.getMessage() != null) { msg.append(event.getMessage()); msg.append(' '); } msg.append(buildDescriptionMsgItem(event)); msg.append(buildDescriptionMsgAction(event)); msg.append(buildDescriptionMsgAuthor(event)); msg.append(buildDescriptionMsgAddress(event)); content.setValue(msg.toString()); return content; }
public static SyndContent content(String value, String mime, String mode) { final SyndContent c = new SyndContentImpl(); c.setValue(value); c.setType(mime); c.setMode(mode); return c; }
protected SyndContent createSyndContent(Content content) { SyndContent sContent = new SyndContentImpl(); sContent.setType(content.getType()); sContent.setValue(content.getValue()); return sContent; }
protected SyndContent createSyndContent(Content content) { SyndContent sContent = new SyndContentImpl(); sContent.setType(content.getType()); sContent.setValue(content.getValue()); return sContent; }
protected SyndContent createSyndContent(Content content) { SyndContent sContent = new SyndContentImpl(); sContent.setType(content.getType()); sContent.setValue(content.getValue()); return sContent; }
protected SyndContent createSyndContent(Content content) { SyndContent sContent = new SyndContentImpl(); sContent.setType(content.getType()); sContent.setValue(content.getValue()); return sContent; }
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); } return syndEntry; }
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); } return syndEntry; }
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); } return syndEntry; }
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); } return syndEntry; }
@Override 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); } return syndEntry; }
@Override 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); } return syndEntry; }
@Override 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); } return syndEntry; }
@Override 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); } return syndEntry; }
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 ); } return entries; } }
description.setType("text/html"); description.setValue(Utils.markdownToHtml(post.getBody()));
private SyndEntry toSyndEntry(TgwEntry tgwEntry) { SyndEntry entry = new SyndEntryImpl(); // basic info //entry.setUri("http://aaa.com/" + entry.hashCode()); //entry.setLink("http://aaa.com/" + entry.hashCode()); entry.setTitle(tgwEntry.getTitle()); entry.setPublishedDate(tgwEntry.getPublished()); entry.setUpdatedDate(tgwEntry.getUpdated()); entry.setAuthor(tgwEntry.getAuthor()); // entry.setLink("abcd"); SyndLink link = new SyndLinkImpl(); link.setRel("self"); link.setType("application/atom+xml"); link.setHref("xxxx"); // SyndLink link = new SyndLinkImpl(); // link.set // content SyndContent content = new SyndContentImpl(); content.setType("text/plain"); content.setValue(tgwEntry.getContent()); entry.setDescription(content); List<SyndContent> list = new ArrayList<SyndContent>(); list.add(content); entry.setContents(list); return entry; }
private static SyndEntry createNewsFeedEntry(NewsItem pieceOfNews) { SyndEntry entry; SyndContent description; entry = new SyndEntryImpl(); entry.setTitle(pieceOfNews.getTitle()); if (pieceOfNews.getMoreLink() != null) { entry.setLink(pieceOfNews.getMoreLink()); } entry.setPublishedDate(SiteFunctions.convertToDate(pieceOfNews.getDate(), "yyyyMMdd")); description = new SyndContentImpl(); description.setType("text/plain"); description.setValue(pieceOfNews.getDescription().getValue()); entry.setDescription(description); return entry; }