Server.Xml file
5 posts
• Page 1 of 1
Server.Xml file
Good morning!
How could I read a variable defined in Server.xml file from within a namespace ?
Example: I have defined <RootData>c:\SiteXData\</RootData> in Server.xml and I have MyUtil.dyalog script file namespace.
From within a “pageABC.dyalog” I get using rootData←req.Server.Config.RootData. How could I get it from within functions/methods defined in MyUtil namespace?
Thanks,
Marco Gantois
How could I read a variable defined in Server.xml file from within a namespace ?
Example: I have defined <RootData>c:\SiteXData\</RootData> in Server.xml and I have MyUtil.dyalog script file namespace.
From within a “pageABC.dyalog” I get using rootData←req.Server.Config.RootData. How could I get it from within functions/methods defined in MyUtil namespace?
Thanks,
Marco Gantois
- Gantois
- Posts: 89
- Joined: Thu Apr 17, 2014 9:44 am
Re: Server.Xml file
Hi Marco!
You can access the server configuration using #.Boot.ms.Config from anywhere in the workspace, so in your example, you'd use #.Boot.ms.Config.RootData
I hope this helps!
/Brian
You can access the server configuration using #.Boot.ms.Config from anywhere in the workspace, so in your example, you'd use #.Boot.ms.Config.RootData
I hope this helps!
/Brian
-
Brian|Dyalog - Posts: 120
- Joined: Thu Nov 26, 2009 4:02 pm
- Location: West Henrietta, NY
Re: Server.Xml file
Hi Brian!
Your solution will help me so much but something wrong occurs on #.Boot after the Load command as following:
A) Before Load: that's right
)load mserver
C:\MiServer\mserver saved Thu Apr 18 00:42:52 2013
Start 'Intro' ⍝ Run the demo server
Start 'c:\MeusSites\rcerta' ⍝ Run the demo server
0
MiServer started on port: 8088
#.Boot.ms.Config.RootData
c:\rCerta\
B) After Load:
Load'c:\MeusSites\rcerta'
Development environment loaded
#.Boot.ms.Config.RootData
VALUE ERROR
#.Boot.ms.Config.RootData
C) Another example:
)load mserver
C:\MiServer\mserver saved Thu Apr 18 00:42:52 2013
Start 'Intro' ⍝ Run the demo server
Start 'c:\MeusSites\rcerta' ⍝ Run the demo server
0
MiServer started on port: 8088
#.Restart
Object 'SRV00000000' has been closed - Web Server shutting down
MildServer stopped.
MiServer started on port: 8088
Load'c:\MeusSites\rcerta'
Development environment loaded
#.Restart
VALUE ERROR
Restart[1] approot←Boot.AppRoot
Thanks
Marco
Your solution will help me so much but something wrong occurs on #.Boot after the Load command as following:
A) Before Load: that's right
)load mserver
C:\MiServer\mserver saved Thu Apr 18 00:42:52 2013
Start 'Intro' ⍝ Run the demo server
Start 'c:\MeusSites\rcerta' ⍝ Run the demo server
0
MiServer started on port: 8088
#.Boot.ms.Config.RootData
c:\rCerta\
B) After Load:
Load'c:\MeusSites\rcerta'
Development environment loaded
#.Boot.ms.Config.RootData
VALUE ERROR
#.Boot.ms.Config.RootData
C) Another example:
)load mserver
C:\MiServer\mserver saved Thu Apr 18 00:42:52 2013
Start 'Intro' ⍝ Run the demo server
Start 'c:\MeusSites\rcerta' ⍝ Run the demo server
0
MiServer started on port: 8088
#.Restart
Object 'SRV00000000' has been closed - Web Server shutting down
MildServer stopped.
MiServer started on port: 8088
Load'c:\MeusSites\rcerta'
Development environment loaded
#.Restart
VALUE ERROR
Restart[1] approot←Boot.AppRoot
Thanks
Marco
- Gantois
- Posts: 89
- Joined: Thu Apr 17, 2014 9:44 am
Re: Server.Xml file
Hi Marco!
Right now, #.Boot.ms.Config is only available while MiServer is running.
Part of the startup of MiServer reads the configuration files and populates the server's configuration.
The Load function just loads the necessary classes so that you can edit pages for your website. Though, it might make some sense to load the configuration as well. I'll consider implementing that for MiServer 3.0.
/Brian
Right now, #.Boot.ms.Config is only available while MiServer is running.
Part of the startup of MiServer reads the configuration files and populates the server's configuration.
The Load function just loads the necessary classes so that you can edit pages for your website. Though, it might make some sense to load the configuration as well. I'll consider implementing that for MiServer 3.0.
/Brian
-
Brian|Dyalog - Posts: 120
- Joined: Thu Nov 26, 2009 4:02 pm
- Location: West Henrietta, NY
Re: Server.Xml file
Hi Brian,
I solved my problem putting RootData variable inside "MyUtil" namespace when I initialized the site variables sessions as following:
#.MyUtil.RootData←req.Server.Config.RootData
req.Session.State.var1←'aaa'
req.Session.State.var2←'bbbbbb'
.....
Thanks
Gantois
I solved my problem putting RootData variable inside "MyUtil" namespace when I initialized the site variables sessions as following:
#.MyUtil.RootData←req.Server.Config.RootData
req.Session.State.var1←'aaa'
req.Session.State.var2←'bbbbbb'
.....
Thanks
Gantois
- Gantois
- Posts: 89
- Joined: Thu Apr 17, 2014 9:44 am
5 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group