OSDN Git Service

- XMLRPCゲートウェイサポート追加(experimental)
authorfujimoto <fujimoto@2ef88817-412d-0410-a32c-8029a115e976>
Fri, 24 Mar 2006 07:15:04 +0000 (07:15 +0000)
committerfujimoto <fujimoto@2ef88817-412d-0410-a32c-8029a115e976>
Fri, 24 Mar 2006 07:15:04 +0000 (07:15 +0000)
-- ethna add-action-xmlrpc [action]でXMLRPCメソッドを追加可能
-- 引数1つとフォーム定義1つが定義順に対応します
-- ToDo
--- 出力バッファチェック
--- method not foundなどエラー処理対応

CHANGES
class/Ethna_ActionForm.php
class/Ethna_Controller.php
class/Ethna_SkeltonGenerator.php
class/Handle/Ethna_Handle_AddActionXmlrpc.php [new file with mode: 0644]
class/Handle/Ethna_Handle_Manager.php
skel/app.controller.php
skel/skel.action_xmlrpc.php [new file with mode: 0644]
skel/www.xmlrpc.php [new file with mode: 0644]

diff --git a/CHANGES b/CHANGES
index 483f833..a410ee8 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -4,6 +4,13 @@
 
 *** features
 
+- XMLRPC¥²¡¼¥È¥¦¥§¥¤¥µ¥Ý¡¼¥ÈÄɲÃ(experimental)
+-- ethna add-action-xmlrpc [action]¤ÇXMLRPC¥á¥½¥Ã¥É¤òÄɲòÄǽ
+-- °ú¿ô1¤Ä¤È¥Õ¥©¡¼¥àÄêµÁ1¤Ä¤¬ÄêµÁ½ç¤ËÂбþ¤·¤Þ¤¹
+-- ToDo
+--- ½ÐÎϥХåե¡¥Á¥§¥Ã¥¯
+--- method not found¤Ê¤É¥¨¥é¡¼½èÍýÂбþ
+- Ethna_ActionForm¥¯¥é¥¹¤Î¥³¥ó¥¹¥È¥é¥¯¥¿¤ÇsetFormVars()¤ò¼Â¹Ô¤·¤Ê¤¤¤è¤¦¤ËÊѹ¹
 - ¥¹¥±¥ë¥È¥ó¤Ë´Þ¤Þ¤ì¤ë'your name'¤ò¥Þ¥¯¥í({$author})¤ËÊѹ¹(~/.ethnaÂбþ)
 - ¤Ê¤²¤ä¤êÊØÍø´Ø¿ôfile_exists_ex(), is_absolute_path()¤òÄɲÃ
 - SimpleTest¤È¤ÎÏ¢·Èµ¡Ç½¤òÄɲÃ(ethna¥³¥Þ¥ó¥É¤Ëadd-action-test,add-view-test¤ÎÄɲäʤÉ)
index 94c8015..c9687bb 100644 (file)
@@ -89,9 +89,6 @@ class Ethna_ActionForm
 
                // ¥Õ¥©¡¼¥àÃÍÄêµÁ¤ÎÀßÄê
                $this->_setFormDef();
