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


Java Feed.setId方法代码示例

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


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

示例1: buildFeedMetadata

import com.rometools.rome.feed.atom.Feed; //导入方法依赖的package包/类
@Override
protected void buildFeedMetadata(Map<String, Object> model, Feed feed, HttpServletRequest request) {
	feed.setId("https://github.com/mploed/event-driven-spring-boot/customer");
	feed.setTitle("Customer");
	List<Link> alternateLinks = new ArrayList<>();
	Link link = new Link();
	link.setRel("self");
	link.setHref(baseUrl(request) + "feed");
	alternateLinks.add(link);
	List<SyndPerson> authors = new ArrayList<SyndPerson>();
	Person person = new Person();
	person.setName("Big Pug Bank");
	authors.add(person);
	feed.setAuthors(authors);

	feed.setAlternateLinks(alternateLinks);
	feed.setUpdated(customerRepository.lastUpdate());
	Content subtitle = new Content();
	subtitle.setValue("List of all customers");
	feed.setSubtitle(subtitle);
}
 
开发者ID:mploed,项目名称:event-driven-spring-boot,代码行数:22,代码来源:CustomerAtomFeedView.java

示例2: buildFeedMetadata

import com.rometools.rome.feed.atom.Feed; //导入方法依赖的package包/类
@Override
protected void buildFeedMetadata(Map<String, Object> model, Feed feed, HttpServletRequest request) {
	feed.setId("tag:ewolff.com/microservice-atom/order");
	feed.setTitle("Order");
	List<Link> alternateLinks = new ArrayList<>();
	Link link = new Link();
	link.setRel("self");
	link.setHref(baseUrl(request) + "feed");
	alternateLinks.add(link);
	List<SyndPerson> authors = new ArrayList<SyndPerson>();
	Person person = new Person();
	person.setName("Big Money Online Commerce Inc.");
	authors.add(person);
	feed.setAuthors(authors);

	feed.setAlternateLinks(alternateLinks);
	feed.setUpdated(orderRepository.lastUpdate());
	Content subtitle = new Content();
	subtitle.setValue("List of all orders");
	feed.setSubtitle(subtitle);
}
 
开发者ID:ewolff,项目名称:microservice-atom,代码行数:22,代码来源:OrderAtomFeedView.java

示例3: buildFeedMetadata

import com.rometools.rome.feed.atom.Feed; //导入方法依赖的package包/类
@Override
protected void buildFeedMetadata(Map<String, Object> model, Feed feed, HttpServletRequest request) {
    ZUser user = userService.getCurrentUser();
    ZUserConfig userConfig = user.getUserConfig();
    Locale locale;
    if (userConfig != null) {
        locale = userConfig.getLocale();
    } else {
        locale = Locale.getDefault();
    }
    super.buildFeedMetadata(model, feed, request);
    OPDSMetadata metadata = (OPDSMetadata) model.get(OPDS_METADATA);
    Res title = metadata.getTitle();
    feed.setTitle(res.get(locale, title.getKey(), title.getObjs()));
    feed.setId(metadata.getId());
    feed.setUpdated(metadata.getUpdated());
    feed.setIcon("favicon.ico");
    feed.setEncoding("utf-8");
    //noinspection unchecked
    feed.setOtherLinks(metadata.getOtherLinks());
}
 
开发者ID:patexoid,项目名称:ZombieLib2,代码行数:22,代码来源:OpdsView.java

示例4: buildFeedMetadata

import com.rometools.rome.feed.atom.Feed; //导入方法依赖的package包/类
@Override
protected void buildFeedMetadata(Map<String, Object> model, Feed feed,
		HttpServletRequest request) {
	feed.setTitle("User Feeds News");
	feed.setId("tag:hrmsUserTypes");
	feed.setUpdated(new Date());

}
 
开发者ID:PacktPublishing,项目名称:Spring-MVC-Blueprints,代码行数:9,代码来源:HrmsAtomViewBuilder.java

示例5: buildFeedMetadata

import com.rometools.rome.feed.atom.Feed; //导入方法依赖的package包/类
protected void buildFeedMetadata(Map model, Feed feed, HttpServletRequest request) {
    feed.setId("" + model.get("feed_id"));
    feed.setTitle("" + model.get("feed_title"));
    Content subTitle = new Content();
    subTitle.setValue("" + model.get("feed_description"));
    feed.setSubtitle(subTitle);
}
 
开发者ID:PodcastpediaOrg,项目名称:podcastpedia-web,代码行数:8,代码来源:GenericAtomFeedView.java

示例6: testEquals

