Ejemplo n.º 1
0
  private Foxml11Document createFoxmlObject(String spid, String contentLocation) throws Exception {
    PID pid = PID.getInstance(spid);
    Date date = new Date(1);

    Foxml11Document doc = new Foxml11Document(pid.toString());
    doc.addObjectProperty(Property.STATE, "A");

    if (contentLocation != null && contentLocation.length() > 0) {
      String ds = "DS";
      String dsv = "DS1.0";
      doc.addDatastream(ds, State.A, ControlGroup.M, true);
      doc.addDatastreamVersion(ds, dsv, "text/plain", "label", 1, date);
      doc.setContentLocation(
          dsv, contentLocation, org.fcrepo.server.storage.types.Datastream.DS_LOCATION_TYPE_URL);
    }
    return doc;
  }
Ejemplo n.º 2
0
 private String subjectAsURI(String subj) {
   // already a uri?
   if (subj.startsWith(Constants.FEDORA.uri)) {
     return subj;
   }
   // no, convert to uri
   return PID.toURI(subj);
 }
Ejemplo n.º 3
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;
  }