Focal Point
How to delete FOC files through HTML?

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/8351092892

September 05, 2008, 03:17 AM
Prash
How to delete FOC files through HTML?
Hi All,
I have a requirement where in I need to embed the script to delete the FOC files when the User CLICKS Close Button from the HTML Browser. I will be putting the Confirmation message after the user clicks Close Button. If the User selects Yes then all the Foc files that will be created in that session should be deleted.

Can anybody guide me through this as it is an urgent requirement?


Thanks in advance.


WebFOCUS 7.1
Windows
Output: HTML, Excel & PDF
September 05, 2008, 04:00 AM
<JG>
I assume that you are not using the edatemp directory to hold these files
because if you are then the will be deleted automatically.

HTML CANNOT delete files on the server

All you need to do is create a new focexec that contains

!del c:\*.* (actually I would not do that but rather give it the correct directory\*.foc structure)

The focexec would be executed when the user clicked the confirm button
September 05, 2008, 09:22 AM
GinnyJakes
You can also use the APP DELETEF command in the focexec.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
September 05, 2008, 11:42 AM
Darin Lee
I think one of the big questions is how are you going to get a procedure to run (which would be something kind of form action, url call, etc.) by clicking on a browser window function. Clicking on toolbars, maximize, close, etc. in a standard browser window is no going to perform some function within the windows itself.

Combined with JG's comments, I don't think your approach to this issue is valid. What is the real problem? Why are you needing to delete the FOC files? Are they in EDATEMP? If not, why? More info please...


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
September 08, 2008, 02:03 PM
Prash
Actualy at a time nearly 150-200 users will be accessing the report. The report will be developed to pull the real time data. In order to retain the same resultset(In order to Export to PDF/Excel) we are creating the FOC files with the User name who is accessing the report. So when the user closes the Report we need to delete the Foc file that has got created when the user logged in.


WebFOCUS 7.1
Windows
Output: HTML, Excel & PDF
September 08, 2008, 02:21 PM
GinnyJakes
It might be easier for you to leave them there and then have a Report Caster job or a scheduled Windows script go through the directory (hopefully the same one for all of these user-named files) and delete them based on some sort of date and time criteria.

Or you could upgrade to 7.6.5 and make use of the FOCCACHE option. Wink


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
September 08, 2008, 04:22 PM
Darin Lee
As I mentioned, there is NO functional link between closing a web browser and cleaning up the WF server. You could put a button or link on the report itself which would excute a cleanup fex, but if the user doesn't click it, you still need some mechanism to clean them up after the fact as Ginny suggests. The FOCCACHE stuff I saw at this year's Summit conference would be an ideal option for you.


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
September 09, 2008, 01:34 AM
<JG>
quote:
In order to Export to PDF/Excel


Now we have the reason.

By far the easiest way to manage this is to have a delete at the beginning
of the focexec that creates the first extract and not worry about cleaning
up on closing the report.