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


Java SyndImage类代码示例

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


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

示例1: createRealFeed

import com.sun.syndication.feed.synd.SyndImage; //导入依赖的package包/类
protected WireFeed createRealFeed(String type,SyndFeed syndFeed) {
    Channel channel = new Channel(type);
    channel.setModules(ModuleUtils.cloneModules(syndFeed.getModules()));

    channel.setEncoding(syndFeed.getEncoding());

    channel.setTitle(syndFeed.getTitle());
    channel.setLink(syndFeed.getLink());
    channel.setDescription(syndFeed.getDescription());
    SyndImage sImage = syndFeed.getImage();
    if (sImage!=null) {
        channel.setImage(createRSSImage(sImage));
    }

    List sEntries = syndFeed.getEntries();
    if (sEntries!=null) {
        channel.setItems(createRSSItems(sEntries));
    }
    return channel;
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:21,代码来源:ConverterForRSS090.java

示例2: createSyndImage

import com.sun.syndication.feed.synd.SyndImage; //导入依赖的package包/类
protected SyndImage createSyndImage(Image rssImage) {
    SyndImage syndImage = new SyndImageImpl();
    syndImage.setTitle(rssImage.getTitle());
    syndImage.setUrl(rssImage.getUrl());
    syndImage.setLink(rssImage.getLink());
    return syndImage;
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:8,代码来源:ConverterForRSS090.java

示例3: createRSSImage

import com.sun.syndication.feed.synd.SyndImage; //导入依赖的package包/类
protected Image createRSSImage(SyndImage sImage) {
    Image image = new Image();
    image.setTitle(sImage.getTitle());
    image.setUrl(sImage.getUrl());
    image.setLink(sImage.getLink());
    return image;
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:8,代码来源:ConverterForRSS090.java

示例4: createRSSImage

import com.sun.syndication.feed.synd.SyndImage; //导入依赖的package包/类
@Override
protected Image createRSSImage(SyndImage sImage) {
    Image image = super.createRSSImage(sImage);
    image.setDescription(sImage.getDescription());

    return image;
}
 
开发者ID:4thline,项目名称:feeds,代码行数:8,代码来源:ConverterForRSS091Userland.java

示例5: createSyndImage

import com.sun.syndication.feed.synd.SyndImage; //导入依赖的package包/类
@Override
protected SyndImage createSyndImage(Image rssImage) {
    SyndImage syndImage = super.createSyndImage(rssImage);
    syndImage.setDescription(rssImage.getDescription());

    return syndImage;
}
 
开发者ID:4thline,项目名称:feeds,代码行数:8,代码来源:ConverterForRSS091Userland.java

示例6: addExternalImageURL

import com.sun.syndication.feed.synd.SyndImage; //导入依赖的package包/类
/**
 * @param extFeed
 * @param feed
 */
private void addExternalImageURL(final SyndFeed feed, final Feed extFeed) {
    final SyndImage img = feed.getImage();
    if (img != null) {
        extFeed.setExternalImageURL(img.getUrl());
    } else {
        extFeed.setExternalImageURL(null);
    }
}
 
开发者ID:huihoo,项目名称:olat,代码行数:13,代码来源:FeedManagerImpl.java

示例7: createSyndImage

import com.sun.syndication.feed.synd.SyndImage; //导入依赖的package包/类
protected SyndImage createSyndImage(Image rssImage) {
    SyndImage syndImage = super.createSyndImage(rssImage);
    syndImage.setDescription(rssImage.getDescription());
    return syndImage;
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:6,代码来源:ConverterForRSS091Userland.java

示例8: createRSSImage

import com.sun.syndication.feed.synd.SyndImage; //导入依赖的package包/类
protected Image createRSSImage(SyndImage sImage) {
    Image image = super.createRSSImage(sImage);
    image.setDescription(sImage.getDescription());
    return image;
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:6,代码来源:ConverterForRSS091Userland.java

示例9: RSSFeed

import com.sun.syndication.feed.synd.SyndImage; //导入依赖的package包/类
/**
    * Constructor. The identityKey is needed to generate personal URLs for the corresponding user.
    */
protected RSSFeed(final Feed feed, final Identity identity, final Long courseId, final String nodeId,final Translator translator, RepositoryService repositoryService) {
       super();

       // This helper object is required for generating the appropriate URLs for
       // the given user (identity)
	final FeedViewHelper helper = new FeedViewHelper(feed, identity, courseId, nodeId, translator, repositoryService);

       setFeedType("rss_2.0");
       setEncoding(RSSServlet.DEFAULT_ENCODING);
       setTitle(feed.getTitle());
       // According to the rss specification, the feed channel description is not
       // (explicitly) allowed to contain html tags.
       String strippedDescription = FilterFactory.getHtmlTagsFilter().filter(feed.getDescription());
       strippedDescription = strippedDescription.replaceAll(" ", " "); // TODO: remove when filter
       // does it
       setDescription(strippedDescription);
       setLink(helper.getJumpInLink());

       setPublishedDate(feed.getLastModified());
       // The image
       if (feed.getImageName() != null) {
           final SyndImage image = new SyndImageImpl();
           image.setDescription(feed.getDescription());
           image.setTitle(feed.getTitle());
           image.setLink(getLink());
           image.setUrl(helper.getImageUrl());
           setImage(image);
       }

       final List<SyndEntry> episodes = new ArrayList<SyndEntry>();
       for (final Item item : feed.getPublishedItems()) {
           final SyndEntry entry = new SyndEntryImpl();
           entry.setTitle(item.getTitle());

           final SyndContent itemDescription = new SyndContentImpl();
           itemDescription.setType("text/plain");
           itemDescription.setValue(helper.getItemDescriptionForBrowser(item));
           entry.setDescription(itemDescription);

           // Link will also be converted to the rss guid tag. Except if there's an
           // enclosure, then the enclosure url is used.
           // Use jump-in link far all entries. This will be overriden if the item
           // has an enclosure.
           entry.setLink(helper.getJumpInLink() + "#" + item.getGuid());
           entry.setPublishedDate(item.getPublishDate());
           entry.setUpdatedDate(item.getLastModified());

           // The enclosure is the media (audio or video) file of the episode
           final Enclosure media = item.getEnclosure();
           if (media != null) {
               final SyndEnclosure enclosure = new SyndEnclosureImpl();
               enclosure.setUrl(helper.getMediaUrl(item));
               enclosure.setType(media.getType());
               enclosure.setLength(media.getLength());
               // Also set the item link to point to the enclosure
               entry.setLink(helper.getMediaUrl(item));
               final List<SyndEnclosure> enclosures = new ArrayList<SyndEnclosure>();
               enclosures.add(enclosure);
               entry.setEnclosures(enclosures);
           }

           episodes.add(entry);
       }
       setEntries(episodes);
   }
 
开发者ID:huihoo,项目名称:olat,代码行数:69,代码来源:RSSFeed.java

示例10: RSSFeed

import com.sun.syndication.feed.synd.SyndImage; //导入依赖的package包/类
/**
 * Constructor. The identityKey is needed to generate personal URLs for the corresponding user.
 */
protected RSSFeed(final Feed feed, final Identity identity, final Long courseId, final String nodeId, final Translator translator, RepositoryService repositoryService) {
    super();

    // This helper object is required for generating the appropriate URLs for
    // the given user (identity)
    final FeedViewHelper helper = new FeedViewHelper(feed, identity, courseId, nodeId, translator, repositoryService);

    setFeedType("rss_2.0");
    setEncoding(DEFAULT_ENCODING);
    setTitle(feed.getTitle());
    // According to the rss specification, the feed channel description is not
    // (explicitly) allowed to contain html tags.
    String strippedDescription = FilterFactory.getHtmlTagsFilter().filter(feed.getDescription());
    strippedDescription = strippedDescription.replaceAll("&nbsp;", " "); // TODO: remove when filter
    // does it
    setDescription(strippedDescription);
    setLink(helper.getJumpInLink());

    setPublishedDate(feed.getLastModified());
    // The image
    if (feed.getImageName() != null) {
        final SyndImage image = new SyndImageImpl();
        image.setDescription(feed.getDescription());
        image.setTitle(feed.getTitle());
        image.setLink(getLink());
        image.setUrl(helper.getImageUrl());
        setImage(image);
    }

    final List<SyndEntry> episodes = new ArrayList<SyndEntry>();
    for (final Item item : feed.getPublishedItems()) {
        final SyndEntry entry = new SyndEntryImpl();
        entry.setTitle(item.getTitle());

        final SyndContent itemDescription = new SyndContentImpl();
        itemDescription.setType("text/plain");
        itemDescription.setValue(helper.getItemDescriptionForBrowser(item));
        entry.setDescription(itemDescription);

        // Link will also be converted to the rss guid tag. Except if there's an
        // enclosure, then the enclosure url is used.
        // Use jump-in link far all entries. This will be overriden if the item
        // has an enclosure.
        entry.setLink(helper.getJumpInLink() + "#" + item.getGuid());
        entry.setPublishedDate(item.getPublishDate());
        entry.setUpdatedDate(item.getLastModified());

        // The enclosure is the media (audio or video) file of the episode
        final Enclosure media = item.getEnclosure();
        if (media != null) {
            final SyndEnclosure enclosure = new SyndEnclosureImpl();
            enclosure.setUrl(helper.getMediaUrl(item));
            enclosure.setType(media.getType());
            enclosure.setLength(media.getLength());
            // Also set the item link to point to the enclosure
            entry.setLink(helper.getMediaUrl(item));
            final List<SyndEnclosure> enclosures = new ArrayList<SyndEnclosure>();
            enclosures.add(enclosure);
            entry.setEnclosures(enclosures);
        }

        episodes.add(entry);
    }
    setEntries(episodes);
}
 
开发者ID:huihoo,项目名称:olat,代码行数:69,代码来源:RSSFeed.java

示例11: feedUpdate

import com.sun.syndication.feed.synd.SyndImage; //导入依赖的package包/类
/**
 * Updates feed information such as accessed time and other attributes
 * pertaining feed/channel.
 * 
 * @param feedDB
 * @param feed
 */
@SuppressWarnings("unchecked")
private void feedUpdate(DBObject feedDB, SyndFeed feed) {
	// this field is for RSS Delegate worker to check for stalled threads or
	// threads that crashed and were not able to update used filed back to 0
	feedDB.put("accessedAt", new Date());

	/******** REQUIRED channel elements as defined in RSS 2.0 Specification ********/
	// http://cyber.law.harvard.edu/rss/rss.html#
	// even though this elements are required by specification we
	// cannot trust the source
	if (feed.getTitle() != null)
		feedDB.put("title", feed.getTitle());
	if (feed.getLink() != null)
		feedDB.put("link", feed.getLink());
	if (feed.getDescription() != null)
		feedDB.put("description", feed.getDescription());

	/******** OPTIONAL channel elements as defined in RSS 2.0 Specification ********/
	if (feed.getLanguage() != null)
		feedDB.put("language", feed.getLanguage());
	if (feed.getCopyright() != null)
		feedDB.put("copyright", feed.getCopyright());
	// no specific get method for managing editor and web master in rome
	// library. Using authors instead
	if (feed.getAuthors() != null && feed.getAuthors().size() > 0) {
		ArrayList<BasicDBObject> authors = getAuthors((ArrayList<SyndPerson>) feed
				.getAuthors());
		feedDB.put("authors", authors);
	}
	if (feed.getPublishedDate() != null)
		feedDB.put("pubDate", feed.getPublishedDate());
	// last build date does not exist in rome library
	if (feed.getCategories() != null && feed.getCategories().size() > 0) {
		ArrayList<BasicDBObject> categories = getCategories((ArrayList<SyndCategory>) feed
				.getCategories());
		feedDB.put("category", categories);
	}
	// generator does not exist in rome library
	// docs does not exist in rome library
	// cloud does not exist in rome library
	// ttl does not exist in rome library
	SyndImage feedImage = feed.getImage();
	if (feedImage != null) {
		BasicDBObject imageDB = new BasicDBObject();
		if (feedImage.getUrl() != null)
			imageDB.append("url", feedImage.getUrl());
		if (feedImage.getTitle() != null)
			imageDB.append("title", feedImage.getTitle());
		if (feedImage.getLink() != null)
			imageDB.append("link", feedImage.getLink());
		if (feedImage.getDescription() != null)
			imageDB.append("description", feedImage.getDescription());
		if (feedImage.getUrl() != null || feedImage.getTitle() != null
				|| feedImage.getLink() != null
				|| feedImage.getDescription() != null)
			feedDB.put("image", imageDB);
		// width does not exist in rome library
		// height does not exist in rome library
	}
	// rating does not exist in rome library
	// text input does not exist in rome library
	// skip hours does not exist in rome library
	// skip days does not exist in rome library

	rssColl.update(new BasicDBObject("feedUrl", feedDB.get("feedUrl")),
			feedDB);
}
 
开发者ID:jeryini,项目名称:distributed-rss,代码行数:75,代码来源:RSSThreadWorker.java

示例12: WriteToFile

import com.sun.syndication.feed.synd.SyndImage; //导入依赖的package包/类
private boolean WriteToFile(String title, String link, String description, Date Pubdate,
		String copyright,String imageTitle, String imageDescription,String imageLink, String imageUrl,String language,String author)
{
	boolean retval=false;
	try
	{
		// Specify Filename
           String fileName=data.filename;;
           
		// Set channel ...
		data.feed =new SyndFeedImpl();				 
           if(Const.isEmpty(meta.getVersion())) 
           	data.feed.setFeedType("rss_2.0");
           else
           	data.feed.setFeedType(meta.getVersion());
           
           // Set encoding ...			 
           if(Const.isEmpty(meta.getEncoding())) 
           	data.feed.setEncoding("iso-8859-1");
           else
           	data.feed.setEncoding(meta.getEncoding());
           
           
           if(title!=null) data.feed.setTitle(title);
           if(link!=null) data.feed.setLink(link);
           if(description!=null) data.feed.setDescription(description);
           if(Pubdate!=null)  data.feed.setPublishedDate(Pubdate);//data.dateParser.parse(Pubdate.toString()));
           // Set image ..
           if(meta.AddImage())
           {
            SyndImage image = new SyndImageImpl();
            if(imageTitle!=null) image.setTitle(title);
            if(imageLink!=null) image.setLink(link);
            if(imageUrl!=null) image.setUrl(imageUrl);
            if(imageDescription!=null)  image.setDescription(imageDescription);
            data.feed.setImage(image);
           }
           if(language!=null) data.feed.setLanguage(language);
           if(copyright!=null) data.feed.setCopyright(copyright);
           if(author!=null) data.feed.setAuthor(author);
           
		// Add entries
		data.feed.setEntries(data.entries);
           
           Writer writer = new FileWriter(fileName);
           SyndFeedOutput output = new SyndFeedOutput();
           output.output(data.feed,writer);
           writer.close();
           
       	if (meta.AddToResult())
		{
			// Add this to the result file names...
			ResultFile resultFile = new ResultFile(ResultFile.FILE_TYPE_GENERAL, KettleVFS.getFileObject(fileName), getTransMeta().getName(), getStepname());
			resultFile.setComment("This file was created with a RSS Output step");
            addResultFile(resultFile);
		}
            
        if(log.isDetailed())
        	log.logDetailed(toString(),Messages.getString("RssOutput.Log.CreatingFileOK",fileName));
       	
		retval=true;
	}
	catch(Exception e)
	{
		logError(Messages.getString("RssOutput.Log.ErrorCreatingFile",e.toString()));
		setErrors(1);
		retval = false;
	}	
	return retval;
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:71,代码来源:RssOutput.java

示例13: WriteToFile

import com.sun.syndication.feed.synd.SyndImage; //导入依赖的package包/类
private boolean WriteToFile(String title, String link, String description, Date Pubdate,
		String copyright,String imageTitle, String imageDescription,String imageLink, String imageUrl,String language,String author)
{
	boolean retval=false;
	try
	{
		// Specify Filename
           String fileName=data.filename;;
           
		// Set channel ...
		data.feed =new SyndFeedImpl();				 
           if(Const.isEmpty(meta.getVersion())) 
           	data.feed.setFeedType("rss_2.0");
           else
           	data.feed.setFeedType(meta.getVersion());
           
           // Set encoding ...			 
           if(Const.isEmpty(meta.getEncoding())) 
           	data.feed.setEncoding("iso-8859-1");
           else
           	data.feed.setEncoding(meta.getEncoding());
           
           
           if(title!=null) data.feed.setTitle(title);
           if(link!=null) data.feed.setLink(link);
           if(description!=null) data.feed.setDescription(description);
           if(Pubdate!=null)  data.feed.setPublishedDate(Pubdate);//data.dateParser.parse(Pubdate.toString()));
           // Set image ..
           if(meta.AddImage())
           {
            SyndImage image = new SyndImageImpl();
            if(imageTitle!=null) image.setTitle(title);
            if(imageLink!=null) image.setLink(link);
            if(imageUrl!=null) image.setUrl(imageUrl);
            if(imageDescription!=null)  image.setDescription(imageDescription);
            data.feed.setImage(image);
           }
           if(language!=null) data.feed.setLanguage(language);
           if(copyright!=null) data.feed.setCopyright(copyright);
           if(author!=null) data.feed.setAuthor(author);
           
		// Add entries
		data.feed.setEntries(data.entries);
           
           Writer writer = new FileWriter(fileName);
           SyndFeedOutput output = new SyndFeedOutput();
           output.output(data.feed,writer);
           writer.close();
           
       	if (meta.AddToResult())
		{
			// Add this to the result file names...
			ResultFile resultFile = new ResultFile(ResultFile.FILE_TYPE_GENERAL, KettleVFS.getFileObject(fileName, getTransMeta()), getTransMeta().getName(), getStepname());
			resultFile.setComment("This file was created with a RSS Output step");
            addResultFile(resultFile);
		}
            
        if(log.isDetailed())
        	logDetailed(BaseMessages.getString(PKG, "RssOutput.Log.CreatingFileOK",fileName));
       	
		retval=true;
	}
	catch(Exception e)
	{
		logError(BaseMessages.getString(PKG, "RssOutput.Log.ErrorCreatingFile",e.toString()));
		setErrors(1);
		retval = false;
	}	
	return retval;
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:71,代码来源:RssOutput.java


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