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
16-Oct-2008
[3172x2]
<textarea id="code1" onkeydown="tab_to_tab(event,document.getElementById('code1')) 
name="source" rows="40" cols="140"> source
</textarea>
my cut and paste javascript function!
Dockimbel
16-Oct-2008
[3174]
Maybe some JS expert here can help you with that issue ?
Graham
16-Oct-2008
[3175]
I get this 

syntax error ! 
Invalid tag --
Dockimbel
16-Oct-2008
[3176]
Did you tried with Firebug step by step JS debugger ?
Graham
16-Oct-2008
[3177x4]
ahhh....
unmatched quotes in my textarea :(
Gee .. it's working now!!
<textarea id="code1" onkeydown="tab_to_tab(event,document.getElementById('code1'))" 
name="source" rows="40" cols="140"> source
</textarea>
Dockimbel
16-Oct-2008
[3181]
:-)
Henrik
16-Oct-2008
[3182]
ah, got my page working now. always a joy to build a page in a few 
minutes with REBOL.
Graham
16-Oct-2008
[3183x2]
How about returning a file! type instead of a string! value?
not important though ...
Graham
17-Oct-2008
[3185x7]
doc, is there any documentation on how modules work?
As I understand it, modules implemented the task-master API.  But 
now you have mods instead of modules, and instead of install-module, 
you have install-HTTPd-extension
So, how does a particular mod get invoked for an incoming url?  
How do I get the mod-rest.r to process the urls?
So, mods are able to process the various phases as described in cheyennes 
processing pipeliine. Each module can decide whether to process a 
phase, do nothing, and /or prevent another mod from processing that 
phase.
So, I guess if the mod-rest is not seeing the url-translate phase, 
one of the other standard modules has already processed it.
mod-static has this

	order: [
		method-support	last
		url-translate	first
		url-to-filename	last
		access-check	last
		set-mime-type	last
		make-response	last
		filter-output	last
		reform-headers	last
		logging			last
	]
So, I guess mod-static is processing url-translate first ... and 
I need to change this to 

url-translate normal
Dockimbel
17-Oct-2008
[3192]
You shouldn't do that. If you want take priority other an existing 
module already declaring it's callback as 'first, you have to put 
your module after the other module in config file (modules section).
Graham
17-Oct-2008
[3193]
Oh .. so order is important there.
Dockimbel
17-Oct-2008
[3194x2]
You can trace modules activity launching Cheyenne with -vvv option. 
You'll be able to see which module executes a given callback.
Order matters in modules [...] section.
Graham
17-Oct-2008
[3196x2]
I've already got mod-rest as first there.
I'll try the -www
Dockimbel
17-Oct-2008
[3198]
The last one in the list will be the last loaded, so will be able 
to take the FIRST or LAST place even if other previously loaded mods 
did the same.
Graham
17-Oct-2008
[3199]
so, it has to be last then?
Dockimbel
17-Oct-2008
[3200]
Your mod should be *after* mod-static.
Graham
17-Oct-2008
[3201x3]
ok.
18/10-08:16:29.195-[HTTPd] Trying phase url-translate ( mod-rest 
)

18/10-08:16:29.201-[HTTPd] Trying phase url-translate ( mod-static 
)
18/10-08:16:29.210-[uniserve] Calling >on-received< with {^M
url-translate is returning 'true in mod-rest, but mod-static is still 
being called
Dockimbel
17-Oct-2008
[3204]
That's odd.
Graham
17-Oct-2008
[3205]
True	 Request processed. Prevent other modules from processing this 
request (for the current phases).
Dockimbel
17-Oct-2008
[3206]
That how it's supposed to work.
Graham
17-Oct-2008
[3207x2]
ahh....
what's this line do?

		if not find/part req/in/url "/@" 2 [return none]
Dockimbel
17-Oct-2008
[3209x2]
It give up on processing the request and pass it to other mods.
gives
Graham
17-Oct-2008
[3211]
so that's happening
Dockimbel
17-Oct-2008
[3212]
Only URLs starting with /@ pattern will be processed by this mod's 
callback.
Graham
17-Oct-2008
[3213]
is that because the examples I gave you had /@ in them?  :)
Dockimbel
17-Oct-2008
[3214]
Yes :)
Graham
17-Oct-2008
[3215x7]
ok ;)
Things are a lot clearer now :)
It's probably a good idea though ... makes it easy to process the 
rest requests from others
If you use a url like

http://user:[password-:-localhost]/


where is the user and password captured?  I see the browsers FF and 
Chrome immediately remove the userid/password from the address bar. 
 IE complains that it's not a valid site
It's not in req/auth which is empty
and it's been removed already from req/in/url
before the url-translate phase