Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] HTML Embedded procedures and ...session lifetime?
Go
New
Search
Notify
Tools
Reply
  
[SOLVED] HTML Embedded procedures and ...session lifetime?
 Login/Join
 
Virtuoso
posted
Hello,

I have a start-fex that stores some data in a HOLD file, which in turn is supposed to be used by an embedded procedure in a HTMLFORM included later on in the same fex. The HOLD-file should be stored on a per-session basis too, so I'm experimenting with FOCCACHE for this.

I have a couple of related questions.

Chickens and eggs...
The first problem is the chicken-and-egg problem of selecting the master file to be used in HTML Composer's interface: Parameters - combobox1 - Dynamic - External Procedure.
Since the HOLD-file is created in the same fex that includes this HTMLFORM, the master isn't available yet at this point. How do you select it? FOCCACHE isn't in the path, and I can't add it either as it's outside my project tree...

I've tried running the start-fex without the HTMLFORM first, to create the master file, so that Dev Studio can pick it up, but that didn't seem to help any.


Hold it!
In the end I added the code for the embedded procedure by hand. The start-fex has this code:
-* File foccache_test.fex
APP HOLD FOCCACHE

TABLE FILE CAR
PRINT MODEL
BY CAR
ON TABLE HOLD AS CARMODEL
END
-HTMLFORM foccache_test.htm


The HTML form is a freshly created one with a dropdown dragged in. The embedded procedure for this dropdown is:
APP HOLD FOCCACHE
TABLE FILE FOCCACHE/carmodel
PRINT MODEL
BY CAR
ON TABLE PCHOLD FORMAT XML
END


If I run this, I can see in the HTML source that the start-fex found 18 lines, but the dropdown box remains empty!:
<!--
0 NUMBER OF RECORDS IN TABLE=       18  LINES=     18

-->


We do have something similar to the above approach working for some other projects, where we use an APP HOLD to the project's local directory (say: APP HOLD CAR). That works, but I can't do that in this case, since we need to keep different sessions apart.

I have gotten this to work by using an APP HOLD &USERID, but as I understand it, FOCCACHE is supposed to replace the need for such abominations.

What I can't get to work though, is this same approach either without an APP HOLD, or by using FOCCACHE. What am I missing?


Documentation?
As much as FOCCACHE is louded as the new approach to... what really? There is not even mention of it in the Help files provided with Dev Studio, and even searching the Technical Documentation Library, the only relevant documents that show up are marketing documents - very low on technical details of how to use FOCCACHE.

Where's the documentation?

This message has been edited. Last edited by: Wep5622,


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
 
Posts: 1652 | Location: Enschede, Netherlands | Registered: August 12, 2010Reply With QuoteReport This Post
Expert
posted Hide Post
FOCCACHE is included in the APP PATH for an individual user so picking up your MAS should not be an issue.

If you APP FI CARMODEL FOCCACHE/carmodel.ftm as the first part of your embedded fex then the data file should be able to be seen OK.

For information APP HOLD is used to direct output files not input files, for that you need APP PATH or, as I mentioned above, APP FILEDEF.

My understanding of FOCCACHE is that it is relevant to the users browser session and will be used whilst that browser session is active. There is a length of time that the contents of FOCCACHE will remain around but what that timing is I do not know.

The reason (as far as I can tell) for FOCCACHE is that, in times gone by, one of the methods utilised to make an individual hold file available to a specific user was to append the user id to the filename and store it in a network share that was available to the server. This required a filedef etc. in subsequent processes and could get rather complex if you let it. Required less now that we have FOCCACHE!

How the usage of FOCCACHE will pan out using it for chained combos I cannot tell but, in theory at least, it should be OK.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.06 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5617 | Location: United Kingdom | Registered: April 08, 2004Reply With QuoteReport This Post
Virtuoso
posted Hide Post
You need to add
ON TABLE PCHOLD FORMAT XML

to your embedded procedure
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Reply With QuoteReport This Post
Virtuoso
posted Hide Post
quote:
Originally posted by j.gross:
You need to add
ON TABLE PCHOLD FORMAT XML

to your embedded procedure


A sharp observation, that certainly doesn't help! Thanks for pointing that out.

Unfortunately, even with the correct output format, the dropdown remains empty. I expected that, I've seen it before; I'm pretty sure that's because the HTTP-request that populates that dropdown doesn't know to look in FOCCACHE.

I already have a case open on a similar issue with paths dynamically altered in the load-fex; the path from the load-fex doesn't seem to propagate to the HTTP-request used to populate the asynchronously loaded dropdown.


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
 
Posts: 1652 | Location: Enschede, Netherlands | Registered: August 12, 2010Reply With QuoteReport This Post
Member
posted Hide Post
Put a
-RUN
after your table file and before your
-HTMLFORM
 
Posts: 17 | Location: Colorado, USA | Registered: January 22, 2010Reply With QuoteReport This Post
Virtuoso
posted Hide Post
It wasn't the -RUN, but I got it solved.

In the end the below code worked:
-* File foccache_test.fex
APP HOLD FOCCACHE

TABLE FILE CAR
PRINT MODEL
BY CAR
ON TABLE HOLD AS FOCCACHE/CARMODEL
END
-HTMLFORM foccache_test.htm


Note the FOCCACHE/ prefix added in the above.

The embedded procedure for this dropdown is:
TABLE FILE carmodel
PRINT MODEL
BY CAR
ON TABLE PCHOLD FORMAT XML
END


Time to apply this to actual problems! Smiler


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
 
Posts: 1652 | Location: Enschede, Netherlands | Registered: August 12, 2010Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] HTML Embedded procedures and ...session lifetime?

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.