Revision 6639
Added by ben leinfelder over 12 years ago
CNResourceHandler.java | ||
---|---|---|
77 | 77 |
import org.xml.sax.SAXException; |
78 | 78 |
|
79 | 79 |
import edu.ucsb.nceas.metacat.dataone.CNodeService; |
80 |
import edu.ucsb.nceas.metacat.properties.PropertyService; |
|
81 |
import edu.ucsb.nceas.utilities.PropertyNotFoundException; |
|
80 | 82 |
|
81 | 83 |
/** |
82 | 84 |
* CN REST service implementation handler |
... | ... | |
602 | 604 |
response.setStatus(200); |
603 | 605 |
response.setContentType("text/xml"); |
604 | 606 |
|
605 |
TypeMarshaller.marshalTypeToOutputStream(objectFormatList, out); |
|
607 |
// style the object with a processing directive |
|
608 |
String stylesheet = null; |
|
609 |
try { |
|
610 |
stylesheet = PropertyService.getProperty("dataone.types.xsl"); |
|
611 |
} catch (PropertyNotFoundException e) { |
|
612 |
logMetacat.warn("Could not locate DataONE types XSLT: " + e.getMessage()); |
|
613 |
} |
|
614 |
|
|
615 |
TypeMarshaller.marshalTypeToOutputStream(objectFormatList, out, stylesheet); |
|
606 | 616 |
|
607 | 617 |
} |
608 | 618 |
|
... | ... | |
952 | 962 |
OutputStream out = response.getOutputStream(); |
953 | 963 |
response.setStatus(200); |
954 | 964 |
response.setContentType("text/xml"); |
965 |
|
|
966 |
// style the object with a processing directive |
|
967 |
String stylesheet = null; |
|
968 |
try { |
|
969 |
stylesheet = PropertyService.getProperty("dataone.types.xsl"); |
|
970 |
} catch (PropertyNotFoundException e) { |
|
971 |
logMetacat.warn("Could not locate DataONE types XSLT: " + e.getMessage()); |
|
972 |
} |
|
973 |
|
|
955 | 974 |
// Serialize and write it to the output stream |
956 |
TypeMarshaller.marshalTypeToOutputStream(ol, out); |
|
975 |
TypeMarshaller.marshalTypeToOutputStream(ol, out, stylesheet);
|
|
957 | 976 |
} |
958 | 977 |
|
959 | 978 |
/** |
Also available in: Unified diff
lookup stylesheet from metacat.properties for CN list objects and list formats. This is used in conjunction with the CN rest service deployment where the xslt is actually kept.