Platform
-
René Houba
- Posts: 220
- Joined: Thu Nov 26, 2015 7:03 am
Re: Platform
Hi Paulm,
I cannot remember a system variable for these, but you can try:
*OSAPI (WIN32 for example for Windows)
I cannot remember a system variable for these, but you can try:
*OSAPI (WIN32 for example for Windows)
Re: Platform
*OSAPI, here:
https://docs.lansa.com/14/en/lansa015/c ... eneral.htm
*OSAPI
Operating System API Name.
This is a more precise replacement for *CPUTYPE which is less likely to change the name of its values.
Windows Desktop - WIN32 (Note Windows Desktop 64-bit uses WIN32 API)
Windows Metro – WINRT
IBM i – IBMI
Linux - LINUX
https://docs.lansa.com/14/en/lansa015/c ... eneral.htm
*OSAPI
Operating System API Name.
This is a more precise replacement for *CPUTYPE which is less likely to change the name of its values.
Windows Desktop - WIN32 (Note Windows Desktop 64-bit uses WIN32 API)
Windows Metro – WINRT
IBM i – IBMI
Linux - LINUX
Re: Platform
Hi,
*OSAPI is not supported on the Web
*OSAPI is not supported on the Web
Re: Platform
Hi Paul
If you are in the web, you can find directly what is the browser you are using.
but if you want to know server information, you need to ask the server.
For that, you can create (or add to any server module you are using now) a
server routine like this (in my example here i called test1212 to this server module):
then in your webpage:
etc.
If you are in the web, you can find directly what is the browser you are using.
but if you want to know server information, you need to ask the server.
For that, you can create (or add to any server module you are using now) a
server routine like this (in my example here i called test1212 to this server module):
Code: Select all
Begin_Com Role(*EXTENDS #PRIM_SRVM)
Srvroutine Name(GetServerInformation)
Field_Map For(*OUTPUT) Field(#std_strng) Parameter_Name(OSAPI)
#std_strng := *OSAPI
Endroutine
End_Com
Code: Select all
Define_Com Class(#test1212.GetServerInformation) Name(#GetServerInformation)
#GetServerInformation.ExecuteAsync OSAPI(#STD_STRNG)
Re: Platform
So taking the question of what platform a client is running a VL web application from to the next step, I am curious what others might be implementing, or ideas to use.
With the fact our application is VL web, running in a browser.
From the HTTP User Agent string, we can get a good idea of the browser and device OS.
But is there a means to get a more specific device name that we can record as well?
With a remote branch, with several members signing on through the web application, the web IP will all be the ISP assigned to their router connection, so that is really not unique enough (such as LAN ip).
Using a Login ID and pwd, are fine to tell us the "who" and of course we can get the "when", but if there was a more specific "where", that would be helpful. Like the old workstation ID's, it would be great to know that Jim Smith signed in on "Jims iPhone" or "Galaxy Tab A".
I realize the browser is limited, and a simple google search basically confirms a browser on it's own can not pull the computer/device name, but am hopeful someone here might have a good idea to use.
With the fact our application is VL web, running in a browser.
From the HTTP User Agent string, we can get a good idea of the browser and device OS.
But is there a means to get a more specific device name that we can record as well?
With a remote branch, with several members signing on through the web application, the web IP will all be the ISP assigned to their router connection, so that is really not unique enough (such as LAN ip).
Using a Login ID and pwd, are fine to tell us the "who" and of course we can get the "when", but if there was a more specific "where", that would be helpful. Like the old workstation ID's, it would be great to know that Jim Smith signed in on "Jims iPhone" or "Galaxy Tab A".
I realize the browser is limited, and a simple google search basically confirms a browser on it's own can not pull the computer/device name, but am hopeful someone here might have a good idea to use.
Arlyn Dale
Servias LLC
Servias LLC
Re: Platform
Hi Dino,Dino wrote: Tue Dec 13, 2022 12:30 am Hi Paul
If you are in the web, you can find directly what is the browser you are using.
but if you want to know server information, you need to ask the server.
In fact, I would like to know the platform on which the browser runs (client side)
Re: Platform
I can see in pages like this one:
https://stackoverflow.com/questions/259 ... he-browser
that you can get some information from the browser,
...using javascript function navigator.
To include javascript in LANSA, one of the possible ways is to use a widget. You can create a new widget
like this: and in the implementation tab use this javascript code:
then you can include that widget in any LANSA web page you need and use it like this:
By using a widget, if you ever need to update the way you get this browser information, is just one centralized place to do it in the repository, instead of having different code to achieve the same in several programs.
https://stackoverflow.com/questions/259 ... he-browser
that you can get some information from the browser,
Code: Select all
navigator["appCodeName"]
navigator["appName"]
navigator["appMinorVersion"]
navigator["cpuClass"]
navigator["platform"]
navigator["plugins"]
navigator["opsProfile"]
navigator["userProfile"]
navigator["systemLanguage"]
navigator["userLanguage"]
navigator["appVersion"]
navigator["userAgent"]
navigator["onLine"]
navigator["cookieEnabled"]
navigator["mimeTypes"]To include javascript in LANSA, one of the possible ways is to use a widget. You can create a new widget
like this: and in the implementation tab use this javascript code:
Code: Select all
function( PROTOTYPE, WIDGET )
{
PROTOTYPE.navigator = function( strvalueRequested )
{
return navigator[strvalueRequested];
}
return WIDGET.Completed;
}
Code: Select all
Begin_Com Role(*EXTENDS #PRIM_WEB) Theme(#SYS_THEME<MaterialDesignBlue>)
Define_Com Class(#getDetailedBrowserInformation) Name(#getDetailedBrowserInformation)
Define_Com Class(#PRIM_MD.Label) Name(#Text) Caption('Text') DisplayPosition(1) Left(33) Parent(#COM_OWNER) TabPosition(1) Top(263) Width(968)
Evtroutine Handling(#Com_owner.Initialize)
#Text.Caption := #getDetailedBrowserInformation.navigator( "appCodeName" )
Endroutine
End_Com
Re: Platform
Has anyone else tried to utilize the js function navigator?
I have followed Dino's example, created the widget, loaded to a VL web view, but only get some of the fields populated?
Values received for:
appCodeName, appName, platform, appVersion, userAgent, onLine, cookieEnabled
Blank, or no values received for:
appMinorVersion, cpuClass, opsProfile, userProfile, systemLanguage, userLanguage, mimeTypes
I am just wondering if I have something incorrect, or should I not expect to get values for those other fields?
I have followed Dino's example, created the widget, loaded to a VL web view, but only get some of the fields populated?
Values received for:
appCodeName, appName, platform, appVersion, userAgent, onLine, cookieEnabled
Blank, or no values received for:
appMinorVersion, cpuClass, opsProfile, userProfile, systemLanguage, userLanguage, mimeTypes
I am just wondering if I have something incorrect, or should I not expect to get values for those other fields?
Arlyn Dale
Servias LLC
Servias LLC
Re: Platform
Thank you very much Dino, I will try your solution
Re: Platform
Hi Dino,
I tried your solution and it is exactly what I needed.
Thank you very much for your help.
I tried your solution and it is exactly what I needed.
Thank you very much for your help.
Re: Platform
Browsers do not guarantee that *any* of that information is accurate.
In many browsers, it is possible to configure the browser to 'alter' the provided information (ie. the user can change what is exposed).
So it should not be *relied* upon.
I prefer the idea of asking your 'logged in' user to name their device, and storing a Secure Cookie or using Secure Storage to store a value that you generated as an 'ID' (which you can then 'lookup' in a table).
The bigger question would be 'why do you need to know if they are on Windows/Linux/Android/IOS etc.':
If you are using the supplied controls with LANSA, then these *should* work the same regardless of platform.
If you have something specific which you *know* would only be available on a specific device, then follow the advice since 2001 which is to:
*test* for the feature existence. :
This avoids coding a specific ' IF InternetExplorer running on windows 8' do something.
In many browsers, it is possible to configure the browser to 'alter' the provided information (ie. the user can change what is exposed).
So it should not be *relied* upon.
I prefer the idea of asking your 'logged in' user to name their device, and storing a Secure Cookie or using Secure Storage to store a value that you generated as an 'ID' (which you can then 'lookup' in a table).
The bigger question would be 'why do you need to know if they are on Windows/Linux/Android/IOS etc.':
If you are using the supplied controls with LANSA, then these *should* work the same regardless of platform.
If you have something specific which you *know* would only be available on a specific device, then follow the advice since 2001 which is to:
*test* for the feature existence. :
Code: Select all
if (window.navigator.msSaveOrOpenBlob)
{
// do what you need with that feature (typically this would be InternetExplorer specific).
}
else
{
// do things the way it works in most browsers
}
Re: Platform
Brendan,
I do not know the exact needs Paulm started this thread for, but I am looking for suggestions and ideas on how others might be logging or tracking what would be the "workstation" name or id, when using VL web client applications. This would be for audit or training purposes to track the "Who, When, and Where" of an action being logged. The Who & When is the easy part, I am looking for a good "Where" option. Is there already an example of what you are describing in your idea with the secure storage (maybe in a technical newsletter)?
I do not know the exact needs Paulm started this thread for, but I am looking for suggestions and ideas on how others might be logging or tracking what would be the "workstation" name or id, when using VL web client applications. This would be for audit or training purposes to track the "Who, When, and Where" of an action being logged. The Who & When is the easy part, I am looking for a good "Where" option. Is there already an example of what you are describing in your idea with the secure storage (maybe in a technical newsletter)?
Arlyn Dale
Servias LLC
Servias LLC