91
Web Server - Ask For Help / Re: Changing theme has no effect
« Last post by Poul Jensen on April 18, 2025, 10:18:53 PM »Hi Jane,
I really would like to set the theme as early as possible, and with static dataset this is easy.
As I understand it, with multiple datasets the Webhandler - Processlink is the best place to set the users dataset, and this works fine now.
And here I also read the user theme.
See the code below.
I will see if I can make it to the Thursday webinar.
Webhandler - Processlink:
Webhandler - ParseRequestHeader:
I really would like to set the theme as early as possible, and with static dataset this is easy.
As I understand it, with multiple datasets the Webhandler - Processlink is the best place to set the users dataset, and this works fine now.
And here I also read the user theme.
See the code below.
I will see if I can make it to the Thursday webinar.
Webhandler - Processlink:
Code: [Select]
ds_outputdebugstring( 'Webhandler Processlink - p_web.GetValue(a) 1: ' & p_web.GetValue('a') )
ds_outputdebugstring( 'Webhandler Processlink - p_web.GSV(CommandA) 1: ' & p_web.GSV('CommandA') )
!ANY PARAMETER? IF NOT DEFAULTS TO '1', BUT ONLY IF p_web.GSV('CommandA') IS NOT SET:
IF p_web.GetValue('a') <> ''
p_web.SetValue('CommandA', p_web.GetValue('a'))
p_web.SSV('CommandA', p_web.GetValue('a'))
!LOGS OUT
p_web.SSV('Med_Init', '')
p_web.SSV('Med_Navn', '')
p_web.SSV('Med_Email', '')
p_web.SetSessionLoggedIn(0)
ELSE
IF p_web.GSV('CommandA') = ''
p_web.SetValue('CommandA','1')
p_web.SSV('CommandA', '1')
END
END
ds_outputdebugstring( 'Webhandler Processlink - p_web.GSV(CommandA) 2: ' & p_web.GSV('CommandA') )
!SETTING THE DATAPATH - A FOLDER OFF THE STATIC PATH IN GLO:StellarProgSti
GLO:RegnskabsNummer = p_web.GSV('CommandA')
p_web.SSV('GLO:RegnskabsNummer', GLO:RegnskabsNummer)
GLO:DataSti = CLIP(GLO:StellarProgSti) & '\' & p_web.GSV('CommandA')
p_web.SSV('GLO:DataSti', GLO:DataSti)
p_web.SSV('DataPath', p_web.GSV('GLO:DataSti'))
ds_outputdebugstring('Webhandler Processlink - GLO:DataSti: ' & p_web.GSV('DataPath'))
IF EXISTS( GLO:DataSti )
GLO:Inifil = clip(GLO:DataSti) & '\MobilService.ini'
p_web.SSV('GLO:Inifil', GLO:Inifil)
include('\pstellar_filename_defs_Slim.inc') !THIS IS WHERE THE FILENAMES ARE BUILD
!GETTING CUSTOMER NAME FROM INI
g:KundeNavn = GETINI('KundeProg','Kundenavn_' & p_web.GSV('CommandA') ,'' , clip(path()) & '\KundeProg.ini')
IF CLIP(g:KundeNavn) = ''
!GRABS DEFAULT:
g:KundeNavn = GETINI('KundeProg','Kundenavn' ,'' , clip(path()) & '\KundeProg.ini')
END
p_web.SSV('Kundenavn', g:KundeNavn)
!GETTING THEME FROM INI
GloTheme = GETINI('KundeProg','Theme_' & p_web.GSV('CommandA') ,'redmond', clip(path()) & '\KundeProg.ini')
p_web.SSV('theme', GloTheme )
ds_outputdebugstring('Webhandler Processlink - GloTheme: ' & CLIP(GloTheme))
ELSE
p_web.showInfo('ERROR IN PARAMETER.....')
ds_outputdebugstring('Webhandler Processlink - Path does not exist: ' & CLIP(GLO:DataSti) )
!AND SETS DEFAULT
p_web.SSV('CommandA', '1')
END
Webhandler - ParseRequestHeader:
Code: [Select]
!CALLING ONE OR THE OTHER - BUT SINCE THEY ARE CLEARED, NO CHANGETHEME HAPPENS:
!ds_outputdebugstring('In ParseRequestHeader - p_web.GSV(theme): ' & p_web.GSV('CommandA') & ' - ' & p_web.GSV('theme') )
!IF CLIP(p_web.GSV('theme')) <> ''
! self.ChangeTheme( p_web.GSV('theme') )
!END
ds_outputdebugstring('In ParseRequestHeader - GloTheme: ' & p_web.GSV('CommandA') & ' - ' & CLIP(GloTheme ))
IF CLIP(GloTheme) <> ''
self.ChangeTheme( CLIP(GloTheme ))
END
92
Web Server - Ask For Help / Re: Changing theme has no effect
« Last post by Jane on April 18, 2025, 08:52:47 AM »Why don't you post the exact code you're trying to use?
What you just posted isn't consistent - if the variable is GloTheme then it should be p_web.GSV('GloTheme') rather than what you wrote.
And what does ParseRequestHeader have to do with getting a theme name from an INI file?
And you should only have to set the user's theme once for a session. Are you really reading and setting that each time in ProcessLink?
On second thought, maybe worth asking for help on Bruce's Thursday webinar.
What you just posted isn't consistent - if the variable is GloTheme then it should be p_web.GSV('GloTheme') rather than what you wrote.
And what does ParseRequestHeader have to do with getting a theme name from an INI file?
And you should only have to set the user's theme once for a session. Are you really reading and setting that each time in ProcessLink?
On second thought, maybe worth asking for help on Bruce's Thursday webinar.
93
Web Server - Ask For Help / Re: Changing theme has no effect
« Last post by Poul Jensen on April 18, 2025, 12:25:22 AM »My initial description is incomplete.
I actually read the individual users dataset and thus their selected theme in Webhandler - Processlink, and set the GloTheme accordingly.
But in Webhandler - ParseRequestHeader those variables are empty, no matter if I use
self.ChangeTheme( GloTheme )
or
self.ChangeTheme( p_web.GSV('theme') )
I am confused....
/Poul
I actually read the individual users dataset and thus their selected theme in Webhandler - Processlink, and set the GloTheme accordingly.
But in Webhandler - ParseRequestHeader those variables are empty, no matter if I use
self.ChangeTheme( GloTheme )
or
self.ChangeTheme( p_web.GSV('theme') )
I am confused....
/Poul
94
The Rest - Share Knowledge / Re: Posting a file to a web site
« Last post by ILEANA PETERSEN on April 17, 2025, 03:08:03 PM »Hi Seanh,
Your post helped me resolve a similar issue, but now when I try to post the CSV file, I get Error -71
"The SSL Remote Certificate Common Name did not match the Server Name."
Any suggestions on how to resolve this error?
Your post helped me resolve a similar issue, but now when I try to post the CSV file, I get Error -71
"The SSL Remote Certificate Common Name did not match the Server Name."
Any suggestions on how to resolve this error?
95
Web Server - Ask For Help / Re: Changing theme has no effect
« Last post by Jane on April 17, 2025, 10:53:23 AM »Spelling counts.
Using exactly what you see in debugview, can you use that exact text value and change the theme from the URL?
i.e.
http://127.0.0.1:88/?_theme_=palmtree
Using exactly what you see in debugview, can you use that exact text value and change the theme from the URL?
i.e.
http://127.0.0.1:88/?_theme_=palmtree
96
Web Server - Ask For Help / Changing theme has no effect (SOLVED)
« Last post by Poul Jensen on April 17, 2025, 02:27:20 AM »In Webhandler - ParseRequestHeader I have:
but no change in theme is being done.
I have verified that the correct theme is picked from the ini-file.
Any hints?
tia
/Poul
Code: [Select]
GloTheme = GETINI('KundeProg','Theme_' & p_web.GSV('CommandA') ,'redmond', clip(path()) & '\KundeProg.ini')
ds_outputdebugstring('In ParseRequestHeader - GloTheme: ' & GloTheme )
self.ChangeTheme( GloTheme )
but no change in theme is being done.
I have verified that the correct theme is picked from the ini-file.
Any hints?
tia
/Poul
97
Web Server - Ask For Help / Re: Pass parameter in servercall?
« Last post by Poul Jensen on April 17, 2025, 12:32:39 AM »p_web.StoreValue('a')
Is the best way to set a session value to a value, because then if the value doesn't exist (as a parameter) it does not overwrite the session value.
I expect you are just overwriting your session value to blank when the value does not exist.
Thanks Bruce - spot on.
98
Web Server - Ask For Help / Re: Pass parameter in servercall?
« Last post by Poul Jensen on April 17, 2025, 12:32:03 AM »You'll need to set your filename variables EACH TIME your code runs through p_web.ProcessLink in the webhandler (because each pass through there is happening on a new thread), so set the session values the first time (when they're sent as parameters) then use those session values to set the filename variables EACH TIME.
That was the missing piece :-)
Thanks Jane.
99
Web Server - Ask For Help / Re: Pass parameter in servercall?
« Last post by Bruce on April 16, 2025, 06:45:26 PM »p_web.StoreValue('a')
Is the best way to set a session value to a value, because then if the value doesn't exist (as a parameter) it does not overwrite the session value.
I expect you are just overwriting your session value to blank when the value does not exist.
Is the best way to set a session value to a value, because then if the value doesn't exist (as a parameter) it does not overwrite the session value.
I expect you are just overwriting your session value to blank when the value does not exist.
100
Web Server - Ask For Help / Re: Pass parameter in servercall?
« Last post by Jane on April 16, 2025, 03:22:59 PM »Works for me, Poul.
How are you storing the parameter? If you're putting it into a sessionValue, it should be sticky and persist through the login and beyond.
You'll need to set your filename variables EACH TIME your code runs through p_web.ProcessLink in the webhandler (because each pass through there is happening on a new thread), so set the session values the first time (when they're sent as parameters) then use those session values to set the filename variables EACH TIME.
How are you storing the parameter? If you're putting it into a sessionValue, it should be sticky and persist through the login and beyond.
You'll need to set your filename variables EACH TIME your code runs through p_web.ProcessLink in the webhandler (because each pass through there is happening on a new thread), so set the session values the first time (when they're sent as parameters) then use those session values to set the filename variables EACH TIME.