cvs: peardoc /en/package/webservices services-ebay.xml /en/package/webservices/services-ebay architecture.xml
| From: | Stephan Schmidt | Date: | Sun, 19 Dec 2004 12:35:26 +0000 |
| Subject: | cvs: peardoc /en/package/webservices services-ebay.xml /en/package/webservices/services-ebay architecture.xml | ||
| Groups: | php.pear.doc | ||
| Request: | Send a blank email to pear-doc+get-5298@lists.php.net to get a copy of this message | ||
schst Sun Dec 19 07:35:26 2004 EDT
Added files:
/peardoc/en/package/webservices/services-ebay architecture.xml
Modified files:
/peardoc/en/package/webservices services-ebay.xml
Log:
added overview of the architecture
http://cvs.php.net/diff.php/peardoc/en/package/webservices/services-ebay.xml?r1=1.1&r2=1.2&ty=u Index: peardoc/en/package/webservices/services-ebay.xml diff -u peardoc/en/package/webservices/services-ebay.xml:1.1 peardoc/en/package/webservices/services-ebay.xml:1.2 --- peardoc/en/package/webservices/services-ebay.xml:1.1 Mon Nov 22 17:06:48 2004 +++ peardoc/en/package/webservices/services-ebay.xml Sun Dec 19 07:35:26 2004 @@ -1,4 +1,4 @@ -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <sect1 id="package.webservices.services-ebay"> <title>Services_Ebay</title> @@ -6,8 +6,9 @@ Object-oriented abstraction for eBay's XML API. </para> &package.webservices.services-ebay.intro; - &package.webservices.services-ebay.example; &package.webservices.services-ebay.getting-started; + &package.webservices.services-ebay.architecture; + &package.webservices.services-ebay.example; </sect1> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/co.php/peardoc/en/package/webservices/services-ebay/architecture.xml?r=1.1&p=1 Index: peardoc/en/package/webservices/services-ebay/architecture.xml +++ peardoc/en/package/webservices/services-ebay/architecture.xml <!-- $Revision: 1.1 $ --> <refentry id="package.webservices.services-ebay.architecture"> <refnamediv> <refname>Architecture</refname> <refpurpose>The architecture of Services_Ebay</refpurpose> </refnamediv> <refsect1 id="package.webservices.services-ebay.architecture.refsect1"> <title>Overview of Services_Ebay architecture</title> <para> Services_Ebay consists of a lot of small classes, which keeps the used codebase small, as only the functionality that you use in your applications are loaded and parsed. </para> <para> This will give you a short overview of the different types of objects that are provided and for which tasks they are used. </para> </refsect1> <refsect1 id="package.webservices.services-ebay.architecture.services-ebay"> <title>Services_Ebay</title> <para> The <classname>Services_Ebay</classname> class is used for the following tasks: </para> <para> <orderedlist> <listitem> <simpara> Provides factory methods. </simpara> <para> The <classname>Services_Ebay</classname> provides methods to load and instantiate all of the other classes, that are included in the Services_Ebay distribution. That means that this is the only class you should include and instantiate yourself. Factory methods include <function>loadApiCall</function>, <function>getSession</function> and <function>loadModel</function>. </para> </listitem> <listitem> <simpara> Provides constants. </simpara> <para> This class also defines some constants like the eBay site ids that you will need in your applications, constants include <constant>Services_Ebay::SITEID_ID</constant>, <constant>Services_Ebay::AUTH_TYPE_TOKEN</constant> or <constant>Services_Ebay::FEEDBACK_BRIEF</constant>. Whenever the eBay webservice expects an integer value in an XML tag, <classname>Services_Ebay</classname> tries to provide a matching constant. </para> </listitem> <listitem> <simpara> Provides static helper methods. </simpara> <para> The class also provide170 s some helper methods, which can be called statically like <function>getAvailableApiCalls</function>. </para> </listitem> <listitem> <simpara> Acts as a proxy class. </simpara> <para> The most important usage is that <classname>Services_Ebay</classname> acts as a proxy class for the API calls, that means you can call methods on the class which will then be redirected to the appropriate call object. </para> </listitem> </orderedlist> </para> </refsect1> <refsect1 id="package.webservices.services-ebay.architecture.services-ebay-session"> <title>Services_Ebay_Session</title> <para> The <classname>Services_Ebay_Session</classname> class is used to handle the serialization and unserialization of the incoming and outgoing XML streams. Furthermore it builds the HTTP headers that are needed and manages all user authentication. </para> <para> You will probably always use the session inderictly by at first passing it the the <classname>Services_Ebay</classname> object which will then use the session for making API calls. </para> <example> <title>Using the session class</title> <programlisting role="php"> <![CDATA[require_once 'Services/Ebay.php'; // pass some authentication data $session = Services_Ebay::getSession($devId, $appId, $certId); $session->setToken($token); // create new proxy object with the instantiated session $ebay = new Services_Ebay($session);]]> </programlisting> </example> </refsect1> <refsect1 id="package.webservices.services-ebay.architecture.services-ebay-transport"> <title>Services_Ebay_Transport</title> <para> The <classname>Services_Ebay_Transport</classname> classes are used to build up network connections to the eBay webservices and send and recieve the raw data which has been created by <classname>Services_Ebay_Session</classname>. </para> <para> Theroretically there may be different transport classes, but due to bugs in PHP's stream functions and some SSL libraries, the only working transport class is <classname>Services_Ebay_Transport_Curl</classname>, which uses PHP's curl extension. </para> </refsect1> <refsect1 id="package.webservices.services-ebay.architecture.services-ebay-call"> <title>Services_Ebay_Call</title> <para> The <classname>Services_Ebay_Call</classname> classes contain information about the API calls that the eBay webservice offers. Each API call is encapsulated in an object that contains information about the API call, which XML tags have to be used and what the call is expected to return. </para> <para> There are two ways in which the call objects can be used: </para> <para> <orderedlist> <listitem> <simpara> Instantiate them directly (best via the factory method of <classname>Services_Ebay</classname>), pass all parameters and invode <function>Services_Ebay_Call::call</function> while passing the session object to this method. </simpara> </listitem> <listitem> <simpara> Use <classname>Services_Ebay</classname> as a proxy object which is able to do all the work by using PHP5's new object overloading features. </simpara> </listitem> </orderedlist> </para> <para> It ius recommended to use <classname>Services_Ebay</classname> as a proxy insteadof working directly on the Call objects. <classname>Services_Ebay</classname> will instantiate the class, pass the parameters and invoke the call method on the Call object. </para> </refsect1> <refsect1 id="package.webservices.services-ebay.architecture.services-ebay-model"> <title>Services_Ebay_Model</title> <para> The <classname>Services_Ebay_Model</classname> classes act as local containers for the remote data stored on the eBay server. For example, when calling <function>Services_Ebay::getItem</function>, the method will return an instance of <classname>Services_Ebay_Model_Item</classname>, which contains information about the item as well as some helper methods like <function>Services_Ebay_Model_Item::addToDescription</function> which encapsulates a new API call. </para> <para> Currently Services_Ebay provides models for accounts, disputes (single dispute and a list of disputes), user feedback (summary and a single feedback entry), items and list of items, MyeBay, orders, preferences, search results, shipments, eBay stores, transactions and users. </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=webservices fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 -->
http://cvs.php.net/diff.php/peardoc/en/package/webservices/services-ebay.xml?r1=1.1&r2=1.2&ty=u Index: peardoc/en/package/webservices/services-ebay.xml diff -u peardoc/en/package/webservices/services-ebay.xml:1.1 peardoc/en/package/webservices/services-ebay.xml:1.2 --- peardoc/en/package/webservices/services-ebay.xml:1.1 Mon Nov 22 17:06:48 2004 +++ peardoc/en/package/webservices/services-ebay.xml Sun Dec 19 07:35:26 2004 @@ -1,4 +1,4 @@ -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <sect1 id="package.webservices.services-ebay"> <title>Services_Ebay</title> @@ -6,8 +6,9 @@ Object-oriented abstraction for eBay's XML API. </para> &package.webservices.services-ebay.intro; - &package.webservices.services-ebay.example; &package.webservices.services-ebay.getting-started; + &package.webservices.services-ebay.architecture; + &package.webservices.services-ebay.example; </sect1> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/co.php/peardoc/en/package/webservices/services-ebay/architecture.xml?r=1.1&p=1 Index: peardoc/en/package/webservices/services-ebay/architecture.xml +++ peardoc/en/package/webservices/services-ebay/architecture.xml <!-- $Revision: 1.1 $ --> <refentry id="package.webservices.services-ebay.architecture"> <refnamediv> <refname>Architecture</refname> <refpurpose>The architecture of Services_Ebay</refpurpose> </refnamediv> <refsect1 id="package.webservices.services-ebay.architecture.refsect1"> <title>Overview of Services_Ebay architecture</title> <para> Services_Ebay consists of a lot of small classes, which keeps the used codebase small, as only the functionality that you use in your applications are loaded and parsed. </para> <para> This will give you a short overview of the different types of objects that are provided and for which tasks they are used. </para> </refsect1> <refsect1 id="package.webservices.services-ebay.architecture.services-ebay"> <title>Services_Ebay</title> <para> The <classname>Services_Ebay</classname> class is used for the following tasks: </para> <para> <orderedlist> <listitem> <simpara> Provides factory methods. </simpara> <para> The <classname>Services_Ebay</classname> provides methods to load and instantiate all of the other classes, that are included in the Services_Ebay distribution. That means that this is the only class you should include and instantiate yourself. Factory methods include <function>loadApiCall</function>, <function>getSession</function> and <function>loadModel</function>. </para> </listitem> <listitem> <simpara> Provides constants. </simpara> <para> This class also defines some constants like the eBay site ids that you will need in your applications, constants include <constant>Services_Ebay::SITEID_ID</constant>, <constant>Services_Ebay::AUTH_TYPE_TOKEN</constant> or <constant>Services_Ebay::FEEDBACK_BRIEF</constant>. Whenever the eBay webservice expects an integer value in an XML tag, <classname>Services_Ebay</classname> tries to provide a matching constant. </para> </listitem> <listitem> <simpara> Provides static helper methods. </simpara> <para> The class also provide170 s some helper methods, which can be called statically like <function>getAvailableApiCalls</function>. </para> </listitem> <listitem> <simpara> Acts as a proxy class. </simpara> <para> The most important usage is that <classname>Services_Ebay</classname> acts as a proxy class for the API calls, that means you can call methods on the class which will then be redirected to the appropriate call object. </para> </listitem> </orderedlist> </para> </refsect1> <refsect1 id="package.webservices.services-ebay.architecture.services-ebay-session"> <title>Services_Ebay_Session</title> <para> The <classname>Services_Ebay_Session</classname> class is used to handle the serialization and unserialization of the incoming and outgoing XML streams. Furthermore it builds the HTTP headers that are needed and manages all user authentication. </para> <para> You will probably always use the session inderictly by at first passing it the the <classname>Services_Ebay</classname> object which will then use the session for making API calls. </para> <example> <title>Using the session class</title> <programlisting role="php"> <![CDATA[require_once 'Services/Ebay.php'; // pass some authentication data $session = Services_Ebay::getSession($devId, $appId, $certId); $session->setToken($token); // create new proxy object with the instantiated session $ebay = new Services_Ebay($session);]]> </programlisting> </example> </refsect1> <refsect1 id="package.webservices.services-ebay.architecture.services-ebay-transport"> <title>Services_Ebay_Transport</title> <para> The <classname>Services_Ebay_Transport</classname> classes are used to build up network connections to the eBay webservices and send and recieve the raw data which has been created by <classname>Services_Ebay_Session</classname>. </para> <para> Theroretically there may be different transport classes, but due to bugs in PHP's stream functions and some SSL libraries, the only working transport class is <classname>Services_Ebay_Transport_Curl</classname>, which uses PHP's curl extension. </para> </refsect1> <refsect1 id="package.webservices.services-ebay.architecture.services-ebay-call"> <title>Services_Ebay_Call</title> <para> The <classname>Services_Ebay_Call</classname> classes contain information about the API calls that the eBay webservice offers. Each API call is encapsulated in an object that contains information about the API call, which XML tags have to be used and what the call is expected to return. </para> <para> There are two ways in which the call objects can be used: </para> <para> <orderedlist> <listitem> <simpara> Instantiate them directly (best via the factory method of <classname>Services_Ebay</classname>), pass all parameters and invode <function>Services_Ebay_Call::call</function> while passing the session object to this method. </simpara> </listitem> <listitem> <simpara> Use <classname>Services_Ebay</classname> as a proxy object which is able to do all the work by using PHP5's new object overloading features. </simpara> </listitem> </orderedlist> </para> <para> It ius recommended to use <classname>Services_Ebay</classname> as a proxy insteadof working directly on the Call objects. <classname>Services_Ebay</classname> will instantiate the class, pass the parameters and invoke the call method on the Call object. </para> </refsect1> <refsect1 id="package.webservices.services-ebay.architecture.services-ebay-model"> <title>Services_Ebay_Model</title> <para> The <classname>Services_Ebay_Model</classname> classes act as local containers for the remote data stored on the eBay server. For example, when calling <function>Services_Ebay::getItem</function>, the method will return an instance of <classname>Services_Ebay_Model_Item</classname>, which contains information about the item as well as some helper methods like <function>Services_Ebay_Model_Item::addToDescription</function> which encapsulates a new API call. </para> <para> Currently Services_Ebay provides models for accounts, disputes (single dispute and a list of disputes), user feedback (summary and a single feedback entry), items and list of items, MyeBay, orders, preferences, search results, shipments, eBay stores, transactions and users. </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=webservices fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 -->