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


Java Content.setValue方法代码示例

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


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

示例1: buildFeedMetadata

import com.rometools.rome.feed.atom.Content; //导入方法依赖的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: buildFeedEntries

import com.rometools.rome.feed.atom.Content; //导入方法依赖的package包/类
@Override
protected List<Entry> buildFeedEntries(Map<String, Object> model, HttpServletRequest request,
                                       HttpServletResponse response) throws Exception {

	List<Entry> entries = new ArrayList<Entry>();
	List<Customer> customerlist = (List<Customer>) model.get("customers");

	for (Customer o : customerlist) {
		Entry entry = new Entry();
		entry.setId("https://github.com/mploed/event-driven-spring-boot/customer/" + Long.toString(o.getId()));
		entry.setUpdated(o.getUpdated());
		entry.setTitle("Customer " + o.getId());
		List<Content> contents = new ArrayList<Content>();
		Content content = new Content();
		content.setSrc(baseUrl(request) + "customer/rest/" + Long.toString(o.getId()));
		content.setType("application/json");
		contents.add(content);
		entry.setContents(contents);
		Content summary = new Content();
		summary.setValue("This is the customer " + o.getId());
		entry.setSummary(summary);
		entries.add(entry);
	}

	return entries;
}
 
开发者ID:mploed,项目名称:event-driven-spring-boot,代码行数:27,代码来源:CustomerAtomFeedView.java

示例3: buildFeedMetadata

import com.rometools.rome.feed.atom.Content; //导入方法依赖的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

示例4: buildFeedEntries

import com.rometools.rome.feed.atom.Content; //导入方法依赖的package包/类
@Override
protected List<Entry> buildFeedEntries(Map<String, Object> model, HttpServletRequest request,
		HttpServletResponse response) throws Exception {

	List<Entry> entries = new ArrayList<Entry>();
	List<Order> orderlist = (List<Order>) model.get("orders");

	for (Order o : orderlist) {
		Entry entry = new Entry();
		entry.setId("tag:ewolff.com/microservice-atom/order/" + Long.toString(o.getId()));
		entry.setUpdated(o.getUpdated());
		entry.setTitle("Order " + o.getId());
		List<Content> contents = new ArrayList<Content>();
		Content content = new Content();
		content.setSrc(baseUrl(request) + "order/" + Long.toString(o.getId()));
		content.setType("application/json");
		contents.add(content);
		entry.setContents(contents);
		Content summary = new Content();
		summary.setValue("This is the order " + o.getId());
		entry.setSummary(summary);
		entries.add(entry);
	}

	return entries;
}
 
开发者ID:ewolff,项目名称:microservice-atom,代码行数:27,代码来源:OrderAtomFeedView.java

示例5: buildFeedEntries

import com.rometools.rome.feed.atom.Content; //导入方法依赖的package包/类
@Override
protected List<Entry> buildFeedEntries(Map<String, Object> model, HttpServletRequest request, HttpServletResponse response) throws Exception {
  List<Owner> owners = (List<Owner>) model.get("owners");
  List<Entry> entries = new ArrayList<>();
  for (Owner owner : owners) {
    Entry entry = new Entry();
    entry.setId(String.format("%d", owner.getId()));
    Person person = new Person();
    person.setName(owner.getFirstName());
    entry.setAuthors(Collections.singletonList(person));
    entry.setTitle(owner.getAddress());
    Content summary = new Content();
    summary.setValue(owner.getAddress());
    entry.setSummary(summary);
    entries.add(entry);
  }
  return entries;
}
 
开发者ID:puncha,项目名称:petclinic,代码行数:19,代码来源:OwnerAtomFeedView.java

示例6: buildFeedEntries

