Changeset 26171 for other-projects/gs3-webservices-java-client/trunk/src/GS3Fedora/org/greenstone/fedora/services/FedoraConnection.java
- Timestamp:
- 2012-09-11T16:22:31+12:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
other-projects/gs3-webservices-java-client/trunk/src/GS3Fedora/org/greenstone/fedora/services/FedoraConnection.java
r22368 r26171 984 984 } 985 985 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 986 1012 /** @return the title metadata for the given document sections. 987 1013 * These titles are returned in the same order as the given docPIDs
Note:
See TracChangeset
for help on using the changeset viewer.