You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lenya.apache.org by Andreas Hartmann <an...@apache.org> on 2009/03/19 14:18:50 UTC

[Proposal] Serve usecases from module sitemaps

Hi Lenya devs,

for the Firedocs integration, which is based on a RESTful API based on 
the Atom publishing protocol, we implemented a simple but handy 
extension to the usecase framework.

Usecases can be served directly from module sitemaps, without invoking 
the usecase framework. Basically, all that's needed is an additional 
snippet in usecase.xmap:

   <map:pipeline>
     <map:match type="usecase" pattern="*.*">
       <map:select type="resource-exists">
         <map:when test="fallback://lenya/modules/{1}/sitemap.xmap">
           <map:mount pass-through="true" uri-prefix=""
                      src="fallback://lenya/modules/{1}/sitemap.xmap"
             check-reload="yes" reload-method="synchron"/>
         </map:when>
       </map:select>
     </map:match>
   </map:pipeline>


In plain English:

* Usecase foo.bar is requested
* Check if module "foo" exists
* If yes, mount the module-sitemap with pass-through=true

This is especially useful for single-request, non-continuation usecases 
(like a typical REST get/put/post/delete call).

There's a little snag to this extension, though:
If someone uses a usecase matcher in the module sitemap, e.g. to serve a 
usecase view, the usecase will break because the usecase module sitemap 
  is not entered. But I consider this risk rather low.

I'd like to add this extension to the 2.0.x branch. WDYT?

-- Andreas


-- 
Andreas Hartmann, CTO
BeCompany GmbH
http://www.becompany.ch
Tel.: +41 (0) 43 818 57 01


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org