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     [WORKAROUND] maintain launch along with user profile, get amper variable from url

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[WORKAROUND] maintain launch along with user profile, get amper variable from url
 Login/Join
 
Silver Member
posted
I am launching a maintain MNTAPP where &DIR changes depending on user selection:

ibi_apps/WFServlet?IBIF_cmd=MNTCON+EX+MNTAPP&DIR=THISFOLDER&IBIS_connect=on&IBIC_user=launchmnt

I created a user profile 'launchmnt' with:

-DEFAULTS DIR=SAMPLE
-SET &&DIR=&DIR;

Right now, it is defaulting to SAMPLE but I would to get &DIR set from the url launch so &dir is set to THISFOLDER.

Is there a way to 'grab' the &dir from url above?


I am on 7.7.03

thanks

This message has been edited. Last edited by: <Kathryn Henning>,
 
Posts: 36 | Registered: October 01, 2003Report This Post
Virtuoso
posted Hide Post
It would be useful to know what you are really trying to achieve. What does &DIR do within the Maintain, and why do you think you need a Global variable?

The IBIF_cmd operates differently to IBIF_ex, there are approaches you can take to ameliorate the differences, but better to know what it is you are trying to achieve.


Alan.
WF 7.705/8.007
 
Posts: 1451 | Location: Portugal | Registered: February 07, 2007Report This Post
Silver Member
posted Hide Post
Let me provide more details on what I am trying to achieve. Maybe there is another way to do this.
Basically I am trying to launch a maintain app but carrying the amper variables that user selected.
Prior to launch the maintain application, user runs a fex file (see below) which basically calls a USE dynamically statement to a focus db. This amper variable &DIR shows on url.
I have a number of folders with same focus db:
/sample/fdb.foc
/thisfolder/fdb.foc
/thisfolder1/fdb.foc
etc...

The fex file that is selected by user. I have put this fex in user profile (launchmnt)
-DEFAULTS DIR=SAMPLE
-SET &&DIR=&DIR;
-SET &DB='F'|&&DIR;
USE CLEAR
USE
&DB ON FOCSU01 AS DB READ
END
-RUN

User selects THISFOLDER as &DIR. However launching my maintain with: ibi_apps/WFServlet?IBIF_cmd=MNTCON+EX+MNTAPP&DIR=THISFOLDER&IBIS_connect=on&IBIC_user=launchmnt
it never picks up selected THISFOLDER as &DIR by user.
In my maintain app, I am using DIRP/a8 = IWC.GetAppCGIValue("DIR");
I see that DIRP is SAMPLE from default in user profile.

Maybe there is a better way to launch maintain while able to carry variable DIR.

This is my javascript code I use currently to launch from maintain.html

<script language=JavaScript>
function run(appl)
{
var cmd =
"/ibi_apps/WFServlet?IBIF_cmd=MNTCON+EX+fcstvpas&DIR=!IBI.AMP.DIR;&IBIS_connect=on&IBIC_user="
+appl;
window.open(cmd, "maintain", "scrollbars=yes,resizable=yes");
}


href="java_script:run['launchmnt')"
onMouseOver="return showStatus('Maintain launch')"
onMouseOut="return showStatus('')">Maintain launch

Let me know if you need more info.

thanks

This message has been edited. Last edited by: paulux99,
 
Posts: 36 | Registered: October 01, 2003Report This Post
Virtuoso
posted Hide Post
The approach I would take is to create a focexec and call this focexec, instead of the maintain, with IBIF_ex and IBIC_user.

The focexec will call the Maintain with a MNTCON EX fcstvpas parm1.

Running the focexec this way should call the user profile, and the &&variable can be applied as parm1 in the MNTCON call.

Within the maintain you can use Sys_mgr functions (Sys_Mgr.Get_NameParm, Sys.Mgr.Get_InputParams_Count and Sys_Mgr.Get_PositionParm) to retrieve the parameter values.

I know the IBIF_ex approach works, but have never tried to use it to call a user profile in this way, though it should work.

Otherwise could this just be in the focexec called by the original call, rather than in the user profile, it seems to be straightforward enough.

.../WFServlet?IBIF_ex=mntcall&DIR=xxxxx
-*mntcall.fex
-INCLUDE mntcallinc
MNTCON EX fcstvpas &DIR

-*mntcallinc.fex
-DEFAULTS DIR=SAMPLE
-SET &&DIR=&DIR;
-SET &DB='F'|&&DIR;
USE CLEAR
USE
&DB ON FOCSU01 AS DB READ
END
-RUN


If you are using the FOCUS db direct within the maintain, that should be fine, but if you are running a focexec from within the maintain that uses the FOCUS db, that focexec needs to set up the USE again, so you will need to pass parameters to allow that to happen and -INCLUDE mntcallinc again. If you use the KEEP parameter on the call this only needs to be run once per maintain session, else run on each call.


Alan.
WF 7.705/8.007
 
Posts: 1451 | Location: Portugal | Registered: February 07, 2007Report This Post
Silver Member
posted Hide Post
Alan, thanks for the suggestion, actually my original code was based upon ibif_ex with what you suggested. It seems to work with version 6 or prior but no longer works with 7 version above.
I am launching a maintain form so the initial launch page (/ibi_apps/WFServlet?IBIF_ex=rtlmainx&DIR=XXSAV01) form shows the correct directory but once
I click on any maintain case, then it will loose the maintain page (http 405 blank page).
I have also talked to ibi and it seems that I might have to launch with ?IBIF_cmd=MNTCON+EX+

If other suggestion, let me know. thanks

This message has been edited. Last edited by: paulux99,
 
Posts: 36 | Registered: October 01, 2003Report This Post
Virtuoso
posted Hide Post
What is rtlmainx and what code does it have in it?


Alan.
WF 7.705/8.007
 
Posts: 1451 | Location: Portugal | Registered: February 07, 2007Report This Post
Silver Member
posted Hide Post
rtlmainx or mntcall has basically your code

-*mntcall.fex
-INCLUDE mntcallinc
MNTCON EX fcstvpas &DIR
 
Posts: 36 | Registered: October 01, 2003Report This Post
Virtuoso
posted Hide Post
Okay

This is a technique I have used successfully before with no issues. When you say you click on a maintain case, is that an event handler from a form to a Maintain case using IWCTrigger?

I presume this is persistent maintain.

Another approach would be to use -HTMLFORM after the -INCLUDE, utilising a self submitting call to IBIF_cmd. I've got the code somewhere, so can get it out if you need it.


Alan.
WF 7.705/8.007
 
Posts: 1451 | Location: Portugal | Registered: February 07, 2007Report This Post
Silver Member
posted Hide Post
Yes I have an event handler on a click to infer into a stack then show another form.
then I get a blank page. I am on 7.7.03. This coding seems to work for me with my older version of focus 6 or earlier.
Talking to ibi, they seem to say due to security concerns that ibif_ex does not work.

On another method, I have also tried with with -html include and it does not seem to work either.
Maybe you can provide your coding or tell me me what could be wrong with the code below.

-*launchpage.htm
function run(appl) {
var cmd =
"/ibi_apps/WFServlet?IBIF_ex=mntfcst&";
cmd = cmd + "DIR=!IBI.AMP.DIR;&FEX=" + appl;
window.open(cmd, "maintain");

nmouseover="return showStatus('Launch)')" onmouseout="return showStatus('')" href="javascript:run('rtlmainx')">Launch
/font>

-*rtlmainx
-INCLUDE mntcallinc

-*mntfcst
-*-HTMLFORM BEGIN
script type="text/javascript">
function doSubmit()
{
var maintainForm = document.getElementById("maintain");
maintainForm.IBIF_cmd.value = "MNTCON EX fcstvpas";
maintainForm.submit();
return (true);
}
/script>

-*body onload="doSubmit[);">
-*form name="maintain" id="maintain" " action="/ibi_apps/WFServlet"
method="post">
input type="hidden" name="IBIS_connect" value="on">
input type="hidden" name="IBIS_outbound" value="off">
input type="hidden" name="IBIF_cmd">
input type="hidden" name="IBIS_passthru" value="on">
input type="hidden" name="IBIC_user" value="lauchmnt">

-*/form>
-*/body>
-**

-*-HTMLFORM END
  

This message has been edited. Last edited by: paulux99,
 
Posts: 36 | Registered: October 01, 2003Report This Post
Virtuoso
posted Hide Post
Let's try and keep simple for the moment. There seem to be too manny parameters floating around.

Call a focexec called mntcall. The url will be
http://server:port/ibi_apps/WFServlet?IBIF_ex=mntcall&DIR=whatever
or an equivalent form.

-*mntcallinc.fex
-DEFAULTS &DIR=SAMPLE
-SET &DB='F'|&DIR;
USE CLEAR
USE
&DB ON FOCSU01 AS DB READ
END
-RUN


-* File mntcall.fex
-INCLUDE mntcallinc

-HTMLFORM BEGIN
<html>
<head>
<script>
function submitForm(){
document.getElementById("maintainForm").submit();
}
window.onload=submitForm;
</script>
</head>
<body>
<form id="maintainForm" action="../../ibi_apps/WFServlet" method="post">
<input type=hidden name="IBIF_cmd" value="MNTCON EX fcstvpas -v !IBI.AMP.DIR;">
</form>
</body>
</html>
-HTMLFORM END


In the maintain fcstvpas, get the value of DIR with Sys_Mgr.Get_PositionParm(1);

This message has been edited. Last edited by: Alan B,


Alan.
WF 7.705/8.007
 
Posts: 1451 | Location: Portugal | Registered: February 07, 2007Report This Post
Virtuoso
posted Hide Post
Okay

I see your issue. When running a Maintain direct through MNTCON, as opposed to running through IBIF_cmd, the call-back in the generated code to the Resume Maintain is coded as ibi_cgi/ibiweb.exe, which is now invalid, hence the error you are getting. It should be ibi_app/WFServlet as it is when run through IBIF_cmd. This is either deliberate, which would surprise me, or an oversight.

So whilst you can set it up to get the &DIR into the Maintain, you cannot issue a dynamic USE, or I cannot see how it could be done.

The only option I can see is to make the Maintain non-persitent, with a direct call from MNTCON, so that you can issue the USE. A bit messy really, but doable.


Alan.
WF 7.705/8.007
 
Posts: 1451 | Location: Portugal | Registered: February 07, 2007Report This Post
Silver Member
posted Hide Post
Alan,
It seems that Parm1/a0=sys_mgr.get_positionParm(1); captures &DIR in maintain but it seems the -INCLUDE mntcallinc is not passing the USE statement for DB.foc
I am getting:
(FOC036) NO DATA FOUND FOR THE FOCUS FILE NAMED: DB

when I do -EXIT prior to maintain launch, I can see DB that is set

-INCLUDE mntcallinc
-DEFAULTS DIR=SAMPLE
-SET &DB='F'|XXSAV01;
USE CLEAR
USE ADD
FXXSAV01 ON FOCSU01 AS DB READ
END
? USE
-EXIT
0 DIRECTORIES IN USE ARE:
FXXSAV01 AS DB ON FOCSU01


this is what I have coded

-****************************
-* html launch

-*<script language=JavaScript>
function Launch()
{
sURL = "/ibi_apps/WFServlet?IBIF_ex=mntcall&DIR=!IBI.AMP.DIR;";
vTarget = window.open(sURL);
}
Launch();

-*A href="java_script:Launch[)">Launch

-*mntcall

-*-SET &ECHO=ALL;
-INCLUDE mntcallinc
-**-EXIT
-**-HTMLFORM BEGIN
-**<script>
function submitForm(){
document.getElementById("maintainForm").submit();
}
window.onload=submitForm;
-**
/head>
body>
form id="maintainForm" action="../../ibi_apps/WFServlet" method="post">

/form>
-**-HTMLFORM END

-****************************

This message has been edited. Last edited by: paulux99,
 
Posts: 36 | Registered: October 01, 2003Report This Post
Virtuoso
posted Hide Post
quote:
So whilst you can set it up to get the &DIR into the Maintain, you cannot issue a dynamic USE, or I cannot see how it could be done.


What you are seeing is what I know will happen.

The only option I see is to make your Maintain non-persistent and use direct MNTCON EX. Then the dynamic USE will be in effect.

You can issue a non-dynamic USE in EDASPROF, there is nowhere I can find to issue a dynamic USE when using IBIF_cmd.

Could you restructure your DB to have the ability to segregate the data rather than have separate files?


Alan.
WF 7.705/8.007
 
Posts: 1451 | Location: Portugal | Registered: February 07, 2007Report This Post
Silver Member
posted Hide Post
Alan,
Unfortunately, we cannot change, we have too many fex and directories based on that separation. If I hear some suggestions/fixes from ibi, I will sure let you know. Thanks for the different suggestions.
Paul
 
Posts: 36 | Registered: October 01, 2003Report This Post
Virtuoso
posted Hide Post
Hi Paul

Try making the Maintain non-persistent - winform show_and_exit. There are different things to consider running this way, but it is effective, and will overcome the 404/405 error you are getting, run from MNTCON EX not IBIF_cmd, and then you can issue the dynamic USE prior to the MNTCON command.


Alan.
WF 7.705/8.007
 
Posts: 1451 | Location: Portugal | Registered: February 07, 2007Report This Post
Silver Member
posted Hide Post
Hi Alan,
I think for now, I rather not use my Maintain application to become non-persistent. It seems I would have to rewrite my maintain app quite a lot to work. In non-persitent mode, I would basically use only JavaScript on the form and Maintain commands do not work in events. Anyway thanks for suggestion, I might use non-persistent as a last resort. Thanks for all your suggestion.
Paul

This message has been edited. Last edited by: paulux99,
 
Posts: 36 | Registered: October 01, 2003Report 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     [WORKAROUND] maintain launch along with user profile, get amper variable from url

Copyright © 1996-2020 Information Builders