Ejemplo n.º 1
0
  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"));
    }
  }
Ejemplo n.º 2
0
  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;
  }