Actually after your previous comment I was abot to get it working as a prototype:
I had to change my implementation a bit but it made it mostly cleaner. To get the original script name I now need to parse the request uri, but that''s the right thing to do in the first place and something I was not able to do previously. But 2 questions remain:
- is there a utility class for parsing active-type uris? org.netkernel.layer0.urii.ParsedIdentifierImpl if ok for extracting the arguments, but doesn''t have a way to get the scheme or scheme-specific part (i.e., java.net.URI gives you the scheme, scheme-specific-part, and query as per the URI spec where the query is everything after ''?'', but in a nk active-type uri the query is everything after the first ''+''). I could use a grammar to parse this, but I don''t want the identifier as a separate argument.
- what is the difference between arguments (RequestReadOnly.getArgument*) and parameters (RequestContest.getParamValue)? I did find that in this prototype, the "script" argument to the prototype is a parameter and the grammar groups are arguments, but otherwise the distinction isn''t terribly clear.
|
<overlay>
<prototype>JavascriptPrototype</prototype> <script>res:/wrapper/jsreq.js</script> <grammar>jsrun:/ <group> <regextype="relative-path" /> <regextype="nmtoken" />.js </group> <groupmin="0" max="*">+ <groupname="argName"> <regextype="nmtoken" /> </group>@ <groupname="argValue"> <regextype="active-escaped-uri-loose" /> </group> </group> </grammar> </overlay> |
I had to change my implementation a bit but it made it mostly cleaner. To get the original script name I now need to parse the request uri, but that''s the right thing to do in the first place and something I was not able to do previously. But 2 questions remain:
- is there a utility class for parsing active-type uris? org.netkernel.layer0.urii.ParsedIdentifierImpl if ok for extracting the arguments, but doesn''t have a way to get the scheme or scheme-specific part (i.e., java.net.URI gives you the scheme, scheme-specific-part, and query as per the URI spec where the query is everything after ''?'', but in a nk active-type uri the query is everything after the first ''+''). I could use a grammar to parse this, but I don''t want the identifier as a separate argument.
- what is the difference between arguments (RequestReadOnly.getArgument*) and parameters (RequestContest.getParamValue)? I did find that in this prototype, the "script" argument to the prototype is a parameter and the grammar groups are arguments, but otherwise the distinction isn''t terribly clear.