Ejemplo n.º 1
0
  private void addDCDatastream(DigitalObjectDocument.DigitalObject dobj) {
    DatastreamType ds = dobj.addNewDatastream();
    ds.setID("DC");
    ds.setCONTROLGROUP(DatastreamType.CONTROLGROUP.X);
    ds.setSTATE(StateType.A);

    DatastreamVersionType dsv = ds.addNewDatastreamVersion();
    dsv.setID("DC.0");
    dsv.setFORMATURI("http://www.openarchives.org/OAI/2.0/oai_dc/");
    dsv.setMIMETYPE("text/xml");
    dsv.setLABEL("Dublin Core Record for this object");

    XmlContentType content = dsv.addNewXmlContent();
    DcDocument dcDocument = getDcDocument();
    content.set(dcDocument);
  }
Ejemplo n.º 2
0
  private void addRELSEXTDatastream(DigitalObjectDocument.DigitalObject dobj) {
    DatastreamType datastream = dobj.addNewDatastream();
    datastream.setID("RELS-EXT");
    datastream.setSTATE(StateType.A);
    datastream.setCONTROLGROUP(DatastreamType.CONTROLGROUP.X);

    DatastreamVersionType version = datastream.addNewDatastreamVersion();
    version.setID("RELS-EXT.0");
    version.setMIMETYPE("application/rdf+xml");
    version.setFORMATURI("info:fedora/fedora-system:FedoraRELSExt-1.0");
    version.setLABEL("RDF Statements about this object");

    XmlContentType content = version.addNewXmlContent();
    RDFDocument rdfDocument = getRDFDescription();
    content.set(rdfDocument);
  }
Ejemplo n.º 3
0
  private void addQucosaXMLContentDatastream(DigitalObjectDocument.DigitalObject dobj)
      throws ParserConfigurationException {
    DatastreamType ds = dobj.addNewDatastream();
    ds.setID("QUCOSA-XML");
    ds.setCONTROLGROUP(DatastreamType.CONTROLGROUP.X);
    ds.setSTATE(StateType.A);

    DatastreamVersionType dsv = ds.addNewDatastreamVersion();
    dsv.setID("QUCOSA-XML.0");
    dsv.setMIMETYPE("text/xml");
    dsv.setLABEL("Qucosa XML Record for this Object (Opus4-XMLv2)");

    XmlContentType content = dsv.addNewXmlContent();

    // Workaround for https://issues.apache.org/jira/browse/XMLBEANS-100
    // XMLBeans does not work with jdk1.6 as calls made to methods within XObj.java
    // return with a runtime: "java.lang.RuntimeException: DOM Level 3 Not implemented"
    Node childNode =
        content
            .getDomNode()
            .getOwnerDocument()
            .importNode(qucosaXmlDocument.getDocumentElement(), true);
    content.getDomNode().appendChild(childNode);
  }