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


Java SyndEntry.setLink方法代码示例

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


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

示例1: createFeedEntry

import com.sun.syndication.feed.synd.SyndEntry; //导入方法依赖的package包/类
private @Nonnull SyndEntry createFeedEntry(@Nonnull String extractPageElement, @Nullable String titleSelector,
		@Nullable String linkSelector, @Nullable String authorSelector) {
	SyndEntry entry = new SyndEntryImpl();
	if(titleSelector != null) {
		entry.setTitle(stripHtml(getText(extractPageElement, titleSelector)));
	}
	if(linkSelector != null) {
			entry.setLink(makeAbsolute(getHref(getText(extractPageElement, linkSelector)), pageUrl));
	}
	if(authorSelector != null) {
		entry.setAuthor(stripHtml(getText(extractPageElement, authorSelector)));
	}
	
	entry.setDescription(createFeedContent(extractPageElement));
	return entry;
}
 
开发者ID:rrauschenbach,项目名称:FeedExpander,代码行数:17,代码来源:FeedCreatorImpl.java

示例2: apply

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

示例3: createEntries

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

示例4: createSyndEntry

import com.sun.syndication.feed.synd.SyndEntry; //导入方法依赖的package包/类
protected SyndEntry createSyndEntry(Item item) {
    SyndEntry syndEntry = new SyndEntryImpl();

    syndEntry.setModules(ModuleUtils.cloneModules(item.getModules()));

    syndEntry.setUri(item.getLink());
    syndEntry.setTitle(item.getTitle());
    syndEntry.setLink(item.getLink());
    return syndEntry;
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:11,代码来源:ConverterForRSS090.java

示例5: createSyndEntry

import com.sun.syndication.feed.synd.SyndEntry; //导入方法依赖的package包/类
protected SyndEntry createSyndEntry(Item item) {
    SyndEntry syndEntry = super.createSyndEntry(item);

    // adding native feed author to DC creators list
    String author = item.getAuthor();
    if (author!=null) {
        List creators = ((DCModule)syndEntry.getModule(DCModule.URI)).getCreators();
        if (!creators.contains(author)) {
            Set s = new HashSet(); // using a set to remove duplicates
            s.addAll(creators);    // DC creators
            s.add(author);         // feed native author
            creators.clear();
            creators.addAll(s);
        }
    }

    Guid guid = item.getGuid();
    if (guid!=null) {
        syndEntry.setUri(guid.getValue());
        if (item.getLink()==null && guid.isPermaLink()) {
            syndEntry.setLink(guid.getValue());
        }
    }
    else {
        syndEntry.setUri(item.getLink());
    }
    return syndEntry;
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:29,代码来源:ConverterForRSS094.java

示例6: getBuildEntries

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

示例7: getBuildEntries

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

示例8: getFeedEntries

import com.sun.syndication.feed.synd.SyndEntry; //导入方法依赖的package包/类
@Override
public List<FeedEntry> getFeedEntries(String feedUrl)        
        throws FeedException, IOException {        
    SyndFeed feed = createFeed(feedUrl);
    List entries = feed.getEntries();
    List<FeedEntry> result = new ArrayList<>(entries.size());
    for (Object o : entries) {
        SyndEntry e = (SyndEntry)o;
        e.setLink(HttpUtils.cleanFeedUrl(e.getLink()));
        result.add(syndEntryToFeedEntry(e));
    }        
    closeUrlConnection();
    return result;
}
 
开发者ID:dkorenci,项目名称:feedsucker,代码行数:15,代码来源:RomeFeedReader.java

示例9: makeEntryFromRSSCorrespon

import com.sun.syndication.feed.synd.SyndEntry; //导入方法依赖的package包/类
/**
 * コレポンからRSSのエントリー(それぞれのItem)を作成.
 */
private SyndEntry makeEntryFromRSSCorrespon(
    RSSCorrespon c, String baseURL) {
    if (log.isDebugEnabled()) {
        log.debug("id[{}]", c.getId());
    }
    SyndEntry entry = new ExtendedSyndEntryImpl();

    // title設定
    entry.setTitle(c.getSubject());
    // description設定
    entry.setDescription(makeDescriptionFromRSSCorrespon(c, baseURL));
    // link(とguid)設定
    entry.setLink(baseURL + "correspon/correspon.jsf?id=" + c.getId()
            + "&projectId=" + c.getProjectId());
    // author設定
    SyndPerson author = new SyndPersonImpl();
    author.setEmail(c.getProjectId() + " : " + c.getProjectNameE());
    List<SyndPerson> authors = new ArrayList<SyndPerson>();
    authors.add(author);
    entry.setAuthors(authors);
    // category設定
    SyndCategory category = new SyndCategoryImpl();
    category.setName(c.getCategory().getLabel());
    List<SyndCategory> categories = new ArrayList<SyndCategory>();
    categories.add(category);
    entry.setCategories(categories);
    // pubDate(とdc:date)設定
    entry.setPublishedDate(c.getUpdatedAt());

    return entry;
}
 
开发者ID:otsecbsol,项目名称:linkbinder,代码行数:35,代码来源:RSSServiceImpl.java

示例10: createInvalidLinkedEntriesWithTestDescription

import com.sun.syndication.feed.synd.SyndEntry; //导入方法依赖的package包/类
private List<SyndEntry> createInvalidLinkedEntriesWithTestDescription() {
	SyndEntry entry1 = new SyndEntryImpl();
	entry1.setLink("test://not_exists1.html");
	SyndContentImpl syndContent1 = new SyndContentImpl();
	syndContent1.setValue("Test");
	entry1.setDescription(syndContent1);

	SyndEntry entry2 = new SyndEntryImpl();
	entry2.setLink("test://not_exists2.html");
	SyndContentImpl syndContent2 = new SyndContentImpl();
	syndContent2.setValue("Test");
	entry2.setDescription(syndContent2);

	return Arrays.asList(entry1, entry2);
}
 
开发者ID:rrauschenbach,项目名称:FeedExpander,代码行数:16,代码来源:FeedContentExchangerTest.java

示例11: createValidLinkedEntriesWithEmptyDescription

import com.sun.syndication.feed.synd.SyndEntry; //导入方法依赖的package包/类
private List<SyndEntry> createValidLinkedEntriesWithEmptyDescription(String content) {
	SyndEntry entry1 = new SyndEntryImpl();
	entry1.setLink("test://feeds/valid_feed/content_1.html");
	SyndContentImpl syndContent1 = new SyndContentImpl();
	syndContent1.setValue(content);
	entry1.setDescription(syndContent1);

	SyndEntry entry2 = new SyndEntryImpl();
	entry2.setLink("test://feeds/valid_feed/content_2.html");
	SyndContentImpl syndContent2 = new SyndContentImpl();
	syndContent2.setValue(content);
	entry2.setDescription(syndContent2);

	return Arrays.asList(entry1, entry2);
}
 
开发者ID:rrauschenbach,项目名称:FeedExpander,代码行数:16,代码来源:FeedContentExchangerTest.java

示例12: getSyndEntry

import com.sun.syndication.feed.synd.SyndEntry; //导入方法依赖的package包/类
public static SyndEntry getSyndEntry(Connection db, int id, String url) throws SQLException {
  SyndEntry entry = new SyndEntryImpl();
  try {
    Project project = new Project(db, id);
    if (!project.getApproved() || !project.getApprovalDate().before(new Timestamp(System.currentTimeMillis()))) {
      return null;
    }
    entry.setTitle(project.getTitle());
    // Need to check status
    entry.setPublishedDate(project.getEntered());
    entry.setAuthor(UserUtils.getUserName(project.getEnteredBy()));
    entry.setLink(url + "/show/" + project.getUniqueId());

    SyndContent description = new SyndContentImpl();
    description.setType("text/html");
    if (StringUtils.hasText(project.getShortDescription())) {
      if (project.getShortDescription().length() > 1000) {
        description.setValue(project.getShortDescription().substring(0, 1000));
      } else {
        description.setValue(project.getShortDescription());
      }
    }
    entry.setDescription(description);
  } catch (Exception e) {
    //likely if the object does not exist.
    return null;
  }

  return entry;
}
 
开发者ID:Concursive,项目名称:concourseconnect-community,代码行数:31,代码来源:ProjectFeedEntry.java

示例13: getSyndEntry

import com.sun.syndication.feed.synd.SyndEntry; //导入方法依赖的package包/类
public static SyndEntry getSyndEntry(Connection db, int id, String url) throws SQLException {
  SyndEntry entry = new SyndEntryImpl();
  try {
    BlogPost blogPost = new BlogPost(db, id);
    Project project = ProjectUtils.loadProject(blogPost.getProjectId());
    if (blogPost.getStatus() != BlogPost.PUBLISHED) {
      return null;
    }
    entry.setTitle(blogPost.getSubject());
    // Need to check status
    entry.setPublishedDate(blogPost.getStartDate());
    entry.setAuthor(UserUtils.getUserName(blogPost.getEnteredBy()));
    entry.setLink(url + "/show/" + project.getUniqueId() + "/post/" + blogPost.getId());
    SyndContent description = new SyndContentImpl();
    description.setType("text/html");
    if (StringUtils.hasText(blogPost.getIntro())) {
      if (blogPost.getIntro().length() > 1000) {
        description.setValue(blogPost.getIntro().substring(0, 1000));
      } else {
        description.setValue(blogPost.getIntro());
      }
    }
    entry.setDescription(description);
  } catch (Exception e) {
    //likely if the object does not exist.
    return null;
  }

  return entry;
}
 
开发者ID:Concursive,项目名称:concourseconnect-community,代码行数:31,代码来源:BlogPostFeedEntry.java

示例14: getSyndEntry

import com.sun.syndication.feed.synd.SyndEntry; //导入方法依赖的package包/类
public static SyndEntry getSyndEntry(Connection db, int id, String url) throws SQLException {
  SyndEntry entry = new SyndEntryImpl();
  try {
    ProjectRating projectRating = new ProjectRating(db, id);
    Project project = ProjectUtils.loadProject(projectRating.getProjectId());
    if (!project.getApproved() || !project.getApprovalDate().before(new Timestamp(System.currentTimeMillis()))) {
      return null;
    }
    entry.setTitle(project.getTitle() + " review " + "\"" + projectRating.getTitle() + "\" (" + projectRating.getRating() + "/5)");
    entry.setPublishedDate(projectRating.getEntered());
    entry.setAuthor(UserUtils.getUserName(projectRating.getEnteredBy()));
    entry.setLink(url + "/show/" + project.getUniqueId() + "/review/" + projectRating.getId());

    SyndContent description = new SyndContentImpl();
    description.setType("text/html");
    if (StringUtils.hasText(projectRating.getComment())) {
      if (projectRating.getComment().length() > 500) {
        description.setValue(projectRating.getComment().substring(0, 500));
      } else {
        description.setValue(projectRating.getComment());
      }
    }
    entry.setDescription(description);
  } catch (Exception e) {
    //likely if the object does not exist.
    return null;
  }

  return entry;
}
 
开发者ID:Concursive,项目名称:concourseconnect-community,代码行数:31,代码来源:ProjectRatingFeedEntry.java

示例15: getSyndEntry

import com.sun.syndication.feed.synd.SyndEntry; //导入方法依赖的package包/类
public static SyndEntry getSyndEntry(Connection db, int id, String url) throws SQLException {
  SyndEntry entry = new SyndEntryImpl();
  try {
    Topic topic = new Topic(db, id);
    Project project = ProjectUtils.loadProject(topic.getProjectId());
    if (!project.getApproved() || !project.getApprovalDate().before(new Timestamp(System.currentTimeMillis()))) {
      return null;
    }
    entry.setTitle("Discussion - " + topic.getSubject());
    entry.setPublishedDate(topic.getEntered());
    entry.setAuthor(UserUtils.getUserName(topic.getEnteredBy()));
    entry.setLink(url + "/show/" + project.getUniqueId() + "/topic/" + topic.getId());

    SyndContent description = new SyndContentImpl();
    description.setType("text/html");
    if (StringUtils.hasText(topic.getBody())) {
      if (topic.getBody().length() > 500) {
        description.setValue(topic.getBody().substring(0, 500));
      } else {
        description.setValue(topic.getBody());
      }
    }
    entry.setDescription(description);
  } catch (Exception e) {
    //likely if the object does not exist.
    return null;
  }

  return entry;
}
 
开发者ID:Concursive,项目名称:concourseconnect-community,代码行数:31,代码来源:DiscussionTopicFeedEntry.java


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