-
-               // ¥Õ¥©¡¼¥àÃͤÎÀßÄê
-               $this->setFormVars();
        }
 
        /**
index af8cb71..69b9ed5 100644 (file)
@@ -13,6 +13,8 @@
 /**
  *  ¥³¥ó¥È¥í¡¼¥é¥¯¥é¥¹
  *
+ *  @todo       gateway¤Çswitch¤·¤Æ¤ë¤È¤³¤í¤¬¥À¥µ¥À¥µ
+ *
  *  @author     Masaki Fujimoto <fujimoto@php.net>
  *  @access     public
  *  @package    Ethna
@@ -38,6 +40,7 @@ class Ethna_Controller
     /** @var    array       ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥Ç¥£¥ì¥¯¥È¥ê */
     var $directory = array(
         'action'        => 'app/action',
+        'action_xmlrpc' => 'app/action_xmlrpc',
         'app'           => 'app',
         'etc'           => 'etc',
         'filter'        => 'app/filter',
@@ -92,12 +95,18 @@ class Ethna_Controller
     /** @var    string  ¸½ºß¼Â¹ÔÃæ¤Î¥¢¥¯¥·¥ç¥ó̾ */
     var $action_name;
 
+    /** @var    string  ¸½ºß¼Â¹ÔÃæ¤ÎXMLRPC¥á¥½¥Ã¥É̾ */
+    var $xmlrpc_method_name;
+
     /** @var    array   forwardÄêµÁ */
     var $forward = array();
 
     /** @var    array   actionÄêµÁ */
     var $action = array();
 
+    /** @var    array   action(XMLRPC)ÄêµÁ */
+    var $action_xmlrpc = array();
+
     /** @var    array   ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥Þ¥Í¡¼¥¸¥ãÄêµÁ */
     var $manager = array();
 
@@ -335,9 +344,20 @@ class Ethna_Controller
      *  @access public
      *  @return string  ¥¢¥¯¥·¥ç¥ó¥Ç¥£¥ì¥¯¥È¥ê
      */
-    function getActiondir()
+    function getActiondir($gateway = null)
     {
-        return (empty($this->directory['action']) ? ($this->base . (empty($this->base) ? '' : '/')) : ($this->directory['action'] . "/"));
+        $key = 'action';
+        $gateway = is_null($gateway) ? $this->getGateway() : $gateway;
+        switch ($gateway) {
+        case GATEWAY_WWW:
+        case GATEWAY_CLI:
+            $key = 'action';
+            break;
+        case GATEWAY_XMLRPC:
+            $key = 'action_xmlrpc';
+        }
+
+        return (empty($this->directory[$key]) ? ($this->base . (empty($this->base) ? '' : '/')) : ($this->directory[$key] . "/"));
     }
 
     /**
@@ -509,6 +529,17 @@ class Ethna_Controller
     }
 
     /**
+     *  ¼Â¹ÔÃæ¤ÎXMLRPC¥á¥½¥Ã¥É̾¤òÊÖ¤¹
+     *
+     *  @access public
+     *  @return string  ¼Â¹ÔÃæ¤ÎXMLRPC¥á¥½¥Ã¥É̾
+     */
+    function getXmlrpcMethodName()
+    {
+        return $this->xmlrpc_method_name;
+    }
+
+    /**
      *  »ÈÍѸÀ¸ì¤ò¼èÆÀ¤¹¤ë
      *
      *  @access public
@@ -576,16 +607,19 @@ class Ethna_Controller
      *  XMLRPC¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Î¥¨¥ó¥È¥ê¥Ý¥¤¥ó¥È
      *
      *  @access public
-     *  @param  string  $class_name     ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥³¥ó¥È¥í¡¼¥é¤Î¥¯¥é¥¹Ì¾
-     *  @param  mixed   $action_name    »ØÄê¤Î¥¢¥¯¥·¥ç¥ó̾(¾Êά²Ä)
-     *  @param  mixed   $fallback_action_name   ¥¢¥¯¥·¥ç¥ó¤¬·èÄê¤Ç¤­¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¼Â¹Ô¤µ¤ì¤ë¥¢¥¯¥·¥ç¥ó̾(¾Êά²Ä)
      *  @static
      */
-    function main_XMLRPC($class_name, $action_name = "", $fallback_action_name = "")
+    function main_XMLRPC($class_name)
     {
+        if (extension_loaded('xmlrpc') == false) {
+            die("xmlrpc extension is required to enable this gateway");
+        } else if (ini_get('always_populate_raw_post_data') == false) {
+            die("always_populate_raw_post_data ini variable should be true to enable this gateway");
+        }
+
         $c =& new $class_name;
         $c->setGateway(GATEWAY_XMLRPC);
-        $c->trigger($action_name, $fallback_action_name);
+        $c->trigger("", "", false);
     }
 
     /**
@@ -700,6 +734,7 @@ class Ethna_Controller
         // ¥ª¥Ö¥¸¥§¥¯¥ÈÀ¸À®
         $form_name = $this->getActionFormName($action_name);
         $this->action_form =& new $form_name($this);
+        $this->action_form->setFormVars();
 
         // ¥Ð¥Ã¥¯¥¨¥ó¥É½èÍý¼Â¹Ô
         $backend =& $this->getBackend();
@@ -756,7 +791,56 @@ class Ethna_Controller
      */
     function _trigger_XMLRPC($action_name = "")
     {
-        die("sorry, xmlrpc gateway is not supported yet");
+        $xmlrpc_gateway_method_name = "_Ethna_XmlrpcGateway";
+
+        $xmlrpc_server = xmlrpc_server_create();
+        $method = null;
+        $param = xmlrpc_decode_request($GLOBALS['HTTP_RAW_POST_DATA'], $method);
+        $this->xmlrpc_method_name = $method;
+
+        $request = xmlrpc_encode_request($xmlrpc_gateway_method_name, $param, array("output_type" => "xml", "verbosity" => "pretty", "escaping" => array('markup'), "version" => "xmlrpc", "encoding" => "utf-8")); 
+        xmlrpc_server_register_method($xmlrpc_server, $xmlrpc_gateway_method_name, $xmlrpc_gateway_method_name);
+        $r = xmlrpc_server_call_method($xmlrpc_server, $request, null, array("output_type" => "xml", "verbosity" => "pretty", "escaping" => array('markup'), "version" => "xmlrpc", "encoding" => "utf-8"));
+
+        header('Content-Length: ' . strlen($r));
+        header('Content-Type: text/xml; charset=UTF-8');
+        print $r;
+    }
+
+    /**
+     *  _trigger_XMLRPC¤Î¥³¡¼¥ë¥Ð¥Ã¥¯¥á¥½¥Ã¥É
+     *
+     *  @access public
+     */
+    function trigger_XMLRPC($method, $param)
+    {
+        // ¥¢¥¯¥·¥ç¥óÄêµÁ¤Î¼èÆÀ
+        $action_obj =& $this->_getAction($method);
+        if (is_null($action_obj)) {
+            return Ethna::raiseError("undefined xmlrpc method [%s]", E_APP_UNDEFINED_ACTION, $method);
+        }
+
+        // ¥ª¥Ö¥¸¥§¥¯¥ÈÀ¸À®
+        $form_name = $this->getActionFormName($method);
+        $this->action_form =& new $form_name($this);
+        $def = $this->action_form->getDef();
+        $n = 0;
+        foreach ($def as $key => $value) {
+            if (isset($param[$n]) == false) {
+                $this->action_form->set($key, null);
+            } else {
+                $this->action_form->set($key, $param[$n]);
+            }
+            $n++;
+        }
+
+        // ¥Ð¥Ã¥¯¥¨¥ó¥É½èÍý¼Â¹Ô
+        $backend =& $this->getBackend();
+        $session =& $this->getSession();
+        $session->restore();
+        $r = $backend->perform($method);
+
+        return $r;
     }
 
     /**
@@ -921,9 +1005,19 @@ class Ethna_Controller
      *  @param  string  $action_name    ¥¢¥¯¥·¥ç¥ó̾
      *  @return array   ¥¢¥¯¥·¥ç¥óÄêµÁ
      */
-    function &_getAction($action_name)
+    function &_getAction($action_name, $gateway = null)
     {
-        $action =& $this->action;
+        $action = array();
+        $gateway = is_null($gateway) ? $this->getGateway() : $gateway;
+        switch ($gateway) {
+        case GATEWAY_WWW:
+        case GATEWAY_CLI:
+            $action =& $this->action;
+            break;
+        case GATEWAY_XMLRPC:
+            $action =& $this->action_xmlrpc;
+            break;
+        }
 
         $action_obj = array();
         if (isset($action[$action_name])) {
@@ -936,7 +1030,7 @@ class Ethna_Controller
         }
 
         // ¥¢¥¯¥·¥ç¥ó¥¹¥¯¥ê¥×¥È¤Î¥¤¥ó¥¯¥ë¡¼¥É
-        $this->_includeActionScript($action_obj, $action_name);
+        $this->_includeActionScript($action_obj, $action_name, $gateway);
 
         // ¾ÊάÃͤÎÊäÀµ
         if (isset($action_obj['class_name']) == false) {
@@ -1048,10 +1142,12 @@ class Ethna_Controller
      *  @param  string  $action_name    ¥¢¥¯¥·¥ç¥ó̾
      *  @return string  ¥¢¥¯¥·¥ç¥ó¥Õ¥©¡¼¥à̾
      */
-    function getDefaultFormClass($action_name)
+    function getDefaultFormClass($action_name, $gateway = null)
     {
+        $gateway_prefix = $this->_getGatewayPrefix($gateway);
+
         $postfix = preg_replace('/_(.)/e', "strtoupper('\$1')", ucfirst($action_name));
-        $r = sprintf("%s_Form_%s", $this->getAppId(), $postfix);
+        $r = sprintf("%s_%sForm_%s", $this->getAppId(), $gateway_prefix ? $gateway_prefix . "_" : "", $postfix);
         $this->logger->log(LOG_DEBUG, "default action class [%s]", $r);
 
         return $r;
@@ -1123,10 +1219,12 @@ class Ethna_Controller
      *  @param  string  $action_name    ¥¢¥¯¥·¥ç¥ó̾
      *  @return string  ¥¢¥¯¥·¥ç¥ó¥¯¥é¥¹Ì¾
      */
-    function getDefaultActionClass($action_name)
+    function getDefaultActionClass($action_name, $gateway = null)
     {
+        $gateway_prefix = $this->_getGatewayPrefix($gateway);
+
         $postfix = preg_replace('/_(.)/e', "strtoupper('\$1')", ucfirst($action_name));
-        $r = sprintf("%s_Action_%s", $this->getAppId(), $postfix);
+        $r = sprintf("%s_%sAction_%s", $this->getAppId(), $gateway_prefix ? $gateway_prefix . "_" : "", $postfix);
         $this->logger->log(LOG_DEBUG, "default action class [%s]", $r);
 
         return $r;
@@ -1229,10 +1327,12 @@ class Ethna_Controller
      *  @param  string  $forward_name   forward̾
      *  @return string  view class¥¯¥é¥¹Ì¾
      */
-    function getDefaultViewClass($forward_name)
+    function getDefaultViewClass($forward_name, $gateway = null)
     {
+        $gateway_prefix = $this->_getGatewayPrefix($gateway);
+
         $postfix = preg_replace('/_(.)/e', "strtoupper('\$1')", ucfirst($forward_name));
-        $r = sprintf("%s_View_%s", $this->getAppId(), $postfix);
+        $r = sprintf("%s_%sView_%s", $this->getAppId(), $gateway_prefix ? $gateway_prefix . "_" : "", $postfix);
         $this->logger->log(LOG_DEBUG, "default view class [%s]", $r);
 
         return $r;
@@ -1446,6 +1546,31 @@ class Ethna_Controller
     }
 
     /**
+     *  ¥²¡¼¥È¥¦¥§¥¤¤ËÂбþ¤·¤¿¥¯¥é¥¹Ì¾¤Î¥×¥ì¥Õ¥£¥¯¥¹¤ò¼èÆÀ¤¹¤ë
+     *
+     *  @access public
+     *  @param  string  $gateway    ¥²¡¼¥È¥¦¥§¥¤
+     *  @return string  ¥²¡¼¥È¥¦¥§¥¤¥¯¥é¥¹¥×¥ì¥Õ¥£¥¯¥¹
+     */
+    function _getGatewayPrefix($gateway = null)
+    {
+        $gateway = is_null($gateway) ? $this->getGateway() : $gateway;
+        switch ($gateway) {
+        case GATEWAY_WWW:
+        case GATEWAY_CLI:
+            $prefix = '';
+            break;
+        case GATEWAY_XMLRPC:
+            $prefix = 'Xmlrpc';
+            break;
+        default:
+            $prefix = '';
+        }
+
+        return $prefix;
+    }
+
+    /**
      *  ¥Þ¥Í¡¼¥¸¥ã¥¯¥é¥¹Ì¾¤ò¼èÆÀ¤¹¤ë
      *
      *  @access public
@@ -1736,4 +1861,21 @@ class Ethna_Controller
     }
 }
 // }}}
+
+/**
+ *  XMLRPC¥²¡¼¥È¥¦¥§¥¤¤Î¥¹¥¿¥Ö¥¯¥é¥¹
+ *
+ *  @access     public
+ */
+function _Ethna_XmlrpcGateway($method_stub, $param)
+{
+    $ctl =& Ethna_Controller::getInstance();
+    $method = $ctl->getXmlrpcMethodName();
+    $r = $ctl->trigger_XMLRPC($method, $param);
+    if (Ethna::isError($r)) {
+        // ToDo: notify fault
+        return -1;
+    }
+    return $r;
+}
 ?>
index d4457a3..f39d0ff 100644 (file)
@@ -32,6 +32,7 @@ class Ethna_SkeltonGenerator
                $dir_list = array(
                        array("app", 0755),
                        array("app/action", 0755),
+                       array("app/action_xmlrpc", 0755),
                        array("app/filter", 0755),
                        array("app/view", 0755),
                        array("bin", 0755),
@@ -103,8 +104,10 @@ class Ethna_SkeltonGenerator
                $macro['view_name'] = '{$view_name}';
                $macro['view_path'] = '{$view_path}';
 
+        // the longest if? :)
                if ($this->_generateFile("www.index.php", "$basedir/www/index.php", $macro) == false ||
                        $this->_generateFile("www.info.php", "$basedir/www/info.php", $macro) == false ||
+                       $this->_generateFile("www.xmlrpc.php", "$basedir/www/xmlrpc.php", $macro) == false ||
                        $this->_generateFile("dot.ethna", "$basedir/.ethna", $macro) == false ||
                        $this->_generateFile("app.controller.php", sprintf("$basedir/app/%s_Controller.php", $macro['project_id']), $macro) == false ||
                        $this->_generateFile("app.error.php", sprintf("$basedir/app/%s_Error.php", $macro['project_id']), $macro) == false ||
@@ -133,9 +136,10 @@ class Ethna_SkeltonGenerator
         *      @access public
         *      @param  string  $action_name    ¥¢¥¯¥·¥ç¥ó̾
      *  @param  string  $app_dir        ¥×¥í¥¸¥§¥¯¥È¥Ç¥£¥ì¥¯¥È¥ê
+     *  @param  int     $gateway        ¥²¡¼¥È¥¦¥§¥¤
         *      @return bool    true:À®¸ù false:¼ºÇÔ
         */
-       function generateActionSkelton($action_name, $app_dir)
+       function generateActionSkelton($action_name, $app_dir, $gateway = GATEWAY_WWW)
        {
         // discover controller
         $controller_class = $this->_discoverController($app_dir);
@@ -146,10 +150,10 @@ class Ethna_SkeltonGenerator
         $c =& new $controller_class;
         $c->setGateway(GATEWAY_CLI);
 
-               $action_dir = $c->getActiondir();
-               $action_class = $c->getDefaultActionClass($action_name, false);
-               $action_form = $c->getDefaultFormClass($action_name, false);
-               $action_path = $c->getDefaultActionPath($action_name, false);
+               $action_dir = $c->getActiondir($gateway);
+               $action_class = $c->getDefaultActionClass($action_name, $gateway);
+               $action_form = $c->getDefaultFormClass($action_name, $gateway);
+               $action_path = $c->getDefaultActionPath($action_name);
 
                $macro = array();
                $macro['project_id'] = $c->getAppId();
@@ -163,9 +167,19 @@ class Ethna_SkeltonGenerator
 
                $this->_mkdir(dirname("$action_dir$action_path"), 0755);
 
+        switch ($gateway) {
+        case GATEWAY_WWW:
+        case GATEWAY_CLI:
+            $skelton = "skel.action.php";
+            break;
+        case GATEWAY_XMLRPC:
+            $skelton = "skel.action_xmlrpc.php";
+            break;
+        }
+
                if (file_exists("$action_dir$action_path")) {
                        printf("file [%s] already exists -> skip\n", "$action_dir$action_path");
-               } else if ($this->_generateFile("skel.action.php", "$action_dir$action_path", $macro) == false) {
+               } else if ($this->_generateFile($skelton, "$action_dir$action_path", $macro) == false) {
                        printf("[warning] file creation failed [%s]\n", "$action_dir$action_path");
                } else {
                        printf("action script(s) successfully created [%s]\n", "$action_dir$action_path");
diff --git a/class/Handle/Ethna_Handle_AddActionXmlrpc.php b/class/Handle/Ethna_Handle_AddActionXmlrpc.php
new file mode 100644 (file)
index 0000000..d0300ed
--- /dev/null
@@ -0,0 +1,57 @@
+<?php
+// vim: foldmethod=marker
+/**
+ *     Ethna_Handle_AddActionXmlrpc.php
+ *
+ *     @author         Masaki Fujimoto <fujimoto@php.net>
+ *     @license        http://www.opensource.org/licenses/bsd-license.php The BSD License
+ *     @package        Ethna
+ *     @version        $Id$
+ */
+include_once(ETHNA_BASE . '/class/Handle/Ethna_Handle_AddAction.php');
+
+// {{{ Ethna_Handle_AddActionXmlrpc
+/**
+ *  add-action handler
+ *
+ *     @author         Masaki Fujimoto <fujimoto@php.net>
+ *     @access         public
+ *     @package        Ethna
+ */
+class Ethna_Handle_AddActionXmlrpc extends Ethna_Handle_AddAction
+{
+    /**
+     *  get handler's description
+     *
+     *  @access public
+     */
+    function getDescription()
+    {
+        return "add new xmlrpc action to project:\n    {$this->id} [action] ([project-base-dir])\n";
+    }
+
+    /**
+     *  add action
+     *
+     *  @access public
+     */
+    function perform()
+    {
+        $r = $this->_validateArgList();
+        if (Ethna::isError($r)) {
+            return $r;
+        }
+        list($action_name, $app_dir) = $r;
+
+        $sg =& new Ethna_SkeltonGenerator();
+        $r = $sg->generateActionSkelton($action_name, $app_dir, GATEWAY_XMLRPC);
+        if (Ethna::isError($r)) {
+            printf("error occurred while generating skelton. please see also following error message(s)\n\n");
+            return $r;
+        }
+
+        return true;
+    }
+}
+// }}}
+?>
index 6ef5998..dc63d30 100644 (file)
@@ -83,6 +83,8 @@ class Ethna_Handle_Manager
         }
         closedir($dh);
 
+        usort($handler_list, array($this, "_handler_sort_callback"));
+
         return $handler_list;
     }
 
@@ -138,6 +140,14 @@ class Ethna_Handle_Manager
         $id = preg_replace('/\-(.)/e', "strtoupper('\$1')", ucfirst($id));
         return sprintf("Ethna_Handle_%s", $id);
     }
+
+    /**
+     *  sort callback method
+     */
+    function _handler_sort_callback($a, $b)
+    {
+        return strcmp($a->getId(), $b->getId());
+    }
 }
 // }}}
 ?>
index c822b5d..f185945 100644 (file)
@@ -84,6 +84,7 @@ class {$project_id}_Controller extends Ethna_Controller
         */
        var $directory = array(
                'action'                => 'app/action',
+        'action_xmlrpc' => 'app/action_xmlrpc',
         'app'           => 'app',
                'etc'                   => 'etc',
                'filter'                => 'app/filter',
diff --git a/skel/skel.action_xmlrpc.php b/skel/skel.action_xmlrpc.php
new file mode 100644 (file)
index 0000000..b09f2e1
--- /dev/null
@@ -0,0 +1,71 @@
+<?php
+/**
+ *     {$action_path}
+ *
+ *     @author         {$author}
+ *     @package        {$project_id}
+ *     @version        $Id$
+ */
+
+/**
+ *     {$action_name}¥Õ¥©¡¼¥à¤Î¼ÂÁõ
+ *
+ *     @author         {$author}
+ *     @access         public
+ *     @package        {$project_id}
+ */
+class {$action_form} extends Ethna_ActionForm
+{
+       /**
+        *      @access private
+        *      @var    array   ¥Õ¥©¡¼¥àÃÍÄêµÁ
+        */
+       var     $form = array(
+               /*
+               'sample' => array(
+                       'name'                  => '¥µ¥ó¥×¥ë',          // É½¼¨Ì¾
+                       'required'      => true,                        // É¬¿Ü¥ª¥×¥·¥ç¥ó(true/false)
+                       'min'           => null,                        // ºÇ¾®ÃÍ
+                       'max'           => null,                        // ºÇÂçÃÍ
+                       'regexp'        => null,                        // Ê¸»ú¼ï»ØÄê(Àµµ¬É½¸½)
+                       'custom'        => null,                        // ¥á¥½¥Ã¥É¤Ë¤è¤ë¥Á¥§¥Ã¥¯
+                       'filter'        => null,                        // ÆþÎÏÃÍÊÑ´¹¥Õ¥£¥ë¥¿¥ª¥×¥·¥ç¥ó
+                       'form_type'     => FORM_TYPE_TEXT,      // ¥Õ¥©¡¼¥à·¿
+                       'type'          => VAR_TYPE_INT,        // ÆþÎÏÃÍ·¿
+               ),
+               */
+       );
+}
+
+/**
+ *     {$action_name}¥¢¥¯¥·¥ç¥ó¤Î¼ÂÁõ
+ *
+ *     @author         {$author}
+ *     @access         public
+ *     @package        {$project_id}
+ */
+class {$action_class} extends Ethna_ActionClass
+{
+       /**
+        *      {$action_name}¥¢¥¯¥·¥ç¥ó¤ÎÁ°½èÍý
+        *
+        *      @access public
+        *      @return string          Á«°Ü̾(Àµ¾ï½ªÎ»¤Ê¤énull, ½èÍý½ªÎ»¤Ê¤éfalse)
+        */
+       function prepare()
+       {
+               return null;
+       }
+
+       /**
+        *      {$action_name}¥¢¥¯¥·¥ç¥ó¤Î¼ÂÁõ
+        *
+        *      @access public
+        *      @return string  Á«°Ü̾
+        */
+       function perform()
+       {
+               return '{$action_name}';
+       }
+}
+?>
diff --git a/skel/www.xmlrpc.php b/skel/www.xmlrpc.php
new file mode 100644 (file)
index 0000000..890db96
--- /dev/null
@@ -0,0 +1,5 @@
+<?php
+include_once('{$basedir}/app/{$project_id}_Controller.php');
+
+{$project_id}_Controller::main_XMLRPC('{$project_id}_Controller');
+?>