import com.rometools.rome.feed.atom.Content; //导入方法依赖的package包/类
@Override
protected List<Entry> buildFeedEntries(Map<String, Object> model,
                                       HttpServletRequest request, HttpServletResponse response) throws Exception {

    Vets vets = (Vets) model.get("vets");
    List<Vet> vetList = vets.getVetList();
    List<Entry> entries = new ArrayList<Entry>(vetList.size());

    for (Vet vet : vetList) {
        Entry entry = new Entry();
        // see http://diveintomark.org/archives/2004/05/28/howto-atom-id#other
        entry.setId(String.format("tag:springsource.org,%s", vet.getId()));
        entry.setTitle(String.format("Vet: %s %s", vet.getFirstName(), vet.getLastName()));
        //entry.setUpdated(visit.getDate().toDate());

        Content summary = new Content();
        summary.setValue(vet.getSpecialties().toString());
        entry.setSummary(summary);

        entries.add(entry);
    }
    response.setContentType("blabla");
    return entries;

}
 
开发者ID:jenkinsci,项目名称:docker-workflow-plugin,代码行数:26,代码来源:VetsAtomView.java

示例7: buildFeedEntries

import com.rometools.rome.feed.atom.Content; //导入方法依赖的package包/类
@Override
protected List<Entry> buildFeedEntries(Map<String, Object> model,
		HttpServletRequest req, HttpServletResponse response) throws Exception {
	// get data model which is passed by the Spring container
	  List<HrmsNews> news = (List<HrmsNews>) model.get("allNews");
       List<Entry> entries = new ArrayList<Entry>(news.size());
		
		for(HrmsNews topic : news ){
		
			Entry entry = new Entry();
			
			
			entry.setId(topic.getId()+"");
						
			entry.setTitle(topic.getDescription());
			
			Content summary = new Content();
			summary.setValue(topic.getSummary());
		    entry.setSummary(summary);
		       
		    Link link = new Link();
		    link.setType("text/html");
		    link.setHref(topic.getLink()); //because I have a different controller to show news at http://yourfanstasticsiteUrl.com/news/ID
		    List arrLinks = new ArrayList();
		    arrLinks.add(link);
		    entry.setAlternateLinks(arrLinks);
		    entry.setUpdated(new Date());
			
		    entries.add(entry);
		}
		
		return entries;
}
 
开发者ID:PacktPublishing,项目名称:Spring-MVC-Blueprints,代码行数:34,代码来源:HrmsAtomViewBuilder.java

示例8: buildFeedEntries

