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


Java Item.setPubDate方法代码示例

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


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

示例1: buildFeedItems

import com.rometools.rome.feed.rss.Item; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Override
protected List<Item> buildFeedItems(Map<String, Object> model,
		HttpServletRequest req, HttpServletResponse resp) throws Exception {
	
	// get data model which is passed by the Spring container
	List<HrmsNews> news = (List<HrmsNews>) model.get("allNews");
       List<Item> items = new ArrayList<Item>(news.size());
 	
	for(HrmsNews topic : news ){
	
		Item item = new Item();
		
		Content content = new Content();
		content.setValue(topic.getSummary());
		item.setContent(content);
		
		item.setTitle(topic.getDescription());
		item.setLink(topic.getLink());
		item.setPubDate(new Date());
		
		items.add(item);
	}
	
	return items;
}
 
开发者ID:PacktPublishing,项目名称:Spring-MVC-Blueprints,代码行数:27,代码来源:HrmsRssViewBuilder.java

示例2: buildFeedItems

import com.rometools.rome.feed.rss.Item; //导入方法依赖的package包/类
protected List buildFeedItems(Map model, HttpServletRequest request, HttpServletResponse response)
        throws Exception {
    	
        List<Podcast> podcasts = (List<Podcast>) model.get("list_of_podcasts");
        List<Item> items = new ArrayList<Item>(podcasts.size());

        for (Podcast podcast : podcasts) {
            Item item = new Item();
//            String date = String.format("%1$tY-%1$tm-%1$td", podcast.getLastEpisode().getPublicationDate());
            item.setTitle(podcast.getTitle());
            item.setPubDate(podcast.getPublicationDate());
            item.setLink(model.get("HOST_AND_PORT_URL") + "/podcasts/" + podcast.getPodcastId() 
            		+ "/" + podcast.getTitleInUrl());
            
            Description podcastDescription = new Description();
            podcastDescription.setValue(podcast.getDescription());
            item.setDescription(podcastDescription);  
                        
            items.add(item);
        }

        return items;
    }
 
开发者ID:PodcastpediaOrg,项目名称:podcastpedia-web,代码行数:24,代码来源:FoundPodcastsRssFeedView.java

示例3: parseItem

import com.rometools.rome.feed.rss.Item; //导入方法依赖的package包/类
@Override
protected Item parseItem(final Element rssRoot, final Element eItem, final Locale locale) {

    final Item item = super.parseItem(rssRoot, eItem, locale);

    final Element pubDate = eItem.getChild("pubDate", getRSSNamespace());
    if (pubDate != null) {
        item.setPubDate(DateParser.parseDate(pubDate.getText(), locale));
    }

    final Element expirationDate = eItem.getChild("expirationDate", getRSSNamespace());
    if (expirationDate != null) {
        item.setExpirationDate(DateParser.parseDate(expirationDate.getText(), locale));
    }

    final Element description = eItem.getChild("description", getRSSNamespace());
    if (description != null) {
        final String type = description.getAttributeValue("type");
        if (type != null) {
            item.getDescription().setType(type);
        }
    }

    return item;

}
 
开发者ID:rometools,项目名称:rome,代码行数:27,代码来源:RSS093Parser.java

示例4: createItem

import com.rometools.rome.feed.rss.Item; //导入方法依赖的package包/类
private Item createItem(Post post) {
    Item item = new Item();
    item.setLink(applicationSettings.getBaseUrl() + "/post/" + post.getPostName());
    item.setTitle(post.getPostTitle());
    item.setDescription(createDescription(post));
    item.setPubDate(getPostDate(post));
    return item;
}
 
开发者ID:mintster,项目名称:nixmash-blog,代码行数:9,代码来源:RssPostFeedView.java

示例5: convertArticle

import com.rometools.rome.feed.rss.Item; //导入方法依赖的package包/类
private Item convertArticle(Article article) {
  Item entry = new Item();
  Guid guid = new Guid();
  guid.setValue(article.getArticleId().toString());
  entry.setGuid(guid);
  entry.setTitle(cleanXml10Characters(article.getTitle()));
  entry.setPubDate(Date.from(article.getCreateTime()));
  Description summary = new Description();
  summary.setType("html");
  summary.setValue(buildSummary(article));
  entry.setDescription(summary);
  entry.setLink(articleUrl(article));
  return entry;
}
 
