Ignore:
Timestamp:
2012-09-11T16:22:31+12:00 (12 years ago)
Author:
ak19
Message:

Uncommitted changes from ages back to fedoraGS3 classes to get greenstone to work as an interface to fedora repository backend.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • other-projects/gs3-webservices-java-client/trunk/src/GS3Fedora/org/greenstone/fedora/services/FedoraConnection.java

    r22368 r26171  
    984984    }
    985985   
     986
     987    /** Used to obtain the dc:title value (hashID) of the DC stream of a digital
     988     * object whose fedoraID is of a special sort: greenstone-http:<colname>-id. */
     989    protected String getDCTitle(String fedoraPID)
     990    throws RemoteException, UnsupportedEncodingException,
     991            SAXException, IOException
     992    {
     993    String title = "";
     994    MIMETypedStream dcdata = APIA.getDatastreamDissemination(fedoraPID, DC, null);
     995    if(dcdata == null || dcdata.equals("")) {
     996        return title;
     997    }
     998    String dcStream = new String(dcdata.getStream(), UTF8);
     999   
     1000    InputSource source = new InputSource(new StringReader(dcStream));
     1001    Document doc = builder.parse(source);
     1002    Element docEl = doc.getDocumentElement(); // docEl=<oai_dc:dc></oai_dc:dc>
     1003    NodeList children = docEl.getElementsByTagName("dc:title");
     1004    if(children != null && children.getLength() > 0) {
     1005        Node n = children.item(0); // <dc:title>
     1006        Element e = (Element)n;
     1007        title = FedoraCommons.getValue(e);
     1008    }
     1009    return title;
     1010    }
     1011
    9861012    /** @return the title metadata for the given document sections.
    9871013     * These titles are returned in the same order as the given docPIDs
Note: See TracChangeset for help on using the changeset viewer.