当前位置: 首页>>代码示例>>Java>>正文


Java SyndContent类代码示例

本文整理汇总了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;
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:21,代码来源:ConverterForRSS10.java

示例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;
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:19,代码来源:ConverterForRSS091Userland.java

示例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;
}
 
开发者ID:otsecbsol,项目名称:linkbinder,代码行数:17,代码来源:ExtendedSyndEntryImpl.java

示例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;
}
 
开发者ID:otsecbsol,项目名称:linkbinder,代码行数:32,代码来源:RSSServiceImpl.java

示例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;
}
 
开发者ID:4thline,项目名称:feeds,代码行数:24,代码来源:ConverterForRSS10.java

示例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;
}
 
开发者ID:4thline,项目名称:feeds,代码行数:21,代码来源:ConverterForRSS10.java

示例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;
}
 
开发者ID:4thline,项目名称:feeds,代码行数:23,代码来源:ConverterForRSS091Userland.java

示例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;
}
 
开发者ID:4thline,项目名称:feeds,代码行数:27,代码来源:ConverterForRSS091Userland.java

示例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;
}
 
开发者ID:fcrepo4-archive,项目名称:fcrepo-module-rss,代码行数:18,代码来源:RSSPublisher.java

示例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;
}
 
开发者ID:nodchip,项目名称:QMAClone,代码行数:25,代码来源:RssServletStub.java

示例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;
}
 
开发者ID:Norkart,项目名称:NK-VirtualGlobe,代码行数:23,代码来源:ConverterForRSS10.java

示例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;
}
 
开发者ID:Norkart,项目名称:NK-VirtualGlobe,代码行数:20,代码来源:ConverterForRSS10.java

示例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;
}
 
开发者ID:Norkart,项目名称:NK-VirtualGlobe,代码行数:21,代码来源:ConverterForRSS091Userland.java

示例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;
}
 
开发者ID:Norkart,项目名称:NK-VirtualGlobe,代码行数:18,代码来源:ConverterForRSS091Userland.java

示例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:"));
}
 
开发者ID:Norkart,项目名称:NK-VirtualGlobe,代码行数:20,代码来源:TestSyndFeedAtom10.java


注:本文中的com.sun.syndication.feed.synd.SyndContent类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。