import com.agiletec.plugins.jpsurvey.aps.system.services.survey.model.SurveyRecord;
public class LoadSurveyTag extends TagSupport {
public int doStartTag() throws JspException {
ISurveyManager surveyManager = (ISurveyManager) ApsWebApplicationUtils.getBean(SurveySystemConstants.SURVEY_MANAGER, pageContext);
ILangManager langManager = (ILangManager) ApsWebApplicationUtils.getBean(SystemConstants.LANGUAGE_MANAGER,pageContext);
IResourceManager resourceManager = (IResourceManager) ApsWebApplicationUtils.getBean(JacmsSystemConstants.RESOURCE_MANAGER, this.pageContext);
SurveyRecord survey = null;
try {
String defaultLang = langManager.getDefaultLang().getCode();
survey = surveyManager.loadSurvey(this.getSurveyId());
if (this._preferredLang == null) {
this._preferredLang = defaultLang;
}
this.pageContext.setAttribute(this.getCtxName(), survey);
// fetch image