Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] Embedded procedures can't find data with APP HOLDDATA

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] Embedded procedures can't find data with APP HOLDDATA
 Login/Join
 
Virtuoso
posted
Hello,

We have some procedures that require temporary data to be kept private to that user. To that effect we created APP HOLDs for each user based on their account information. However, while data is accessable just fine from within fexes, we're having problems accessing this private data from embedded procedures (in the HTML).

Is there some way to tell the embedded procedure what APP PATH to use?

A few more details about our setup:

We have these apps:

  • Car - the actual application, contains foc and ftm files accessable to everyone with access to this application.
  • u5562 - my personal app, contains my private data. App name is generated dynamically based on my user ID.
  • u1234 - someone else's personal app, contains similar data, but specific to that user.


Our code contains in my case:
APP HOLDDATA u5562
APP HOLDMETA FinancialReports
APP PREPENDPATH u5562


And in the other users' case:
APP HOLDDATA u1234
APP HOLDMETA FinancialReports
APP PREPENDPATH u1234


We have a start-fex that includes the above code and contains something like:
-* Prepend the users' app to the app path (see above code)
-INCLUDE UserApp

-* Below results get saved in the users' private application directory
TABLE FILE CAR
BY CAR
BY MODEL
ON TABLE HOLD AS my_cars
END

-HTMLFORM my_cars.htm


The HTML file contains a dropdown filled by an embedded procedure.
It is supposed to read the hold file generated above. However, the user directory that is prepended to the path dynamically (based on login information) is apparently not included in the APP PATH that the embedded procedure uses, even though it was specified in the fex that opened the HTML form.

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


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: 1669 | Location: Enschede, Netherlands | Registered: August 12, 2010Report This Post
Virtuoso
posted Hide Post
I take it that in the other user's case, the prependpath is also with his/her u-directory and not with yours?
quote:
Is there some way to tell the embedded procedure what APP PATH to use?
You're doing that just fine, I think.
The only thing you did not show us was what is in the my_cars.htm file. It should contains a reference to the my_cars.ftm file to be able to show it on screen. it should be of the form '!IBI.FIL.MY_CARS;', because that is the name of the filedef given to the hold file. This filedef tells the system where to find the file and it should contain the correct physical location.


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
 
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007Report This Post
Expert
posted Hide Post
I would add
APP SHOWPATH
wherever the APP PATH is modified with PREPEND PATH - this should show you if the PREPEND worked.

If the PREPEND works, wouldn't the result of
ON TABLE HOLD AS my_cars
be stored in u5562 and not u1234? Is this what you want?


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Virtuoso
posted Hide Post
quote:
Originally posted by GamP:
I take it that in the other user's case, the prependpath is also with his/her u-directory and not with yours?


Yes, it is.

quote:
quote:
Is there some way to tell the embedded procedure what APP PATH to use?
You're doing that just fine, I think.
The only thing you did not show us was what is in the my_cars.htm file. It should contains a reference to the my_cars.ftm file to be able to show it on screen. it should be of the form '!IBI.FIL.MY_CARS;', because that is the name of the filedef given to the hold file. This filedef tells the system where to find the file and it should contain the correct physical location.


