NIHVIVO-3729 Remove redundant parameter from FreemarkerConfigurationLoader.getConfig()

This commit is contained in:
j2blake 2012-04-20 17:42:57 +00:00
parent ac873fe238
commit e3d2a8fb47
5 changed files with 6 additions and 8 deletions

View file

@ -6,7 +6,6 @@ import java.io.IOException;
import java.io.PrintWriter;
import java.util.Map;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
@ -75,7 +74,7 @@ public abstract class VitroAjaxController extends HttpServlet {
* its data through a template.
*/
protected final Configuration getFreemarkerConfiguration(VitroRequest vreq) {
return FreemarkerConfigurationLoader.getConfig(vreq, getServletContext());
return FreemarkerConfigurationLoader.getConfig(vreq);
}
/**

View file

@ -19,10 +19,9 @@ public class FreemarkerConfigurationLoader {
private static final Map<String, FreemarkerConfiguration> themeToConfigMap = new HashMap<String, FreemarkerConfiguration>();
public static FreemarkerConfiguration getConfig(VitroRequest vreq,
ServletContext context) {
public static FreemarkerConfiguration getConfig(VitroRequest vreq) {
String themeDir = getThemeDir(vreq.getAppBean());
return getConfigForTheme(themeDir, vreq.getAppBean(), context);
return getConfigForTheme(themeDir, vreq.getAppBean(), vreq.getSession().getServletContext());
}
private static String getThemeDir(ApplicationBean appBean) {

View file

@ -197,7 +197,7 @@ public class FreemarkerHttpServlet extends VitroHttpServlet {
}
protected FreemarkerConfiguration getConfig(VitroRequest vreq) {
return FreemarkerConfigurationLoader.getConfig(vreq, getServletContext());
return FreemarkerConfigurationLoader.getConfig(vreq);
}
/**

View file

@ -257,7 +257,7 @@ public class EditConfigurationUtils {
//Generate HTML for a specific field name given
public static String generateHTMLForElement(VitroRequest vreq, String fieldName, EditConfigurationVTwo editConfig) {
String html = "";
Configuration fmConfig = FreemarkerConfigurationLoader.getConfig(vreq, vreq.getSession().getServletContext());
Configuration fmConfig = FreemarkerConfigurationLoader.getConfig(vreq);
FieldVTwo field = editConfig == null ? null : editConfig.getField(fieldName);
MultiValueEditSubmission editSub = EditSubmissionUtils.getEditSubmissionFromSession(vreq.getSession(), editConfig);

View file

@ -406,7 +406,7 @@ public class InputElementFormattingTag extends TagSupport {
}
//get freemarker Configuration
Configuration fmConfig = FreemarkerConfigurationLoader.getConfig(vreq, pageContext.getServletContext());
Configuration fmConfig = FreemarkerConfigurationLoader.getConfig(vreq);
/* populate the pieces */
String classStr = doClass();