r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[!Cheyenne] Discussions about the Cheyenne Web Server

Graham
3-Jun-2007
[988x3]
Not that I know of ...
Could it be some interaction with the javascript libraries?
Which seems unlikely
Dockimbel
3-Jun-2007
[991x2]
unless you LOAD the js code somhow in the REBOL context...
somehow
Graham
3-Jun-2007
[993x2]
I'm only doing 

<% include-file something.js %>
so, it can't be doing that ...
Dockimbel
3-Jun-2007
[995x2]
are you passing a file! type to INCLUDE-FILE ?
does it work ok if you remove this line ?
Graham
3-Jun-2007
[997x3]
It works okay most of the time ... but sometimes when I use the back 
arrow on my browser it crashes
<html>
<head>
<% include-file %button-header.js %>

	<title>Welcome to TestApp web application</title>
</head>
<body>
<img src="logo.png">
<center>
<% include-file %button-form.js %>
<a href="logout.rsp">Logout</a>
</center>
</body>
</html>
that's it
Terry
3-Jun-2007
[1000]
hey Doc.. while you're here...  I want to trap all 404s and process 
them (in other words, there's no such thing as a 404 where I am).. 
how would I do that?
Graham
3-Jun-2007
[1001]
it was crashing on  this page
Terry
3-Jun-2007
[1002]
Another way to put it.. I want to map all urls to a single module
Dockimbel
3-Jun-2007
[1003x2]
Terry: use the 'filter-output phase to catch all 404 (you can implement 
it in mod-static, or in your won module).
won = own
Terry
3-Jun-2007
[1005]
any specs on that phase?
Dockimbel
3-Jun-2007
[1006]
all phases use the same func spec block, this one will be called 
just before the response is sent to the client.
Terry
3-Jun-2007
[1007]
Also I tried a make-response phase in  a module, but it never fired?
Dockimbel
3-Jun-2007
[1008]
more info in %docs/developer-guide.html
Terry
3-Jun-2007
[1009x2]
yeah.. I got to this part.. 

Here's a typical phase implementation :

url-translate: func
:)
Graham
3-Jun-2007
[1011x3]
http://www.compkarori.co.nz- userid dockimbel pass 1234
not crashing at the moment
doesn't do much except authenticate and produce a menu
Dockimbel
3-Jun-2007
[1014x2]
If your 'make-response is not fired, it's because another module's 
'make-response did get called and closed the phase. You should also 
turn on debugging using -vv option when starting cheyenne.r, it will 
show you which phase from which module get called, so you'll see 
who's the guilty one ;-)
Graham: testing, seems ok so far.
Graham
3-Jun-2007
[1016]
I'll play some more .. but I have been avoiding redefining global 
words :)
Terry
3-Jun-2007
[1017x2]
and change it's return to false, i take it.
which modules do I need to include for stripped down cheyenne?
Dockimbel
3-Jun-2007
[1019x3]
right: FALSE will let other module a chance to process the phase, 
TRUE will close the phase.
mod-static (static pages), mod-action (CGI)
and mod-rsp if you want RSP engine.
Terry
3-Jun-2007
[1022x3]
so.. looks like static returns true?
[HTTPd] Phase access-check done ( mod-static )
Ok.. .. so .. what's up with the first normal last?
Dockimbel
3-Jun-2007
[1025]
humm, not sure you can infer the resulting phase value from that 
log (might be TRUE or FALSE, but not NONE)
Terry
3-Jun-2007
[1026x2]
So, does Cheyenne process all modules phases then moves onto the 
next in all modules?
kinda parallel?
Dockimbel
3-Jun-2007
[1028]
first / normal / last : that's the position in phase list, you'd 
like for your function in a given phase
Terry
3-Jun-2007
[1029]
in other words.. do all url-to-filename for all modules.. then do 
all set-mime-type for all modules... and so on.
Dockimbel
3-Jun-2007
[1030x2]
Right, one phase calls all modules (unless one returns TRUE), then 
go to the next phase (see the 1.1 in developer's guide).
exactly
Terry
3-Jun-2007
[1032x3]
ahh... ok...
that's pretty cool...
why does the position matter?.. is the position related to other 
modules, or to itself?
Dockimbel
3-Jun-2007
[1035]
the position determines the calling order in a given phase
Terry
3-Jun-2007
[1036]
I take it the module order in the config file is a type of position 
as well?   if the tirst module returns true, then the rest not considered?
Dockimbel
3-Jun-2007
[1037]
when you declare : url-translate first, you want your module's url-translate 
to be called the first.