There used to be an !IBI.FIL in that HTML form, but the HTML editor seems to want to replace that with an embedded procedure (it broke several of our IBI.FIL's), like so:
<input_control bindcontrolid="compUid_3" elementtype="8" name="KOSTENPL" id="KOSTENPL" multiple="0"
    onetimepopulated="0" top="20" left="250" width="60" height="20" inbinding="1" unresolved="0">
<link linktype="default">
<condition default="1" name="Default" whattodowithcontrol="0" valuescompareoperator="0" parameterscompareoperator="0"
    conditionmultiselectoperator="0">
<data_info datatype="1" datasource="kostenpl.mas" datafield="KOSTENPL.SEG01.SPNR" displayfield="KOSTENPL.SEG01.KSTNPL"
    addalloption="1" operation="NONE" sourcetype="typeMaster" selectedvalue="" ibiapp_app="FinancialReports general
    ibiwork baseapp" ibiformat="P10" dfformat="A100" modifiedrequest="1" dynalldisplayvalue="ALL" activereportmenutype="0">

<![CDATA[TABLE FILE kostenpl
SUM FST.KOSTENPL.SEG01.KSTNPL
 BY KOSTENPL.SEG01.SPNR
-*insert_filters_here
ON TABLE PCHOLD FORMAT XML
END
]]>

</data_info></condition></link></input_control>


The part in the CDATA section gets called asynchronously (as a javascript XmlHttpRequest). So the call is actually done using a fresh HTTP-request and apparently that's missing the APP PATH that was specified in the fex that loaded that HTML page.

This behaviour changed between 7.6.8 (which we used before) and 7.6.11 (which we're using now).
In the former version we did indeed include !IBI.FIL style data, which loads the data from the same request as the fex that contains the -HTMLFORM and therefore would probably have adhered to the APP PATH specified.

In the latter version it has become an asynchronous request, which loads the data using a new HTTP-request instead. Apparently the APP PATH doesn't get passed on to that request, so I wonder if there's a trick to that?

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: 1669 | Location: Enschede, Netherlands | Registered: August 12, 2010Report This Post
Virtuoso
posted Hide Post
quote:
Originally posted by Francis Mariani:
If the PREPEND works, wouldn't the result of
ON TABLE HOLD AS my_cars
be stored in u5562 and not u1234? Is this what you want?


Ah, that's a typo in the example - my bad. Fixed now Wink


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: 1669 | Location: Enschede, Netherlands | Registered: August 12, 2010Report This Post
Virtuoso
posted Hide Post
I think that if we were able to read the current APP PATH into a focus variable we could work around it relatively easy. Is there a way to get the current APP PATH as a variable?

If we'd have something like
-TYPE &APPPATH
u5562 general finance

then it wouldn't be too hard to use that variable in the HTML page where ibiapp_app is being set, which appears to be the path used when looking up data with an embedded procedure.


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: 1669 | Location: Enschede, Netherlands | Registered: August 12, 2010Report This Post
Virtuoso
posted Hide Post
I'm not sure what you are trying to do here, but I would suggest you look into using FOCCACHE rather then what you are doing. It may save you a lot of trouble. Also, change you hold request to do ON TABLE HOLD AS foccache/my_cars. That way you do not have to worry about using the HOLDMETA and HOLDDATA commands, as both the MAS and the FTM will be written to FOCCACHE, and the DATASET attribute will be written to the MAS (iow: no allocation necessary)

I don't know if this will solve your issue, but it should remove a lot of the confusion with APP PATH and help clear the way for a final solution.


"There is no limit to what you can achieve ... if you don’t care who gets the credit." Roger Abbott
 
Posts: 1102 | Location: Toronto, Ontario | Registered: May 26, 2004Report This Post
Virtuoso
posted Hide Post
quote:
< ![CDATA[TABLE FILE kostenpl
SUM FST.KOSTENPL.SEG01.KSTNPL
BY KOSTENPL.SEG01.SPNR
-*insert_filters_here
ON TABLE PCHOLD FORMAT XML
END ]]>


Why don't you insert
-INCLUDE UserApp

and whatever additional set-up code you need, ahead of TABLE request. Presumably, UserApp.fex creates a &var containing the user's assigned APP folder name, so you can code the filedef explicitly using that &var.

Personally I prefer to store the procedure as a fex file and reference it, rather than imbed the code in the html file. Easier to develop and test, and makes it easier to manage changes.
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
Virtuoso
posted Hide Post
quote:
Originally posted by dhagen:
I'm not sure what you are trying to do here, but I would suggest you look into using FOCCACHE rather then what you are doing. It may save you a lot of trouble. Also, change you hold request to do ON TABLE HOLD AS foccache/my_cars. That way you do not have to worry about using the HOLDMETA and HOLDDATA commands, as both the MAS and the FTM will be written to FOCCACHE, and the DATASET attribute will be written to the MAS (iow: no allocation necessary)

I don't know if this will solve your issue, but it should remove a lot of the confusion with APP PATH and help clear the way for a final solution.


Thanks for the pointer!

I have seen some obtuse references to FOCCACHE before, but we don't know enough about it to base our decisions on - it isn't mentioned in the help-file index if you enter FOCCACHE, for example.
I did find a reference to the online docs, which mentions:
quote:

Note: Each time a WebFOCUS user logs into the Managed Reporting (MR) environment a new session with its own foccache directory is created. Files that were stored in a prior foccache directory are no longer accessible. When the user logs out of MR the foccache directory used within that MR session is no longer accessible.

Which suggests that each user would have a different FOCCACHE directory in their session, which is probably exactly what we're looking for. However, that document could probably be a bit more explicit about that if that's the case.

I'm not entirely sure we would need to keep the masters for temporary files separate as well. There shouldn't be any conflicts between identically named masters from different projects, but with them all in one directory, chances are that they do. Hmm...


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: 1669 | Location: Enschede, Netherlands | Registered: August 12, 2010Report This Post
Virtuoso
posted Hide Post
@j.gross

Sure, we could alter all our HTML files so that their embedded procedures -INCLUDE UserApp, or we could alter all the references to ibiapp_app and prepend their value-lists with a "!IBI.AMP.USERHOLD; ", or we could switch to using external procedures instead of embedded ones. All of those solutions mean quite a bit of work for us - that we didn't anticipate - though.

What I'm a bit curious about is why the generated HTML even contains those ibiapp_app values. The contents of those values are generated when the HTML page is created, while the APP PATH can be changed at run-time! Shouldn't those values be dynamic as well? I'd expect that to cause all kinds of issues.


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: 1669 | Location: Enschede, Netherlands | Registered: August 12, 2010Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] Embedded procedures can't find data with APP HOLDDATA

Copyright © 1996-2020 Information Builders