View Source

<ac:macro ac:name="note"><ac:parameter ac:name="title">Outdated</ac:parameter><ac:rich-text-body>
<p>This proposal is outdated, not ready for review.<br />
please see, <a href="http://framework.zend.com/wiki/display/ZFPROP/Zend_Service_Rakuten">Zend_Service_Rakuten Proposal</a></p></ac:rich-text-body></ac:macro>

<ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[{zone-template-instance:ZFDEV:Zend Proposal Zone Template}

{zone-data:component-name}
Zend_Service_Rakuten
{zone-data}

{zone-data:proposer-list}
Shingo Terui
{zone-data}

{zone-data:revision}
0.1 - 1 March 2007: Started proposal process.
{zone-data}

{zone-data:overview}
Zend_Service_Rakuten is a Zend Framework interface to use the "Rakuten Web service" API that Rakuten Inc is providing.
{zone-data}

{zone-data:references}
following links are API references written with Japanese.
* [Rakuten Web Service|http://webservice.rakuten.co.jp/document/index.html]
* [Rakuten item search API|http://webservice.rakuten.co.jp/api/itemsearch/]
* [Rakuten genre search API|http://webservice.rakuten.co.jp/api/genresearch/]
* [Rakuten item code search API|http://webservice.rakuten.co.jp/api/itemcodesearch/]
* [Rakuten book search API|http://webservice.rakuten.co.jp/api/booksearch/]
* [Rakuten CD search API|http://webservice.rakuten.co.jp/api/cdsearch/]
* [Rakuten DVD search API|http://webservice.rakuten.co.jp/api/dvdsearch/]
* [Rakuten catalog search API|http://webservice.rakuten.co.jp/api/catalogsearch/]
* [Rakuten-Travel hotel detail search API|http://webservice.rakuten.co.jp/api/hoteldetailsearch/]
* [Rakuten-Travel vacant hotel search API|http://webservice.rakuten.co.jp/api/vacanthotelsearch/]
* [Rakuten-Travel area code API|http://webservice.rakuten.co.jp/api/getareaclass/]
{zone-data}

{zone-data:requirements}
* Implements all available "Rakuten Web Service" API calls with consistent naming conventions.
* Returns server responses as lightweight data objects.
{zone-data}

{zone-data:dependencies}
* Zend_Rest_Client
* Zend_Service_Exception
* Zend_Exception
{zone-data}

{zone-data:operation}
Returns server response as lightweight objects.
{zone-data}

{zone-data:milestones}
* Milestone 1: Class development and write proposal
* Milestone 2: Unit tests and debugging
* Milestone 3: Documentation
{zone-data}

{zone-data:class-list}
* Zend_Service_Rakuten
* Zend_Service_Rakuten_ResultSet
* Zend_Service_Rakuten_Exception
{zone-data}

{zone-data:use-cases}
||UC-01||
Retrieve an item including the key word "Baby".

{code}
require_once 'Zend/Service/Rakuten.php';
$rakuten = new Zend_Service_Rakuten(YOUR_DEVELOPER_ID);
$results = $rakuten->keyword('baby')->hits(10)->search('ItemSearch');
foreach ($results as $item) {
echo $item->itemName . ': ' . $item->itemPrice . ' yen.<br />';
}

{code}

{zone-data}

{zone-data:skeletons}
{code}
class Zend_Service_Rakuten
{
/**
* Constants referring to RWS response schema types
*/
const SCHEMA_REST = 'rest';
const SCHEMA_JSON = 'json';

/**
* RWS version number
*
* @var string
*/
protected $rws_version = '1.4';

/**
* RWS schema type
*
* @var string
*/
protected $rws_schema = 'rest';

/**
* RWS request parameters
*
* @var array
*/
protected $parameters = array();

/**
* Class constructor
*
* @param string $developerId hex number of chars.
* @param string $rws_version example: "1.4"
* @throws Zend_Service_Rakuten_Exception
*/
public function __construct($developerId, $rws_version = null);

/**
* set API parameter
*
* @param string $method example: "keyword", "hits" ...
* @param array $arguments
* @return Zend_Service_Rakuten
* @throws Zend_Service_Rakuten_Exception
*/
public function __call($method, $arguments);

/**
* set RWS schema.
*
* @param string $schema "rest" or "json"
* @return Zend_Service_Rakuten
* @throws Zend_Service_Rakuten_Exception
*/
public function schema($schema);

/**
* connect to RWS API and retrieve response data.
*
* @param string $operation RWS API operation name
* @param array $parameters
* @return Zend_Service_Rakuten_ResultSet
* @throws Zend_Service_Rakuten_Exception
*/
public function search($operation, $parameters = null);
}

class Zend_Service_Rakuten_ResultSet
{
}

class Zend_Service_Rakuten_Exception extends Zend_Service_Exception
{
}

{code}
{zone-data}

{zone-template-instance}]]></ac:plain-text-body></ac:macro>