private Map<String, String> getRequestedRawDataMimeTypes(Collection<String> rawResults, Name name,
ProcessFactory pf) {
Map<String, String> result = new HashMap<String, String>();
ResponseFormType form = request.getResponseForm();
OutputDefinitionType raw = form.getRawDataOutput();
ResponseDocumentType document = form.getResponseDocument();
if (form == null || (raw == null && document == null)) {
// all outputs using their default mime
for (String rawResult : rawResults) {
String mime = AbstractRawData.getDefaultMime(name, pf, rawResult);
result.put(rawResult, mime);
}
} else if (raw != null) {
// just one output type
String output = raw.getIdentifier().getValue();
String mime;
if (raw.getMimeType() != null) {
mime = raw.getMimeType();
} else {
mime = AbstractRawData.getDefaultMime(name, pf, output);
}
result.put(output, mime);
} else {
// the response document form
for (Iterator it = document.getOutput().iterator(); it.hasNext();) {
OutputDefinitionType out = (OutputDefinitionType) it.next();
String outputName = out.getIdentifier().getValue();
if(rawResults.contains(outputName)) {
// was the output mime specified?
String mime = out.getMimeType();