Skip to content

Commit

Permalink
get mime type frow views when not set otherwise
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelwechner committed Jan 30, 2016
1 parent ddd2349 commit 4ae9eab
Showing 1 changed file with 9 additions and 2 deletions.
Expand Up @@ -319,10 +319,12 @@ private StreamSource getXSLTStreamSource() throws Exception {
}

/**
* Get mime type
* @see org.wyona.yanel.impl.resources.BasicXMLResource#getMimeType(String)
*/
@Override
public String getMimeType(String viewId) throws Exception {
String mimeType = null;

ResourceConfiguration rc = getConfiguration();
if (rc != null) {
mimeType = rc.getProperty("mime-type");
Expand All @@ -331,8 +333,13 @@ public String getMimeType(String viewId) throws Exception {
}
if (mimeType != null) return mimeType;

mimeType = super.getMimeType(viewId);
if (mimeType != null) return mimeType;

// NOTE: Assuming fallback re default_dir2xhtml.xsl ...
return "application/xhtml+xml";
mimeType = "application/xhtml+xml";
log.warn("No content type configured, hence fallback to '" + mimeType + "' ...");
return mimeType;
}

/**
Expand Down

0 comments on commit 4ae9eab

Please sign in to comment.