开发者ID:kaif-open,项目名称:kaif,代码行数:15,代码来源:HotArticleRssContentView.java

示例6: buildFeedItems

import com.rometools.rome.feed.rss.Item; //导入方法依赖的package包/类
protected List buildFeedItems(Map model, HttpServletRequest request, HttpServletResponse response)
    throws Exception {
	
    List<Episode> episodes = (List<Episode>) model.get("list_of_episodes");
    List<Item> items = new ArrayList<Item>(episodes.size());

    for (Episode episode : episodes) {
        Item item = new Item();
        String date = String.format("%1$tY-%1$tm-%1$td", episode.getPublicationDate());
        item.setTitle(episode.getTitle());
        item.setPubDate(episode.getPublicationDate());
        item.setLink(model.get("HOST_AND_PORT_URL") + "/podcasts/" + episode.getPodcastId() 
        		+ "/" + episode.getPodcast().getTitleInUrl()+ "/episodes/" + episode.getEpisodeId()
        		+ "/" + episode.getTitleInUrl());
        
        Description episodeDescription = new Description();
        episodeDescription.setValue(episode.getDescription());
        item.setDescription(episodeDescription);  
        
        //set enclosures
        List<Enclosure> enclosures = new ArrayList<Enclosure>();
        Enclosure enclosure = new Enclosure();
        enclosure.setUrl(episode.getMediaUrl());
        if(episode.getLength() != null) enclosure.setLength(episode.getLength());
        if(episode.getEnclosureType() != null ) enclosure.setType(episode.getEnclosureType()); 
        enclosures.add(enclosure);
        item.setEnclosures(enclosures);
        
        items.add(item);
    }

    return items;
}
 
开发者ID:PodcastpediaOrg,项目名称:podcastpedia-web,代码行数:34,代码来源:FoundEpisodesRssFeedView.java

示例7: buildFeedItems

import com.rometools.rome.feed.rss.Item; //导入方法依赖的package包/类
protected List buildFeedItems(Map model, HttpServletRequest request, HttpServletResponse response)
    throws Exception {
	
    List<Podcast> podcasts = (List<Podcast>) model.get("list_of_podcasts");
    List<Item> items = new ArrayList<Item>(podcasts.size());

    for (Podcast podcast : podcasts) {
        Episode episode = podcast.getLastEpisode();
        Item item = new Item();
        String date = String.format("%1$tY-%1$tm-%1$td", episode.getPublicationDate());
        item.setTitle(podcast.getTitle()+ " - " + episode.getTitle());
        item.setPubDate(podcast.getPublicationDate());
        item.setLink( model.get("HOST_AND_PORT_URL") + "/podcasts/" + podcast.getPodcastId() 
        		+ "/" + podcast.getTitleInUrl() );
        
        Description episodeDescription = new Description();
        episodeDescription.setValue(episode.getDescription());
        item.setDescription(episodeDescription);  
        
        //set enclosures
        List<Enclosure> enclosures = new ArrayList<Enclosure>();
        Enclosure enclosure = new Enclosure();
        enclosure.setUrl(episode.getMediaUrl());    
        if(episode.getLength() != null) enclosure.setLength(episode.getLength());
        if(episode.getEnclosureType() != null ) enclosure.setType(episode.getEnclosureType());             
        enclosures.add(enclosure);
        item.setEnclosures(enclosures);
        
        items.add(item);
    }

    return items;
}
 
开发者ID:PodcastpediaOrg,项目名称:podcastpedia-web,代码行数:34,代码来源:GenericRssFeedView.java

示例8: createRSSItem

import com.rometools.rome.feed.rss.Item; //导入方法依赖的package包/类
@Override
protected Item createRSSItem(final SyndEntry sEntry) {
    final Item item = super.createRSSItem(sEntry);
    item.setPubDate(sEntry.getPublishedDate()); // c
    return item;
}
 
开发者ID:rometools,项目名称:rome,代码行数:7,代码来源:ConverterForRSS093.java


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