Genero Desktop Client ActiveX / How Templates Work for the GDCAX |
The template provided by the GAS package only indicates that the GDCAX package needs to be installed. After GDCAX installation, this template is replaced by the GDCAX default template.
Example fglgdcdefault.html (line breaks added for documentation readability)
!-- FOURJS_START_COPYRIGHT(D,2002) Property of Four Js* (c) Copyright Four Js 2002, 2019. All Rights Reserved. * Trademark of Four Js Development Tools Europe Ltd in the United States and elsewhere This file can be modified by licensees according to the product manual. FOURJS_END_COPYRIGHT --> <HTML> <HEAD> <TITLE> $(application.id) - Genero Desktop Client - Active X </TITLE> <META http-equiv="expires" content="1"> <META http-equiv="pragma" content="no-cache"> </HEAD> <BODY BGCOLOR="#FFFFFF" onload="startIt();" onbeforeunload="preventClose();"> <H2> Application: $(application.id) </H2> <CENTER> <DIV id="divgdc" style="display:none"></DIV> <DIV id="divwait"> <BR> Please wait while Genero Desktop Client Active X is being installed... <BR> This could take up to a few minutes depending on your connection speed and your system. <BR> <BR> Internet Explorer may prompt you with message regarding Active X Security, you've to allow Genero Desktop Client Active X installation. <BR> <BR> <IMG src="$(connector.uri)/pic/processing.gif"/> <BR> </DIV> </CENTER> </BODY> <SCRIPT src="$(connector.uri)/fjs/activex/fglgdcdefault.js"></SCRIPT> <SCRIPT language="javascript"> var timerID = 0; var gdc = 0; var retryCount = 0; var maxRetry = 240; //the script will test if GDC is loaded for 240 seconds function startIt() { // first activate ActiveX. gdc = loadGDC("divgdc", "GeneroDesktopClient", "2,50,5,0", "$(connector.uri)"); checkGDC(); } function preventClose() { if ( !gdc ) { return; } // if there still an application running, display a // message on close browser. if (gdc.applicationCount > 0) { event.returnValue = "Genero Desktop Client"; } } function configureGDC() { //uncomment following line to enable Admin Mode //gdc.setAdmin(true); //uncomment following line to enable Debug Mode //gdc.setDebug(true); //uncomment and modify the following line if you want to change // the ping timeout (120 sec by default) //gdc.setPingTimeOut(120); //uncomment and modify the following line if you want to change // the proxy (using system settings by default) //gdc.setProxy("proxy:3128") // this is to ensure that any popup window will appear in front // of the browser gdc.setFocus(); } function startApplication(appName, appQueryString) { // the serverUrl must be set BEFORE starting the application if ("$(connector.uri)" != ""){ gdc.setSrvUrl(location.protocol + "//" + location.host + "$(connector.uri)" + "/wa/r/" + appName + "?" + appQueryString); } else { gdc.setSrvUrl(location.href); } gdc.setPictureUrl("$(pictures.uri)"); gdc.setAppName(appName); return false; } // this function checks if GDC object is ready. If not, // wait 1 second and retry. function checkGDC(){ if(timerID) { clearTimeout(timerID); timerID = 0; } if (!gdc || !gdc.enabled) { // gdc is not ready, wait a few seconds... retryCount++; if (retryCount <= maxRetry) { timerID = setTimeout("checkGDC()", 1000); } else { if (confirm("Genero Desktop Client could not be started within the correct time.\nKeep waiting ?")){ retryCount = 0; timerID = setTimeout("checkGDC()", 1000); return; } document.getElementById("divwait").style.display = 'none'; document.getElementById("divgdc").style.display = 'block'; alert("Genero Desktop Client can't be started, please contact your system admin."); } } else { //gdc is loaded, hide the loading panel and show gdc panel document.getElementById("divwait").style.display = 'none'; document.getElementById("divgdc").style.display = 'block'; configureGDC(); return startApplication("$(application.id)", "$(application.querystring)"); } } </SCRIPT> </HTML>
<STYLE type="text/css"> .hidden { display: none; } </STYLE> ... <OBJECT NAME="gdc" class="hidden" ...> ... </OBJECT>