package org.apache.jsp.templates;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import java.util.*;
import java.net.*;
import org.ofbiz.security.*;
import org.ofbiz.entity.*;
import org.ofbiz.base.util.*;
import org.ofbiz.webapp.pseudotag.*;
import org.ofbiz.webapp.control.*;
import org.ofbiz.base.util.collections.*;
import org.ofbiz.securityext.login.*;
import org.ofbiz.common.*;

public final class main_005ftemplate_jsp extends org.apache.jasper.runtime.HttpJspBase
    implements org.apache.jasper.runtime.JspSourceDependent {

  private static java.util.Vector _jspx_dependants;

  static {
    _jspx_dependants = new java.util.Vector(3);
    _jspx_dependants.add("/includes/envsetup.jsp");
    _jspx_dependants.add("/WEB-INF/ofbiz.tld");
    _jspx_dependants.add("/WEB-INF/regions.tld");
  }

  private org.apache.jasper.runtime.TagHandlerPool _jspx_tagPool_region_render_section_nobody;

  public java.util.List getDependants() {
    return _jspx_dependants;
  }

  public void _jspInit() {
    _jspx_tagPool_region_render_section_nobody = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
  }

  public void _jspDestroy() {
    _jspx_tagPool_region_render_section_nobody.release();
  }

  public void _jspService(HttpServletRequest request, HttpServletResponse response)
        throws java.io.IOException, ServletException {

    JspFactory _jspxFactory = null;
    PageContext pageContext = null;
    HttpSession session = null;
    ServletContext application = null;
    ServletConfig config = null;
    JspWriter out = null;
    Object page = this;
    JspWriter _jspx_out = null;
    PageContext _jspx_page_context = null;


    try {
      _jspxFactory = JspFactory.getDefaultFactory();
      response.setContentType("text/html");
      response.addHeader("X-Powered-By", "JSP/2.0");
      pageContext = _jspxFactory.getPageContext(this, request, response,
      			null, true, 8192, true);
      _jspx_page_context = pageContext;
      application = pageContext.getServletContext();
      config = pageContext.getServletConfig();
      session = pageContext.getSession();
      out = pageContext.getOut();
      _jspx_out = out;

      out.write("<!doctype HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n");
      out.write("\n");
      out.write("\n");
      out.write("\n");
      out.write("\n");
      out.write("\n");
      out.write("\n");
      org.ofbiz.security.Security security = null;
      synchronized (request) {
        security = (org.ofbiz.security.Security) _jspx_page_context.getAttribute("security", PageContext.REQUEST_SCOPE);
        if (security == null){
          throw new java.lang.InstantiationException("bean security not found within scope");
        }
      }
      out.write('\n');
      org.ofbiz.entity.GenericDelegator delegator = null;
      synchronized (request) {
        delegator = (org.ofbiz.entity.GenericDelegator) _jspx_page_context.getAttribute("delegator", PageContext.REQUEST_SCOPE);
        if (delegator == null){
          throw new java.lang.InstantiationException("bean delegator not found within scope");
        }
      }
      out.write('\n');

    GenericValue userLogin = (GenericValue) session.getAttribute("userLogin");
    if (userLogin != null) request.setAttribute("userLogin", userLogin);

    GenericValue person = (GenericValue) session.getAttribute("_PERSON_");
    if (person == null) {
        person = userLogin == null ? null : userLogin.getRelatedOne("Person");
        if (person != null) session.setAttribute("_PERSON_", person);
    }
    if (person != null) request.setAttribute("person", person);

    String controlPath = (String) request.getAttribute("_CONTROL_PATH_");
    String contextRoot = (String) request.getAttribute("_CONTEXT_ROOT_");
    String serverRoot = (String) request.getAttribute("_SERVER_ROOT_URL_");

    /* reading of the localization information */
    List availableLocales = UtilMisc.availableLocales();
    request.setAttribute("availableLocales",availableLocales);

    Locale locale = UtilHttp.getLocale(request);
    request.setAttribute("locale",locale);
    ResourceBundleMapWrapper uiLabelMap = (ResourceBundleMapWrapper) UtilProperties.getResourceBundleMap("WebtoolsUiLabels", locale);
    uiLabelMap.addBottomResourceBundle("CommonUiLabels");
    request.setAttribute("uiLabelMap", uiLabelMap);

    Map layoutSettings = new HashMap();
    request.setAttribute("layoutSettings", layoutSettings);
    
    layoutSettings.put("companyName", "OFBiz: Core Web Tools");
    layoutSettings.put("companySubtitle", "Part of the Open For Business Family of Open Source Software");
    layoutSettings.put("headerImageUrl", "/images/ofbiz_logo.jpg");
    layoutSettings.put("headerMiddleBackgroundUrl", null);
    layoutSettings.put("headerRightBackgroundUrl", null);
    
    request.setAttribute("checkLoginUrl", LoginWorker.makeLoginUrl(request, "checkLogin"));
    
    String externalLoginKey = LoginWorker.getExternalLoginKey(request);
    String externalKeyParam = externalLoginKey == null ? "" : "&externalLoginKey=" + externalLoginKey;
    request.setAttribute("externalKeyParam", externalKeyParam);
    request.setAttribute("externalLoginKey", externalLoginKey);

    List eventMessageList = (List) request.getAttribute("eventMessageList");
    if (eventMessageList == null) eventMessageList = new LinkedList();
    List errorMessageList = (List) request.getAttribute("errorMessageList");
    if (errorMessageList == null) errorMessageList = new LinkedList();

    if (request.getAttribute("_EVENT_MESSAGE_") != null) {
        eventMessageList.add(UtilFormatOut.replaceString((String) request.getAttribute("_EVENT_MESSAGE_"), "\n", "<br/>"));
        request.removeAttribute("_EVENT_MESSAGE_");
    }
    if (request.getAttribute("_EVENT_MESSAGE_LIST_") != null) {
        eventMessageList.addAll((List) request.getAttribute("_EVENT_MESSAGE_LIST_"));
        request.removeAttribute("_EVENT_MESSAGE_LIST_");
    }
    if (request.getAttribute("_ERROR_MESSAGE_") != null) {
        errorMessageList.add(UtilFormatOut.replaceString((String) request.getAttribute("_ERROR_MESSAGE_"), "\n", "<br/>"));
        request.removeAttribute("_ERROR_MESSAGE_");
    }
    if (session.getAttribute("_ERROR_MESSAGE_") != null) {
        errorMessageList.add(UtilFormatOut.replaceString((String) session.getAttribute("_ERROR_MESSAGE_"), "\n", "<br/>"));
        session.removeAttribute("_ERROR_MESSAGE_");
    }
    if (request.getAttribute("_ERROR_MESSAGE_LIST_") != null) {
        errorMessageList.addAll((List) request.getAttribute("_ERROR_MESSAGE_LIST_"));
        request.removeAttribute("_ERROR_MESSAGE_LIST_");
    }
    request.setAttribute("eventMessageList", eventMessageList);
    request.setAttribute("errorMessageList", errorMessageList);

      out.write('\n');
      out.write("\n");
      out.write("\n");
      out.write("\n");
      out.write("\n");
      if (_jspx_meth_region_render_0(_jspx_page_context))
        return;
      out.write('\n');
      if (_jspx_meth_region_render_1(_jspx_page_context))
        return;
      out.write("\n");
      out.write("\n");
      out.write("<div class=\"centerarea\">\n");
      out.write("  ");
      if (_jspx_meth_region_render_2(_jspx_page_context))
        return;
      out.write("\n");
      out.write("  <div class=\"contentarea\">\n");
      out.write("    <div style='border: 0; margin: 0; padding: 0; width: 100%;'>\n");
      out.write("      <table style='border: 0; margin: 0; padding: 0; width: 100%;' cellpadding='0' cellspacing='0'>\n");
      out.write("        <tr>\n");
      out.write("          ");
      if (_jspx_meth_region_render_3(_jspx_page_context))
        return;
      out.write("\n");
      out.write("          <td width='100%' valign='top' align='left'>\n");
      out.write("            ");
      if (_jspx_meth_region_render_4(_jspx_page_context))
        return;
      out.write("\n");
      out.write("            ");
      if (_jspx_meth_region_render_5(_jspx_page_context))
        return;
      out.write("\n");
      out.write("          </td>\n");
      out.write("          ");
      if (_jspx_meth_region_render_6(_jspx_page_context))
        return;
      out.write("\n");
      out.write("        </tr>\n");
      out.write("      </table>       \n");
      out.write("    </div>\n");
      out.write("    <div class='spacer'></div>\n");
      out.write("  </div>\n");
      out.write("</div>\n");
      out.write("\n");
      if (_jspx_meth_region_render_7(_jspx_page_context))
        return;
      out.write('\n');
      out.write('\n');
    } catch (Throwable t) {
      if (!(t instanceof SkipPageException)){
        out = _jspx_out;
        if (out != null && out.getBufferSize() != 0)
          out.clearBuffer();
        if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
      }
    } finally {
      if (_jspxFactory != null) _jspxFactory.releasePageContext(_jspx_page_context);
    }
  }

  private boolean _jspx_meth_region_render_0(PageContext _jspx_page_context)
          throws Throwable {
    PageContext pageContext = _jspx_page_context;
    JspWriter out = _jspx_page_context.getOut();
    //  region:render
    org.ofbiz.webapp.region.RenderTag _jspx_th_region_render_0 = (org.ofbiz.webapp.region.RenderTag) _jspx_tagPool_region_render_section_nobody.get(org.ofbiz.webapp.region.RenderTag.class);
    _jspx_th_region_render_0.setPageContext(_jspx_page_context);
    _jspx_th_region_render_0.setParent(null);
    _jspx_th_region_render_0.setSection("header");
    int _jspx_eval_region_render_0 = _jspx_th_region_render_0.doStartTag();
    if (_jspx_th_region_render_0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE)
      return true;
    _jspx_tagPool_region_render_section_nobody.reuse(_jspx_th_region_render_0);
    return false;
  }

  private boolean _jspx_meth_region_render_1(PageContext _jspx_page_context)
          throws Throwable {
    PageContext pageContext = _jspx_page_context;
    JspWriter out = _jspx_page_context.getOut();
    //  region:render
    org.ofbiz.webapp.region.RenderTag _jspx_th_region_render_1 = (org.ofbiz.webapp.region.RenderTag) _jspx_tagPool_region_render_section_nobody.get(org.ofbiz.webapp.region.RenderTag.class);
    _jspx_th_region_render_1.setPageContext(_jspx_page_context);
    _jspx_th_region_render_1.setParent(null);
    _jspx_th_region_render_1.setSection("appbar");
    int _jspx_eval_region_render_1 = _jspx_th_region_render_1.doStartTag();
    if (_jspx_th_region_render_1.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE)
      return true;
    _jspx_tagPool_region_render_section_nobody.reuse(_jspx_th_region_render_1);
    return false;
  }

  private boolean _jspx_meth_region_render_2(PageContext _jspx_page_context)
          throws Throwable {
    PageContext pageContext = _jspx_page_context;
    JspWriter out = _jspx_page_context.getOut();
    //  region:render
    org.ofbiz.webapp.region.RenderTag _jspx_th_region_render_2 = (org.ofbiz.webapp.region.RenderTag) _jspx_tagPool_region_render_section_nobody.get(org.ofbiz.webapp.region.RenderTag.class);
    _jspx_th_region_render_2.setPageContext(_jspx_page_context);
    _jspx_th_region_render_2.setParent(null);
    _jspx_th_region_render_2.setSection("appheader");
    int _jspx_eval_region_render_2 = _jspx_th_region_render_2.doStartTag();
    if (_jspx_th_region_render_2.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE)
      return true;
    _jspx_tagPool_region_render_section_nobody.reuse(_jspx_th_region_render_2);
    return false;
  }

  private boolean _jspx_meth_region_render_3(PageContext _jspx_page_context)
          throws Throwable {
    PageContext pageContext = _jspx_page_context;
    JspWriter out = _jspx_page_context.getOut();
    //  region:render
    org.ofbiz.webapp.region.RenderTag _jspx_th_region_render_3 = (org.ofbiz.webapp.region.RenderTag) _jspx_tagPool_region_render_section_nobody.get(org.ofbiz.webapp.region.RenderTag.class);
    _jspx_th_region_render_3.setPageContext(_jspx_page_context);
    _jspx_th_region_render_3.setParent(null);
    _jspx_th_region_render_3.setSection("leftbar");
    int _jspx_eval_region_render_3 = _jspx_th_region_render_3.doStartTag();
    if (_jspx_th_region_render_3.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE)
      return true;
    _jspx_tagPool_region_render_section_nobody.reuse(_jspx_th_region_render_3);
    return false;
  }

  private boolean _jspx_meth_region_render_4(PageContext _jspx_page_context)
          throws Throwable {
    PageContext pageContext = _jspx_page_context;
    JspWriter out = _jspx_page_context.getOut();
    //  region:render
    org.ofbiz.webapp.region.RenderTag _jspx_th_region_render_4 = (org.ofbiz.webapp.region.RenderTag) _jspx_tagPool_region_render_section_nobody.get(org.ofbiz.webapp.region.RenderTag.class);
    _jspx_th_region_render_4.setPageContext(_jspx_page_context);
    _jspx_th_region_render_4.setParent(null);
    _jspx_th_region_render_4.setSection("error");
    int _jspx_eval_region_render_4 = _jspx_th_region_render_4.doStartTag();
    if (_jspx_th_region_render_4.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE)
      return true;
    _jspx_tagPool_region_render_section_nobody.reuse(_jspx_th_region_render_4);
    return false;
  }

  private boolean _jspx_meth_region_render_5(PageContext _jspx_page_context)
          throws Throwable {
    PageContext pageContext = _jspx_page_context;
    JspWriter out = _jspx_page_context.getOut();
    //  region:render
    org.ofbiz.webapp.region.RenderTag _jspx_th_region_render_5 = (org.ofbiz.webapp.region.RenderTag) _jspx_tagPool_region_render_section_nobody.get(org.ofbiz.webapp.region.RenderTag.class);
    _jspx_th_region_render_5.setPageContext(_jspx_page_context);
    _jspx_th_region_render_5.setParent(null);
    _jspx_th_region_render_5.setSection("content");
    int _jspx_eval_region_render_5 = _jspx_th_region_render_5.doStartTag();
    if (_jspx_th_region_render_5.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE)
      return true;
    _jspx_tagPool_region_render_section_nobody.reuse(_jspx_th_region_render_5);
    return false;
  }

  private boolean _jspx_meth_region_render_6(PageContext _jspx_page_context)
          throws Throwable {
    PageContext pageContext = _jspx_page_context;
    JspWriter out = _jspx_page_context.getOut();
    //  region:render
    org.ofbiz.webapp.region.RenderTag _jspx_th_region_render_6 = (org.ofbiz.webapp.region.RenderTag) _jspx_tagPool_region_render_section_nobody.get(org.ofbiz.webapp.region.RenderTag.class);
    _jspx_th_region_render_6.setPageContext(_jspx_page_context);
    _jspx_th_region_render_6.setParent(null);
    _jspx_th_region_render_6.setSection("rightbar");
    int _jspx_eval_region_render_6 = _jspx_th_region_render_6.doStartTag();
    if (_jspx_th_region_render_6.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE)
      return true;
    _jspx_tagPool_region_render_section_nobody.reuse(_jspx_th_region_render_6);
    return false;
  }

  private boolean _jspx_meth_region_render_7(PageContext _jspx_page_context)
          throws Throwable {
    PageContext pageContext = _jspx_page_context;
    JspWriter out = _jspx_page_context.getOut();
    //  region:render
    org.ofbiz.webapp.region.RenderTag _jspx_th_region_render_7 = (org.ofbiz.webapp.region.RenderTag) _jspx_tagPool_region_render_section_nobody.get(org.ofbiz.webapp.region.RenderTag.class);
    _jspx_th_region_render_7.setPageContext(_jspx_page_context);
    _jspx_th_region_render_7.setParent(null);
    _jspx_th_region_render_7.setSection("footer");
    int _jspx_eval_region_render_7 = _jspx_th_region_render_7.doStartTag();
    if (_jspx_th_region_render_7.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE)
      return true;
    _jspx_tagPool_region_render_section_nobody.reuse(_jspx_th_region_render_7);
    return false;
  }
}
