本文整理汇总了Java中com.sun.syndication.feed.synd.SyndContent类的典型用法代码示例。如果您正苦于以下问题:Java SyndContent类的具体用法?Java SyndContent怎么用?Java SyndContent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SyndContent类属于com.sun.syndication.feed.synd包,在下文中一共展示了SyndContent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createSyndEntry
import com.sun.syndication.feed.synd.SyndContent; //导入依赖的package包/类
protected SyndEntry createSyndEntry(Item item) {
SyndEntry syndEntry = super.createSyndEntry(item);
Description desc = item.getDescription();
if (desc!=null) {
SyndContent content = new SyndContentImpl();
content.setType(desc.getType());
content.setValue(desc.getValue());
syndEntry.setDescription(content);
// contents[0] and description then reference the same content
//
List contents = new ArrayList();
contents.add(content);
syndEntry.setContents(contents);
}
return syndEntry;
}
示例2: createSyndEntry
import com.sun.syndication.feed.synd.SyndContent; //导入依赖的package包/类
protected SyndEntry createSyndEntry(Item item) {
SyndEntry syndEntry = super.createSyndEntry(item);
Description desc = item.getDescription();
if (desc!=null) {
SyndContent content = new SyndContentImpl();
content.setType(desc.getType());
content.setValue(desc.getValue());
syndEntry.setDescription(content);
// contents[0] and description then reference the same content
//
List contents = new ArrayList();
contents.add(content);
syndEntry.setContents(contents);
}
return syndEntry;
}
示例3: getContents
import com.sun.syndication.feed.synd.SyndContent; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public List getContents() {
List<SyndContent> contents = super.getContents();
List<SyndContent> result = new ArrayList<SyndContent>(contents.size());
for (SyndContent c : contents) {
SyndContent cc = new SyndContentImpl();
if (c != null) {
cc.setType(removeInvalidChars(c.getType()));
cc.setMode(removeInvalidChars(c.getMode()));
cc.setValue(removeInvalidChars(c.getValue()));
}
result.add(cc);
}
return result;
}
示例4: makeDescriptionFromRSSCorrespon
import com.sun.syndication.feed.synd.SyndContent; //导入依赖的package包/类
/**
* Itemのdescription(本文)を作成.
* @param c コレポン
* @param baseURL BaseURL
* @return itemのdescription
*/
private SyndContent makeDescriptionFromRSSCorrespon(
RSSCorrespon c, String baseURL) {
SyndContent description = new SyndContentImpl();
description.setType("text/html");
StringBuilder sb = new StringBuilder();
sb.append(makeDescriptionLine("No.", c.getId()));
sb.append(makeDescriptionLine("Correspondence No.", c.getCorresponNo()));
sb.append(makeDescriptionLine("From", c.getFromCorresponGroup()));
sb.append(makeDescriptionLine("To", c.getToGroupName()));
sb.append(makeDescriptionLine("Cc", c.getCcGroupName()));
sb.append(makeDescriptionLine("Type", c.getCorresponType()));
sb.append(makeDescriptionLine("Subject", c.getSubject()));
sb.append(makeDescriptionLine("Workflow Status", c.getWorkflowStatus()));
sb.append(makeDescriptionLine("Created on", c.getCreatedAt()));
sb.append(makeDescriptionLine("Issued on", c.getIssuedAt()));
sb.append(makeDescriptionLine("Deadline for Reply", c.getDeadlineForReply()));
sb.append(makeDescriptionLine("Created by", c.getCreatedBy()));
sb.append(makeDescriptionLine("Issued by", c.getIssuedBy()));
sb.append(makeDescriptionLine("Reply Required", c.getReplyRequired()));
sb.append(makeDescriptionLine(true, "URL", baseURL + "correspon/correspon.jsf?id="
+ convertDescriptionString(c.getId()) + "&projectId="
+ convertDescriptionString(c.getProjectId())));
description.setValue(sb.toString());
return description;
}
示例5: createSyndEntry
import com.sun.syndication.feed.synd.SyndContent; //导入依赖的package包/类
@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;
}
示例6: createRSSItem
import com.sun.syndication.feed.synd.SyndContent; //导入依赖的package包/类
@Override
protected Item createRSSItem(SyndEntry sEntry) {
Item item = super.createRSSItem(sEntry);
SyndContent desc = sEntry.getDescription();
if (desc!=null) {
item.setDescription(createItemDescription(desc));
}
List contents = sEntry.getContents();
if (contents!=null && contents.size() > 0) {
item.setContent(createItemContent((SyndContent)contents.get(0)));
}
String uri = sEntry.getUri();
if (uri != null) {
item.setUri(uri);
}
return item;
}
示例7: createRSSItem
import com.sun.syndication.feed.synd.SyndContent; //导入依赖的package包/类
@Override
protected Item createRSSItem(SyndEntry sEntry) {
Item item = super.createRSSItem(sEntry);
SyndContent sContent = sEntry.getDescription();
if (sContent != null) {
item.setDescription(createItemDescription(sContent));
}
List contents = sEntry.getContents();
if ((contents != null) && (contents.size() > 0)) {
SyndContent syndContent = (SyndContent) contents.get(0);
Content cont = new Content();
cont.setValue(syndContent.getValue());
cont.setType(syndContent.getType());
item.setContent(cont);
}
return item;
}
示例8: createSyndEntry
import com.sun.syndication.feed.synd.SyndContent; //导入依赖的package包/类
@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;
}
示例9: apply
import com.sun.syndication.feed.synd.SyndContent; //导入依赖的package包/类
@Override
public SyndEntry apply(final FedoraEvent event) {
final SyndEntry entry = new SyndEntryImpl();
try {
entry.setTitle(event.getIdentifier());
entry.setLink(event.getPath());
entry.setPublishedDate(new DateTime(event.getDate())
.toDate());
final SyndContent description = new SyndContentImpl();
description.setType("text/plain");
description.setValue(event.getTypes().toString());
entry.setDescription(description);
} catch (final RepositoryException e) {
throw propagate(e);
}
return entry;
}
示例10: createEntries
import com.sun.syndication.feed.synd.SyndContent; //导入依赖的package包/类
private List<SyndEntry> createEntries() throws DatabaseException {
List<SyndEntry> entries = Lists.newArrayList();
Date publishedData = new Date();
for (PacketProblem problem : database.getLastestProblems()) {
SyndEntry entry = new SyndEntryImpl();
String problemReportSentence = problem.getProblemReportSentence();
if (problemReportSentence.length() > 20) {
problemReportSentence = problemReportSentence.substring(0, 20);
}
entry.setTitle("問題番号:" + problem.id + " " + problemReportSentence + "...");
entry.setLink("http://kishibe.dyndns.tv/qmaclone/");
entry.setPublishedDate(publishedData);
SyndContent description = new SyndContentImpl();
description.setType("text/plain");
description.setValue(problemReportSentence);
entry.setDescription(description);
entry.setAuthor(problem.creator);
entries.add(entry);
}
return entries;
}
示例11: createSyndEntry
import com.sun.syndication.feed.synd.SyndContent; //导入依赖的package包/类
protected SyndEntry createSyndEntry(Item item) {
SyndEntry syndEntry = super.createSyndEntry(item);
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;
}
示例12: createRSSItem
import com.sun.syndication.feed.synd.SyndContent; //导入依赖的package包/类
protected Item createRSSItem(SyndEntry sEntry) {
Item item = super.createRSSItem(sEntry);
SyndContent desc = sEntry.getDescription();
if (desc!=null) {
item.setDescription(createItemDescription(desc));
}
List contents = sEntry.getContents();
if (contents!=null && contents.size() > 0) {
item.setContent(createItemContent((SyndContent)contents.get(0)));
}
String uri = sEntry.getUri();
if (uri != null) {
item.setUri(uri);
}
return item;
}
示例13: createSyndEntry
import com.sun.syndication.feed.synd.SyndContent; //导入依赖的package包/类
protected SyndEntry createSyndEntry(Item item) {
SyndEntry syndEntry = super.createSyndEntry(item);
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;
}
示例14: createRSSItem
import com.sun.syndication.feed.synd.SyndContent; //导入依赖的package包/类
protected Item createRSSItem(SyndEntry sEntry) {
Item item = super.createRSSItem(sEntry);
SyndContent sContent = sEntry.getDescription();
if (sContent!=null) {
item.setDescription(createItemDescription(sContent));
}
List contents = sEntry.getContents();
if (contents != null && contents.size() > 0) {
SyndContent syndContent = (SyndContent)contents.get(0);
Content cont = new Content();
cont.setValue(syndContent.getValue());
cont.setType(syndContent.getType());
item.setContent(cont);
}
return item;
}
示例15: _testEntry
import com.sun.syndication.feed.synd.SyndContent; //导入依赖的package包/类
protected void _testEntry(int i) throws Exception {
List items = getCachedSyndFeed().getEntries();
SyndEntry entry = (SyndEntry) items.get(i);
assertProperty(entry.getTitle(),"feed.entry["+i+"].title");
assertProperty(entry.getTitleEx().getValue(),"feed.entry["+i+"].title");
assertEquals("text",entry.getTitleEx().getType());
assertEquals(entry.getLink(),"http://example.com/blog/entry" + (i + 1));
assertEquals(((SyndEnclosure)entry.getEnclosures().get(0)).getUrl(),"http://example.com/blog/enclosure"+(i+1)+".gif");
assertProperty(entry.getAuthor(),"feed.entry["+i+"].author.name");
Date d = DateParser.parseW3CDateTime("2000-0"+(i+1)+"-01T01:00:00Z");
assertEquals(entry.getPublishedDate(),d);
assertProperty(entry.getDescription().getValue(),"feed.entry["+i+"].summary");
assertProperty(((SyndContent)entry.getContents().get(0)).getValue(),"feed.entry["+i+"].content[0]");
assertEquals(1, ((List)entry.getForeignMarkup()).size());
SyndLink slink = (SyndLink)entry.getLinks().get(2);
assertTrue(slink.getHref().startsWith("tag:"));
}