incubator-jspwiki-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Murray Altheim <murra...@altheim.com>
Subject Re: REST-ful URLs [Was: url rewriting supported?]
Date Tue, 08 Jul 2008 08:44:49 GMT
Janne Jalkanen wrote:
>> Yes, understood. I'm thinking it might be a fourth URLConstructor scheme
>> since it won't completely replace (plug-and-play wise) any of the
>> existing schemes. And as I mentioned to Andrew, I'd like to be able to
>> literally re-use it to invoke another web service layer on top of
>> JSPWiki (for preservation, interwiki, and other potential services).
> 
> If you're in a hurry, I would look into a specific URLConstructor...  I 
> doubt 3.0 will be ready for a long time.

Understood -- as I mentioned just a minute ago, I'd hope we could get
this developed as an add-on that would *also* work with 3.0.

>> I'm not much on hype myself, and while I do agree that the 
>> ShortURLConstructor
>> is either very close to or exactly matching the URL schema I'm 
>> considering,
>> there are some problems with the existing implementation *and* I believe
>> I may have a requirement to load the verb on as the latter token rather
>> than being included in the query string. I don't want to quibble over the
>> definition of RESTful either, but I may need to replace that latter URL
> 
> You could fix the ShortURLConstructor ;-)

I'm thinking that perhaps Andrew and I might be able to fix it via
Stripes. I don't know how big the library is but if it's not big we
could possibly introduce Stripes into the mix as the backing technology
for the ShortURLConstructor, which would ease *everyone* into the 3.0
path since they could begin to use the new schema for all new sites
once we made the new constructor available (as option #4 potentially,
if a complete replacement of ShortURLConstructor isn't feasible or the
URL schema doesn't quite match ShortURLConstructor's, and I don't think
it does exactly).

>>    ShortURLConstructor - uses path-like reference style:
>>
>>          http://mywiki.com/jspwiki/wiki/Main
>>          http://mywiki.com/jspwiki/wiki/Main?do=Edit
>>
>> with
>>
>>          http://mywiki.com/jspwiki/wiki/Main/edit/
> 
> Both of these are RESTful, with the added bonus that the latter will 
> break once we have sub-pages and someone creates a page called "Main/edit".
> 
> Which, BTW, is also a big problem with CleanURIs.

No, I don't think you noticed the schema design then:

    baseURL collectionHierarchy [objectId] action ['?' parameters]

The 'collectionHierarchy' is in the current wiki a single token but
*could* be deeper. Given I don't think we'd want arbitrary depth
(I may be wrong) then there's only the possibility that we might
go from "Main" to "Main/SubMain". That shouldn't be a big problem
if we design the schema such that the verb is either at the very
end or part of the query. So "Main/edit" can only be a page reference
if it's "Main/edit/verb/" (e.g., "Main/edit/edit/") or
"Main/edit/?action=verb". This shouldn't be a problem.

>> Yes, certainly. We're dealing with government/corporate cooperative team
>> designing and implementing an enormous application that is entirely built
>> on this principle. There are RESTful URLs all through the application and
>> I've got a requirement to hook JSPWiki into that. It would be lovely if
>> the URLs that the user sees when using the wiki are the *same* ones (or
>> are from at least the same schema) as the ones hooking the wiki into the
>> preservation system, which is why I'm excited by Andrew's latest missive.
> 
> Well, the URIs *are* already RESTful. ;-)
> 
> (In fact, /Edit.jsp?page=Foo is also RESTful.  Most people just like to 
> hide the technology [jsp in this case] by using neutral URIs like 
> /edit/Foo).

Yes, I have an absolute, unbendable requirement that we have to hide
implementation details from the URLs. So if one's definition of RESTful
includes hiding implementation details (and mine does), then this is a
necessity. In my actual case it is a requirement.

Another aspect of this I haven't mentioned is that we do want to
implement the full REST set of verbs, e.g., we want a HEAD request
(whatever it's called, doesn't matter) to deliver metadata about
a record, e.g.,

  // delivers default metadata
  http://mywiki.com/jspwiki/wiki/Main/meta/

  // delivers METS metadata
  http://mywiki.com/jspwiki/wiki/Main/meta/?schema=mets

  // delivers DC-XML metadata
  http://mywiki.com/jspwiki/wiki/Main/meta/?schema=dcxml

etc. I'd also like to be able to do PUTs via a RESTful interface in
addition to the human UI so we can remotely populate a wiki from an
external site, for synchronization, etc.

Murray

...........................................................................
Murray Altheim <murray07 at altheim.com>                           ===  = =
http://www.altheim.com/murray/                                     = =  ===
SGML Grease Monkey, Banjo Player, Wantanabe Zen Monk               = =  = =

       Boundless wind and moon - the eye within eyes,
       Inexhaustible heaven and earth - the light beyond light,
       The willow dark, the flower bright - ten thousand houses,
       Knock at any door - there's one who will respond.
                                       -- The Blue Cliff Record

Mime
View raw message