World: r3wp
[!Cheyenne] Discussions about the Cheyenne Web Server
older newer | first last |
Graham 7-Mar-2009 [4203x3] | I have a demo database that contains dummy data ... anyone can access it. |
I have a real database which I don't let anyone except myself access :) | |
so one set of users access the demo website, and I use the other one. | |
Dockimbel 7-Mar-2009 [4206] | I see, so the patch I'm working on should solve that. It should be available tomorrow. |
Graham 7-Mar-2009 [4207] | Thanks. |
Dockimbel 8-Mar-2009 [4208x7] | Graham, I have a working patch that supports setting same DB virtual name to different connections URL per webapps. Here's an example definition of 2 webapps using this new feature : webapp [ virtual-root "/curecode1/" root-dir %//dev/curecode/ locales-dir %private/locales/ databases [ bugs mysql://[root-:-localhost]/bugs1 ] ] webapp [ virtual-root "/curecode2/" root-dir %//dev/curecode/ locales-dir %private/locales/ databases [ bugs mysql://[root-:-localhost]/bugs2 ] ] |
So, in order to reuse the same code for your EMR app but branching on 2 disctinct databases, you'll have to define 2 different webapps. | |
I've also patched the systray code to include the port number(s) in the yellow help message. | |
Patch available here : http://cheyenne-server.org/tmp/patch-0920.zip | |
Just replace the patched file in your current Cheyenne v0.9.19 sources folder. | |
Test this very carefully before taking it in production and report me any issue/bugs related to that patch (be sure to have checked your own code before reporting). | |
Btw, the 'databases keyword in global section is still working but the 'databases definition block in webapp will take precedence if provided. | |
Graham 8-Mar-2009 [4215] | thanks .. I'm out of town today, but will try it tonight. |
Graham 10-Mar-2009 [4216x4] | what's the process of acccessing a rsp page ? |
is this all I need ? session/start session/content/login?: yes | |
and I need an app-init.r in the web-app directory? | |
Looks like it won't work without an app-init.r | |
Dockimbel 10-Mar-2009 [4220] | An RSP page can be accessed standalone without a webapp. The webapp gives you some additional features like automatic session starting, optional authentification protection, private folders, app-init events, etc... |
Graham 10-Mar-2009 [4221] | I tried that .. and got no response |
Dockimbel 10-Mar-2009 [4222x2] | See the RSP script examples provided in %www folder from Cheyenne sources. |
I don't understand what you want to achieve with the code above? | |
Graham 10-Mar-2009 [4224x2] | access the web app folder |
I couldn't get rsp working in www/ directory | |
Dockimbel 10-Mar-2009 [4226x2] | What's your webapp folder? |
/ ? | |
Graham 10-Mar-2009 [4228x6] | no .. |
let me try this again. | |
gee, rsp is now working again in the www/ directory. | |
I was creating rsp pages writing them to the www directory and trying to browse to them ... and it wasn't working with my test.rsp page | |
Isn't the above the correct way to add a browser to the webapp? | |
well, I guess it isn't because it can't find 'login? | |
Dockimbel 10-Mar-2009 [4234x2] | I don't understand why you need this code if you're in a webapp context. |
The webapp will provide you with automatic session, so session/start is not needed (it may even mess up your session content). | |
Graham 10-Mar-2009 [4236] | If I want to login in users from a particular ip address to the webapp? |
Dockimbel 10-Mar-2009 [4237x2] | The login? session special value is used only to control access when authentication protection is set using the AUTH keyword in config file. You need to set it only when you consider that the user has provided enough credentials to let him in (for example once he has filled a login form with correct ID / pass values). |
For login users from particular IP address, just force the login? session value in the RSP script used for authentication. | |
Graham 10-Mar-2009 [4239] | so just session/login?: true |
Dockimbel 10-Mar-2009 [4240x2] | something like : <% allowed-ip: [1.2.3.4 ...] if find allowed-ip request/client-ip [ session/content/login?: yes response/redirect "home.rsp" ] %> |
See %www/testapp/login.rsp | |
Graham 10-Mar-2009 [4242] | That's similar to what I tried .. but got Invalid path value: login? |
Dockimbel 10-Mar-2009 [4243x2] | Did you removed the incorrect session/start? |
Session/start has only been provided to manually start a session for RSP scripts that are not inside a webapp. | |
Graham 10-Mar-2009 [4245] | I see. |
Dockimbel 10-Mar-2009 [4246] | I should document better session/start in RSP API doc. |
Graham 10-Mar-2009 [4247x4] | Just a little observation .... you have this timing script at the bottom of the page ( in app-init.r ) |
It inserts the html before </body> | |
the xml i was emitting also had a </body> in it ... | |
such is life :) | |
Dockimbel 10-Mar-2009 [4251] | That's for the example, you can drop it. It's not needed anymore, the timings are now (from 0.9.19) automatically inserted by the RSP engine in debug mode (when DEBUG keyword is found in the webapp config block). |
Graham 10-Mar-2009 [4252] | I dd remove it .. it was just an observation |
older newer | first last |