NIHVIVO-3729 Remove redundant parameter from FreemarkerConfigurationLoader.getConfig()
This commit is contained in:
parent
ac873fe238
commit
e3d2a8fb47
5 changed files with 6 additions and 8 deletions
|
@ -6,7 +6,6 @@ import java.io.IOException;
|
||||||
import java.io.PrintWriter;
|
import java.io.PrintWriter;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import javax.servlet.ServletContext;
|
|
||||||
import javax.servlet.ServletException;
|
import javax.servlet.ServletException;
|
||||||
import javax.servlet.http.HttpServlet;
|
import javax.servlet.http.HttpServlet;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
@ -75,7 +74,7 @@ public abstract class VitroAjaxController extends HttpServlet {
|
||||||
* its data through a template.
|
* its data through a template.
|
||||||
*/
|
*/
|
||||||
protected final Configuration getFreemarkerConfiguration(VitroRequest vreq) {
|
protected final Configuration getFreemarkerConfiguration(VitroRequest vreq) {
|
||||||
return FreemarkerConfigurationLoader.getConfig(vreq, getServletContext());
|
return FreemarkerConfigurationLoader.getConfig(vreq);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -19,10 +19,9 @@ public class FreemarkerConfigurationLoader {
|
||||||
|
|
||||||
private static final Map<String, FreemarkerConfiguration> themeToConfigMap = new HashMap<String, FreemarkerConfiguration>();
|
private static final Map<String, FreemarkerConfiguration> themeToConfigMap = new HashMap<String, FreemarkerConfiguration>();
|
||||||
|
|
||||||
public static FreemarkerConfiguration getConfig(VitroRequest vreq,
|
public static FreemarkerConfiguration getConfig(VitroRequest vreq) {
|
||||||
ServletContext context) {
|
|
||||||
String themeDir = getThemeDir(vreq.getAppBean());
|
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) {
|
private static String getThemeDir(ApplicationBean appBean) {
|
||||||
|
|
|
@ -197,7 +197,7 @@ public class FreemarkerHttpServlet extends VitroHttpServlet {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected FreemarkerConfiguration getConfig(VitroRequest vreq) {
|
protected FreemarkerConfiguration getConfig(VitroRequest vreq) {
|
||||||
return FreemarkerConfigurationLoader.getConfig(vreq, getServletContext());
|
return FreemarkerConfigurationLoader.getConfig(vreq);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -257,7 +257,7 @@ public class EditConfigurationUtils {
|
||||||
//Generate HTML for a specific field name given
|
//Generate HTML for a specific field name given
|
||||||
public static String generateHTMLForElement(VitroRequest vreq, String fieldName, EditConfigurationVTwo editConfig) {
|
public static String generateHTMLForElement(VitroRequest vreq, String fieldName, EditConfigurationVTwo editConfig) {
|
||||||
String html = "";
|
String html = "";
|
||||||
Configuration fmConfig = FreemarkerConfigurationLoader.getConfig(vreq, vreq.getSession().getServletContext());
|
Configuration fmConfig = FreemarkerConfigurationLoader.getConfig(vreq);
|
||||||
|
|
||||||
FieldVTwo field = editConfig == null ? null : editConfig.getField(fieldName);
|
FieldVTwo field = editConfig == null ? null : editConfig.getField(fieldName);
|
||||||
MultiValueEditSubmission editSub = EditSubmissionUtils.getEditSubmissionFromSession(vreq.getSession(), editConfig);
|
MultiValueEditSubmission editSub = EditSubmissionUtils.getEditSubmissionFromSession(vreq.getSession(), editConfig);
|
||||||
|
|
|
@ -406,7 +406,7 @@ public class InputElementFormattingTag extends TagSupport {
|
||||||
}
|
}
|
||||||
|
|
||||||
//get freemarker Configuration
|
//get freemarker Configuration
|
||||||
Configuration fmConfig = FreemarkerConfigurationLoader.getConfig(vreq, pageContext.getServletContext());
|
Configuration fmConfig = FreemarkerConfigurationLoader.getConfig(vreq);
|
||||||
|
|
||||||
/* populate the pieces */
|
/* populate the pieces */
|
||||||
String classStr = doClass();
|
String classStr = doClass();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue