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     How to get user id using javascript

Read-Only Read-Only Topic
Go
Search
Notify
Tools
How to get user id using javascript
 Login/Join
 
Gold member
posted
I am using HTML layer painter in Developer Studio (version 716) to build a user interface, and want to show the user id on the HTML page. Is there a way to use javascript to get the user id? Thanks in advance for your help.


WebFOCUS 7.1.6 on Win 2K/IIS 6/ISAPI HTML
 
Posts: 77 | Location: San Ramon, CA | Registered: May 17, 2007Report This Post
Virtuoso
posted Hide Post
I don't think it can be done that way.
I believe that the username is something that gets passed on by the webserver to the server, not to the client, and so it is not available to the javascript that runs on the client side.
I think the only way to do this is to code it in such a way that the server is being polled to provide the username. In other words, create a html page that will do nothing but fire off a fex which will collect the username and send it back in a new html page to the client.
Your webserver and application server will have to be secure to accomplish this.


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
You could use ASP if you know how to trap session variables.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Virtuoso
posted Hide Post
Yep, that'll do it. Or php, or jsp or ... doesn't really matter as long as it comes from the server. And our good old fine html painter just can't cope with that.


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
 
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007Report This Post
Master
posted Hide Post
The HTML Painter can code with it. Here is a logical example:

Create an iframe, have it call a url to the fex,php,asp what every you want. the results should create some javascript the when loaded talks to the parent document setting the variable to the value you want. The iframe should be invisible so the user will not see it.

Hope this gives you an idea on how to accomplish it in the HTML Layout Painter.

Tex




Scott

 
Posts: 865 | Registered: May 24, 2004Report This Post
Gold member
posted Hide Post
Hi Tony, i did not know i could use asp in developer studio... could you tell me more about that? btw, did you go to the summit? are you from London? We might have met in summit.


WebFOCUS 7.1.6 on Win 2K/IIS 6/ISAPI HTML
 
Posts: 77 | Location: San Ramon, CA | Registered: May 17, 2007Report This Post
Expert
posted Hide Post
Learner,

I never said you could use ASP in Dev Studio, but what you wanted to achieve could be done in ASP. You read more than I wrote Wink

You would have to write the ASP yourself and then reference it as per TS above, or you could create your HTML in the painter and then convert it to ASP, or you could ........ utilise so many other methods, you only have to know what you want and how to do it using that language.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Gold member
posted Hide Post
sorry i misinterrupted your meaning. You said "you could create your HTML in the painter and then convert it to ASP", I know how to create HTML in the painter in Dev Studio but don't know hwo to convert it to ASP. I have written ASP before so have some idea how that works. Could you kindly show that?


WebFOCUS 7.1.6 on Win 2K/IIS 6/ISAPI HTML
 
Posts: 77 | Location: San Ramon, CA | Registered: May 17, 2007Report This Post
Expert
posted Hide Post
Learner,

If you have created ASP and HTML before then you know the difference. It's that simple.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Expert
posted Hide Post
To get the user id, several things must be in place.


  • Your Web server must have security on, i.e. you must be authenticated.
  • The Web Server needs to be set up to populate the REMOTE_USER variable
  • You should then be able to determine who is logged on.


If you are on a Windoes network with IIS as a webserver, the set up should be simple.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Gold member
posted Hide Post
This is going on what WAZ said, why dont you set the following variable in the ibicommad.wfs or site.wfs

REMOTE_USER=&WF_REMOTE_USER
REMOTE_USER(PASS)

Then in your .fex put this in your define
REMOTE_USER/A8='&REMOTE_USER';


WF 7.6.10 /IIS 6/ JBoss Enterprise 4.3
Windows XP SP 2/Windows 2003 Server
MVS 7.3.3
 
Posts: 76 | Location: Hartford, CT | Registered: August 30, 2005Report This Post
Silver Member
posted Hide Post
Here is a working example of how it can be done on the client using javascript.....

Must enable ActiveX controls however.

<%@ language="VBScript" %>
<html>
  <head>
    <title>wmi query</title>
    <style>
      .pi_ns
      {
        background-color:buttonface;
        border-collapse:collapse;
        margin-top:10px;
      }
      .pi_ns th
      {
        background-color:#d4e9ff;
        font-weight:bold;
      }
      .pi_ns caption
      {
        font-size:16pt;
        text-align:left;
        font-weight:bold;
      }
  
      .pi_ns td,th
      {
        padding:5px;
        border:1px solid buttonshadow;
      }
    </style>
    <script>
      function doquery()
      {
      
        var strComputer = ".";
      	var SWBemlocator = new ActiveXObject("WbemScripting.SWbemLocator");
      	var objWMIService = SWBemlocator.ConnectServer(strComputer, "/root/CIMV2");
      	var strProcess;
      	var stuff;
      	var className = "WIN32_ComputerSystem"
      	var names = objWMIService.Get(className);
      	var colItems = objWMIService.ExecQuery("SELECT * FROM "+className);
      
      	
      	e = new Enumerator(names.Properties_)
      	e2 = new Enumerator(colItems)
      	var propNames = new Array();
      	
      	for(; ! e.atEnd(); e.moveNext())
        {
          propNames.push(e.item().Name);
        }
        var output = ""
        output += "<table class='pi_ns'>";
        output += "<tr>";
        
        for(var i=0;i<propNames.length;i++)
        {
          output += "<th>"+propNames[i]+"</th>";
        }
        output += "</tr>";
      
      	for(; ! e2.atEnd(); e2.moveNext())
        {
          output += "<tr>";
          for(var i=0;i<propNames.length;i++)
          {
            output += "<td>"+eval("e2.item()."+propNames[i])+"</td>";
          }
          output += "</tr>";
        }
        output += "</table>";
        document.getElementById("output").innerHTML = output;
      }
      </script>
  </head>
  <body><%=now()%>
  <div id="output">wait for it...</div>
  <script>doquery();</script>
  </body>
</html>


7.6.6 Mainframe
7.6.4 Web Focus
Windows

 
Posts: 45 | Location: Gaffney SC | Registered: March 30, 2007Report 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     How to get user id using javascript

Copyright © 1996-2020 Information Builders