org.apache.abdera.model.Feed.addAuthor()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(10.5k)|赞(0)|评价(0)|浏览(164)

本文整理了Java中org.apache.abdera.model.Feed.addAuthor()方法的一些代码示例,展示了Feed.addAuthor()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Feed.addAuthor()方法的具体详情如下:
包路径:org.apache.abdera.model.Feed
类名称:Feed
方法名:addAuthor

Feed.addAuthor介绍

暂无

代码示例

代码示例来源:origin: org.apache.ws.commons.axiom/fom-testsuite

@Override
  protected Element addChild(Feed feed) {
    return feed.addAuthor("Me");
  }
}

代码示例来源:origin: DSpace/DSpace

private void addMetadata(Feed feed, Item item) {
  SimpleDCMetadata md = this.getMetadata(item);
  /* not necessary ...
  Map<String, String> dc = md.getDublinCore();
  for (String element : dc.keySet())
  {
    String value = dc.get(element);
    feed.addSimpleExtension(new QName(UriRegistry.DC_NAMESPACE, element), value);
  }
  */
  Map<String, String> atom = md.getAtom();
  for (String element : atom.keySet()) {
    if ("author".equals(element)) {
      feed.addAuthor(atom.get(element));
    }
  }
  // ensure that the feed has one author or more
  if (feed.getAuthors().size() == 0) {
    feed.addAuthor(ConfigurationManager.getProperty("dspace.name"));
  }
}

代码示例来源:origin: org.apache.ws.commons.axiom/fom-testsuite

@Override
  protected Element addChild(Feed feed) {
    Person person = feed.getFactory().newAuthor();
    person.setName("Me");
    feed.addAuthor(person);
    return person;
  }
}

代码示例来源:origin: rackerlabs/atom-hopper

@Override
  public void process(RequestContext rc, AdapterResponse<Feed> adapterResponse) {
    final Feed feed = adapterResponse.getBody();
    Author author = feedConfiguration.getAuthor();

    if (author != null) {
      String name = author.getName();
      if ((name != null) && !(name.isEmpty()) && (feed.getAuthor() == null)) {
        feed.addAuthor(name);
      }
    }
  }
}

代码示例来源:origin: fcrepo3/fcrepo

private Feed createAtomObject(String spid, String contentLocation) throws Exception {
  PID pid = PID.getInstance(spid);
  Date date = new Date(1);
  String title = "title";
  String author = "org.fcrepo.test.api.TestManagedDatastreams";
  Feed feed = abdera.newFeed();
  feed.setId(pid.toURI());
  feed.setTitle(title);
  feed.setUpdated(date);
  feed.addAuthor(author);
  if (contentLocation != null && contentLocation.length() > 0) {
    addAtomManagedDatastream(feed, contentLocation);
  }
  return feed;
}

代码示例来源:origin: org.apache.abdera/abdera-server

protected Feed createFeed() throws Exception {
  Feed feed = abdera.newFeed();
  feed.setId(config.getFeedUri());
  feed.setTitle(config.getFeedTitle());
  feed.setUpdated(new Date());
  feed.addAuthor(config.getFeedAuthor());
  return feed;
}

代码示例来源:origin: org.fuzzydb.atom/org.fuzzydb.abdera.util

private Document<Feed> init_feed_doc(Abdera abdera) {
  Factory factory = abdera.getFactory();
  Feed feed = factory.newFeed();
  try {
    feed.setId("tag:example.org,2006:feed");
    feed.setTitle("Simple");
    feed.setUpdated(new Date());
    feed.addLink("");
    feed.addLink("", "self");
    feed.addAuthor("Simple");
  } catch (Exception e) {
    e.printStackTrace();
  } // FIXME: Document this exception
  return feed.getDocument();
}

代码示例来源:origin: org.apache.abdera/abdera-server

/**
 * Create the base feed for the requested collection.
 */
protected Feed createFeedBase(RequestContext request) throws ResponseContextException {
  Factory factory = request.getAbdera().getFactory();
  Feed feed = factory.newFeed();
  feed.setId(getId(request));
  feed.setTitle(getTitle(request));
  feed.addLink("");
  feed.addLink("", "self");
  feed.addAuthor(getAuthor(request));
  feed.setUpdated(new Date());
  return feed;
}

代码示例来源:origin: apache/cxf