import com.rometools.rome.feed.atom.Feed; //导入方法依赖的package包/类
public void testEquals() {
    final Feed feed1 = new Feed();
    final Feed feed2 = new Feed();
    final Feed feed3 = new Feed();
    final Feed feed4 = new Feed();
    feed4.setId("a");

    // reflexive
    assertTrue(feed1.equals(feed1));

    // symmetric
    assertTrue(feed1.equals(feed2));
    assertTrue(feed2.equals(feed1));

    assertFalse(feed1.equals(feed4));
    assertFalse(feed4.equals(feed1));

    // transitive
    assertTrue(feed1.equals(feed2));
    assertTrue(feed2.equals(feed3));
    assertTrue(feed1.equals(feed3));

    assertTrue(feed1.equals(feed2));
    assertFalse(feed2.equals(feed4));
    assertFalse(feed1.equals(feed4));

    // consistent
    assertTrue(feed1.equals(feed2));
    assertTrue(feed1.equals(feed2));

    assertFalse(feed1.equals(feed4));
    assertFalse(feed1.equals(feed4));

    // not-null to null is FALSE
    assertFalse(feed1.equals(null));
}
 
开发者ID:rometools,项目名称:rome,代码行数:37,代码来源:TestEqualsBean.java

示例7: buildFeedMetadata

import com.rometools.rome.feed.atom.Feed; //导入方法依赖的package包/类
@Override
protected void buildFeedMetadata(Map<String, Object> model, Feed feed, HttpServletRequest request) {
    String feedPath = (String) model.get("feed-path");
    feed.setTitle((String) model.get("feed-title"));
    feed.setId(String.format("http://spring.io%s", feedPath));
    feed.setIcon(siteUrl.getAbsoluteUrl("/favicon.ico"));
    setFeedUrl(feedPath, feed);
    setBlogUrl((String) model.get("blog-path"), feed);
    setUpdatedDate(model, feed);

    super.buildFeedMetadata(model, feed, request);
}
 
开发者ID:spring-io,项目名称:sagan,代码行数:13,代码来源:AtomFeedView.java

示例8: run

import com.rometools.rome.feed.atom.Feed; //导入方法依赖的package包/类
@Override
public void run()
{
	// Not terribly efficient
	AbstractRootSearchSection<?> rootSearch = info.lookupSection(AbstractRootSearchSection.class);
	AbstractFreetextResultsSection<?, ?> searchResults = info
		.lookupSection(AbstractFreetextResultsSection.class);

	FreetextSearchEvent event = searchResults.createSearchEvent(info);
	info.processEvent(event);

	FreetextSearchResults<FreetextResult> results = freeTextService.search(event.getFinalSearch(), 0, length);
	if( feedType.equals("rss_2.0") )
	{
		response.setContentType("application/rss+xml; charset=UTF-8");
	}
	else
	{
		response.setContentType("application/atom+xml; charset=UTF-8");
	}
	SyndFeed feed = getFeed(info, searchResults, results);

	feed.setFeedType(feedType);
	String title = rootSearch.getTitle(info).getText();
	feed.setTitle(title);
	String urlPath = path;
	if( urlPath != null && urlPath.startsWith("/") )
	{
		urlPath = urlPath.substring(1);
	}
	feed.setLink(institutionService.institutionalise(urlPath));
	feed.setDescription(title);
	WireFeed wfeed = feed.createWireFeed(feedType);
	if( wfeed instanceof Feed )
	{
		// add compulsory Atom fields
		Feed atomFeed = (Feed) wfeed;
		atomFeed.setId(institutionService.institutionalise("atom_1.0"));
		atomFeed.setUpdated(new Date());
	}

	WireFeedOutput outputter = new WireFeedOutput();
	try
	{
		outputter.output(wfeed, response.getWriter());
	}
	catch( Exception fe )
	{
		throw new RuntimeException(fe);
	}
}
 
开发者ID:equella,项目名称:Equella,代码行数:52,代码来源:FeedServlet.java

示例9: buildFeedMetadata

import com.rometools.rome.feed.atom.Feed; //导入方法依赖的package包/类
@Override
protected void buildFeedMetadata(Map<String, Object> model, Feed feed, HttpServletRequest request) {
    feed.setId("tag:springsource.org");
    feed.setTitle("Veterinarians");
    //feed.setUpdated(date);
}
 
开发者ID:jenkinsci,项目名称:docker-workflow-plugin,代码行数:7,代码来源:VetsAtomView.java

示例10: buildFeedMetadata

import com.rometools.rome.feed.atom.Feed; //导入方法依赖的package包/类
@Override
protected void buildFeedMetadata(Map<String, Object> model, Feed feed, HttpServletRequest request) {
	feed.setId("tag:springsource.org");
	feed.setTitle("Veterinarians");
	feed.setUpdated(new Date());
}
 
开发者ID:arnaldop,项目名称:enhanced-pet-clinic,代码行数:7,代码来源:VetsAtomView.java


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