 +   * @see      xp://scriptlet.xml.workflow.routing.Route
 +   * @purpose  Route implementation
 +   */
-+  class MethodRoute extends Object {
++  class MethodRoute extends Object implements Route {
 +    protected
 +      $state  = NULL,
 +      $method = NULL;

+   * @see      xp://scriptlet.xml.workflow.routing.Router
+   * @purpose  Router implementation
+   */
+  class StaticRouter extends Object {
+  
+    /**
+     * Route a request

Name: svn:keywords
   + Id

Index: routing/FacadeRoute.class.php
===================================================================
--- routing/FacadeRoute.class.php	(revision 0)
+++ routing/FacadeRoute.class.php	(revision 0)
@@ -0,0 +1,57 @@
+<?php
+/* This class is part of the XP framework
+ *
+ * $Id$ 
+ */
+
+  uses('scriptlet.xml.workflow.routing.Route');
+
+  /**
+   * Facade route
+   *
+   * @see      xp://scriptlet.xml.workflow.routing.FacadeRouter
+   * @see      xp://scriptlet.xml.workflow.routing.Route
+   * @purpose  Route implementation
+   */
+  class FacadeRoute extends Object implements Route {
+    protected
+      $facade    = NULL,
+      $operation = '';
+     
+    const
+      COLLECTION  = 0x0001,
+      ENTITY      = 0x0002;
+
+    /**
+     * Constructor
+     *
+     * @param   scriptlet.xml.workflow.facade.Facade facade
+     * @param   string operation
+     */
+    public function __construct($facade, $operation) {
+      $this->facade= $facade;
+      $this->operation= $operation;
+    }
+    
+    /**
+     * Dispatch this route
+     *
+     * @param   scriptlet.xml.XMLScriptletRequest
+     * @param   scriptlet.xml.XMLScriptletResponse
+     * @param   scriptlet.xml.workflow.Context
+     * @return  mixed
+     */
+    public function dispatch($request, $response, $context) {
+      static $operations= array(
+        'list'    => self::COLLECTION,
+        'search'  => self::COLLECTION,
+        'view'    => self::ENTITY,
+        'edit'    => self::ENTITY,
+        'delete'  => self::ENTITY,
+        'add'     => self::ENTITY,
+      );
+
+      $this->facade->{'do'.$this->operation}($request, $response, $context);
+    }
+  } 
+?>

Property changes on: routing/FacadeRoute.class.php
___________________________________________________________________
Name: svn:keywords
   + Id

Index: routing/FacadeRouter.class.php
===================================================================
--- routing/FacadeRouter.class.php	(revision 0)
+++ routing/FacadeRouter.class.php	(revision 0)
@@ -0,0 +1,46 @@
+<?php
+/* This class is part of the XP framework
+ *
+ * $Id$ 
+ */
+
+  uses('scriptlet.xml.workflow.routing.FacadeRoute', 'scriptlet.xml.workflow.routing.Router');
+
+  /**
+   * The facade router is a router implementation that will route requests
+   * to facades.
+   *
+   * <pre>
+   *   State name    Class name           Operation         
+   *   ------------- -------------------- ----------
+   *   /news         [package.]NewsFacade list
+   *   /news/list    [package.]NewsFacade list
+   *   /news/search  [package.]NewsFacade search
+   *   /news/view    [package.]NewsFacade view
+   *   /news/edit    [package.]NewsFacade edit
+   *   /news/add     [package.]NewsFacade add
+   *   /news/delete  [package.]NewsFacade delete
+   * </pre>
+   *
+   * @see      xp://scriptlet.xml.workflow.facade.Facade
+   * @see      xp://scriptlet.xml.workflow.routing.Router
+   * @purpose  Router implementation
+   */
+  class FacadeRouter extends Object implements Router {
+  
+    /**
+     * Route a request
+     *
+     * @param   string package
+     * @param   scriptlet.xml.XMLScriptletRequest
+     * @param   scriptlet.xml.XMLScriptletResponse
+     * @param   scriptlet.xml.workflow.Context
+     * @return  scriptlet.xml.workflow.routing.Route
+     * @throws  lang.ClassNotFoundException in case the state class cannot be found
+     */
+    public function route($package, $request, $response, $context) {
+      1 == sscanf($request->getStateName(), '%[^/]/%s', $name, $operation) && $operation= 'list';
+      return new FacadeRoute(XPClass::forName($package.ucfirst($name).'Facade')->newInstance(), $operation);
+    }
+  }
+?>

Property changes on: routing/FacadeRouter.class.php
___________________________________________________________________
Name: svn:keywords
   + Id

Index: routing/DelegatingRouter.class.php
===================================================================
--- routing/DelegatingRouter.class.php	(revision 0)