private Feed doGetBookAsFeed(@Context UriInfo uParam) {
  Factory factory = Abdera.getNewFactory();
  Feed f = factory.newFeed();
  f.setBaseUri(uParam.getAbsolutePath().toString());
  f.setTitle("Collection of Books");
  f.setId("http://www.books.com");
  f.addAuthor("BookStore Management Company");
  try {
    for (Book b : books.values()) {
      Entry e = AtomUtils.createBookEntry(factory, b);
      f.addEntry(e);
    }
  } catch (Exception ex) {
    // ignore
  }
  return f;
}

代码示例来源:origin: org.xcmis/xcmis-restatom

/**
* {@inheritDoc}
*/
@Override
protected Feed createFeedBase(RequestContext request) throws ResponseContextException
{
 Factory factory = request.getAbdera().getFactory();
 Feed feed = factory.newFeed();
 feed.setId(getId(request));
 feed.setTitle(getTitle(request));
 feed.addAuthor(getAuthor(request));
 feed.setUpdated(AtomUtils.getAtomDate(Calendar.getInstance()));
 feed.addLink(getServiceLink(request), "service", "application/atomsvc+xml", null, null, -1);
 return feed;
}

代码示例来源:origin: org.xcmis/xcmis-restatom

/**
  * {@inheritDoc}
  */
  @Override
  protected Feed createFeedBase(RequestContext request) throws ResponseContextException
  {
   Factory factory = request.getAbdera().getFactory();
   Feed feed = factory.newFeed();
   feed.setId(getId(request));
   feed.setTitle(getTitle(request));
   feed.addAuthor(getAuthor(request));
   feed.setUpdated(AtomUtils.getAtomDate(Calendar.getInstance()));
   feed.addLink(getServiceLink(request), AtomCMIS.LINK_SERVICE, AtomCMIS.MEDIATYPE_ATOM_SERVICE, null, null, -1);
   return feed;
  }
}

代码示例来源:origin: org.kie.uberfire/kie-uberfire-social-activities-backend

public static String generate( List<SocialActivitiesEvent> eventTimeline, String type ) {
    Abdera abdera = new Abdera();
    Feed feed = abdera.newFeed();

    feed.setId( "tag:org.uberfire,2014:/"+ type );
    feed.setTitle( "Social Activities Feed" );
    feed.setUpdated( new Date() );
    feed.addAuthor( "Red Hat JBoss" );

    for ( SocialActivitiesEvent event : eventTimeline ) {
      Entry entry = feed.addEntry();
      entry.setTitle( event.getType() );
      entry.setSummary( event.getSocialUser().getUserName() + "  " + event.toString() );
      entry.setUpdated( event.getTimestamp() );
      entry.setPublished( event.getTimestamp() );
    }
    return feed.toString();
  }
}

代码示例来源:origin: org.xcmis/xcmis-restatom

/**
* {@inheritDoc}
*/
@Override
protected Feed createFeedBase(RequestContext request) throws ResponseContextException
{
 Factory factory = request.getAbdera().getFactory();
 Feed feed = factory.newFeed();
 feed.setId(getId(request));
 feed.setTitle(getTitle(request));
 feed.addAuthor(getAuthor(request));
 // Updated is incorrect when pass Date.
 // Abdera uses Calendar.getInstance(TimeZone.getTimeZone("GMT"))
 // See org.apache.abdera.model.AtomDate .
 feed.setUpdated(AtomUtils.getAtomDate(Calendar.getInstance()));
 feed.addLink(getServiceLink(request), "service", "application/atomsvc+xml", null, null, -1);
 return feed;
}

代码示例来源:origin: org.xcmis/xcmis-restatom

/**
* {@inheritDoc}
*/
@Override
protected Feed createFeedBase(RequestContext request) throws ResponseContextException
{
 Factory factory = request.getAbdera().getFactory();
 Feed feed = factory.newFeed();
 feed.setId(getId(request));
 feed.setTitle(getTitle(request));
 feed.addAuthor(getAuthor(request));
 // Updated is incorrect when pass Date.
 // Abdera uses Calendar.getInstance(TimeZone.getTimeZone("GMT"))
 // See org.apache.abdera.model.AtomDate .
 feed.setUpdated(AtomUtils.getAtomDate(Calendar.getInstance()));
 feed.addLink(getServiceLink(request), "service", "application/atomsvc+xml", null, null, -1);
 return feed;
}

代码示例来源:origin: org.xcmis/xcmis-restatom

