[SOLVED] Reusing an XML hold file between Web Pages
I am using chained list boxes on an HTML pages. However, the dataset is large (over 6000 departments in 25 organizations) and takes over four minutes to populate. This is mainly due to DBMS security processing. I would like to be able to populate an XML file once, and reuse it as a data source between different HTML pages. Once the browser is closed, I would need the XML file cleaned up. I started looking at AJAX, but I don't know if that would be the way to go. I have searched other posts in this forum but couldn't find anything that would help. Is there some way to save a temp file to the user's PC that would be available to all requests in a session?This message has been edited. Last edited by: Kerry,
Local Development Environment: WF 7.6.10 on Vista Ultimate 64-bit Edition Client Environments: WF 7.1.3, 7.6.4, and 7.6.10 on various Windows Server platforms using servlet implementation over SSL Oracle and MSSQL DBs Output formats: HTML, PDF, Excel 2000, XML
October 08, 2008, 08:59 AM
gregv
Here's one reference that might help. There are more if you search for 'keep temp files'.
Thanks Greg, I did get some useful information on that thread, among others I found with those keywords. I was able to create a temp directory on the server using the users ID (captured by javascript on the logon page) and create a focus hold file (userID_value.foc).
However, userID_value.foc is 8.5 MB. This still takes a substantial amount of time to download to the client. So, I am now looking at creating a client-side hold file that I can reuse between pages. I believe I can use the ActiveXObject("Scripting.FileSystemObject") to generate flat files and use those to populate the listboxes. I am not sure if chaining supports flat files so I may also need to write my own routines to populate them.
I will be working on this so I will post a follow-up soon in case my solution can help others.
Local Development Environment: WF 7.6.10 on Vista Ultimate 64-bit Edition Client Environments: WF 7.1.3, 7.6.4, and 7.6.10 on various Windows Server platforms using servlet implementation over SSL Oracle and MSSQL DBs Output formats: HTML, PDF, Excel 2000, XML
January 08, 2009, 08:45 PM
DivisionByZero
I have found my solution and I would like to post it here, since others may benefit from this. You will need to know WebFOCUS, HTML and JavaScript to use it.
Here are the benefits: Cut the HTML page initial load time from 10 minutes to 10 seconds. Much, much faster response for chained listboxes.
Here are the drawbacks: Only works in IE due to ActiveX controls. Requires that the user add the server's base URL to IE's Trusted Zone. It is also advisable to set the Trusted Zone to Low Level security to avoid those annoying ActiveX prompts on every page.
There are really three steps here:
---- 1 ----- Capture the login ID from the login page. This will allow multiple users to use the same machine, and stores the local file for each as [USERID].txt. This requires some hidden controls:
I added some javascript to assign the login ID to RUSER.
<script type="text/javascript">
function setUserId()
{
document.getElementById("RUSER").value = document.getElementById("IBIC_user").value;
}
function setDataPath()
{
var tempDir = "C:\\myWebFocusFiles\\";
var userName = document.getElementById("RUSER").value;
document.getElementById("DATAPATH").value = tempDir + userName + ".xml";
}
</script>
To run the scripts after the login ID is enterd, I used:
Local Development Environment: WF 7.6.10 on Vista Ultimate 64-bit Edition Client Environments: WF 7.1.3, 7.6.4, and 7.6.10 on various Windows Server platforms using servlet implementation over SSL Oracle and MSSQL DBs Output formats: HTML, PDF, Excel 2000, XML
January 09, 2009, 11:11 AM
DivisionByZero
Thank you Kerry for cleaning up my post
Local Development Environment: WF 7.6.10 on Vista Ultimate 64-bit Edition Client Environments: WF 7.1.3, 7.6.4, and 7.6.10 on various Windows Server platforms using servlet implementation over SSL Oracle and MSSQL DBs Output formats: HTML, PDF, Excel 2000, XML
January 09, 2009, 01:52 PM
DivisionByZero
I just remembered that you will also need the Windows Script Host 5.7 installed for this to work.
Local Development Environment: WF 7.6.10 on Vista Ultimate 64-bit Edition Client Environments: WF 7.1.3, 7.6.4, and 7.6.10 on various Windows Server platforms using servlet implementation over SSL Oracle and MSSQL DBs Output formats: HTML, PDF, Excel 2000, XML
January 16, 2009, 05:04 PM
FrankDutch
I created an xml file with webfocus only.
Frank
prod: WF 7.6.10 platform Windows, databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7 test: WF 7.6.10 on the same platform and databases,IE7
January 19, 2009, 02:57 PM
DivisionByZero
Did you create the xml file on the client's PC or on the server?
Local Development Environment: WF 7.6.10 on Vista Ultimate 64-bit Edition Client Environments: WF 7.1.3, 7.6.4, and 7.6.10 on various Windows Server platforms using servlet implementation over SSL Oracle and MSSQL DBs Output formats: HTML, PDF, Excel 2000, XML