import com.rometools.rome.feed.atom.Content; //导入方法依赖的package包/类
@Override
protected List<Entry> buildFeedEntries(Map model, HttpServletRequest request, HttpServletResponse response)
		throws Exception {
	List<Entry> entries = new ArrayList<Entry>();
	for (Iterator iterator = model.keySet().iterator(); iterator.hasNext();) {
		String name = (String) iterator.next();
		Entry entry = new Entry();
		entry.setTitle(name);
		Content content = new Content();
		content.setValue((String) model.get(name));
		entry.setSummary(content);
		entries.add(entry);
	}
	return entries;
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:16,代码来源:AtomFeedViewTests.java

示例9: reduceContent

import com.rometools.rome.feed.atom.Content; //导入方法依赖的package包/类
private Content reduceContent(Content first, Content second) {
    Content newContent = new Content();
    String type = first.getType();
    String newValue;
    if (type.toLowerCase().contains("html")) {
        newValue = first.getValue() + "<br/>" + second.getValue();
    } else {
        newValue = first.getValue() + "\n " + second.getValue();

    }
    newContent.setValue(newValue);
    newContent.setType(type);
    newContent.setSrc(first.getSrc());
    return newContent;
}
 
开发者ID:patexoid,项目名称:ZombieLib2,代码行数:16,代码来源:OpdsView.java

示例10: buildFeedMetadata

import com.rometools.rome.feed.atom.Content; //导入方法依赖的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

示例11: buildFeedEntries

import com.rometools.rome.feed.atom.Content; //导入方法依赖的package包/类
@Override
protected List<Entry> buildFeedEntries(Map<String, Object> model, HttpServletRequest request,
		HttpServletResponse response) throws Exception {

	log.info("In buildFeedEntries: " + model);

	Vets vets = (Vets) model.get("vets");
	List<Vet> vetList = vets.getVetList();
	List<Entry> entries = new ArrayList<Entry>(vetList.size());

	for (Vet vet : vetList) {
		Entry entry = new Entry();
		// see
		// http://diveintomark.org/archives/2004/05/28/howto-atom-id#other
		entry.setId(String.format("tag:springsource.org,%s", vet.getId()));
		entry.setTitle(String.format("Vet: %s %s", vet.getFirstName(), vet.getLastName()));
		entry.setUpdated(new Date());

		Content summary = new Content();
		summary.setValue(vet.getSpecialties().toString());
		entry.setSummary(summary);

		entries.add(entry);
	}
	response.setContentType("blabla");
	return entries;
}
 
开发者ID:arnaldop,项目名称:enhanced-pet-clinic,代码行数:28,代码来源:VetsAtomView.java

示例12: parseContent

import com.rometools.rome.feed.atom.Content; //导入方法依赖的package包/类
private Content parseContent(final Element e) {

        final String value = parseTextConstructToString(e);
        final String src = getAttributeValue(e, "src");
        final String type = getAttributeValue(e, "type");

        final Content content = new Content();
        content.setSrc(src);
        content.setType(type);
        content.setValue(value);
        return content;

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

示例13: createFeed

import com.rometools.rome.feed.atom.Content; //导入方法依赖的package包/类
private Feed createFeed() {
    final Feed feed = new Feed();
    final Content content = new Content();
    content.setType("application/xml");
    content.setValue("<test>Hello Hello</test>");
    feed.setTitleEx(content);
    feed.setFeedType("atom_1.0");
    return feed;
}
 
开发者ID:rometools,项目名称:rome,代码行数:10,代码来源:TestAtomContent.java

示例14: setContent

import com.rometools.rome.feed.atom.Content; //导入方法依赖的package包/类
/**
 * Set content of entry.
 *
 * @param contentString content string.
 * @param type Must be "text" for plain text, "html" for escaped HTML, "xhtml" for XHTML or a
 *            valid MIME content-type.
 */
public void setContent(final String contentString, final String type) {
    final Content newContent = new Content();
    newContent.setType(type == null ? Content.HTML : type);
    newContent.setValue(contentString);
    final ArrayList<Content> contents = new ArrayList<Content>();
    contents.add(newContent);
    setContents(contents);
}
 
开发者ID:rometools,项目名称:rome,代码行数:16,代码来源:ClientEntry.java

示例15: testGetEntries

import com.rometools.rome.feed.atom.Content; //导入方法依赖的package包/类
/**
 * Verify that server returns service document containing workspaces containing collections.
 */
public void testGetEntries() throws Exception {

    // no auth necessary for iterating through entries
    ClientCollection col = AtomClientFactory.getCollection(collectionURI, new GDataAuthStrategy(email, password, "blogger"));
    assertNotNull(col);
    int count = 0;
    for (final Iterator<ClientEntry> it = col.getEntries(); it.hasNext();) {
        final ClientEntry entry = it.next();
        assertNotNull(entry);
        count++;
    }
    assertTrue(count > 0);

    col = AtomClientFactory.getCollection(collectionURI, new GDataAuthStrategy(email, password, "blogger"));
    final ClientEntry p1 = col.createEntry();
    p1.setTitle("Propono post");
    final Content c = new Content();
    c.setValue("This is content from ROME Propono");
    p1.setContent(c);
    col.addEntry(p1);

    final ClientEntry p2 = col.getEntry(p1.getEditURI());
    assertNotNull(p2);

    final ClientAtomService atomService = AtomClientFactory.getAtomService(collectionURI, new GDataAuthStrategy(email, password, "blogger"));
    assertNotNull(atomService);

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


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