cvs: peardoc /ja/package webservices.xml /ja/package/webservices services-blogging.xml /ja/package/webservices/services-blogging connecting.xml
drivers.xml example.xml intro.xml posts.xml

From: Date: Sun, 15 Apr 2007 11:38:29 +0000
Subject: cvs: peardoc /ja/package webservices.xml /ja/package/webservices services-blogging.xml /ja/package/webservices/services-blogging connecting.xml
drivers.xml example.xml intro.xml posts.xml
Groups: php.pear.doc 
Request: Send a blank email to pear-doc+get-9635@lists.php.net to get a copy of this message
takagi Sun Apr 15 11:38:29 2007 UTC Added files: /peardoc/ja/package/webservices/services-blogging posts.xml intro.xml example.xml drivers.xml connecting.xml /peardoc/ja/package/webservices services-blogging.xml Modified files: /peardoc/ja/package webservices.xml Log: added Japanese translation for Services_Blogging.

http://cvs.php.net/viewvc.cgi/peardoc/ja/package/webservices.xml?r1=1.12&r2=1.13&diff_format=u Index: peardoc/ja/package/webservices.xml diff -u peardoc/ja/package/webservices.xml:1.12 peardoc/ja/package/webservices.xml:1.13 --- peardoc/ja/package/webservices.xml:1.12 Fri Mar 30 03:49:26 2007 +++ peardoc/ja/package/webservices.xml Sun Apr 15 11:38:28 2007 @@ -1,12 +1,13 @@ <?xml version="1.0" encoding="utf-8" ?> -<!-- EN-Revision: 1.18 Maintainer: Status: ready --> -<!-- $Id: webservices.xml,v 1.12 2007/03/30 03:49:26 takagi Exp $ --> +<!-- EN-Revision: 1.19 Maintainer: Status: ready --> +<!-- $Id: webservices.xml,v 1.13 2007/04/15 11:38:28 takagi Exp $ --> <chapter id="package.webservices"> <title>Web サービス</title> &blankpagehack; + &package.webservices.services-blogging; &package.webservices.services-delicious; &package.webservices.services-ebay; &package.webservices.services-technorati; http://cvs.php.net/viewvc.cgi/peardoc/ja/package/webservices/services-blogging/posts.xml?view=markup&rev=1.1 Index: peardoc/ja/package/webservices/services-blogging/posts.xml +++ peardoc/ja/package/webservices/services-blogging/posts.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.1 Maintainer: takagi Status: ready --> <sect2 id="package.webservices.services-blogging.posts"> <title>Blog の投稿</title> <para> 既存の投稿を読んだり一覧表示したりする機能の差のほかにも、 API によって投稿のプロパティのサポートにも差があります。 あるシンプルな API は投稿の本文しか処理できないけれど、 別のより高機能な API はタイトルも設定できたり、 さらに別のものでは日付や公開日、カテゴリなどを指定できたりといった具合です。 </para> <para> あなたの blog 用のドライバオブジェクトを取得したら、 まずはそのドライバがサポートしている投稿のプロパティの一覧を取得しましょう。 そのためのメソッドが <function>getSupportedPostProperties</function> です。これはプロパティ名の配列を返します。 現在は、以下のプロパティが使用できます。 </para> <itemizedlist> <listitem><para><literal>title</literal></para></listitem> <listitem><para><literal>content</literal></para></listitem> <listitem><para><literal>publishdate</literal></para></listitem> <listitem><para><literal>date</literal></para></listitem> <listitem><para><literal>url</literal></para></listitem> <listitem><para><literal>categories</literal></para></listitem> </itemizedlist> <para> データ型については <classname>Services_Blogging_Post</classname> の API ドキュメントを参照ください。 </para> </sect2> <!-- 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/viewvc.cgi/peardoc/ja/package/webservices/services-blogging/intro.xml?view=markup&rev=1.1 Index: peardoc/ja/package/webservices/services-blogging/intro.xml +++ peardoc/ja/package/webservices/services-blogging/intro.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.1 Maintainer: takagi Status: ready --> <sect2 id="package.webservices.services-blogging.intro"> <title>Services_Blogging について</title> <para> ウェブログは、インターネット上で無視できない存在です。 一般人が、自分の意見を表明したり 家族や友人や世間に対する思いを記したりといったことを 簡単にできるようになります。 やり方はとても簡単で、自分のサーバやレンタルサーバで blog を運用するために、わざわざ計算機科学を専攻する必要もありません。 </para> <para> blog 用のツールの欠点のひとつは、そのユーザインターフェイスです。 ブラウザベースのツールであるため、 blog のエントリを書いている間は常にオンラインである必要があります。 あるいは通常のテキストエディタでエントリを書き、 オンラインになった時点でそれをコピー&amp;ペーストするという手もあります。 しかし、テキストエディタを使用していると、テキストに対してフォントの効果を適用することができません。 このような場合は、オフラインのツールで blog のエントリを書くのがよいでしょう。 </para> <para> オフラインツールを使用して、ウェブインターフェイス以外 (たとえばウェブサービス経由) でエントリを書くことを考えてみましょう。 たいていの blog 業者や blog ソフトウェアは、 このようなウエブサービス API を (XML-RPC などで) 提供しています。 </para> <para> 残念ながら、現在出回っているこれらの API は、それぞれ異なったものとなっています。 エントリの投稿にのみ対応しているものもあれば、投稿だけでなく読み込みに対応したものもあります。 画像やタグの投稿をサポートしているものもあれば、そうでないものもあります。 このようにさまざまな API があるため、 結局のところ各 blog サーバ用に独自のコードを書くはめになってしまいます。 </para> <para> そこで <classname>Services_Blogging</classname> の出番です。 これは blog のエントリを投稿したり読み込んだりするための統一された API を、各 blog ソフトウェアに依存しない形式で提供します。 ドライバベースの手法で、さまざまな API とのやりとりを行います。 新しい blog 用 API が発表されたとしても、誰かが <classname>Services_Blogging</classname> パッケージ用のドライバを書きさえすればその blog にアクセスできます。 </para> <para> 2007 年 4 月時点で、このパッケージには次のドライバが含まれています。 <itemizedlist> <listitem><para>Blogger</para></listitem> <listitem><para>LiveJournal</para></listitem> <listitem><para>MetaWeblog</para></listitem> </itemizedlist> </para> </sect2> <!-- 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/viewvc.cgi/peardoc/ja/package/webservices/services-blogging/example.xml?view=markup&rev=1.1 Index: peardoc/ja/package/webservices/services-blogging/example.xml +++ peardoc/ja/package/webservices/services-blogging/example.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.1 Maintainer: takagi Status: ready --> <sect2 id="package.webservices.services-blogging.example"> <title>例</title> <example> <title>エントリの投稿</title> <programlisting role="php"><![CDATA[ <?php require_once 'Services/Blogging.php'; $bl = Services_Blogging::factory( 'metaWeblog', 'username', 'password', 'http://blog.example.com', '/xmlrpc.php' ); $post = $bl->createNewPost(); //$post->setId('14'); $post->title = '投稿のタイトル'; $post->content = "これは、Services_Blogging" . " による投稿の更新のテストです\r\n\r\n二行目\r\n三行目"; $post->categories = array('カテゴリ1', 'カテゴリ3'); $bl->savePost($post); $nLastPostId = $post->id; echo 'post id: ' . $nLastPostId . "\r\n"; //$bl->deletePost(17); var_dump($bl->getPost($nLastPostId)); var_dump($bl->getRecentPostTitles(2)); var_dump($bl->getRecentPosts()); ?> ]]></programlisting> </example> </sect2> <!-- 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/viewvc.cgi/peardoc/ja/package/webservices/services-blogging/drivers.xml?view=markup&rev=1.1 Index: peardoc/ja/package/webservices/services-blogging/drivers.xml +++ peardoc/ja/package/webservices/services-blogging/drivers.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.1 Maintainer: takagi Status: ready --> <sect2 id="package.webservices.services-blogging.drivers"> <title>ドライバ</title> <para> 既存の blog API にはさまざまな機能があるので、ドライバクラスは二種類用意されています。 <classname>Services_Blogging_Driver</classname> と <classname>Services_Blogging_ExtendetDriver</classname> (これは、最初のクラスを拡張したものです) です。 </para> <para> <classname>Services_Blogging_Driver</classname> を継承したドライバは、 投稿の新規作成、保存および削除のみを行います。 既存の投稿の一覧 (や修正) はできません。 </para> <para> <classname>Services_Blogging_ExtendetDriver</classname> を継承したドライバは、 上で示したほかにも既存の投稿の閲覧や最近の投稿一覧の取得、 最近の投稿のタイトル一覧の取得などが可能です。 </para> </sect2> <!-- 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/viewvc.cgi/peardoc/ja/package/webservices/services-blogging/connecting.xml?view=markup&rev=1.1 Index: peardoc/ja/package/webservices/services-blogging/connecting.xml +++ peardoc/ja/package/webservices/services-blogging/connecting.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.1 Maintainer: takagi Status: ready --> <sect2 id="package.webservices.services-blogging.connecting"> <title>blog サーバへの接続</title> <para> エントリを blog に投稿するには、まずその blog 用に <classname>Services_Blogging_Driver</classname> のインスタンスを作成する必要があります。 使用している blog システムに対応した API を見つけるか、あるいは <classname>Services_Blogging</classname> に自動的にそれを見つけされることになります。 </para> <para> ドライバを作成するには、<classname>Services_Blogging</classname> の <function>factory</function> メソッドを使用します。 指定するパラメータは 5 つで、それぞれ ドライバ名、ユーザ名、パスワード、サーバの URL そしてサーバの API へのパスとなります。 </para> <example> <title>Services_Blogging::factory() によるドライバの作成</title> <programlisting role="php"><![CDATA[ require_once 'Services/Blogging.php'; $bl = Services_Blogging::factory( 'metaWeblog', // ドライバ名 'username', 'password', 'http://blog.example.com', '/xmlrpc.php' ); ]]></programlisting> </example> <para> blog ドライバによっては、サーバやパスが不要なものもあります。 そのような場合は、<literal>null</literal> を指定します。 </para> <sect3> <title>設定の自動取得</title> <para> blog 用の設定をいちいち探すのは面倒なことです。 そこで、このパッケージでは autodiscovery (自動取得) 機能も提供しています。 そのドライバのインスタンスを作成するための設定を自動検出することもできますし、 あなたの blog システムに必要なドライバを自動検出し、 そのインスタンスを返すこともできます。 </para> <para> 設定の自動検出を行うには、<classname>Services_Blogging</classname> の <function>discoverSettings</function> メソッドを使用し、 ここにあなたの blog の URL を渡します。 このメソッドは、必要なすべての設定を配列で返します。 </para> <para> いまどきの blog ソフトウェアの大半は、複数の API をサポートしています。 サポートしている API を自動検出したら、 その中から最適なものを選択する必要があります。 通常は、もっとも多くの機能をサポートしているものを選ぶことになるでしょう。 <classname>Services_Blogging</classname> は、これを補助するためのメソッド <function>getBestAvailableDriver</function> も用意しています。 このメソッドには、先ほど取得した設定の配列を渡します。 これで、ドライバを作成するために必要なデータはすべてそろいました。 </para> <example> <title>設定の自動取得</title> <programlisting role="php"><![CDATA[ require_once 'Services/Blogging.php'; $settings = Services_Blogging::discoverSettings('http://blog.example.com'); var_dump($settings); echo Services_Blogging::getBestAvailableDriver($settings) . "\r\n"; // これを使用して factory() を実行します ]]></programlisting> </example> <para> これでもまだ大変だというのなら、 <classname>Services_Blogging</classname> の <function>discoverDriver</function> メソッドにすべて任せてしまうこともできます。 このメソッドには、blog の URL とユーザ名、そしてパスワードを渡します。 このメソッドは、ドライバオブジェクトを返します。 </para> <example> <title>ドライバの自動作成</title> <programlisting role="php"><![CDATA[ require_once 'Services/Blogging.php'; $bl = Services_Blogging::discoverDriver( 'http://blog.example.com', 'username', 'password' ); ]]></programlisting> </example> <note> <para> これらの自動検出用メソッドは、何か問題が発生した (blog ソフトウェアがそれをサポートしていない、 あるいは適切なドライバが見つからないなど) 際には <classname>Services_Blogging_Exception</classname> 型の例外をスローします。 </para> </note> </sect3> </sect2> <!-- 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/viewvc.cgi/peardoc/ja/package/webservices/services-blogging.xml?view=markup&rev=1.1 Index: peardoc/ja/package/webservices/services-blogging.xml +++ peardoc/ja/package/webservices/services-blogging.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.1 Maintainer: takagi Status: ready --> <sect1 id="package.webservices.services-blogging"> <title>Services_Blogging</title> <para> blog のエントリを投稿したり読んだりするための、汎用ドライバベースのパッケージです。 </para> &package.webservices.services-blogging.intro; &package.webservices.services-blogging.connecting; &package.webservices.services-blogging.drivers; &package.webservices.services-blogging.posts; &package.webservices.services-blogging.example; </sect1> <!-- 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 -->
« previous php.pear.doc (#9635) next »