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


Java SyndContentImpl类代码示例

本文整理汇总了Java中com.sun.syndication.feed.synd.SyndContentImpl的典型用法代码示例。如果您正苦于以下问题:Java SyndContentImpl类的具体用法?Java SyndContentImpl怎么用?Java SyndContentImpl使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


SyndContentImpl类属于com.sun.syndication.feed.synd包,在下文中一共展示了SyndContentImpl类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createSyndEntry

import com.sun.syndication.feed.synd.SyndContentImpl; //导入依赖的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.SyndContentImpl; //导入依赖的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.SyndContentImpl; //导入依赖的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.SyndContentImpl; //导入依赖的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.SyndContentImpl; //导入依赖的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: createSyndEntry

import com.sun.syndication.feed.synd.SyndContentImpl; //导入依赖的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

示例7: apply

import com.sun.syndication.feed.synd.SyndContentImpl; //导入依赖的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

示例8: createEntries

import com.sun.syndication.feed.synd.SyndContentImpl; //导入依赖的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

示例9: buildStringList

import com.sun.syndication.feed.synd.SyndContentImpl; //导入依赖的package包/类
private List<String> buildStringList(List<?> lstConvert) {
	List<String> lstRC = new ArrayList<String>();
	if (lstConvert.isEmpty()) {
		return lstRC;
	}
	for (Object objX : lstConvert) {
		if (objX instanceof SyndPerson) {
			lstRC.add(((SyndPerson) objX).getName());
		} else if (objX instanceof SyndContentImpl) {
			lstRC.add(((SyndContentImpl) objX).getValue());
		} else if (objX instanceof SyndCategoryImpl) {
			lstRC.add(((SyndCategoryImpl) objX).getName());
		} else {
			lstRC.add(objX.toString());
		}
	}
	return lstRC;
}
 
开发者ID:OpenNTF,项目名称:XPagesToolkit,代码行数:19,代码来源:FeedReaderService.java

示例10: createSyndEntry

import com.sun.syndication.feed.synd.SyndContentImpl; //导入依赖的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

示例11: createSyndEntry

import com.sun.syndication.feed.synd.SyndContentImpl; //导入依赖的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

示例12: getAllPostsFromFeed

import com.sun.syndication.feed.synd.SyndContentImpl; //导入依赖的package包/类
public static List getAllPostsFromFeed(String urlToGet, String source) throws IOException, FeedException {

        ArrayList<BlogPost> posts = new ArrayList<BlogPost>();

        URL url = new URL(urlToGet);
        SyndFeedInput input = new SyndFeedInput();
        try {
            SyndFeed feed = input.build(new XmlReader(url));

            int items = feed.getEntries().size();

            if (items > 0) {
                log.info("Attempting to parse rss feed: " + urlToGet);
                log.info("This Feed has " + items + " items");
                List<SyndEntry> entries = feed.getEntries();

                for (SyndEntry item : entries) {
                    if (item.getContents().size() > 0) {
                        SyndContentImpl contentHolder = (SyndContentImpl) item.getContents().get(0);
                        String content = contentHolder.getValue();
                        if (content != null && !content.isEmpty()) {
                            BlogPost post = new BlogPost(content, null, null, source, item.getLink(), item.getUri(), null);
                            posts.add(post);
                        }
                    }
                }
            }
            return posts;
        }
        catch(Exception ex){
            log.error(ex);
            return posts;
        }

    }
 
开发者ID:gidim,项目名称:Babler,代码行数:36,代码来源:RSSScraper.java

示例13: getBuildEntries

import com.sun.syndication.feed.synd.SyndContentImpl; //导入依赖的package包/类
private List getBuildEntries(final ConfigurationManager cm, final int activeBuildID, final BuildStatusURLGenerator urlGenerator) {
  final List result = new ArrayList(11);

  // traverse cmplete build runs for the given build
  final List completedBuildRuns = cm.getCompletedBuildRuns(activeBuildID, 0, PublishedResultFeedGenerator.MAX_BUILD_RUNS);
  for (final Iterator i = completedBuildRuns.iterator(); i.hasNext();) {
    final BuildRun buildRun = (BuildRun)i.next();

    // compose description
    final String resultDescr = buildRun.getResultID() == BuildRun.BUILD_RESULT_BROKEN ? ": " + buildRun.getResultDescription() : "";
    final StringBuffer subj = new StringBuffer(200);
    subj.append(buildRun.getBuildName()).append(" # ").append(buildRun.getBuildRunNumberAsString());
    subj.append(' ').append(new VerbialBuildResult().getVerbialResultString(buildRun));
    subj.append(resultDescr);

    // compose entry
    final SyndEntry entry = new SyndEntryImpl();
    entry.setTitle(subj.toString());
    entry.setPublishedDate(buildRun.getFinishedAt());
    entry.setLink(urlGenerator.makeBuildRunResultURL(buildRun));
    final SyndContent description = new SyndContentImpl();
    description.setType("text/plain");
    //description.setType("text/html");
    description.setValue(subj.toString());
    entry.setDescription(description);

    // edd entry to the result
    result.add(entry);
  }
  return result;
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:32,代码来源:PublishedResultFeedGenerator.java

示例14: getBuildEntries

import com.sun.syndication.feed.synd.SyndContentImpl; //导入依赖的package包/类
private List getBuildEntries(final ConfigurationManager cm, final int activeBuildID, final BuildStatusURLGenerator urlGenerator) {
  final List result = new ArrayList(1);

  // traverse cmplete build runs for the given build
  final List completedBuildRuns = cm.getCompletedBuildRuns(activeBuildID, 0, MAX_BUILD_RUNS);
  for (final Iterator i = completedBuildRuns.iterator(); i.hasNext();) {
    final BuildRun buildRun = (BuildRun) i.next();

    // compose description
    final String resultDescr = buildRun.getResultID() == BuildRun.BUILD_RESULT_BROKEN ? ": " + buildRun.getResultDescription() : "";
    final StringBuffer subj = new StringBuffer(200);
    subj.append(buildRun.getBuildName()).append(" # ").append(buildRun.getBuildRunNumberAsString());
    subj.append(" @ ").append(buildRun.getChangeListNumber());
    subj.append(" on ").append(new SimpleDateFormat("yyyy-MM-dd HH:ss z").format(buildRun.getFinishedAt()));
    subj.append(' ').append(new VerbialBuildResult().getVerbialResultString(buildRun));
    subj.append(resultDescr);

    // compose entry
    final SyndEntry entry = new SyndEntryImpl();
    entry.setTitle(subj.toString());
    entry.setPublishedDate(buildRun.getFinishedAt());
    entry.setLink(urlGenerator.makeBuildRunResultURL(buildRun));
    final SyndContent description = new SyndContentImpl();
    description.setType("text/plain");
    //description.setType("text/html");
    description.setValue(subj.toString());
    entry.setDescription(description);

    // edd entry to the result
    result.add(entry);
  }
  return result;
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:34,代码来源:FeedGenerator.java

示例15: getDescription

import com.sun.syndication.feed.synd.SyndContentImpl; //导入依赖的package包/类
@Override
public SyndContent getDescription() {
    SyndContent c = super.getDescription();
    SyndContent result = new SyndContentImpl();
    if (c != null) {
        result.setType(c.getType());
        result.setMode(c.getMode());
        result.setValue(removeInvalidChars(c.getValue()));
    }
    return result;
}
 
开发者ID:otsecbsol,项目名称:linkbinder,代码行数:12,代码来源:ExtendedSyndEntryImpl.java


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