package org.apache.jsp.data_005fset_005fdisplay;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import com.liferay.frontend.taglib.clay.data.set.model.ClayPaginationEntry;
import com.liferay.frontend.taglib.clay.servlet.taglib.util.CreationMenu;
import com.liferay.frontend.taglib.clay.servlet.taglib.util.DropdownItem;
import com.liferay.frontend.taglib.clay.servlet.taglib.util.SortItemList;
import com.liferay.petra.string.StringPool;
import com.liferay.portal.kernel.json.JSONFactoryUtil;
import com.liferay.portal.kernel.json.JSONSerializer;
import com.liferay.portal.kernel.util.GetterUtil;
import com.liferay.portal.kernel.util.HtmlUtil;
import com.liferay.portal.kernel.util.PortalUtil;
import java.util.List;
import javax.portlet.PortletURL;

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

  private static final JspFactory _jspxFactory = JspFactory.getDefaultFactory();

  private static java.util.List<String> _jspx_dependants;

  static {
    _jspx_dependants = new java.util.ArrayList<String>(1);
    _jspx_dependants.add("/data_set_display/init.jsp");
  }

  private org.apache.jasper.runtime.TagHandlerPool _jspx_tagPool_liferay$1theme_defineObjects_nobody;
  private org.apache.jasper.runtime.TagHandlerPool _jspx_tagPool_aui_script_require;

  private org.glassfish.jsp.api.ResourceInjector _jspx_resourceInjector;

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

  public void _jspInit() {
    _jspx_tagPool_liferay$1theme_defineObjects_nobody = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
    _jspx_tagPool_aui_script_require = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
  }

  public void _jspDestroy() {
    _jspx_tagPool_liferay$1theme_defineObjects_nobody.release();
    _jspx_tagPool_aui_script_require.release();
  }

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

    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 {
      response.setContentType("text/html");
      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;
      _jspx_resourceInjector = (org.glassfish.jsp.api.ResourceInjector) application.getAttribute("com.sun.appserv.jsp.resource.injector");

      out.write('\n');
      out.write('\n');
      out.write("\n\n\n\n\n\n\n\n\n\n");
      //  liferay-theme:defineObjects
      com.liferay.taglib.theme.DefineObjectsTag _jspx_th_liferay$1theme_defineObjects_0 = (com.liferay.taglib.theme.DefineObjectsTag) _jspx_tagPool_liferay$1theme_defineObjects_nobody.get(com.liferay.taglib.theme.DefineObjectsTag.class);
      _jspx_th_liferay$1theme_defineObjects_0.setPageContext(_jspx_page_context);
      _jspx_th_liferay$1theme_defineObjects_0.setParent(null);
      int _jspx_eval_liferay$1theme_defineObjects_0 = _jspx_th_liferay$1theme_defineObjects_0.doStartTag();
      if (_jspx_th_liferay$1theme_defineObjects_0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
        _jspx_tagPool_liferay$1theme_defineObjects_nobody.reuse(_jspx_th_liferay$1theme_defineObjects_0);
        return;
      }
      _jspx_tagPool_liferay$1theme_defineObjects_nobody.reuse(_jspx_th_liferay$1theme_defineObjects_0);
      com.liferay.portal.kernel.theme.ThemeDisplay themeDisplay = null;
      com.liferay.portal.kernel.model.Company company = null;
      com.liferay.portal.kernel.model.Account account = null;
      com.liferay.portal.kernel.model.User user = null;
      com.liferay.portal.kernel.model.User realUser = null;
      com.liferay.portal.kernel.model.Contact contact = null;
      com.liferay.portal.kernel.model.Layout layout = null;
      java.util.List layouts = null;
      java.lang.Long plid = null;
      com.liferay.portal.kernel.model.LayoutTypePortlet layoutTypePortlet = null;
      java.lang.Long scopeGroupId = null;
      com.liferay.portal.kernel.security.permission.PermissionChecker permissionChecker = null;
      java.util.Locale locale = null;
      java.util.TimeZone timeZone = null;
      com.liferay.portal.kernel.model.Theme theme = null;
      com.liferay.portal.kernel.model.ColorScheme colorScheme = null;
      com.liferay.portal.kernel.theme.PortletDisplay portletDisplay = null;
      java.lang.Long portletGroupId = null;
      themeDisplay = (com.liferay.portal.kernel.theme.ThemeDisplay) _jspx_page_context.findAttribute("themeDisplay");
      company = (com.liferay.portal.kernel.model.Company) _jspx_page_context.findAttribute("company");
      account = (com.liferay.portal.kernel.model.Account) _jspx_page_context.findAttribute("account");
      user = (com.liferay.portal.kernel.model.User) _jspx_page_context.findAttribute("user");
      realUser = (com.liferay.portal.kernel.model.User) _jspx_page_context.findAttribute("realUser");
      contact = (com.liferay.portal.kernel.model.Contact) _jspx_page_context.findAttribute("contact");
      layout = (com.liferay.portal.kernel.model.Layout) _jspx_page_context.findAttribute("layout");
      layouts = (java.util.List) _jspx_page_context.findAttribute("layouts");
      plid = (java.lang.Long) _jspx_page_context.findAttribute("plid");
      layoutTypePortlet = (com.liferay.portal.kernel.model.LayoutTypePortlet) _jspx_page_context.findAttribute("layoutTypePortlet");
      scopeGroupId = (java.lang.Long) _jspx_page_context.findAttribute("scopeGroupId");
      permissionChecker = (com.liferay.portal.kernel.security.permission.PermissionChecker) _jspx_page_context.findAttribute("permissionChecker");
      locale = (java.util.Locale) _jspx_page_context.findAttribute("locale");
      timeZone = (java.util.TimeZone) _jspx_page_context.findAttribute("timeZone");
      theme = (com.liferay.portal.kernel.model.Theme) _jspx_page_context.findAttribute("theme");
      colorScheme = (com.liferay.portal.kernel.model.ColorScheme) _jspx_page_context.findAttribute("colorScheme");
      portletDisplay = (com.liferay.portal.kernel.theme.PortletDisplay) _jspx_page_context.findAttribute("portletDisplay");
      portletGroupId = (java.lang.Long) _jspx_page_context.findAttribute("portletGroupId");
      out.write('\n');
      out.write('\n');

String actionParameterName = (String)request.getAttribute("clay:data-set-display:actionParameterName");
String activeViewSettingsJSON = GetterUtil.getString(request.getAttribute("clay:data-set-display:activeViewSettingsJSON"), "{}");
String apiURL = (String)request.getAttribute("clay:data-set-display:apiURL");
String appURL = (String)request.getAttribute("clay:data-set-display:appURL");
List<DropdownItem> bulkActionDropdownItems = (List<DropdownItem>)request.getAttribute("clay:data-set-display:bulkActionDropdownItems");
Object clayDataSetDisplayViewsContext = request.getAttribute("clay:data-set-display:clayDataSetDisplayViewsContext");
CreationMenu creationMenu = (CreationMenu)request.getAttribute("clay:data-set-display:creationMenu");
String dataProviderKey = (String)request.getAttribute("clay:data-set-display:dataProviderKey");
String formId = (String)request.getAttribute("clay:data-set-display:formId");
String id = (String)request.getAttribute("clay:data-set-display:id");
int itemsPerPage = (int)request.getAttribute("clay:data-set-display:itemsPerPage");
String module = (String)request.getAttribute("clay:data-set-display:module");
String namespace = (String)request.getAttribute("clay:data-set-display:namespace");
String nestedItemsKey = (String)request.getAttribute("clay:data-set-display:nestedItemsKey");
String nestedItemsReferenceKey = (String)request.getAttribute("clay:data-set-display:nestedItemsReferenceKey");
int pageNumber = (int)request.getAttribute("clay:data-set-display:pageNumber");
List<ClayPaginationEntry> clayPaginationEntries = (List<ClayPaginationEntry>)request.getAttribute("clay:data-set-display:clayPaginationEntries");
PortletURL portletURL = (PortletURL)request.getAttribute("clay:data-set-display:portletURL");
List<String> selectedItems = (List<String>)request.getAttribute("clay:data-set-display:selectedItems");
String selectedItemsKey = (String)request.getAttribute("clay:data-set-display:selectedItemsKey");
String selectionType = (String)request.getAttribute("clay:data-set-display:selectionType");
boolean showManagementBar = (boolean)request.getAttribute("clay:data-set-display:showManagementBar");
boolean showPagination = (boolean)request.getAttribute("clay:data-set-display:showPagination");
boolean showSearch = (boolean)request.getAttribute("clay:data-set-display:showSearch");
SortItemList sortItemList = (SortItemList)request.getAttribute("clay:headless-data-set-display:sortItemList");
String style = (String)request.getAttribute("clay:data-set-display:style");

JSONSerializer jsonSerializer = JSONFactoryUtil.createJSONSerializer();

String randomNamespace = PortalUtil.generateRandomKey(request, "taglib_step_tracker") + StringPool.UNDERLINE;

String containerId = randomNamespace + "table-id";

      out.write("\n\n<link href=\"");
      out.print( PortalUtil.getStaticResourceURL(request, PortalUtil.getPathModule() + "/frontend-taglib-clay/data_set_display/styles/main.css") );
      out.write("\" rel=\"stylesheet\" />\n\n<div class=\"table-root\" id=\"");
      out.print( containerId );
      out.write("\">\n\t<span aria-hidden=\"true\" class=\"loading-animation my-7\"></span>\n</div>\n\n");
      //  aui:script
      com.liferay.taglib.aui.ScriptTag _jspx_th_aui_script_0 = (com.liferay.taglib.aui.ScriptTag) _jspx_tagPool_aui_script_require.get(com.liferay.taglib.aui.ScriptTag.class);
      _jspx_th_aui_script_0.setPageContext(_jspx_page_context);
      _jspx_th_aui_script_0.setParent(null);
      _jspx_th_aui_script_0.setRequire( module + " as dataSetDisplay" );
      int _jspx_eval_aui_script_0 = _jspx_th_aui_script_0.doStartTag();
      if (_jspx_eval_aui_script_0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
        if (_jspx_eval_aui_script_0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
          out = _jspx_page_context.pushBody();
          _jspx_th_aui_script_0.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
          _jspx_th_aui_script_0.doInitBody();
        }
        do {
          out.write("\n\tvar container = document.getElementById('");
          out.print( containerId );
          out.write("');\n\n\tdataSetDisplay.default(\n\t\t{\n\t\t\tactionParameterName:\n\t\t\t\t'");
          out.print( HtmlUtil.escapeJS(GetterUtil.getString(actionParameterName)) );
          out.write("',\n\t\t\tactiveViewSettings: ");
          out.print( activeViewSettingsJSON );
          out.write(",\n\t\t\tapiURL: '");
          out.print( HtmlUtil.escapeJS(apiURL) );
          out.write("',\n\t\t\tappURL: '");
          out.print( HtmlUtil.escapeJS(appURL) );
          out.write("',\n\t\t\tbulkActions: ");
          out.print( jsonSerializer.serializeDeep(bulkActionDropdownItems) );
          out.write(",\n\t\t\tcomponentId: '");
          out.print( HtmlUtil.escapeJS(containerId) );
          out.write("',\n\t\t\tcreationMenu: ");
          out.print( jsonSerializer.serializeDeep(creationMenu) );
          out.write(",\n\t\t\tcurrentURL: '");
          out.print( PortalUtil.getCurrentURL(request) );
          out.write("',\n\t\t\tdataProviderKey: '");
          out.print( dataProviderKey );
          out.write("',\n\t\t\tformId: '");
          out.print( HtmlUtil.escapeJS(GetterUtil.getString(formId)) );
          out.write("',\n\t\t\tid: '");
          out.print( id );
          out.write("',\n\t\t\tnestedItemsKey:\n\t\t\t\t'");
          out.print( HtmlUtil.escapeJS(GetterUtil.getString(nestedItemsKey)) );
          out.write("',\n\t\t\tnestedItemsReferenceKey:\n\t\t\t\t'");
          out.print( HtmlUtil.escapeJS(GetterUtil.getString(nestedItemsReferenceKey)) );
          out.write("',\n\t\t\tpagination: {\n\t\t\t\tdeltas: ");
          out.print( jsonSerializer.serializeDeep(clayPaginationEntries) );
          out.write(",\n\t\t\t\tinitialDelta: ");
          out.print( itemsPerPage );
          out.write(",\n\t\t\t\tinitialPageNumber: ");
          out.print( pageNumber );
          out.write(",\n\t\t\t},\n\t\t\tshowManagementBar: ");
          out.print( showManagementBar );
          out.write(",\n\t\t\tshowPagination: ");
          out.print( showPagination );
          out.write(",\n\t\t\tshowSearch: ");
          out.print( showSearch );
          out.write(",\n\t\t\tnamespace: '");
          out.print( namespace );
          out.write("',\n\t\t\tportletId: '");
          out.print( portletDisplay.getRootPortletId() );
          out.write("',\n\t\t\tportletURL: '");
          out.print( HtmlUtil.escapeJS(portletURL.toString()) );
          out.write("',\n\t\t\tselectedItems: ");
          out.print( jsonSerializer.serializeDeep(selectedItems) );
          out.write(",\n\t\t\tselectedItemsKey: '");
          out.print( GetterUtil.getString(selectedItemsKey) );
          out.write("',\n\t\t\tselectionType: '");
          out.print( GetterUtil.getString(selectionType) );
          out.write("',\n\t\t\tsorting: ");
          out.print( jsonSerializer.serializeDeep(sortItemList) );
          out.write(",\n\t\t\tstyle: '");
          out.print( style );
          out.write("',\n\t\t\tviews: ");
          out.print( jsonSerializer.serializeDeep(clayDataSetDisplayViewsContext) );
          out.write(",\n\t\t},\n\t\tcontainer\n\t);\n");
          int evalDoAfterBody = _jspx_th_aui_script_0.doAfterBody();
          if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
            break;
        } while (true);
        if (_jspx_eval_aui_script_0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE)
          out = _jspx_page_context.popBody();
      }
      if (_jspx_th_aui_script_0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
        _jspx_tagPool_aui_script_require.reuse(_jspx_th_aui_script_0);
        return;
      }
      _jspx_tagPool_aui_script_require.reuse(_jspx_th_aui_script_0);
    } 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);
        else throw new ServletException(t);
      }
    } finally {
      _jspxFactory.releasePageContext(_jspx_page_context);
    }
  }
}
