package org.apache.jsp.js.cti; import javax.servlet.*; import javax.servlet.http.*; import javax.servlet.jsp.*; import com.edeal.frontline.*; import java.util.*; import com.edeal.frontline.services.*; import com.edeal.frontline.services.cti.*; import com.edeal.frontline.navigation.FlRequest; public final class loadCTI_005fajax_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 _jspx_dependants; static { _jspx_dependants = new java.util.ArrayList(1); _jspx_dependants.add("/WEB-INF/taglib.tld"); } private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005ffl_005fwebapp_005fnobody; private javax.el.ExpressionFactory _el_expressionfactory; private org.apache.AnnotationProcessor _jsp_annotationprocessor; public Object getDependants() { return _jspx_dependants; } public void _jspInit() { _005fjspx_005ftagPool_005ffl_005fwebapp_005fnobody = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig()); _el_expressionfactory = _jspxFactory.getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory(); _jsp_annotationprocessor = (org.apache.AnnotationProcessor) getServletConfig().getServletContext().getAttribute(org.apache.AnnotationProcessor.class.getName()); } public void _jspDestroy() { _005fjspx_005ftagPool_005ffl_005fwebapp_005fnobody.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; FlRequest flRequest = new FlRequest(request); FlContext context = flRequest.getContext(); Boolean actHasCTILic = (Boolean)flRequest.getAttribute("actHasCTILic"); Boolean isDoCTIWindow = (Boolean)flRequest.getAttribute("isDoCTIWindow"); String actID = (String)session.getAttribute("actorID"); if (actHasCTILic == null) { actHasCTILic = false; } if (isDoCTIWindow == null) { isDoCTIWindow = false; } //if CTI is activated, the CTI window will pop up. //if not, it is hidden in the main frameset and the ActiveX control should not be loaded. CTIServiceClient cti; try { cti = (CTIServiceClient)context.getServiceManager().getServiceClient(session, "CTI"); } catch (FlServiceException e) { cti = null; } boolean activateCTI = (cti != null); // DGE : vocalcom add-on. boolean vocalcomCTI = false; boolean C3TCTI = false; if (activateCTI) { try { String idService = cti.getProviderId(); vocalcomCTI = "vocalcom".equalsIgnoreCase(idService); C3TCTI = "C3T".equalsIgnoreCase(idService); } catch(Exception e) { //logger.error("CTI Service Error : ", e); } } String windowWidth = "200"; if (vocalcomCTI) { windowWidth = "800"; } if (isDoCTIWindow && actHasCTILic) { out.write("\r\n"); out.write("\tvar cookieValue = readCookie('EdealCtiWindow_"); out.print(actID); out.write("');\r\n"); out.write("\t\r\n"); out.write("\t"); if (C3TCTI) { out.write("\r\n"); out.write("\t\tif (window.top.location === window.location) { //prevent loading C3T Panel for dashboards\r\n"); out.write("\t\t\t$(\"body\").append(\"
\");\r\n"); out.write("\t\t\t$('#C3TPanel').load('"); if (_jspx_meth_fl_005fwebapp_005f0(_jspx_page_context)) return; out.write("/cti/C3T/cti.jsp');\r\n"); out.write("\t\t}\r\n"); out.write("\t"); } else { out.write("\r\n"); out.write("\t\tif (cookieValue == null) {\t\t\r\n"); out.write("\t\t\t\r\n"); out.write("\t\t\t// if the cookie could not be set in the CTI before the attempt to read it\r\n"); out.write("\t\t\t// in the lines upper, then set it now in order to avoid loading the \r\n"); out.write("\t\t\t// window ctiWindow multiple times if these instructions are executed\r\n"); out.write("\t\t\t// concurrently\r\n"); out.write("\t\t\tcookieValue = createCookie('EdealCtiWindow_"); out.print(actID); out.write("', '1');\r\n"); out.write("\t\t\t\r\n"); out.write("\t\t\tvar ctiWindow = window.open('"); if (_jspx_meth_fl_005fwebapp_005f1(_jspx_page_context)) return; out.write("/cti/cti.jsp', 'CTI', 'menubar=no,status=yes,toolbar=no,scrollbars=no,resizable=yes,width="); out.print( windowWidth ); out.write(",height=200');\r\n"); out.write("\t\t}\r\n"); out.write("\t"); } out.write('\r'); out.write('\n'); } out.write(' '); out.write('\r'); out.write('\n'); } catch (Throwable t) { if (!(t instanceof SkipPageException)){ out = _jspx_out; if (out != null && out.getBufferSize() != 0) try { out.clearBuffer(); } catch (java.io.IOException e) {} if (_jspx_page_context != null) _jspx_page_context.handlePageException(t); else log(t.getMessage(), t); } } finally { _jspxFactory.releasePageContext(_jspx_page_context); } } private boolean _jspx_meth_fl_005fwebapp_005f0(PageContext _jspx_page_context) throws Throwable { PageContext pageContext = _jspx_page_context; JspWriter out = _jspx_page_context.getOut(); // fl:webapp com.edeal.frontline.WebappTag _jspx_th_fl_005fwebapp_005f0 = (com.edeal.frontline.WebappTag) _005fjspx_005ftagPool_005ffl_005fwebapp_005fnobody.get(com.edeal.frontline.WebappTag.class); _jspx_th_fl_005fwebapp_005f0.setPageContext(_jspx_page_context); _jspx_th_fl_005fwebapp_005f0.setParent(null); int _jspx_eval_fl_005fwebapp_005f0 = _jspx_th_fl_005fwebapp_005f0.doStartTag(); if (_jspx_th_fl_005fwebapp_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) { _005fjspx_005ftagPool_005ffl_005fwebapp_005fnobody.reuse(_jspx_th_fl_005fwebapp_005f0); return true; } _005fjspx_005ftagPool_005ffl_005fwebapp_005fnobody.reuse(_jspx_th_fl_005fwebapp_005f0); return false; } private boolean _jspx_meth_fl_005fwebapp_005f1(PageContext _jspx_page_context) throws Throwable { PageContext pageContext = _jspx_page_context; JspWriter out = _jspx_page_context.getOut(); // fl:webapp com.edeal.frontline.WebappTag _jspx_th_fl_005fwebapp_005f1 = (com.edeal.frontline.WebappTag) _005fjspx_005ftagPool_005ffl_005fwebapp_005fnobody.get(com.edeal.frontline.WebappTag.class); _jspx_th_fl_005fwebapp_005f1.setPageContext(_jspx_page_context); _jspx_th_fl_005fwebapp_005f1.setParent(null); int _jspx_eval_fl_005fwebapp_005f1 = _jspx_th_fl_005fwebapp_005f1.doStartTag(); if (_jspx_th_fl_005fwebapp_005f1.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) { _005fjspx_005ftagPool_005ffl_005fwebapp_005fnobody.reuse(_jspx_th_fl_005fwebapp_005f1); return true; } _005fjspx_005ftagPool_005ffl_005fwebapp_005fnobody.reuse(_jspx_th_fl_005fwebapp_005f1); return false; } }