/**
* {@inheritDoc}
*/
@Override
protected Feed createFeedBase(RequestContext request) throws ResponseContextException
{
 Factory factory = request.getAbdera().getFactory();
 Feed feed = factory.newFeed();
 feed.setId(getId(request));
 feed.setTitle(getTitle(request));
 feed.addAuthor(getAuthor(request));
 // Updated is incorrect when pass Date.
 // Abdera uses Calendar.getInstance(TimeZone.getTimeZone("GMT"))
 // See org.apache.abdera.model.AtomDate .
 feed.setUpdated(AtomUtils.getAtomDate(Calendar.getInstance()));
 feed.addLink(getServiceLink(request), "service", "application/atomsvc+xml", null, null, -1);
 return feed;
}

代码示例来源:origin: org.uberfire/uberfire-social-activities-backend

public static String generate(List<SocialActivitiesEvent> eventTimeline,
                 String type) {
    Abdera abdera = new Abdera();
    Feed feed = abdera.newFeed();

    feed.setId("tag:org.uberfire,2014:/" + type);
    feed.setTitle("Social Activities Feed");
    feed.setUpdated(new Date());
    feed.addAuthor("Red Hat JBoss");

    for (SocialActivitiesEvent event : eventTimeline) {
      Entry entry = feed.addEntry();
      entry.setTitle(event.getType());
      entry.setSummary(event.getSocialUser().getUserName() + "  " + event.toString());
      entry.setUpdated(event.getTimestamp());
      entry.setPublished(event.getTimestamp());
    }
    return feed.toString();
  }
}

代码示例来源:origin: kiegroup/appformer

public static String generate(List<SocialActivitiesEvent> eventTimeline,
                 String type) {
    Abdera abdera = new Abdera();
    Feed feed = abdera.newFeed();

    feed.setId("tag:org.uberfire,2014:/" + type);
    feed.setTitle("Social Activities Feed");
    feed.setUpdated(new Date());
    feed.addAuthor("Red Hat JBoss");

    for (SocialActivitiesEvent event : eventTimeline) {
      Entry entry = feed.addEntry();
      entry.setTitle(event.getType());
      entry.setSummary(event.getSocialUser().getUserName() + "  " + event.toString());
      entry.setUpdated(event.getTimestamp());
      entry.setPublished(event.getTimestamp());
    }
    return feed.toString();
  }
}

代码示例来源:origin: org.apache.abdera/abdera-filesystem

public ResponseContext getFeed(RequestContext request) {
  Feed feed = abdera.newFeed();
  feed.setId(config.getServerConfiguration().getServerUri() + "/" + config.getFeedId());
  feed.setTitle(config.getFeedTitle());
  feed.addAuthor(config.getFeedAuthor());
  feed.addLink(config.getFeedUri());
  feed.addLink(config.getFeedUri(), "self");
  feed.setUpdated(new Date());
  getEntries(request, feed, root);
  return ProviderHelper.returnBase(feed.getDocument(), 200, null);
}

代码示例来源:origin: net.sf.taverna.t2.activities/interaction-activity

@Override
public ResponseContext getFeed(final RequestContext request) {
  final Feed feed = this.abdera.newFeed();
  feed.setId(this.config.getServerConfiguration().getServerUri() + "/"
      + this.config.getFeedId());
  feed.setTitle(this.config.getFeedTitle());
  feed.addAuthor(this.config.getFeedAuthor());
  feed.addLink(this.config.getFeedUri());
  feed.addLink(this.config.getFeedUri(), "self");
  feed.setUpdated(new Date());
  this.getEntries(request, feed, this.root);
  return ProviderHelper.returnBase(feed.getDocument(), 200, null);
}

代码示例来源:origin: org.fcrepo/fcrepo-server

private void addObjectProperties(DigitalObject obj, Feed feed) throws ObjectIntegrityException {
  String state = DOTranslationUtility.getStateAttribute(obj);
  String ownerId = obj.getOwnerId();
  String label = obj.getLabel();
  Date cdate = obj.getCreateDate();
  Date mdate = obj.getLastModDate();
  feed.setId(PID.toURI(obj.getPid()));
  feed.setTitle(label == null ? "" : label);
  feed.setUpdated(mdate);
  feed.addAuthor(ownerId == null ? "" : StreamUtility.enc(ownerId));
  feed.addCategory(MODEL.STATE.uri, state, null);
  if (cdate != null) {
    feed.addCategory(MODEL.CREATED_DATE.uri, DateUtility
        .convertDateToString(cdate), null);
  }
  // TODO not sure I'm satisfied with this representation of extProperties
  for (String extProp : obj.getExtProperties().keySet()) {
    feed.addCategory(MODEL.EXT_PROPERTY.uri, extProp, obj
        .getExtProperty(extProp));
  }
}

相关文章