/* Automatically generated.
 * Copyright (c) 2000-2006 by SAP AG, Walldorf.,
 * http://www.sap.com
 * All rights reserved.
 *
 * This software is the confidential and proprietary information
 * of SAP AG, Walldorf. You shall not disclose such Confidential
 * Information and shall use it only in accordance with the terms
 * of the license agreement you entered into with SAP.
 * Do not edit.
 */

import ro.emid.common.utils.ObjectUtils;
import ro.emid.common.types.Category;
import ro.emid.common.db.CategoryAccessDB;
import ro.emid.common.constants.GlobalAppConstants;
import ro.emid.common.constants.AppConstants;
import ro.emid.common.utils.Util;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;

public class JEE_jsp_WEB_2d_INF_pagelet_common_getCategoriesFromServer_1471592530186 extends com.sap.engine.services.servlets_jsp.lib.jspruntime.JspBase{

	public void _jspService(HttpServletRequest request, HttpServletResponse response) throws ServletException, java.io.IOException
	{
		//isXml=false
		JspFactory  _jspFactory     = JspFactory.getDefaultFactory();
		PageContext pageContext = _jspFactory.getPageContext(this,request,response,null,true,32768,true);
		ServletConfig config = pageContext.getServletConfig();
		ServletContext application = pageContext.getServletContext();
		com.sap.engine.services.servlets_jsp.lib.jspruntime.PageContextImpl _jspx_pageContext = (com.sap.engine.services.servlets_jsp.lib.jspruntime.PageContextImpl) pageContext;
		com.sap.engine.services.servlets_jsp.server.application.InjectionWrapper _jspx_resourceInjector = ((com.sap.engine.services.servlets_jsp.server.application.ServletContextImpl)_jspx_pageContext.getServletContext()).getApplicationContext().getInjectionWrapper();
		HttpSession session = pageContext.getSession();
		if (!response.isCommitted()) {
		response.setContentType("text/html;charset=UTF-8");
		}
		JspWriter   out     = pageContext.getOut();
		java.lang.Object page = this;
		try {
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-admin/servlet_jsp/emid-admin/root/WEB-INF/pagelet/common/getCategoriesFromServer.jsp";from=(1,53);to=(2,0)]
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-admin/servlet_jsp/emid-admin/root/WEB-INF/pagelet/common/getCategoriesFromServer.jsp";from=(2,50);to=(3,0)]
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-admin/servlet_jsp/emid-admin/root/WEB-INF/pagelet/common/getCategoriesFromServer.jsp";from=(3,55);to=(4,0)]
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-admin/servlet_jsp/emid-admin/root/WEB-INF/pagelet/common/getCategoriesFromServer.jsp";from=(4,64);to=(5,0)]
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-admin/servlet_jsp/emid-admin/root/WEB-INF/pagelet/common/getCategoriesFromServer.jsp";from=(5,58);to=(6,0)]
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-admin/servlet_jsp/emid-admin/root/WEB-INF/pagelet/common/getCategoriesFromServer.jsp";from=(6,46);to=(7,0)]
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-admin/servlet_jsp/emid-admin/root/WEB-INF/pagelet/common/getCategoriesFromServer.jsp";from=(7,0);to=(17,2)]
			
    long parentId = ObjectUtils.getIntValue(request.getParameter("parentId"), 0);
    long selectedValue = ObjectUtils.getIntValue(request.getParameter("selectedValue"), 0);
    boolean disabled = ObjectUtils.getStringValue(request.getParameter("disabled")).equals("true");
    String selectName = ObjectUtils.getStringValue(request.getParameter("selectName"));

    String selectatiOption = ObjectUtils.getStringValue(request.getParameter("selectatiOption"));
    if( ObjectUtils.isEmpty(selectatiOption)){
        selectatiOption = "Selectati:";
    }

// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-admin/servlet_jsp/emid-admin/root/WEB-INF/pagelet/common/getCategoriesFromServer.jsp";from=(17,2);to=(19,4)]
			out.print("\r\n<respmesg>\r\n    ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-admin/servlet_jsp/emid-admin/root/WEB-INF/pagelet/common/getCategoriesFromServer.jsp";from=(19,4);to=(19,95)]
			 final Category[] categories = CategoryAccessDB.getAllCategoriesByParentId( parentId); 
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-admin/servlet_jsp/emid-admin/root/WEB-INF/pagelet/common/getCategoriesFromServer.jsp";from=(19,95);to=(20,35)]
			out.print("\r\n    <select class=\"gSAPSelect\" id=\"");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-admin/servlet_jsp/emid-admin/root/WEB-INF/pagelet/common/getCategoriesFromServer.jsp";from=(20,35);to=(20,50)]
			out.print(selectName);
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-admin/servlet_jsp/emid-admin/root/WEB-INF/pagelet/common/getCategoriesFromServer.jsp";from=(20,50);to=(20,58)]
			out.print("\" name=\"");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-admin/servlet_jsp/emid-admin/root/WEB-INF/pagelet/common/getCategoriesFromServer.jsp";from=(20,58);to=(20,73)]
			out.print(selectName);
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-admin/servlet_jsp/emid-admin/root/WEB-INF/pagelet/common/getCategoriesFromServer.jsp";from=(20,73);to=(20,75)]
			out.print("\" ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-admin/servlet_jsp/emid-admin/root/WEB-INF/pagelet/common/getCategoriesFromServer.jsp";from=(20,75);to=(20,105)]
			out.print(disabled? "disabled" : "");
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-admin/servlet_jsp/emid-admin/root/WEB-INF/pagelet/common/getCategoriesFromServer.jsp";from=(20,105);to=(21,28)]
			out.print(">\r\n        <option value=\"-1\" >");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-admin/servlet_jsp/emid-admin/root/WEB-INF/pagelet/common/getCategoriesFromServer.jsp";from=(21,28);to=(21,48)]
			out.print(selectatiOption);
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-admin/servlet_jsp/emid-admin/root/WEB-INF/pagelet/common/getCategoriesFromServer.jsp";from=(21,48);to=(22,8)]
			out.print("</option>\r\n        ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-admin/servlet_jsp/emid-admin/root/WEB-INF/pagelet/common/getCategoriesFromServer.jsp";from=(22,8);to=(23,54)]
			 for (int i = 0; i < categories.length; i++) {
            final Category category = categories[i];
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-admin/servlet_jsp/emid-admin/root/WEB-INF/pagelet/common/getCategoriesFromServer.jsp";from=(23,54);to=(24,36)]
			out.print("\r\n            <option codSapAsCentru=\"");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-admin/servlet_jsp/emid-admin/root/WEB-INF/pagelet/common/getCategoriesFromServer.jsp";from=(24,36);to=(24,91)]
			out.print(AppConstants.format( category.getCodSapAsCentru()));
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-admin/servlet_jsp/emid-admin/root/WEB-INF/pagelet/common/getCategoriesFromServer.jsp";from=(24,91);to=(24,113)]
			out.print("\" isCuSectiiSiCentre=\"");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-admin/servlet_jsp/emid-admin/root/WEB-INF/pagelet/common/getCategoriesFromServer.jsp";from=(24,113);to=(24,147)]
			out.print(category.isCuSectiiSiCentre());
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-admin/servlet_jsp/emid-admin/root/WEB-INF/pagelet/common/getCategoriesFromServer.jsp";from=(24,147);to=(24,157)]
			out.print("\" codSAP=\"");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-admin/servlet_jsp/emid-admin/root/WEB-INF/pagelet/common/getCategoriesFromServer.jsp";from=(24,157);to=(24,199)]
			out.print(Util.escapeToJs(category.getCodSap()));
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-admin/servlet_jsp/emid-admin/root/WEB-INF/pagelet/common/getCategoriesFromServer.jsp";from=(24,199);to=(24,209)]
			out.print("\"  value=\"");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-admin/servlet_jsp/emid-admin/root/WEB-INF/pagelet/common/getCategoriesFromServer.jsp";from=(24,209);to=(24,230)]
			out.print(category.getId());
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-admin/servlet_jsp/emid-admin/root/WEB-INF/pagelet/common/getCategoriesFromServer.jsp";from=(24,230);to=(24,232)]
			out.print("\" ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-admin/servlet_jsp/emid-admin/root/WEB-INF/pagelet/common/getCategoriesFromServer.jsp";from=(24,232);to=(24,288)]
			out.print(category.getId() == selectedValue ? "selected" : "");
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-admin/servlet_jsp/emid-admin/root/WEB-INF/pagelet/common/getCategoriesFromServer.jsp";from=(24,288);to=(24,290)]
			out.print(" >");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-admin/servlet_jsp/emid-admin/root/WEB-INF/pagelet/common/getCategoriesFromServer.jsp";from=(24,290);to=(24,313)]
			out.print(category.getName());
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-admin/servlet_jsp/emid-admin/root/WEB-INF/pagelet/common/getCategoriesFromServer.jsp";from=(24,313);to=(25,8)]
			out.print("</option>\r\n        ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-admin/servlet_jsp/emid-admin/root/WEB-INF/pagelet/common/getCategoriesFromServer.jsp";from=(25,8);to=(25,14)]
			 }
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-admin/servlet_jsp/emid-admin/root/WEB-INF/pagelet/common/getCategoriesFromServer.jsp";from=(25,14);to=(28,0)]
			out.print("\r\n    </select>\r\n</respmesg>\r\n");
// end
		} catch (ThreadDeath tde) { throw tde;
		} catch (OutOfMemoryError ome) { throw ome;
		} catch (Throwable t) {
			if (!(t instanceof SkipPageException)) {
				try {
					out.clear();
				} catch(java.io.IOException _jspioex) {}
				_jspx_pageContext.handlePageException(t);
			}
		}finally{
			_jspFactory.releasePageContext(pageContext);
		}
	}

}
