<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-8585981105500683948</id><updated>2024-03-05T19:30:24.870+09:00</updated><category term="PHP"/><category term="CodeIgniter"/><category term="Android"/><category term="UnitTest"/><category term="BEAR.Sunday"/><category term="医療アプリ"/><category term="GoogleCalendarAPI"/><category term="Groovy"/><category term="Java"/><category term="iOS開発"/><category term="web製作"/><category term="つれづれ"/><category term="薬局向けサービス"/><title type='text'>医療情報事務所 一貫堂Blog</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://ikkandou.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8585981105500683948/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://ikkandou.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/8585981105500683948/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>いのうえしげゆき</name><uri>http://www.blogger.com/profile/13282776910860697563</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4jOg9k9PA94jh2U-QMUKSn508dxoLDOSWZIPK7nQDJGHkMuznNHROdpci2TgtUj31D_6z_squlFDoOp0ZaE9FUKw_FoOxt2mV-CqXjXqbanWfp94dejC7GtJScBvaaz8/s220/kaepapa.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>26</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8585981105500683948.post-6193539211419856685</id><published>2013-06-24T08:34:00.001+09:00</published><updated>2013-06-24T08:34:53.502+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android"/><category scheme="http://www.blogger.com/atom/ns#" term="医療アプリ"/><title type='text'>医療スタッフツール添付文書検索 for Android</title><content type='html'>医療情報事務所一貫堂ではこれまでに「&lt;a href=&quot;https://play.google.com/store/apps/details?id=jp.dip.kaepapa.attachdocumentsearchtool&quot;&gt;添付文書検索ツール&lt;/a&gt;」を薬剤師必携の添付文書閲覧アプリケーションとしてご提供させて頂いて参りました。&lt;br /&gt;
&lt;br /&gt;
この度さらに機能が充実して新たに「医療スタッフツール添付文書検索」として生れ変りました。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://play.google.com/store/apps/details?id=jp.medi_ikkandou.apps.android.medical_tools.packageinsert&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgc15YFJFX2SErBy0Xi6BS2jKY7m0Wj6H38HbxQGBF7RnktzWSyvv1A894UefZPmoe59JSgRZg-2npxIjQ4BvXFRtNwSkNOski2ejb0em60tH8pl3LZi_6loxG3VI5sX9li3OcAq6-A5Dg/s1600/%E6%B7%BB%E4%BB%98%E6%96%87%E6%9B%B8%E6%A4%9C%E7%B4%A2%E3%83%A9%E3%83%B3%E3%83%81%E3%83%A3%E3%83%BC%E3%82%A2%E3%82%A4%E3%82%B3%E3%83%B3.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;a href=&quot;https://play.google.com/store/apps/details?id=jp.medi_ikkandou.apps.android.medical_tools.packageinsert&quot;&gt;医療スタッフツール添付文書検索&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
これまでの医療用医薬品と一般用医薬品の添付文書のみならずPMDAで提供されている体外診断薬や医療機器の添付文書検索・閲覧にも対応しました。&lt;br /&gt;
&lt;br /&gt;
またタブレットでの2ペイン表示や添付文書の複数比較閲覧、そして表示履歴リスト等にも新たに対応しまったく新しいアプリケーションとして生まれ変わりました。&lt;br /&gt;
&lt;br /&gt;
それぞれの機能については本ブログにて少しずつご紹介して行きたいと考えております。&lt;br /&gt;
&lt;br /&gt;
添付文書検索ツール同様、新しくなった「医療スタッフツール添付文書検索」を宜しくお願い致します。</content><link rel='replies' type='application/atom+xml' href='http://ikkandou.blogspot.com/feeds/6193539211419856685/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://ikkandou.blogspot.com/2013/06/for-android.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8585981105500683948/posts/default/6193539211419856685'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8585981105500683948/posts/default/6193539211419856685'/><link rel='alternate' type='text/html' href='http://ikkandou.blogspot.com/2013/06/for-android.html' title='医療スタッフツール添付文書検索 for Android'/><author><name>いのうえしげゆき</name><uri>http://www.blogger.com/profile/13282776910860697563</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4jOg9k9PA94jh2U-QMUKSn508dxoLDOSWZIPK7nQDJGHkMuznNHROdpci2TgtUj31D_6z_squlFDoOp0ZaE9FUKw_FoOxt2mV-CqXjXqbanWfp94dejC7GtJScBvaaz8/s220/kaepapa.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgc15YFJFX2SErBy0Xi6BS2jKY7m0Wj6H38HbxQGBF7RnktzWSyvv1A894UefZPmoe59JSgRZg-2npxIjQ4BvXFRtNwSkNOski2ejb0em60tH8pl3LZi_6loxG3VI5sX9li3OcAq6-A5Dg/s72-c/%E6%B7%BB%E4%BB%98%E6%96%87%E6%9B%B8%E6%A4%9C%E7%B4%A2%E3%83%A9%E3%83%B3%E3%83%81%E3%83%A3%E3%83%BC%E3%82%A2%E3%82%A4%E3%82%B3%E3%83%B3.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8585981105500683948.post-4596594399629701757</id><published>2013-06-24T08:15:00.000+09:00</published><updated>2013-06-24T08:15:01.281+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="医療アプリ"/><category scheme="http://www.blogger.com/atom/ns#" term="薬局向けサービス"/><title type='text'>お薬手帳カバー作成webサービス公開</title><content type='html'>医療情報事務所一貫堂ではさまざまなサービスを展開するべく日夜開発を続けております。&lt;br /&gt;
&lt;br /&gt;
本日ご紹介させて頂くのはお薬手帳カバー作成webサービスです。&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://cover.medi-ikkandou.jp/images/top-image.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;266&quot; src=&quot;http://cover.medi-ikkandou.jp/images/top-image.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
お薬手帳カバー作成webサービス&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;a href=&quot;http://cover.medi-ikkandou.jp/&quot;&gt;http://cover.medi-ikkandou.jp/&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
お薬手帳は薬剤師の方々には云わずと知れたものだと思いますがまだまだ一般の方の認知度はそれほど高いと云える状況ではないかもしれません。しかし数年前に比べれば徐々にその度合いは高まってきていることは日々の業務の中からも実感出来ていることと思います。&lt;br /&gt;
&lt;br /&gt;
しかし医療期間受診のたび、薬局への来局のたびに毎回きちんと持参してくださる患者さんはまだまだ少ないといった現状でしょうか。&lt;br /&gt;
&lt;br /&gt;
本webサービスでは、患者さんにお持ち頂くお薬手帳に好みのカバーを付けることでお持ち頂く患者さんオリジナルのお薬手帳とすることが出来ます。お薬手帳の衣替えすることでより愛着を持って頂き、日々医療機関や薬局へ持参して頂けるような工夫をするためのツールとしてお役立てください。&lt;br /&gt;
&lt;br /&gt;
是非上記リンクよりwebサービスサイトへご移動頂きお薬手帳カバーを作成してみてください。A4用紙に印刷後点線に従ってハサミでカットし手帳のビニールカバー内に折り込んで入れることでカバーが完成します。</content><link rel='replies' type='application/atom+xml' href='http://ikkandou.blogspot.com/feeds/4596594399629701757/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://ikkandou.blogspot.com/2013/06/web.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8585981105500683948/posts/default/4596594399629701757'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8585981105500683948/posts/default/4596594399629701757'/><link rel='alternate' type='text/html' href='http://ikkandou.blogspot.com/2013/06/web.html' title='お薬手帳カバー作成webサービス公開'/><author><name>いのうえしげゆき</name><uri>http://www.blogger.com/profile/13282776910860697563</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4jOg9k9PA94jh2U-QMUKSn508dxoLDOSWZIPK7nQDJGHkMuznNHROdpci2TgtUj31D_6z_squlFDoOp0ZaE9FUKw_FoOxt2mV-CqXjXqbanWfp94dejC7GtJScBvaaz8/s220/kaepapa.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8585981105500683948.post-9098633109442792423</id><published>2012-07-12T22:17:00.000+09:00</published><updated>2012-07-12T22:17:13.370+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="つれづれ"/><title type='text'>GitHubを使ってみる。</title><content type='html'>だいぶ前に&lt;a href=&quot;https://github.com/kaepapa&quot;&gt;GitHubのアカウント&lt;/a&gt;は作成していたもののこれまでちゃんと使ってみたことはなかった。&lt;br /&gt;
&lt;br /&gt;
しかし今回BEAR.Sundayを勉強しはじめてtypoを発見したり解決できない問題にぶちあたったりとしている状況の中pull requestやらissueのopenやらをやってみた。&lt;br /&gt;
&lt;br /&gt;
その際に以下のサイトを参考にさせていただいた。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;a href=&quot;http://design1.chu.jp/setucocms-pjt/?p=580&quot;&gt;初心者Git日記その五～GitHubにSSH公開鍵登録～&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;a href=&quot;http://d.hatena.ne.jp/hnw/20110528&quot;&gt;GitHubへのpull requestする際のベストプラクティス&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
まだGitをちゃんと使えるようになれていないし、GitHubについてもわからないことだらけではあるものの今回思ったことは、「手を動かしてみないとなにも理解できない。」ということだった。</content><link rel='replies' type='application/atom+xml' href='http://ikkandou.blogspot.com/feeds/9098633109442792423/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://ikkandou.blogspot.com/2012/07/github.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8585981105500683948/posts/default/9098633109442792423'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8585981105500683948/posts/default/9098633109442792423'/><link rel='alternate' type='text/html' href='http://ikkandou.blogspot.com/2012/07/github.html' title='GitHubを使ってみる。'/><author><name>いのうえしげゆき</name><uri>http://www.blogger.com/profile/13282776910860697563</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4jOg9k9PA94jh2U-QMUKSn508dxoLDOSWZIPK7nQDJGHkMuznNHROdpci2TgtUj31D_6z_squlFDoOp0ZaE9FUKw_FoOxt2mV-CqXjXqbanWfp94dejC7GtJScBvaaz8/s220/kaepapa.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8585981105500683948.post-4904587676628886270</id><published>2012-07-10T16:48:00.001+09:00</published><updated>2012-07-12T21:09:36.797+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="BEAR.Sunday"/><category scheme="http://www.blogger.com/atom/ns#" term="PHP"/><title type='text'>BEAR.Sundayのphpunitの実行</title><content type='html'>先日からいじりはじめた&lt;a href=&quot;http://code.google.com/p/bearsunday/&quot;&gt;BEAR.Sunday&lt;/a&gt;にはしっかりとunittestが書かれており動作確認の意味でもこのテストの実行はとても重要なものだと思われる。先日もインストール後には&lt;a href=&quot;https://github.com/sebastianbergmann/phpunit/&quot;&gt;phpunit&lt;/a&gt;を実行してオールグリーンを確認していた。&lt;br /&gt;
&lt;br /&gt;
BEAR.Sundayのことを教えてくれた&lt;a href=&quot;http://twitter.com/nekoget&quot;&gt;NEKOGETさん&lt;/a&gt;がmysqlのrootにパスワードが設定してあるとテストが通らないということを云ってたのでちょっと調べてみた。&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;2012/7/12 追記&lt;br /&gt;
※ MySQLのrootにパスワードが設定されている場合の対処法が本体の方で修正が入りました。&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&lt;a href=&quot;http://code.google.com/p/bearsunday/wiki/Install&quot;&gt;http://code.google.com/p/bearsunday/wiki/Install&lt;/a&gt; をご参照ください。
&lt;/span&gt;&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;./tests/PagingQueryTest.php:        $this-&amp;gt;pdo = new \PDO(&quot;mysql:host=localhost; dbname=blogbeartest&quot;, &quot;root&quot;, &quot;&quot;);
./tests/PagerTest.php:        $this-&amp;gt;pdo = new \PDO(&quot;mysql:host=localhost; dbname=blogbeartest&quot;, &quot;root&quot;, &quot;&quot;);
./tests/DoctrineDbalAdapterTest.php:        $this-&amp;gt;pdo = new \PDO(&quot;mysql:host=localhost; dbname=blogbeartest&quot;, &quot;root&quot;, &quot;&quot;);
./apps/sandbox/tests/PageBlogPostsTest.php:        $pdo = new \PDO(&quot;mysql:host=localhost; dbname=blogbeartest&quot;, &quot;root&quot;, &quot;&quot;);
./apps/sandbox/tests/AppPostsTest.php:        $pdo = new \PDO(&quot;mysql:host=localhost; dbname=blogbeartest&quot;, &quot;root&quot;, &quot;&quot;);

./sandbox/scripts/test.config.php:        &#39;password&#39; =&amp;gt; null,
./sandbox/scripts/test.config.php:        &#39;password&#39; =&amp;gt; null,
&lt;/pre&gt;
&lt;br /&gt;
ざくっと上記7つのファイルに対してrootのパスワードを設定しないとphpunitがEとSの嵐になってしまう。&lt;br /&gt;
前者5つは&quot;password&quot;後者2つは&#39;password&#39;という形での設定が必要となるようだ。&lt;br /&gt;
&lt;br /&gt;
私はmysqlにまったくもって慣れていないのでrootのパスワードの設定やパスワードリセットに苦労したのは云うまでもないw&lt;br /&gt;
&lt;br /&gt;
ちなみにmysqlのrootパスワードの設定方法は&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;# mysql

mysql&amp;gt; SET PASSWORD FOR root@localhost=PASSWORD(&#39;hoge&#39;);
Query OK, 0 rows affected (0.00 sec)

mysql&amp;gt; quit
&lt;/pre&gt;
&lt;br /&gt;
のような感じで行う。&lt;br /&gt;
&lt;br /&gt;
またパスワードクリアについては&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;# killall mysqld
# /usr/bin/mysqld_safe --user=root --skip-grant-tables &amp;amp; mysql mysql

mysql&amp;gt; update user set Password=null where Host=&#39;localhost&#39; and User=&#39;root&#39;;
mysql&amp;gt; quit

# /etc/rc.d/init.d/mysqld restart
&lt;/pre&gt;
&lt;br /&gt;
な感じでいけるので備忘録。</content><link rel='replies' type='application/atom+xml' href='http://ikkandou.blogspot.com/feeds/4904587676628886270/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://ikkandou.blogspot.com/2012/07/bearsundayphpunit.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8585981105500683948/posts/default/4904587676628886270'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8585981105500683948/posts/default/4904587676628886270'/><link rel='alternate' type='text/html' href='http://ikkandou.blogspot.com/2012/07/bearsundayphpunit.html' title='BEAR.Sundayのphpunitの実行'/><author><name>いのうえしげゆき</name><uri>http://www.blogger.com/profile/13282776910860697563</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4jOg9k9PA94jh2U-QMUKSn508dxoLDOSWZIPK7nQDJGHkMuznNHROdpci2TgtUj31D_6z_squlFDoOp0ZaE9FUKw_FoOxt2mV-CqXjXqbanWfp94dejC7GtJScBvaaz8/s220/kaepapa.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8585981105500683948.post-5011670976000746444</id><published>2012-07-09T10:40:00.001+09:00</published><updated>2012-07-09T10:52:21.958+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="BEAR.Sunday"/><category scheme="http://www.blogger.com/atom/ns#" term="PHP"/><title type='text'>BEAR.Sundayをインストールしてみた。(1)</title><content type='html'>&lt;span style=&quot;background-color: white;&quot;&gt;&lt;a href=&quot;http://twitter.com/nekoget&quot;&gt;NEKOGETさん&lt;/a&gt;からおもしろそうと勧められたPHPのフレームワーク&lt;a href=&quot;http://code.google.com/p/bearsunday/&quot;&gt;BEAR.Sunday&lt;/a&gt;を試してみる。&lt;/span&gt;&lt;br /&gt;
当初Ubuntuにインストールを試みたのだが途中からcomposerによる外部ライブラリのインストールが上手くいかなくなってしまい&lt;a href=&quot;http://fedoraproject.org/ja/&quot;&gt;Fedora17&lt;/a&gt;に入れてみた。&lt;br /&gt;
&lt;br /&gt;
Fedora-17-x86_64-DVD.isoをVMWare環境にインストールを敢行。&lt;br /&gt;
&lt;br /&gt;
○仮想マシン設定&lt;br /&gt;
メモリ2GB&lt;br /&gt;
プロセッサ4コア Intel VT-x/EPTまたはAMD-V/RVIを仮想化にチェック&lt;br /&gt;
ネットワークアダプタ ブリッジ&lt;br /&gt;
ディスク 20GB&lt;br /&gt;
CD/DVDにisoイメージをマウント&lt;br /&gt;
ディスプレイモニタ設定を指定 解像度1024x768&lt;br /&gt;
&lt;br /&gt;
ディスプレイモニタを指定しないとFedoraのインストーラ下部のボタンが表示されなかった。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
パッケージ選択でソフトウエア開発のデフォルトインストールを行ないGnome環境を構築。&lt;br /&gt;
vmware-toolsをインストールし&lt;span style=&quot;background-color: white;&quot;&gt;yum updateを実行し最新環境に再起動。&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Fedora17のベース環境が出来たところでapache2やmysqlそして必要なパッケージを導入しておく。&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;$ sudo yum install httpd mysql-server git curl
&lt;/pre&gt;
apache2とmysql-serverを起動し、自動起動の設定を行い動作確認。&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;$ sudo systemctl start httpd.service
$ sudo systemctl enable httpd.service
ln -s &#39;/usr/lib/systemd/system/httpd.service&#39; &#39;/etc/systemd/system/multi-user.target.wants/httpd.service&#39;
$ sudo systemctl start mysqld.service
$ sudo systemctl enable mysqld.service
ln -s &#39;/usr/lib/systemd/system/mysqld.service&#39; &#39;/etc/systemd/system/multi-user.target.wants/mysqld.service&#39;
&lt;/pre&gt;
php関係のパッケージを導入。以下のものでおそらく事足りるかと思われる。&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;$ sudo yum install php php-mbstring php-pear php-pecl-apc php-xml php-mysql php-pecl-xhprof

&lt;/pre&gt;
そしてphp.iniを編集。&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;$sudo vi /etc/php.ini

default_charser = UTF-8
date.timezone = Asia/Tokyo

mbstring.language = Japanese
mbstring.internal_encoding = UTF-8
mbstring.http_input = pass
mbstring.http_output = pass
mbstring.encoding_translation = Off
bstring.detect_order = auto
mbstring.substitute_character = none;
bstring.func_overload = 0
mbstring.http_output_conv_mimetype=

apc.enable_cli = 1
xhprof.output_dir = /tmp
&lt;/pre&gt;
上記を設定し、phpのバージョンを確認。&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;$ php -v
PHP 5.4.4 (cli) (built: Jun 14 2012 17:00:36)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies
&lt;/pre&gt;
ホームディレクトリにとりあえずBEARディレクトリを作成してgithubよりclone。&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;$ mkdir BEAR
$ cd BEAR/
$ git clone git://github.com/koriym/BEAR.Sunday.git
Cloning into &#39;BEAR.Sunday&#39;...
remote: Counting objects: 5747, done.
remote: Compressing objects: 100% (1923/1923), done.
remote: Total 5747 (delta 2891), reused 5720 (delta 2864)
Receiving objects: 100% (5747/5747), 2.76 MiB | 69 KiB/s, done.
Resolving deltas: 100% (2891/2891), done.
&lt;/pre&gt;
composerのインストールでの変化を確認するためにディレクトリ構造を保存しておいた。&lt;br /&gt;
curlでcomposerのインストーラを取得してphpコマンドに渡しcomposer.pharをインストールした。&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;$ ls -R BEAR.Sunday &amp;gt;List1
$ cd BEAR.Sunday
$ curl -s http://getcomposer.org/installer | php
#!/usr/bin/env php
All settings correct for using Composer
Downloading...

Composer successfully installed to: /home/shige/BEAR/BEAR.Sunday/composer.phar
Use it: php composer.phar
&lt;/pre&gt;
composerのインストール前とインストール後での違いを見るとcomposer.pharファイルのみが導入されていることが確認できた。&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;$ cd ../
$ ls -R BEAR.Sunday &amp;gt;List2
$ diff List1 List2
6a7
&amp;gt; composer.phar
&lt;/pre&gt;
導入したcomposerを利用して外部ライブラリを導入する。&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;$ cd BEAR.Sunday
$ ./composer.phar install
Installing dependencies
&amp;nbsp; - Installing aura/autoload (dev-master)
&amp;nbsp; &amp;nbsp; Cloning 1b8028cd301a8c95da7f0b1725bbf4fc8a495529

&amp;nbsp; - Installing aura/router (dev-master)
&amp;nbsp; &amp;nbsp; Cloning 9b7cceaf1914214ac615cf1697f39d4f4f71e52d

&amp;nbsp; - Installing aura/web (dev-master)
&amp;nbsp; &amp;nbsp; Cloning 111c884927e597f25fe8e14bf2d32860469b3730

&amp;nbsp; - Installing monolog/monolog (1.1.0)
&amp;nbsp; &amp;nbsp; Downloading: 100% &amp;nbsp; &amp;nbsp; &amp;nbsp; 

&amp;nbsp; - Installing symfony/event-dispatcher (v2.0.15)
&amp;nbsp; &amp;nbsp; Downloading: 100% &amp;nbsp; &amp;nbsp; &amp;nbsp;

&amp;nbsp; - Installing guzzle/guzzle (v2.7.2)
&amp;nbsp; &amp;nbsp; Downloading: 100% &amp;nbsp; &amp;nbsp; &amp;nbsp;

&amp;nbsp; - Installing facebook/xhprof (0.9.2)
&amp;nbsp; &amp;nbsp; Downloading: 100% &amp;nbsp; &amp;nbsp; &amp;nbsp; 

&amp;nbsp; - Installing aura/di (dev-master)
&amp;nbsp; &amp;nbsp; Cloning 2bc8695f2efe040935e461f8fa945fc73ebbfe11

&amp;nbsp; - Installing doctrine/common (dev-master)
&amp;nbsp; &amp;nbsp; Cloning b3afbb80506d909743475c5b0904285ab0c07941

&amp;nbsp; - Installing ray/aop (dev-master)
&amp;nbsp; &amp;nbsp; Cloning e7e5125f829130c716bd797b389cf4c5e3f8c2fd

&amp;nbsp; - Installing ray/di (dev-master)
&amp;nbsp; &amp;nbsp; Cloning 460bb44f25742147becd22a3afd8b1b92d3183a0

&amp;nbsp; - Installing aura/signal (dev-master)
&amp;nbsp; &amp;nbsp; Cloning 501f622f7905a5b42f98265937e84c02db6e78bd

&amp;nbsp; - Installing bear/resource (dev-master)
&amp;nbsp; &amp;nbsp; Cloning ae5acc46be3aa39241067e613f6e1b7edbf27a8b

&amp;nbsp; - Installing doctrine/dbal (dev-master)
&amp;nbsp; &amp;nbsp; Cloning 78dbf28923059545b24ba753c112560ad59ca89e

&amp;nbsp; - Installing pagerfanta/pagerfanta (dev-master)
&amp;nbsp; &amp;nbsp; Cloning c490684def33e992241e7fad33bcbd03d9d18643

&amp;nbsp; - Installing vdump/vdump (0.1.0)
&amp;nbsp; &amp;nbsp; Downloading: 100% &amp;nbsp; &amp;nbsp; &amp;nbsp; 

&amp;nbsp; - Installing smarty/smarty (v3.1.11)
&amp;nbsp; &amp;nbsp; Checking out /tags/v3.1.11/@4636

&amp;nbsp; - Installing symfony/console (v2.0.15)
&amp;nbsp; &amp;nbsp; Downloading: 100% &amp;nbsp; &amp;nbsp; &amp;nbsp;

&amp;nbsp; - Installing symfony/http-foundation (v2.0.15)
&amp;nbsp; &amp;nbsp; Downloading: 100% &amp;nbsp; &amp;nbsp; &amp;nbsp;

monolog/monolog suggests installing mlehner/gelf-php (Allow sending log messages to a GrayLog2 server)
pagerfanta/pagerfanta suggests installing doctrine/orm (2.*)
pagerfanta/pagerfanta suggests installing doctrine/mongodb-odm (2.*)
pagerfanta/pagerfanta suggests installing solarium/solarium (2.*)
Writing lock file
Generating autoload files
&lt;/pre&gt;
外部ライブラリ導入前と導入後を比較してみました。&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;$ cd ..
$ ls -R BEAR.Sunday&amp;gt;List3
$ diff List2 List3&amp;gt;diff23
$ cat diff23
6a7
&amp;gt; composer.lock
11a13
&amp;gt; vendor
559a562,5967
&amp;gt;
&amp;gt; BEAR.Sunday/vendor:
&amp;gt; Aura
&amp;gt; BEAR
&amp;gt; Ray
&amp;gt; autoload.php
&amp;gt; composer
&amp;gt; doctrine
&amp;gt; facebook
&amp;gt; guzzle
&amp;gt; monolog
&amp;gt; pagerfanta
&amp;gt; smarty
&amp;gt; symfony
&amp;gt; vdump
&amp;gt;
・・・以下略
&lt;/pre&gt;
composer.lockとvenderが追加されたようで外部ライブラリの入れ直しではこの2つの削除でOKかな？&lt;br /&gt;
&lt;br /&gt;
sandboxアプリのtmp, logディレクトリの権限を変更しておきます。&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;$ cd BEAR.Sunday
$ chmod -R 777 apps/sandbox/tmp apps/sandbox/log
&lt;/pre&gt;
phpunit関係の導入。&lt;br /&gt;
auto_discoverをonにして 新規チャネルを自動的に探すように設定。&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;$ sudo pear config-set auto_discover 1
config-set succeeded

$ sudo pear install pear.phpunit.de/PHPUnit
Attempting to discover channel &quot;pear.phpunit.de&quot;...
downloading channel.xml ...
Starting to download channel.xml (804 bytes)
....done: 804 bytes
Auto-discovered channel &quot;pear.phpunit.de&quot;, alias &quot;phpunit&quot;, adding to registry
Attempting to discover channel &quot;pear.symfony-project.com&quot;...
downloading channel.xml ...
Starting to download channel.xml (865 bytes)
...done: 865 bytes
Auto-discovered channel &quot;pear.symfony-project.com&quot;, alias &quot;symfony&quot;, adding to registry
Did not download optional dependencies: phpunit/PHP_Invoker, use --alldeps to download automatically
phpunit/PHPUnit can optionally use package &quot;phpunit/PHP_Invoker&quot; (version &amp;gt;= 1.1.0)
phpunit/PHP_CodeCoverage can optionally use PHP extension &quot;xdebug&quot; (version &amp;gt;= 2.0.5)
phpunit/PHPUnit_MockObject can optionally use PHP extension &quot;soap&quot;
downloading PHPUnit-3.6.11.tgz ...
Starting to download PHPUnit-3.6.11.tgz (119,171 bytes)
...done: 119,171 bytes
downloading File_Iterator-1.3.1.tgz ...
Starting to download File_Iterator-1.3.1.tgz (5,157 bytes)
...done: 5,157 bytes
downloading Text_Template-1.1.1.tgz ...
Starting to download Text_Template-1.1.1.tgz (3,622 bytes)
...done: 3,622 bytes
downloading PHP_CodeCoverage-1.1.2.tgz ...
Starting to download PHP_CodeCoverage-1.1.2.tgz (132,552 bytes)
...done: 132,552 bytes
downloading PHP_Timer-1.0.2.tgz ...
Starting to download PHP_Timer-1.0.2.tgz (3,686 bytes)
...done: 3,686 bytes
downloading PHPUnit_MockObject-1.1.1.tgz ...
Starting to download PHPUnit_MockObject-1.1.1.tgz (19,897 bytes)
...done: 19,897 bytes
downloading YAML-1.0.6.tgz ...
Starting to download YAML-1.0.6.tgz (10,010 bytes)
...done: 10,010 bytes
downloading PHP_TokenStream-1.1.3.tgz ...
Starting to download PHP_TokenStream-1.1.3.tgz (9,860 bytes)
...done: 9,860 bytes
install ok: channel://pear.phpunit.de/File_Iterator-1.3.1
install ok: channel://pear.phpunit.de/Text_Template-1.1.1
install ok: channel://pear.phpunit.de/PHP_Timer-1.0.2
install ok: channel://pear.symfony-project.com/YAML-1.0.6
install ok: channel://pear.phpunit.de/PHP_TokenStream-1.1.3
install ok: channel://pear.phpunit.de/PHP_CodeCoverage-1.1.2
install ok: channel://pear.phpunit.de/PHPUnit_MockObject-1.1.1
install ok: channel://pear.phpunit.de/PHPUnit-3.6.11

$ sudo pear install phpunit/DbUnit
downloading DbUnit-1.1.2.tgz ...
Starting to download DbUnit-1.1.2.tgz (41,895 bytes)
............done: 41,895 bytes
install ok: channel://pear.phpunit.de/DbUnit-1.1.2
$ sudo pear install phpunit/PHP_Invoker
downloading PHP_Invoker-1.1.0.tgz ...
Starting to download PHP_Invoker-1.1.0.tgz (3,727 bytes)
....done: 3,727 bytes
install ok: channel://pear.phpunit.de/PHP_Invoker-1.1.0

$ sudo pear install phpunit/PHP_Invoker
downloading PHP_Invoker-1.1.0.tgz ...
Starting to download PHP_Invoker-1.1.0.tgz (3,727 bytes)
....done: 3,727 bytes
install ok: channel://pear.phpunit.de/PHP_Invoker-1.1.0
&lt;/pre&gt;
phpunitテストを実行するためにデータベースの準備を行う。&lt;br /&gt;
アプリ用DB blogbearとテスト用DB blogbeartestをCREATEする。&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;$ sudo mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.5.24 MySQL Community Server (GPL)

Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type &#39;help;&#39; or &#39;\h&#39; for help. Type &#39;\c&#39; to clear the current input statement.

mysql&amp;gt; show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| test               |
+--------------------+
4 rows in set (0.00 sec)

mysql&amp;gt; CREATE DATABASE `blogbear` DEFAULT CHARACTER SET &#39;utf8&#39;;
Query OK, 1 row affected (0.00 sec)

mysql&amp;gt; CREATE DATABASE `blogbeartest` DEFAULT CHARACTER SET &#39;utf8&#39;;
Query OK, 1 row affected (0.00 sec)

mysql&amp;gt; show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| blogbear           |
| blogbeartest       |
| mysql              |
| performance_schema |
| test               |
+--------------------+
6 rows in set (0.00 sec)

mysql&amp;gt; quit
Bye
&lt;/pre&gt;
データベースblogbearにpostsテーブルを作成しダミーデータを投入する。&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;$ sudo mysql blogbear
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 5
Server version: 5.5.24 MySQL Community Server (GPL)

Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type &#39;help;&#39; or &#39;\h&#39; for help. Type &#39;\c&#39; to clear the current input statement.

mysql&amp;gt; CREATE TABLE posts (
    -&amp;gt; id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
    -&amp;gt; title VARCHAR(50),
    -&amp;gt; body TEXT,
    -&amp;gt; created DATETIME DEFAULT NULL,
    -&amp;gt; modified DATETIME DEFAULT NULL
    -&amp;gt; );
Query OK, 0 rows affected (0.04 sec)

mysql&amp;gt; INSERT INTO posts (title,body,created)
    -&amp;gt; VALUES (&#39;タイトル&#39;, &#39;これは、記事の本文です。&#39;, NOW());
Query OK, 1 row affected (0.00 sec)

mysql&amp;gt; INSERT INTO posts (title,body,created)
    -&amp;gt; VALUES (&#39;またタイトル&#39;, &#39;そこに本文が続きます。&#39;, NOW());
Query OK, 1 row affected (0.01 sec)

mysql&amp;gt; INSERT INTO posts (title,body,created)
    -&amp;gt; VALUES (&#39;タイトルの逆襲&#39;, &#39;こりゃ本当に面白そう！うそ。&#39;, NOW());
Query OK, 1 row affected (0.01 sec)

mysql&amp;gt; show tables;
+--------------------+
| Tables_in_blogbear |
+--------------------+
| posts              |
+--------------------+
1 row in set (0.00 sec)

mysql&amp;gt; select * from posts;
+----+-----------------------+--------------------------------------------+---------------------+----------+
| id | title                 | body                                       | created             | modified |
+----+-----------------------+--------------------------------------------+---------------------+----------+
|  1 | タイトル              | これは、記事の本文です。                   | 2012-07-08 10:17:18 | NULL     |
|  2 | またタイトル          | そこに本文が続きます。                     | 2012-07-08 10:17:18 | NULL     |
|  3 | タイトルの逆襲        | こりゃ本当に面白そう！うそ。               | 2012-07-08 10:17:19 | NULL     |
+----+-----------------------+--------------------------------------------+---------------------+----------+
3 rows in set (0.00 sec)

mysql&amp;gt; quit
Bye
&lt;/pre&gt;
データベースblogbeartestにpostsテーブルを作成する。&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;$ sudo mysql blogbeartest
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 5.5.24 MySQL Community Server (GPL)

Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type &#39;help;&#39; or &#39;\h&#39; for help. Type &#39;\c&#39; to clear the current input statement.

mysql&amp;gt; CREATE TABLE posts (
    -&amp;gt; id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
    -&amp;gt; title VARCHAR(50),
    -&amp;gt; body TEXT,
    -&amp;gt; created DATETIME DEFAULT NULL,
    -&amp;gt; modified DATETIME DEFAULT NULL
    -&amp;gt; );
Query OK, 0 rows affected (0.03 sec)

mysql&amp;gt; show tables;
+------------------------+
| Tables_in_blogbeartest |
+------------------------+
| posts                  |
+------------------------+
1 row in set (0.00 sec)

mysql&amp;gt; quit
Bye
&lt;/pre&gt;
テスト実行準備が終わったのでphpunitテストを実行する。&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;$ cd ~/BEAR/BEAR.Sunday
$ phpunit
PHPUnit 3.6.11 by Sebastian Bergmann.

The Xdebug extension is not loaded. No code coverage will be generated.

run:sandbox mode=Dev cahce=enable
.............................................

Time: 4 seconds, Memory: 17.25Mb

OK (45 tests, 55 assertions)
&lt;/pre&gt;
sandboxを実際にビルトインサーバーで実行して挙動をブラウザから確認する。&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;$ php -S localhost:8088 web.php 
PHP 5.4.4 Development Server started at Sun Jul  8 10:57:08 2012
Listening on localhost:8088
Document root is /home/shige/BEAR/BEAR.Sunday/apps/sandbox/htdocs
Press Ctrl-C to quit.
[Sun Jul  8 10:57:26 2012] run:sandbox mode=Dev cahce=enable
[Sun Jul  8 10:57:26 2012] ::1:42119 [200]: /assets/css/bootstrap.css
[Sun Jul  8 10:57:26 2012] ::1:42120 [200]: /assets/css/bootstrap-responsive.css
[Sun Jul  8 10:57:26 2012] ::1:42121 [200]: /assets/js/jquery.js
[Sun Jul  8 10:57:26 2012] ::1:42122 [200]: /assets/js/bootstrap-tooltip.js
[Sun Jul  8 10:57:26 2012] ::1:42123 [200]: /assets/js/bootstrap-popover.js
[Sun Jul  8 10:57:26 2012] ::1:42124 [200]: /assets/js/bootstrap-collapse.js
[Sun Jul  8 10:57:26 2012] ::1:42125 [200]: /assets/js/bootstrap-tab.js
[Sun Jul  8 10:57:26 2012] ::1:42126 [200]: /assets/ico/favicon.ico
[Sun Jul  8 10:57:26 2012] ::1:42128 [200]: /assets/img/glyphicons-halflings.png
[Sun Jul  8 10:57:26 2012] ::1:42129 [200]: /assets/ico/favicon.ico
[Sun Jul  8 10:58:03 2012] run:sandbox mode=Dev cahce=enable
[Sun Jul  8 10:58:03 2012] ::1:42133 [200]: /assets/css/bootstrap.css
[Sun Jul  8 10:58:03 2012] ::1:42134 [200]: /assets/js/bootstrap-tooltip.js
[Sun Jul  8 10:58:03 2012] ::1:42135 [200]: /assets/js/bootstrap-popover.js
[Sun Jul  8 10:58:03 2012] ::1:42136 [200]: /assets/js/bootstrap-collapse.js
[Sun Jul  8 10:58:03 2012] ::1:42137 [200]: /assets/js/bootstrap-tab.js
・・・以下略
&lt;/pre&gt;
ブラウザからアクセスしてページ内容を確認。&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a class=&quot;lightbox&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJnNKRZoAOTETwLQgMmV4X4i7vM4sofLjfPq5LsgJnTXDysYAK2Sko4UNwR3AMBJjD9MYsHhzd25r0jpUCA5sfyt54LFMSsLTd-r0XajNwHaoYndHxsRku625bmSTCpEwNC0Rk6FVV0i4/s1600/%E7%94%BB%E5%83%8F2.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;246&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJnNKRZoAOTETwLQgMmV4X4i7vM4sofLjfPq5LsgJnTXDysYAK2Sko4UNwR3AMBJjD9MYsHhzd25r0jpUCA5sfyt54LFMSsLTd-r0XajNwHaoYndHxsRku625bmSTCpEwNC0Rk6FVV0i4/s320/%E7%94%BB%E5%83%8F2.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
起動時に指定したweb.phpがhttp://localhost:8088/へのアクセスで表示される。ページ内にあるリンクからHelloworldを表示する。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a class=&quot;lightbox&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1orX5TuI7ZGXq6bZzVhiOWRmeJfs5xiMVyZoWuhZ_HJ2NgkjTNVLin6SE2T0BOXe0bO0VV_ryIEyq77O2_fEuFOcWzlC0BIkF9NYhCNlQTTTCBIffbgYyzVLUjUWat3EO4EkwzGymduA/s1600/%25E7%2594%25BB%25E5%2583%258F3.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;246&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1orX5TuI7ZGXq6bZzVhiOWRmeJfs5xiMVyZoWuhZ_HJ2NgkjTNVLin6SE2T0BOXe0bO0VV_ryIEyq77O2_fEuFOcWzlC0BIkF9NYhCNlQTTTCBIffbgYyzVLUjUWat3EO4EkwzGymduA/s320/%25E7%2594%25BB%25E5%2583%258F3.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
ちゃんとHelloWorldページが表示された。&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a class=&quot;lightbox&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgw5yQTO71sQry612481LjeApGsmwlywHd-P6OZWEcC2yJKT2BKH5cJpYdw1-bKvxV3UmEunMBBkVutaVTNjI9xt2HU9rdrXtOHzSO5-CYntXgID7I90ZvEb_tAmHRpFXhVq2-Z4K8nesQ/s1600/%25E7%2594%25BB%25E5%2583%258F4.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;246&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgw5yQTO71sQry612481LjeApGsmwlywHd-P6OZWEcC2yJKT2BKH5cJpYdw1-bKvxV3UmEunMBBkVutaVTNjI9xt2HU9rdrXtOHzSO5-CYntXgID7I90ZvEb_tAmHRpFXhVq2-Z4K8nesQ/s320/%25E7%2594%25BB%25E5%2583%258F4.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
こちらはblogbearの一覧表示画面。&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a class=&quot;lightbox&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEihOZmxGJGDdPj9z_U9AUMbh-LqjrcwDYuhEAdnT8iQAfr4jjxSBrI9aiTw92HV6lMTSS3tX5o7z6hQMBeKO7v036Ro6Jxx0pLIUlA1ezulGRNZjCTf4CXvsgEIKDzIo1opd2jtmTncIBA/s1600/%25E7%2594%25BB%25E5%2583%258F5.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;246&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEihOZmxGJGDdPj9z_U9AUMbh-LqjrcwDYuhEAdnT8iQAfr4jjxSBrI9aiTw92HV6lMTSS3tX5o7z6hQMBeKO7v036Ro6Jxx0pLIUlA1ezulGRNZjCTf4CXvsgEIKDzIo1opd2jtmTncIBA/s320/%25E7%2594%25BB%25E5%2583%258F5.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
個々の記事を表示する画面。&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a class=&quot;lightbox&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUvI2Xlm1cEMJwW1QQeUSpkfIc7PMrw9hef4d4wSmEL_Z5Q_ips6XPA4w6n_6Op_b_zyAtDRSLSzqf3JckPwxHNEL1nReSvnaBq4xC6Dw02K8tcBBUahnO5fx4L9T5WVImSSAQfLEPwU8/s1600/%25E7%2594%25BB%25E5%2583%258F6.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;246&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUvI2Xlm1cEMJwW1QQeUSpkfIc7PMrw9hef4d4wSmEL_Z5Q_ips6XPA4w6n_6Op_b_zyAtDRSLSzqf3JckPwxHNEL1nReSvnaBq4xC6Dw02K8tcBBUahnO5fx4L9T5WVImSSAQfLEPwU8/s320/%25E7%2594%25BB%25E5%2583%258F6.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
最後に記事編集画面。新規ページと供用されていると思われる。&lt;br /&gt;
&lt;br /&gt;
以上BEAR.Sundayをgithubから取得しphpunitテストを実行して確認。実際にビルトインサーバにブラウザからアクセスして表示等を確認した。&lt;br /&gt;
&lt;br /&gt;
PHPはかなり不慣れで戸惑う場面も多かったしまだ納得いってない挙動もあるが同様にUbuntu12.04やDebian Wheezy(現testing)でも環境を構築してみたので随時記事にしたいと思う。&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ikkandou.blogspot.com/feeds/5011670976000746444/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://ikkandou.blogspot.com/2012/07/bearsunday1.html#comment-form' title='1 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8585981105500683948/posts/default/5011670976000746444'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8585981105500683948/posts/default/5011670976000746444'/><link rel='alternate' type='text/html' href='http://ikkandou.blogspot.com/2012/07/bearsunday1.html' title='BEAR.Sundayをインストールしてみた。(1)'/><author><name>いのうえしげゆき</name><uri>http://www.blogger.com/profile/13282776910860697563</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4jOg9k9PA94jh2U-QMUKSn508dxoLDOSWZIPK7nQDJGHkMuznNHROdpci2TgtUj31D_6z_squlFDoOp0ZaE9FUKw_FoOxt2mV-CqXjXqbanWfp94dejC7GtJScBvaaz8/s220/kaepapa.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJnNKRZoAOTETwLQgMmV4X4i7vM4sofLjfPq5LsgJnTXDysYAK2Sko4UNwR3AMBJjD9MYsHhzd25r0jpUCA5sfyt54LFMSsLTd-r0XajNwHaoYndHxsRku625bmSTCpEwNC0Rk6FVV0i4/s72-c/%E7%94%BB%E5%83%8F2.png" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8585981105500683948.post-1860001908670293586</id><published>2011-10-03T21:57:00.000+09:00</published><updated>2011-10-03T21:57:19.230+09:00</updated><title type='text'>QLife 添付文書Pro リリース</title><content type='html'>Twitter等でも告知させて頂きましたが情報を集約させるためにブログでまとめたいと思います。&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
さて本日株式会社QLife様よりiOS上で利用出来る添付文書Proがリリースされました。私いのうえしげゆきもこのアプリの開発に監修という形で参加させて頂いております。&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgMe2cjPVvkV_jh4q8-OlJ77CoedyBw7iPqpF4wMywHR_ZPCGSSvzHSluDa1bY5MDUssK1xS2hjyynKjISNUxM6BmDcUBPgfgICbLKhi8naOiMD4hiJO2IA6x-7YtouUMpRRnkYwm5CEgA/s1600/211180_102764546500076_1556251163_n.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgMe2cjPVvkV_jh4q8-OlJ77CoedyBw7iPqpF4wMywHR_ZPCGSSvzHSluDa1bY5MDUssK1xS2hjyynKjISNUxM6BmDcUBPgfgICbLKhi8naOiMD4hiJO2IA6x-7YtouUMpRRnkYwm5CEgA/s1600/211180_102764546500076_1556251163_n.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
AppStoreはこちらからアクセス出来ます。&lt;br /&gt;
&lt;a href=&quot;http://itunes.apple.com/jp/app/id467352729&quot;&gt;http://itunes.apple.com/jp/app/id467352729&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
上記アプリを継続してご利用頂くにはQLM IDを取得して頂く必要があります。&lt;br /&gt;
QLM IDの取得は以下から行なってください。&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://qlifebooks.com/entry/index.php&quot;&gt;https://qlifebooks.com/entry/index.php&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
上記URLは現状iPhoneでの登録について準備中です(10/3現在)。iPhoneでご利用予定の方は事前にIDを取得しておくことをお勧めします。&lt;br /&gt;
&lt;br /&gt;
そして&lt;a href=&quot;http://www.facebook.com/pages/%E6%B7%BB%E4%BB%98%E6%96%87%E6%9B%B8-Pro/102764546500076&quot;&gt;Facebookページ&lt;/a&gt;も作成されておりますので是非情報収集等にお役立てください。&lt;br /&gt;
&lt;br /&gt;
このアプリの特徴としては多くの医薬品が画像付きで表示されること。そしてiOS上の添付文書閲覧アプリでは初だと思いますがインタビューフォームを閲覧することが可能です。&lt;br /&gt;
&lt;br /&gt;
またローカルにデータを保持(約1GB)するため回線不通時でも添付文書の閲覧が可能です。&lt;br /&gt;
このデータを端末に登録するため初回利用時にちょっと大きめなデータダウンロードが必要となります。サイズの関係上wi-fi接続のみ対応となっておりご自宅や職場等でのインストールをお勧め致します。&lt;br /&gt;
&lt;br /&gt;
添付文書Proに関するご意見等は私 @kaepapa33 もしくは@QLife_JP までお寄せ頂けますようお願い致します。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://ikkandou.blogspot.com/feeds/1860001908670293586/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://ikkandou.blogspot.com/2011/10/qlife-pro.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8585981105500683948/posts/default/1860001908670293586'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8585981105500683948/posts/default/1860001908670293586'/><link rel='alternate' type='text/html' href='http://ikkandou.blogspot.com/2011/10/qlife-pro.html' title='QLife 添付文書Pro リリース'/><author><name>いのうえしげゆき</name><uri>http://www.blogger.com/profile/13282776910860697563</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4jOg9k9PA94jh2U-QMUKSn508dxoLDOSWZIPK7nQDJGHkMuznNHROdpci2TgtUj31D_6z_squlFDoOp0ZaE9FUKw_FoOxt2mV-CqXjXqbanWfp94dejC7GtJScBvaaz8/s220/kaepapa.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgMe2cjPVvkV_jh4q8-OlJ77CoedyBw7iPqpF4wMywHR_ZPCGSSvzHSluDa1bY5MDUssK1xS2hjyynKjISNUxM6BmDcUBPgfgICbLKhi8naOiMD4hiJO2IA6x-7YtouUMpRRnkYwm5CEgA/s72-c/211180_102764546500076_1556251163_n.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8585981105500683948.post-408163169435644507</id><published>2011-10-02T15:20:00.004+09:00</published><updated>2011-10-02T15:22:44.814+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android"/><title type='text'>メディア初登場！？</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
はてさて拙作添付文書検索ツールが雑誌に掲載されました。&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
掲載されたのは&lt;a href=&quot;http://getnavi.jp/&quot;&gt;GetNavi&lt;/a&gt;という情報雑誌の11月号。&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
はじめての事なのでちょっと嬉しい・・・ものの添付文書というものがどういうものなのかちゃんと認識されてない点がちょっと残念です。&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a class=&quot;lightbox&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZhKqqKRGJ5W0zDnSzZTf0_yBoNUsNnBPc5X_-sPEBn7btQ9YfxUnnHCsHDviNXwfaX43VLiLnjdKSA_VRKmHucq1uvkS2sXfX-n2yxaXQbf6bo5gUOtPDjnVUgk-buJCli3uxGykuP5g/s1600/GetNavi.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;300&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZhKqqKRGJ5W0zDnSzZTf0_yBoNUsNnBPc5X_-sPEBn7btQ9YfxUnnHCsHDviNXwfaX43VLiLnjdKSA_VRKmHucq1uvkS2sXfX-n2yxaXQbf6bo5gUOtPDjnVUgk-buJCli3uxGykuP5g/s320/GetNavi.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
でもこの雑誌はとりあえず永久保存ということにしましょう。ちゃんとスキャンして画像としても残したので記念ぱぴこ。</content><link rel='replies' type='application/atom+xml' href='http://ikkandou.blogspot.com/feeds/408163169435644507/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://ikkandou.blogspot.com/2011/10/blog-post.html#comment-form' title='4 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8585981105500683948/posts/default/408163169435644507'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8585981105500683948/posts/default/408163169435644507'/><link rel='alternate' type='text/html' href='http://ikkandou.blogspot.com/2011/10/blog-post.html' title='メディア初登場！？'/><author><name>いのうえしげゆき</name><uri>http://www.blogger.com/profile/13282776910860697563</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4jOg9k9PA94jh2U-QMUKSn508dxoLDOSWZIPK7nQDJGHkMuznNHROdpci2TgtUj31D_6z_squlFDoOp0ZaE9FUKw_FoOxt2mV-CqXjXqbanWfp94dejC7GtJScBvaaz8/s220/kaepapa.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZhKqqKRGJ5W0zDnSzZTf0_yBoNUsNnBPc5X_-sPEBn7btQ9YfxUnnHCsHDviNXwfaX43VLiLnjdKSA_VRKmHucq1uvkS2sXfX-n2yxaXQbf6bo5gUOtPDjnVUgk-buJCli3uxGykuP5g/s72-c/GetNavi.jpg" height="72" width="72"/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8585981105500683948.post-4870762104743738068</id><published>2011-09-20T18:34:00.000+09:00</published><updated>2011-09-20T18:34:10.820+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android"/><category scheme="http://www.blogger.com/atom/ns#" term="UnitTest"/><title type='text'>AndroidLibraryプロジェクトの作成とテスト(2)</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #bbbbc9; font-family: Helvetica, Arial, sans-serif; font-size: 14px; line-height: 23px;&quot;&gt;　ちょっと間があいてしまいましたが前回の続きです。&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #bbbbc9; font-family: Helvetica, Arial, sans-serif; font-size: 14px; line-height: 23px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #bbbbc9; font-family: Helvetica, Arial, sans-serif; font-size: 14px; line-height: 23px;&quot;&gt;　今回は実際にテストを作って実行する部分について紹介したいと思います。&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #bbbbc9; font-family: Helvetica, Arial, sans-serif; font-size: 14px; line-height: 23px;&quot;&gt;ではまずはテスト対象となるクラスをライブラリプロジェクトに作成したいと思います。&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #bbbbc9; font-family: Helvetica, Arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 14px; line-height: 23px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a class=&quot;lightbox&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh7e3VAYUYtJQnrsplgX4A6kjwd7JtvU0nVi0HVE5o_BmPrliMKDJJ8x8CVMPuUCs_9RxDD7X72Xs5Bk9qMBDQycWGwll6SUiTcQ0rJ40HWp40ezx43ObLCp6tLtbudeAeaIHx21Gg3y04/s1600/Image12.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;194&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh7e3VAYUYtJQnrsplgX4A6kjwd7JtvU0nVi0HVE5o_BmPrliMKDJJ8x8CVMPuUCs_9RxDD7X72Xs5Bk9qMBDQycWGwll6SUiTcQ0rJ40HWp40ezx43ObLCp6tLtbudeAeaIHx21Gg3y04/s320/Image12.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #bbbbc9; font-family: Helvetica, Arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 14px; line-height: 23px;&quot;&gt;　ライブラリプロジェクトのパッケージ直下にクラスを作成するためにコンテキストメニューから「新規」-「クラス」を選択し以下の新規Javaクラスダイアログを表示します。&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a class=&quot;lightbox&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJX8q8kCwCX6dHR6501NeYjzoso-CU3Qghc6VKI4bH2Kxt7a29SUQaLlrfhYlOObeWaB5IT4p0F43KgHT4Uyg2Hsxc9eR7yxP-5WVaYLEELmWtGz31jMY7hBzqLl5gF8bjm1vpQyt-zIo/s1600/Image13.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;318&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJX8q8kCwCX6dHR6501NeYjzoso-CU3Qghc6VKI4bH2Kxt7a29SUQaLlrfhYlOObeWaB5IT4p0F43KgHT4Uyg2Hsxc9eR7yxP-5WVaYLEELmWtGz31jMY7hBzqLl5gF8bjm1vpQyt-zIo/s320/Image13.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #bbbbc9; font-family: Helvetica, Arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 14px; line-height: 23px;&quot;&gt;　クラス名はプロジェクトと同じ「AndroidLibrary」としました。他は今回なにも変更をしていません。&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #bbbbc9; font-family: Helvetica, Arial, sans-serif; font-size: 14px; line-height: 23px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a class=&quot;lightbox&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwRnha9tKrELGs5zdoR5X-YYMyxbZtOJGFk7NsKvbUJMAyocQzlKueYl_tQraCiRDxl8dfc72U64B4-tKvkXfTDnM8uEHSZIppWm2n7Jc1BawvpZE4L2aGumYW06n1W1MymWbs9nDSVYg/s1600/Image14.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;238&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwRnha9tKrELGs5zdoR5X-YYMyxbZtOJGFk7NsKvbUJMAyocQzlKueYl_tQraCiRDxl8dfc72U64B4-tKvkXfTDnM8uEHSZIppWm2n7Jc1BawvpZE4L2aGumYW06n1W1MymWbs9nDSVYg/s320/Image14.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #bbbbc9; font-family: Helvetica, Arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 14px; line-height: 23px;&quot;&gt;　作成されたクラスファイルにとりあえずコンストラクタメソッドのみ作成して続いてテストクラスを作成します。私はQuickJUnitを利用しているのでAndroidLibraryクラスに対するテストクラスが未作成状態ではCtrl+9で以下のようなダイアログが開きます。既にテストクラスが作成されている場合にはテストクラスがパースペクティブに表示されテスト対象クラスとテストクラスをショートカットで行き来することが出来ます。&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a class=&quot;lightbox&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTJrNDP2DExVD4_mf7vIpt-pz168pgSJQNBQ1xL3wEs7T053A0pXD5IjYA80fic7jaRuxw9diI2Ymnvk0FRwfUQHkhpHqhyzW8UmtvLfJFmKRjGx238tpY5F_AaPO1G1p7bh6vDdaHygU/s1600/Image15.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;90&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTJrNDP2DExVD4_mf7vIpt-pz168pgSJQNBQ1xL3wEs7T053A0pXD5IjYA80fic7jaRuxw9diI2Ymnvk0FRwfUQHkhpHqhyzW8UmtvLfJFmKRjGx238tpY5F_AaPO1G1p7bh6vDdaHygU/s320/Image15.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #bbbbc9; font-family: Helvetica, Arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 14px; line-height: 23px;&quot;&gt;　ここで「はい」と答えると新規JUnitテスト・ケースダイアログが表示されますのでテストクラスを生成させましょう。&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #bbbbc9; font-family: Helvetica, Arial, sans-serif; font-size: 14px; line-height: 23px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a class=&quot;lightbox&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkmZMP4OwZ2vIfm16XF7Bxw20LsVEfx2myJKyJvA4kdIoFQgJ-wwYX5dxUnbqfVC08Ksr9TIlonNulw53qU9mtmocNpC-NqFKzwIq5Wex1eQWOVwz0M-qkMhM7NXQOkTH4kuyK5C3t1c0/s1600/Image16.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkmZMP4OwZ2vIfm16XF7Bxw20LsVEfx2myJKyJvA4kdIoFQgJ-wwYX5dxUnbqfVC08Ksr9TIlonNulw53qU9mtmocNpC-NqFKzwIq5Wex1eQWOVwz0M-qkMhM7NXQOkTH4kuyK5C3t1c0/s320/Image16.png&quot; width=&quot;278&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #bbbbc9; font-family: Helvetica, Arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 14px; line-height: 23px;&quot;&gt;　ソース・フォルダーがLibraryプロジェクトのsrcフォルダがデフォルトで指定されているのでLibraryテストプロジェクトのsrcフォルダに変更しておきます。またスーパークラスをAndroidTestCaseに変更してあります。&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #bbbbc9; font-family: Helvetica, Arial, sans-serif; font-size: 14px; line-height: 23px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a class=&quot;lightbox&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCNa3WK38BqkTJg_RMXBWkkBz7aYInb522hyCY-mJvCZ1uP1h9QfUsG2VakEecVwxFHfZ3oTCh9WoivLiJim6izLL16UW1g4ievJMfhL8a7dCV7cjjNpJQp5pQ6TptQqoxvucg4lPdvVY/s1600/Image17.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;137&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCNa3WK38BqkTJg_RMXBWkkBz7aYInb522hyCY-mJvCZ1uP1h9QfUsG2VakEecVwxFHfZ3oTCh9WoivLiJim6izLL16UW1g4ievJMfhL8a7dCV7cjjNpJQp5pQ6TptQqoxvucg4lPdvVY/s320/Image17.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #bbbbc9; font-family: Helvetica, Arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 14px; line-height: 23px;&quot;&gt;　作成したAndroidLibraryTestクラス内にとりあえず簡単なテストを作成しました。AndroidLibraryクラスのインスタンスを生成してそのインスタンスがAndroidLibraryクラスのものであるか確認しているだけです。コンストラクタメソッドは既に作成してあるのでテストファーストじゃありませんが今回は気にしません。&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #bbbbc9; font-family: Helvetica, Arial, sans-serif; font-size: 14px; line-height: 23px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a class=&quot;lightbox&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQI-KbChvda_SppMYinMo87WV9VwdAEJIbCW7UDFJcV9403YPybhui5bVsBFTEtSJQ3MysNxJssfYXUAnjAgelbz0H0TErxt4CP-ZlRZfKn02JXKzos2daR8BLw5VP62b0p6nM2SFil5o/s1600/Image18.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;128&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQI-KbChvda_SppMYinMo87WV9VwdAEJIbCW7UDFJcV9403YPybhui5bVsBFTEtSJQ3MysNxJssfYXUAnjAgelbz0H0TErxt4CP-ZlRZfKn02JXKzos2daR8BLw5VP62b0p6nM2SFil5o/s320/Image18.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #bbbbc9; font-family: Helvetica, Arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 14px; line-height: 23px;&quot;&gt;　また「新規作成」-「その他」から「Java」-「JUnit」-「Junitテスト・スイート」からAllTestsクラスを作成して配下のテストクラスを収集するよう実装しました。&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #bbbbc9; font-family: Helvetica, Arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 14px; line-height: 23px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #bbbbc9; font-family: Helvetica, Arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 14px; line-height: 23px;&quot;&gt;　ここで一点注意が必要です。プロジェクトを作成したときに自動ビルドの設定になっている場合空プロジェクトがビルドされて既にapkファイルが作成されています。この状態でテストを実行するとエミュレータにLibraryプロジェクトのパッケージがインストールされてしまいテストが上手く実行出来なくなってしまいます。Libraryプロジェクトフォルダ内のbinフォルダは以下のようになっていることと思います。&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a class=&quot;lightbox&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9Uf5YcNthxQ50HLlHj9bwWkOYbdwWeay7IhGOawCdCkvd4A1efyI_8Tug1wB34BcvV1RbtRXRzE9VxTPTNKQ21N96_pKc2EC8XqLVLGVQZTNvMcfqKeEqVhLkW7PxOOT-8IidDFcQfyI/s1600/Image22.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;167&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9Uf5YcNthxQ50HLlHj9bwWkOYbdwWeay7IhGOawCdCkvd4A1efyI_8Tug1wB34BcvV1RbtRXRzE9VxTPTNKQ21N96_pKc2EC8XqLVLGVQZTNvMcfqKeEqVhLkW7PxOOT-8IidDFcQfyI/s320/Image22.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #bbbbc9; font-family: Helvetica, Arial, sans-serif; font-size: 14px; line-height: 23px;&quot;&gt;　これら3つのファイルは必要ありませんのでテスト実行前に必ず削除しておくようにしてください。そうしないとエミュレータ起動ごとにAndroidライブラリパッケージがエミュレータにインストールされてしまいアンインストールしないとテスト実行が出来なくなってしまいます。もしインストールが実行されてしまった場合は.settingあたりを一度削除する必要があるかもしれませんがそこまでは検証していません。&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #bbbbc9; font-family: Helvetica, Arial, sans-serif; font-size: 14px; line-height: 23px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a class=&quot;lightbox&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3Ps_mKzEpmIMuR6VyUdmrDO338aqwIhEwNv9_GGtWyjMLQK6jh_KyhWe5aSK15a5zgECG1J9i3GOJHwxwOo4avQz8GjKkvMIclHQF9olE_zvu-iQBXUuzuYz_o1b62ODfPqHXzN4y2PM/s1600/Image20.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;244&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3Ps_mKzEpmIMuR6VyUdmrDO338aqwIhEwNv9_GGtWyjMLQK6jh_KyhWe5aSK15a5zgECG1J9i3GOJHwxwOo4avQz8GjKkvMIclHQF9olE_zvu-iQBXUuzuYz_o1b62ODfPqHXzN4y2PM/s320/Image20.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #bbbbc9; font-family: Helvetica, Arial, sans-serif; font-size: 14px; line-height: 23px;&quot;&gt;　さて実際のテストの実行ですが「実行構成」を開き通常のAndroidテストと同じように設定を行います。ここは特に詳しい説明は必要ないことでしょう。&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a class=&quot;lightbox&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiEvEbthosHIj9T1W0VAXceGlGTKZ9ZHNk4B2oASvSK0VJlOX09qz1eT31DuK96LgtcZZID9SeN-vXiS4BljQqC2PWcH1DpZvXhDurgh3HkeZINohOdK0UKaK3Wl1fZj2LbVTtzpcHCFeo/s1600/Image21.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;306&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiEvEbthosHIj9T1W0VAXceGlGTKZ9ZHNk4B2oASvSK0VJlOX09qz1eT31DuK96LgtcZZID9SeN-vXiS4BljQqC2PWcH1DpZvXhDurgh3HkeZINohOdK0UKaK3Wl1fZj2LbVTtzpcHCFeo/s320/Image21.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #bbbbc9; font-family: Helvetica, Arial, sans-serif; font-size: 14px; line-height: 23px;&quot;&gt;　そしてテストを実行するともちろんコンストラクタクラスが作られているのでグリーンです。&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #bbbbc9; font-family: Helvetica, Arial, sans-serif; font-size: 14px; line-height: 23px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #bbbbc9; font-family: Helvetica, Arial, sans-serif; font-size: 14px; line-height: 23px;&quot;&gt;　いかがだったでしょうか。注意点はあるもののお手軽にライブラリプロジェクトのテストを行うことが出来ます。ライブラリなのでandroid.jarに依存しないものであれば普通のJavaプロジェクトとして作成したほうがテスト実行速度も速く優位だと思いますがどうしてもandroid.jarに依存してしまう場合にはこの手法でテストが可能となることと思います。&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #bbbbc9; font-family: Helvetica, Arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 14px; line-height: 23px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #bbbbc9; font-family: Helvetica, Arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 14px; line-height: 23px;&quot;&gt;　さてさてこの手法を用いてライブラリを作成しなくちゃ！&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #bbbbc9; font-family: Helvetica, Arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 14px; line-height: 23px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://ikkandou.blogspot.com/feeds/4870762104743738068/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://ikkandou.blogspot.com/2011/09/androidlibrary2.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8585981105500683948/posts/default/4870762104743738068'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8585981105500683948/posts/default/4870762104743738068'/><link rel='alternate' type='text/html' href='http://ikkandou.blogspot.com/2011/09/androidlibrary2.html' title='AndroidLibraryプロジェクトの作成とテスト(2)'/><author><name>いのうえしげゆき</name><uri>http://www.blogger.com/profile/13282776910860697563</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4jOg9k9PA94jh2U-QMUKSn508dxoLDOSWZIPK7nQDJGHkMuznNHROdpci2TgtUj31D_6z_squlFDoOp0ZaE9FUKw_FoOxt2mV-CqXjXqbanWfp94dejC7GtJScBvaaz8/s220/kaepapa.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh7e3VAYUYtJQnrsplgX4A6kjwd7JtvU0nVi0HVE5o_BmPrliMKDJJ8x8CVMPuUCs_9RxDD7X72Xs5Bk9qMBDQycWGwll6SUiTcQ0rJ40HWp40ezx43ObLCp6tLtbudeAeaIHx21Gg3y04/s72-c/Image12.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8585981105500683948.post-3811125410334720741</id><published>2011-09-17T14:48:00.002+09:00</published><updated>2011-09-17T14:54:38.130+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android"/><category scheme="http://www.blogger.com/atom/ns#" term="UnitTest"/><title type='text'>AndroidLibraryプロジェクトの作成とテスト(1)</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #bbbbc9; font-family: Helvetica, Arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 14px; line-height: 23px;&quot;&gt;ADTの機能としてLibraryProjectの作成がある。たしか0.9.7あたりから追加されたものだったと思うが複数のアプリケーションから参照が可能なLibraryプロジェクトが作成可能となっています。&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #bbbbc9; font-family: Helvetica, Arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 14px; line-height: 23px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #bbbbc9; font-family: Helvetica, Arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 14px; line-height: 23px;&quot;&gt;ライブラリであるので当然このLibraryプロジェクトはjarとしてbuildされ複数のAndroidプロジェクトで利用可能ということです。&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #bbbbc9; font-family: Helvetica, Arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 14px; line-height: 23px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #bbbbc9; font-family: Helvetica, Arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 14px; line-height: 23px;&quot;&gt;しかもADTの機能としてLibraryプロジェクトをライブラリとして参照するとそのAndroidプロジェクトの中からもソースコードの添付等を経ずソースコードの参照可能となり使い勝手の面で大きなメリットがあるように思われます。&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #bbbbc9; font-family: Helvetica, Arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 14px; line-height: 23px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #bbbbc9; font-family: Helvetica, Arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 14px; line-height: 23px;&quot;&gt;&lt;a href=&quot;http://www.pshared.net/diary/20110415.html&quot;&gt;@ussy00さんのブログ&lt;/a&gt;で春頃に紹介されていますが画像が無くなってしまっているようなので&lt;a href=&quot;https://sites.google.com/site/androidtestclub/&quot;&gt;ATEC&lt;/a&gt;の一員として後追い記事ではあるものの詳細をまとめてみようと思います。&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #bbbbc9; font-family: Helvetica, Arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 14px; line-height: 23px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #bbbbc9; font-family: Helvetica, Arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 14px; line-height: 23px;&quot;&gt;ということで先ずはLibraryプロジェクトとLibraryテストプロジェクトの作成から行なってみたいと思います。&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #bbbbc9; font-family: Helvetica, Arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 14px; line-height: 23px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a class=&quot;lightbox&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiBEp7w2mn8sWo87I7D2R4AZnN5kb4TBkqX40a6i6IHH7ChVYyCmQVaOq54683YWiIUKL-vB6mCqQswASJQPIzQOOh_vR_XcrPOkLgmMdXPcSnfFLyRteMxow-DvG-rivYAlTFkoL5aHug/s1600/Image01.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;252&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiBEp7w2mn8sWo87I7D2R4AZnN5kb4TBkqX40a6i6IHH7ChVYyCmQVaOq54683YWiIUKL-vB6mCqQswASJQPIzQOOh_vR_XcrPOkLgmMdXPcSnfFLyRteMxow-DvG-rivYAlTFkoL5aHug/s320/Image01.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #bbbbc9; font-family: Helvetica, Arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 14px; line-height: 23px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #bbbbc9; font-family: Helvetica, Arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 14px; line-height: 23px;&quot;&gt;まずは新規作成より通常のAndroidプロジェクトの作成と同様に「Androidプロジェクト」を選択します。作成仮定としてはAndroidプロジェクトとほぼ同じですが一点だけ違うのはAcitivyを作成しないということです。&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a class=&quot;lightbox&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgq00C79Ittpv9smA6cr6IcnYy0PDQdZs8_WUjTXiHyJ4vI8akNHBQDat_4tDaA6BkyQxpYPTUeULOY-OS885pmWmu50HMzYi_wGu9S4k1FTElbg3gf8FvW0UgkpqmAtsplA4De2OqtTHY/s1600/Image02.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgq00C79Ittpv9smA6cr6IcnYy0PDQdZs8_WUjTXiHyJ4vI8akNHBQDat_4tDaA6BkyQxpYPTUeULOY-OS885pmWmu50HMzYi_wGu9S4k1FTElbg3gf8FvW0UgkpqmAtsplA4De2OqtTHY/s320/Image02.png&quot; width=&quot;281&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #bbbbc9; font-family: Helvetica, Arial, sans-serif; font-size: 14px; line-height: 23px;&quot;&gt;上記のようにプロジェクト名を付け内容の部分についてはそれぞれの環境にあわせて設定を行ってください。ビルド・ターゲットとしては今回はAPIレベル7を選択しました。&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #bbbbc9; font-family: Helvetica, Arial, sans-serif; font-size: 14px; line-height: 23px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a class=&quot;lightbox&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixgPTuyh-aYdaBxMmeOL-qcwxAL5_gbHgPkOtBlc-xFAOGtymtMh11Bc-H_HZVQfwG9NxZyn8DGstcrpkeiG0hjYiKBf1jlnYui7k6-T8o01jDM7fxMlRKEemUNTCV7_1Bf4m7D6jNJes/s1600/Image03.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixgPTuyh-aYdaBxMmeOL-qcwxAL5_gbHgPkOtBlc-xFAOGtymtMh11Bc-H_HZVQfwG9NxZyn8DGstcrpkeiG0hjYiKBf1jlnYui7k6-T8o01jDM7fxMlRKEemUNTCV7_1Bf4m7D6jNJes/s320/Image03.png&quot; width=&quot;280&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #bbbbc9; font-family: Helvetica, Arial, sans-serif; font-size: 14px; line-height: 23px;&quot;&gt;パッケージ名をを指定した下の部分でAndroidプロジェクトではアクティビティ名を入力してアクティビティクラスを自動生成させていると思いますが今回のライブラリではAcitivityは使わないという設定にしてチェックを外しています。「次へ」ボタンを押してテストプロジェクトも一緒に作成します。&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a class=&quot;lightbox&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCMYgda057hxKdmegmZNODzF5t7NvCCNkm5SRWC9XrihhYuA1F1BzHFDN8EKpVUIwMCEc3DZR9nfm7lGazFYD0gjzanhaCIjetqOwPNDomfxltwyxA5HMdrQ4pYxSAOBPPknfgnkiGWn4/s1600/Image04.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCMYgda057hxKdmegmZNODzF5t7NvCCNkm5SRWC9XrihhYuA1F1BzHFDN8EKpVUIwMCEc3DZR9nfm7lGazFYD0gjzanhaCIjetqOwPNDomfxltwyxA5HMdrQ4pYxSAOBPPknfgnkiGWn4/s320/Image04.png&quot; width=&quot;281&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #bbbbc9; font-family: Helvetica, Arial, sans-serif; font-size: 14px; line-height: 23px;&quot;&gt;こちらはデフォルトのままでOKです。変更する必要がある場合は随時行なってください。&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a class=&quot;lightbox&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiy0OzmNnCEjeuAiqgPkRXO7jpWx9PwqPevJKGJn5p2IZWeg432W5loTEswfO1v-7cwqH2mvSq1R1kBUSqnXKoZNuSe1ASj6XE0bzWAWV-tFibX57tJBJmKKZyWG9Vii4If7LDR771NW6k/s1600/Image05.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiy0OzmNnCEjeuAiqgPkRXO7jpWx9PwqPevJKGJn5p2IZWeg432W5loTEswfO1v-7cwqH2mvSq1R1kBUSqnXKoZNuSe1ASj6XE0bzWAWV-tFibX57tJBJmKKZyWG9Vii4If7LDR771NW6k/s320/Image05.png&quot; width=&quot;281&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #bbbbc9; font-family: Helvetica, Arial, sans-serif; font-size: 14px; line-height: 23px;&quot;&gt;私はQuickJUnitを使う関係でパッケージ名をAndroidプロジェクトと同じにするようにしています。このあたりも好みかと思いますので自由に設定しましょう。「完了」ボタンを押すと上記ではAndroidLibraryプロジェクトとAndroidLibraryTestプロジェクトの二つがパッケージエクスプローラに表示されるようになったかと思います。続いてそれぞれのパッケージについてLibraryプロジェクトとする設定を行います。&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #bbbbc9; font-family: Helvetica, Arial, sans-serif; font-size: 14px; line-height: 23px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #bbbbc9; font-family: Helvetica, Arial, sans-serif; font-size: 14px; line-height: 23px;&quot;&gt;パッケージエクスプローラでAndroidLibraryプロジェクトを右クリックしてコンテキストメニューからプロパティを選択しその中のAndroid項目を開きます。&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a class=&quot;lightbox&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvgirvP6W5gAtGpGBtAokku7W78sJYBNqwzxX4fpSpwQRuNZRorngY93OKbnB54i462q2Gp1ISyQx_cJne60qxI4-LmSDQ5xXFzsAY43Fi8yfOjFryUx3IYDDw5iKVOaMUcXBiUWWRKkU/s1600/Image06.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvgirvP6W5gAtGpGBtAokku7W78sJYBNqwzxX4fpSpwQRuNZRorngY93OKbnB54i462q2Gp1ISyQx_cJne60qxI4-LmSDQ5xXFzsAY43Fi8yfOjFryUx3IYDDw5iKVOaMUcXBiUWWRKkU/s320/Image06.png&quot; width=&quot;313&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #bbbbc9; font-family: Helvetica, Arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 14px; line-height: 23px;&quot;&gt;下の「ライブラリー」という中の「Is Library」にチェックを入れこのプロジェクトがLibraryプロジェクトであることを設定します。続いてAndroiManifest.xmlを開きます。&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a class=&quot;lightbox&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmUIr2AFGUJSaxDsN2-ydJLb8-xegyDdvUObMVhWuDslZ59o4LpGQN0G3W7nHY7p5vCbhtxx1ldvGsUEiJwrKwoRkPcZ9_W6URWKLQtFP73oMitDqkKJh08hifYdDCKWPM1iwpDb3gjjQ/s1600/Image07.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmUIr2AFGUJSaxDsN2-ydJLb8-xegyDdvUObMVhWuDslZ59o4LpGQN0G3W7nHY7p5vCbhtxx1ldvGsUEiJwrKwoRkPcZ9_W6URWKLQtFP73oMitDqkKJh08hifYdDCKWPM1iwpDb3gjjQ/s320/Image07.png&quot; width=&quot;264&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #bbbbc9; font-family: Helvetica, Arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 14px; line-height: 23px;&quot;&gt;上記はAndroidManifest.xmlファイルのアプリケーションタブの一部です。上部にある「Define an &amp;lt;application&amp;gt; tag in the AndroidManifest.xml」のチェックが入っていると思うのでこれを外します。&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a class=&quot;lightbox&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgX75xvPz5EfBP5MhRVVvBjTCFe9qGhWPUlnpJxrRcemUpcri_WEvadxKhqB4Lc5unNDHMcSbbW5YdfQ958MR6W-C3rgqZlOwIt0ol4rD_scWnTWhMqEk-tt6LYbGFjj3fNY9kqdqlbgas/s1600/Image08.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;205&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgX75xvPz5EfBP5MhRVVvBjTCFe9qGhWPUlnpJxrRcemUpcri_WEvadxKhqB4Lc5unNDHMcSbbW5YdfQ958MR6W-C3rgqZlOwIt0ol4rD_scWnTWhMqEk-tt6LYbGFjj3fNY9kqdqlbgas/s320/Image08.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #bbbbc9; font-family: Helvetica, Arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 14px; line-height: 23px;&quot;&gt;するとAndroidManifest.xmlファイルは上記のようにとても簡単な物になります。&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a class=&quot;lightbox&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjvphS-L0n-KEdWjTWfEegUi2JFi0prDwRjYpEcwaTFdcjAj05OfD1q1LAVv-q-QIt59B0M8zDWh79EXv2MARGMvaEgRG1lT2defkqxxKD2N-f8SdQg49fuvp8Niykcr2XrRNl-QKYmcrI/s1600/Image09.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjvphS-L0n-KEdWjTWfEegUi2JFi0prDwRjYpEcwaTFdcjAj05OfD1q1LAVv-q-QIt59B0M8zDWh79EXv2MARGMvaEgRG1lT2defkqxxKD2N-f8SdQg49fuvp8Niykcr2XrRNl-QKYmcrI/s320/Image09.png&quot; width=&quot;308&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #bbbbc9; font-family: Helvetica, Arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 14px; line-height: 23px;&quot;&gt;続いては必要のなresフォルダの中身を削除してしまいましょう。リソースを利用する場合は残しておいても構いませんが初期設定で置かれるiconやlayout/main.xmlやvalues/string.xmlは必要ないことが多いのではないかと思います。genフォルダ、assetsフォルダそしてresフォルダ自身は残しておかないとコンパイル時にエラーとなってしまうようです。&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #bbbbc9; font-family: Helvetica, Arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 14px; line-height: 23px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #bbbbc9; font-family: Helvetica, Arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 14px; line-height: 23px;&quot;&gt;続いてはAndroidLibraryTestプロジェクトのプロパティを設定します。先程「Is Library」にチェックを入れた部分で「追加」ボタンを押しAndroidLibraryプロジェクトをライブラリとして登録します。&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #bbbbc9; font-family: Helvetica, Arial, sans-serif; font-size: 14px; line-height: 23px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a class=&quot;lightbox&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhx8uzOvxEdvGOl57wJFEc_rj8KOeW-ADbup2fs1cL_0X989bYYCjaCxcjTZiAVFS7oupnQ3sFyB6FgzzPW1TKhxUd2DPTJWkvfRD70BFDM7ZcZYcsN7ciOu02dqZXok_hSTDXfMTwESm0/s1600/Image10.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhx8uzOvxEdvGOl57wJFEc_rj8KOeW-ADbup2fs1cL_0X989bYYCjaCxcjTZiAVFS7oupnQ3sFyB6FgzzPW1TKhxUd2DPTJWkvfRD70BFDM7ZcZYcsN7ciOu02dqZXok_hSTDXfMTwESm0/s320/Image10.png&quot; width=&quot;265&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #bbbbc9; font-family: Helvetica, Arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 14px; line-height: 23px;&quot;&gt;登録すると上記のように表示されライブラリとして追加されたことが表示されます。&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #bbbbc9; font-family: Helvetica, Arial, sans-serif; font-size: 14px; line-height: 23px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a class=&quot;lightbox&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBYr3uId2ZyZ3chbmWKs_fMXRGtAp8oYs8lvkJvyNz_x9O0JEj3pVjR8wdiEZToygUNAWWlDEcjxujsVOxKGWqJHa9VafhulAfATVaKs3GVLMU8dA8SiX0TQkeXhIH41yitx5eKEAxx0Q/s1600/Image11.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBYr3uId2ZyZ3chbmWKs_fMXRGtAp8oYs8lvkJvyNz_x9O0JEj3pVjR8wdiEZToygUNAWWlDEcjxujsVOxKGWqJHa9VafhulAfATVaKs3GVLMU8dA8SiX0TQkeXhIH41yitx5eKEAxx0Q/s320/Image11.png&quot; width=&quot;260&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #bbbbc9; font-family: Helvetica, Arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 14px; line-height: 23px;&quot;&gt;またパッケージエクスプローラ上ではAndroidLibrary_srcとして参照されていることがわかるかと思います。この中身はAndroidLibraryプロジェクトのsrcフォルダがそのままリンクされているような感じで表示されています。こちらからファイルを変更してもAndroidLibraryプロジェクトの内容に反映してくれるようです。&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #bbbbc9; font-family: Helvetica, Arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 14px; line-height: 23px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #bbbbc9; font-family: Helvetica, Arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 14px; line-height: 23px;&quot;&gt;ちょっと長くなってきてしまったのでとりあえずこのあたりでいったん〆め。&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #bbbbc9; font-family: Helvetica, Arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 14px; line-height: 23px;&quot;&gt;次の記事では実際にテストを実行するまでをご紹介します。&lt;/span&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://ikkandou.blogspot.com/feeds/3811125410334720741/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://ikkandou.blogspot.com/2011/09/androidlibrary1.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8585981105500683948/posts/default/3811125410334720741'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8585981105500683948/posts/default/3811125410334720741'/><link rel='alternate' type='text/html' href='http://ikkandou.blogspot.com/2011/09/androidlibrary1.html' title='AndroidLibraryプロジェクトの作成とテスト(1)'/><author><name>いのうえしげゆき</name><uri>http://www.blogger.com/profile/13282776910860697563</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4jOg9k9PA94jh2U-QMUKSn508dxoLDOSWZIPK7nQDJGHkMuznNHROdpci2TgtUj31D_6z_squlFDoOp0ZaE9FUKw_FoOxt2mV-CqXjXqbanWfp94dejC7GtJScBvaaz8/s220/kaepapa.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiBEp7w2mn8sWo87I7D2R4AZnN5kb4TBkqX40a6i6IHH7ChVYyCmQVaOq54683YWiIUKL-vB6mCqQswASJQPIzQOOh_vR_XcrPOkLgmMdXPcSnfFLyRteMxow-DvG-rivYAlTFkoL5aHug/s72-c/Image01.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8585981105500683948.post-7160075528712755718</id><published>2011-08-13T22:44:00.001+09:00</published><updated>2011-08-13T22:46:59.507+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android"/><category scheme="http://www.blogger.com/atom/ns#" term="UnitTest"/><title type='text'>AndroidTestCaseを継承したテストケースでテストプロジェクト内のリソースを利用</title><content type='html'>今日は朝一から外出して若松通商さんで愛用のT61のCPUFan交換後、&lt;a href=&quot;http://atnd.org/events/18235&quot;&gt;第一回Androidテスト・ソースコードリーディング&lt;/a&gt;に参加してきました。&lt;br /&gt;
&lt;br /&gt;
ちょっと人数が少なめで寂しかったですがデ部とのダブルブッキングやら時期的な事を考えると致し方ないことだったでしょうか。&lt;br /&gt;
少人数でスイーツを頂きながらまったりとActivityInstrumentaionTestCase2あたりを眺めてきました。&lt;br /&gt;
&lt;br /&gt;
その中で先日からハマっていたAndroidテストパッケージの中のassets以下のファイルにアクセス出来ない問題について&lt;a href=&quot;http://mikeneck.blogspot.com/&quot;&gt;mike_neckさん&lt;/a&gt;に&lt;a href=&quot;https://gist.github.com/1075531&quot;&gt;例を提示&lt;/a&gt;して頂いたのでAssetManagerの呼び出しに@hideされているgetTestContextメソッドを利用してアクセス出来るようになりました。&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;public class AndroidExtendedTestCase extends AndroidTestCase {

    public Context getExTestContext() {
        Context context = null;
        @SuppressWarnings(&quot;unchecked&quot;)
        Class&lt;androidextendedtestcase&gt; clz = (Class&lt;androidextendedtestcase&gt;) this.getClass();
        try {
            Method method = clz.getMethod(&quot;getTestContext&quot;);
            context = (Context) method.invoke(this);
        } catch (SecurityException e) {
            fail();
        } catch (NoSuchMethodException e) {
            fail();
        } catch (IllegalArgumentException e) {
            fail();
        } catch (IllegalAccessException e) {
            fail();
        } catch (InvocationTargetException e) {
            fail();
        }
        return context;
    }
}
&lt;/pre&gt;&lt;br /&gt;
まんまソースを頂いてループしてしまっているようだったのでメソッド名をちょっと変更しましたがこのAndroidExtendedTestCaseを継承したテストケースクラスで&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;AssetManager assetMgr = getExTestContext().getAssets();
// filenameはassetsファイル以下相対パスを指定
InputStream is = new InputStream(assetMgr.open(filename));
&lt;/pre&gt;&lt;br /&gt;
という感じでばっちりと読み込むことが出来ました。@mike_neckさんいつもありがとうございます。</content><link rel='replies' type='application/atom+xml' href='http://ikkandou.blogspot.com/feeds/7160075528712755718/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://ikkandou.blogspot.com/2011/08/androidtestcase.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8585981105500683948/posts/default/7160075528712755718'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8585981105500683948/posts/default/7160075528712755718'/><link rel='alternate' type='text/html' href='http://ikkandou.blogspot.com/2011/08/androidtestcase.html' title='AndroidTestCaseを継承したテストケースでテストプロジェクト内のリソースを利用'/><author><name>いのうえしげゆき</name><uri>http://www.blogger.com/profile/13282776910860697563</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4jOg9k9PA94jh2U-QMUKSn508dxoLDOSWZIPK7nQDJGHkMuznNHROdpci2TgtUj31D_6z_squlFDoOp0ZaE9FUKw_FoOxt2mV-CqXjXqbanWfp94dejC7GtJScBvaaz8/s220/kaepapa.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8585981105500683948.post-867506105820917117</id><published>2011-08-08T13:32:00.000+09:00</published><updated>2011-08-08T13:32:17.687+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="iOS開発"/><title type='text'>読まねばならぬもの</title><content type='html'>だいぶ前に知人の方からMacBookをお借りしてiOS開発にも挑戦しようとぼちぼちと準備中。&lt;br /&gt;
&lt;br /&gt;
第一の目的は添付文書検索ツールのiOSへの移植…メインはiPadをターゲットにしたいと思います。&lt;br /&gt;
理由としては今後調剤室で添付文書の閲覧が必要になったときには常に最新のものを見てもらいたいということとなかなか業務中にはパソコンの前に座って最新の添付文書を開くというのが難しいということ。&lt;br /&gt;
&lt;br /&gt;
これをクリアするためにiPadなりAndroidタブレットに最適化した添付文書検索ツールのリリースをと&lt;br /&gt;
大分前から考えていたりしますがなかなか形にすることが出来ずにいる訳です。&lt;br /&gt;
&lt;br /&gt;
iPad向け開発もAndroidタブレット向け開発も未経験ではありますがなんとか頑張らないといけません。&lt;br /&gt;
&lt;br /&gt;
とりあえずまったくわかってないiOS開発の勉強をしている訳ですがAppleから膨大なドキュメントが日本語で提供されています。ところがこのページがどこにあるのかDeveloperサイトからなかなか辿ることが出来ないので備忘録的に記事にしておきます。&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://developer.apple.com/jp/devcenter/ios/library/japanese.html&quot;&gt;iOS Developer Library&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
上記リンク先に日本語化されたドキュメントが沢山あります。&lt;br /&gt;
全部じっくりと読めばかなりの知識になりそう。&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://developer.apple.com/library/ios/navigation/&quot;&gt;iOS Developer Library(英語)&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
上記にはさらに沢山のドキュメントが英語ではありますが用意されています。&lt;br /&gt;
&lt;br /&gt;
とりあえずじっくりと腰を据えてドキュメントを読み込みたいと思っています。</content><link rel='replies' type='application/atom+xml' href='http://ikkandou.blogspot.com/feeds/867506105820917117/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://ikkandou.blogspot.com/2011/08/blog-post.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8585981105500683948/posts/default/867506105820917117'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8585981105500683948/posts/default/867506105820917117'/><link rel='alternate' type='text/html' href='http://ikkandou.blogspot.com/2011/08/blog-post.html' title='読まねばならぬもの'/><author><name>いのうえしげゆき</name><uri>http://www.blogger.com/profile/13282776910860697563</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4jOg9k9PA94jh2U-QMUKSn508dxoLDOSWZIPK7nQDJGHkMuznNHROdpci2TgtUj31D_6z_squlFDoOp0ZaE9FUKw_FoOxt2mV-CqXjXqbanWfp94dejC7GtJScBvaaz8/s220/kaepapa.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8585981105500683948.post-8429984394498584938</id><published>2011-08-08T00:06:00.000+09:00</published><updated>2011-08-08T00:06:17.265+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Groovy"/><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><title type='text'>Groovy環境を作ってみる。</title><content type='html'>さてさて半年以上も放置してしまいまいたがぼちぼち書かないといけませんね。&lt;br /&gt;
いろんなことに手をだしていてネタは沢山あるので時間を見つけて書くこととしましょう。&lt;br /&gt;
&lt;br /&gt;
昨日はAndroidテスト部の祭りに参加してきた訳ですが(それも記事にしたらいいのにw)その途中で重いから辞めときゃいいのに本を3冊程買ってしまいました。&lt;br /&gt;
&lt;br /&gt;
そのうちの一冊がこちら&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://www.amazon.co.jp/gp/product/4774147273/ref=as_li_qf_sp_asin_il?ie=UTF8&amp;tag=aaaaaaeeeeaee-22&amp;linkCode=as2&amp;camp=247&amp;creative=1211&amp;creativeASIN=4774147273&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://ws.assoc-amazon.jp/widgets/q?_encoding=UTF8&amp;Format=_SL110_&amp;ASIN=4774147273&amp;MarketPlace=JP&amp;ID=AsinImage&amp;WS=1&amp;tag=aaaaaaeeeeaee-22&amp;ServiceVersion=20070822&quot; &gt;&lt;/a&gt;&lt;img src=&quot;http://www.assoc-amazon.jp/e/ir?t=aaaaaaeeeeaee-22&amp;l=as2&amp;o=9&amp;a=4774147273&quot; width=&quot;1&quot; height=&quot;1&quot; border=&quot;0&quot; alt=&quot;&quot; style=&quot;border:none !important; margin:0px !important;&quot; /&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
テスト部でご一緒させて頂いている&lt;a href=&quot;http://mikeneck.blogspot.com/&quot;&gt;mike_neckさん&lt;/a&gt;に触発されておもわず購入です。&lt;br /&gt;
&lt;br /&gt;
ということでWin7とOSX上に環境構築してみました。&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://groovy.codehaus.org/Download&quot;&gt;公式サイト&lt;/a&gt;よりWindows用インストーラをDLして起動&lt;br /&gt;
インストールパスをC:\JavaLib\Groovy\Groovy-1.8.1に変更したのみ&lt;br /&gt;
環境変数まで設定してくれるので楽チン。&lt;br /&gt;
&lt;br /&gt;
一旦ログアウトしてGroovyConsoleを起動してHello, Groovy!を実行。&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a class=&quot;lightbox&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhLj85FPeQnKksk_J4eoPdkRpbNmTbLmzhAzhvxUMl7ysFZfphmAO07ym75BMKEZ2S1CWawaPqv7kpU39SNPhzg5j4aBpgqgL6of_Om2cMJ4M3lVmL0sQRxYhitDTBIc4IL2HCg2qwm_5w/s1600/20110807GroovyConsoleWin7.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left:1em; margin-right:1em&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; width=&quot;319&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhLj85FPeQnKksk_J4eoPdkRpbNmTbLmzhAzhvxUMl7ysFZfphmAO07ym75BMKEZ2S1CWawaPqv7kpU39SNPhzg5j4aBpgqgL6of_Om2cMJ4M3lVmL0sQRxYhitDTBIc4IL2HCg2qwm_5w/s320/20110807GroovyConsoleWin7.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
Groovyのインストール@OSX&lt;br /&gt;
http://groovy.codehaus.org/DownloadよりバイナリzipをDLして&lt;br /&gt;
Matsumoto.JSさんの&lt;a href=&quot;http://www.matsuaz.com/matsumotojs/2009/05/04/1241366714545.html&quot;&gt;Mac OS XでのGroovy等をインストールする場所&lt;/a&gt;の記事を参考にさせて頂き/Library/Frameworks/Groovy.frameworks/Versions/1.8.1に展開して/Library/Frameworks/Groovy.frameworks/Versions/Currentにシンボリックリンクを作成&lt;br /&gt;
&lt;br /&gt;
.bash_profileを以下にように変更&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;export JAVA_HOME=/Library/Java/Home
export ANT_HOME=/usr/share/java/ant-1.8.2
export GROOVY_HOME=/Library/Frameworks/Groovy.framework/Versions/Current
export PATH=$PATH:/Developer/android-sdk-mac_x86/platform-tools
export PATH=$PATH:$GROOVY_HOME/bin
&lt;/pre&gt;そして確認。&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;MacBook:~ kaepapa$ source .bash_profile
MacBook:~ kaepapa$ groovy -version
Groovy Version: 1.8.1 JVM: 1.6.0_26
&lt;/pre&gt;&lt;br /&gt;
同じくgroovyConsoleを起動してHello, Groovy！を実行&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a class=&quot;lightbox&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEGc0m-nnpOfLkjTTIwhapyuOOdvA78a5Pf2LWNQruRsIdggXjd_TE_cn5k5Oqo4hjq6J_nxLvlK-aa8ILbFKzWJPtWtxOztZSRr7vbzXZatw56CT5trpUMwu5n_5nwncvJsqsy-L-Igs/s1600/20110807GroovyConsoleOSX.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left:1em; margin-right:1em&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;212&quot; width=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEGc0m-nnpOfLkjTTIwhapyuOOdvA78a5Pf2LWNQruRsIdggXjd_TE_cn5k5Oqo4hjq6J_nxLvlK-aa8ILbFKzWJPtWtxOztZSRr7vbzXZatw56CT5trpUMwu5n_5nwncvJsqsy-L-Igs/s320/20110807GroovyConsoleOSX.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
ということで環境構築は完了しました。&lt;br /&gt;
徐々にいろいろといじってみたいと思っております。</content><link rel='replies' type='application/atom+xml' href='http://ikkandou.blogspot.com/feeds/8429984394498584938/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://ikkandou.blogspot.com/2011/08/groovy.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8585981105500683948/posts/default/8429984394498584938'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8585981105500683948/posts/default/8429984394498584938'/><link rel='alternate' type='text/html' href='http://ikkandou.blogspot.com/2011/08/groovy.html' title='Groovy環境を作ってみる。'/><author><name>いのうえしげゆき</name><uri>http://www.blogger.com/profile/13282776910860697563</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4jOg9k9PA94jh2U-QMUKSn508dxoLDOSWZIPK7nQDJGHkMuznNHROdpci2TgtUj31D_6z_squlFDoOp0ZaE9FUKw_FoOxt2mV-CqXjXqbanWfp94dejC7GtJScBvaaz8/s220/kaepapa.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhLj85FPeQnKksk_J4eoPdkRpbNmTbLmzhAzhvxUMl7ysFZfphmAO07ym75BMKEZ2S1CWawaPqv7kpU39SNPhzg5j4aBpgqgL6of_Om2cMJ4M3lVmL0sQRxYhitDTBIc4IL2HCg2qwm_5w/s72-c/20110807GroovyConsoleWin7.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8585981105500683948.post-7115555329805015635</id><published>2010-12-30T13:28:00.000+09:00</published><updated>2010-12-30T13:28:40.114+09:00</updated><title type='text'>CodeIgniterでGoogleCalendarAPIのテスト(2)</title><content type='html'>さてちょっと時間が空いてしまいましたがGoogleCalendarAPIをCI上から利用してカレンダー機能にアクセスはほぼ実装が終わりました。そのあとjsなどをいじっていたので更新が遅くなってしまった訳ですが各機能についてご紹介したいと思います。&lt;br /&gt;
&lt;br /&gt;
前回IBMのサンプルをそのまま用いてカレンダーの予定からタイトルやサマリを取得した訳ですがサマリだとちょっと見づらいので取得する情報をbasicからfullへと変更し各情報の詳細を取得出来るように変更しました。&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;public function getCalendarEntryList() {

 try{
  $gcal = Zend_Gdata_Calendar::AUTH_SERVICE_NAME;
  $client =Zend_Gdata_ClientLogin::getHttpClient($this-&amp;gt;user, $this-&amp;gt;pass, $gcal);
  $gcal = new Zend_Gdata_Calendar($client);

  $query = $gcal-&amp;gt;newEventQuery();
  $query-&amp;gt;setUser(&#39;default&#39;);
  $query-&amp;gt;setVisibility(&#39;private&#39;);
  $query-&amp;gt;setProjection(&#39;full&#39;);
  $query-&amp;gt;setOrderby(&#39;starttime&#39;);

  $feed=$gcal-&amp;gt;getCalendarEventFeed($query);

  $data[&#39;title&#39;] = (string)$feed-&amp;gt;title;
  $data[&#39;totalResults&#39;] = (String)$feed-&amp;gt;totalResults;

  $events = array();
  foreach ($feed as $event) {
   $obj = new stdClass;

   $obj-&amp;gt;title = $event-&amp;gt;title;

   $when = $event-&amp;gt;when;
   $obj-&amp;gt;when = date(&#39;Y/n/j&#39;,strtotime($when[0]-&amp;gt;getStartTime()));
   $obj-&amp;gt;startTime = date(&#39;G:i&#39;,strtotime($when[0]-&amp;gt;getStartTime()));
   $obj-&amp;gt;endTime = date(&#39;G:i&#39;,strtotime($when[0]-&amp;gt;getEndTime()));

   $reminders = $when[0]-&amp;gt;reminders;
   if (count($reminders)!=0) {
    foreach ($reminders as $reminder) {
     if ($reminder-&amp;gt;getMethod()==&#39;email&#39;) {
      $obj-&amp;gt;reminder_email = $reminder-&amp;gt;getMinutes();
     } else {
      $obj-&amp;gt;reminder_alert = $reminder-&amp;gt;getMinutes();
     }
    }
   }
   $obj-&amp;gt;content = $event-&amp;gt;content;
   $obj-&amp;gt;edit_key = $event-&amp;gt;id;

   $where = $event-&amp;gt;where;
   $obj-&amp;gt;where = $where[0]-&amp;gt;getValueString();

   $events[] = $obj;
  }

  $data[&#39;events&#39;] = $events;
 }catch(Exception $e){
  echo &quot;エラー:&quot;.$e-&amp;gt;getMessage();
 }

 return $data;
}
&lt;/pre&gt;&lt;br /&gt;
ソースをご覧頂くとEventQuery生成部分でbasicがfullに変更されているのがおわかり頂けるかと思います。またforeach文の中で各種詳細データを取得しているのが前回との変更点です。&lt;br /&gt;
&lt;br /&gt;
詳細データの取得に関して注意が必要なところは「when」「reminders」そして「where」等の情報はイベントデータ内に配列として保持されている点です。基本的にwhenやwhereは1つだけ保持していると思われるので$when[0]等で決め打ちでアクセスしてしまっています。またリマインダについてはGoogleカレンダー上では複数登録することが出来ますが今回はメールとアラートもしくはメール+アラートという3つの選択肢から選択し設定時間は1つだけ保持できる仕様としております。&lt;br /&gt;
&lt;br /&gt;
続いては削除メソッドです。&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;public function deleteEntry() {
 try {
  $gcal = Zend_Gdata_Calendar::AUTH_SERVICE_NAME;
  $client =Zend_Gdata_ClientLogin::getHttpClient($this-&amp;gt;user, $this-&amp;gt;pass, $gcal);
  $gcal = new Zend_Gdata_Calendar($client);

  $edit_key = $this-&amp;gt;input-&amp;gt;post(&#39;edit_key&#39;, TRUE);
  if (isset($edit_key)) {
   $event = $gcal-&amp;gt;getCalendarEventEntry(&#39;http://www.google.com/calendar/feeds/default/private/full/&#39;.$edit_key);
   $event-&amp;gt;delete();
  }
 }catch(Exception $e){
  echo &quot;エラー:&quot;.$e-&amp;gt;getMessage();
 }
}
&lt;/pre&gt;&lt;br /&gt;
イベントエントリに含まれているidを使って個別EventEntryを取得してdelete()メソッドを実行するだけで削除が可能です。Contactsの時はeditキーを送っていましたがZFの実装がこのようになっています。これはなんなく実装できました。&lt;br /&gt;
&lt;br /&gt;
次は登録メソッドを見てみたいと思います。&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;public function add_entry() {
 try {
  $gcal = Zend_Gdata_Calendar::AUTH_SERVICE_NAME;
  $client =Zend_Gdata_ClientLogin::getHttpClient($this-&amp;gt;user, $this-&amp;gt;pass, $gcal);
  $gcal = new Zend_Gdata_Calendar($client);

  $dates = explode(&#39;/&#39;, $this-&amp;gt;input-&amp;gt;post(&#39;when&#39;, TRUE));
  $stimes = explode(&#39;:&#39;, $this-&amp;gt;input-&amp;gt;post(&#39;start_time&#39;, TRUE));
  $etimes = explode(&#39;:&#39;, $this-&amp;gt;input-&amp;gt;post(&#39;end_time&#39;, TRUE));
  date_default_timezone_set(&#39;Asia/Tokyo&#39;);
  $stime = date(DATE_RFC3339, mktime($stimes[0],$stimes[1],0,$dates[1],$dates[2],$dates[0]));
  $etime = date(DATE_RFC3339, mktime($etimes[0],$etimes[1],0,$dates[1],$dates[2],$dates[0]));

  $event = $gcal-&amp;gt;newEventEntry();
  $event-&amp;gt;title = $gcal-&amp;gt;newTitle($this-&amp;gt;input-&amp;gt;post(&#39;title&#39;, TRUE));
  $when = $gcal-&amp;gt;newWhen();
  $when-&amp;gt;startTime = $stime;
  $when-&amp;gt;endTime = $etime;
  if (isset($_POST[&#39;reminder_cbox&#39;])) {
   $time = $this-&amp;gt;input-&amp;gt;post(&#39;reminder_time&#39;, TRUE);
   $method = $this-&amp;gt;input-&amp;gt;post(&#39;reminder&#39;, TRUE);
   $reminders = array();
   switch ($method) {
    case &#39;m&#39;:
     $reminder = $gcal-&amp;gt;newReminder();
     $reminder-&amp;gt;method = &quot;email&quot;;
     $reminder-&amp;gt;minutes = $time;
     $reminders[] = $reminder;
     break;
    case &#39;p&#39;:
     $reminder = $gcal-&amp;gt;newReminder();
     $reminder-&amp;gt;method = &quot;alert&quot;;
     $reminder-&amp;gt;minutes = $time;
     $reminders[] = $reminder;
     break;
    case &#39;mp&#39;:
     $reminder = $gcal-&amp;gt;newReminder();
     $reminder-&amp;gt;method = &quot;email&quot;;
     $reminder-&amp;gt;minutes = $time;
     $reminders[] = $reminder;
     $reminder = $gcal-&amp;gt;newReminder();
     $reminder-&amp;gt;method = &quot;alert&quot;;
     $reminder-&amp;gt;minutes = $time;
     $reminders[] = $reminder;
     break;
   }
   $when-&amp;gt;reminders = $reminders;
  }
  $event-&amp;gt;when = array($when);
  $event-&amp;gt;where = array($gcal-&amp;gt;newWhere($this-&amp;gt;input-&amp;gt;post(&#39;where&#39;, TRUE)));
  $event-&amp;gt;content = $gcal-&amp;gt;newContent($this-&amp;gt;input-&amp;gt;post(&#39;content&#39;, TRUE));

  $newEvent = $gcal-&amp;gt;insertEvent($event);
 }catch(Exception $e){
  echo &quot;エラー:&quot;.$e-&amp;gt;getMessage();
 }
}
&lt;/pre&gt;&lt;br /&gt;
この部分はわりと苦労しました。日時をRFC3339形式にして送らないといけませんがこれはphpのdate()メソッドが対応してくれていますので$_POSTから取得した日時データをexplode()メソッドでバラして生成しています。冒頭で書いたようにリマインダについては「メールのみ」「ポップアップのみ」そして「メールとポップアップ併用」という3種類を選択可能とし時間は1つだけ指定できる仕様のためこのような実装になっています。「when」「reminders」そして「where」についてはしっかりと配列で渡してあげることをお忘れなく。これを忘れるとエラーとなります。&lt;br /&gt;
&lt;br /&gt;
また各種データについてZF側でインスタンス生成メソッドが用意されているのでそのメソッドを利用してデータを登録しています。xmlを生成していたContactsに比べてとても楽チンになっているので助かりました。いや…逆にメソッドを調べるのが大変だったかも？(笑&lt;br /&gt;
&lt;br /&gt;
最後にデータ修正です。&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;public function correct_entry() {
 try {
  $gcal = Zend_Gdata_Calendar::AUTH_SERVICE_NAME;
  $client =Zend_Gdata_ClientLogin::getHttpClient($this-&amp;gt;user, $this-&amp;gt;pass, $gcal);
  $gcal = new Zend_Gdata_Calendar($client);

  $dates = explode(&#39;/&#39;, $this-&amp;gt;input-&amp;gt;post(&#39;when&#39;, TRUE));
  $stimes = explode(&#39;:&#39;, $this-&amp;gt;input-&amp;gt;post(&#39;start_time&#39;, TRUE));
  $etimes = explode(&#39;:&#39;, $this-&amp;gt;input-&amp;gt;post(&#39;end_time&#39;, TRUE));
  date_default_timezone_set(&#39;Asia/Tokyo&#39;);
  $stime = date(DATE_RFC3339, mktime($stimes[0],$stimes[1],0,$dates[1],$dates[2],$dates[0]));
  $etime = date(DATE_RFC3339, mktime($etimes[0],$etimes[1],0,$dates[1],$dates[2],$dates[0]));

  $event = $gcal-&amp;gt;getCalendarEventEntry($this-&amp;gt;input-&amp;gt;post(&#39;edit_key&#39;, TRUE));
  $event-&amp;gt;title = $gcal-&amp;gt;newTitle($this-&amp;gt;input-&amp;gt;post(&#39;title&#39;, TRUE));
  $when = $gcal-&amp;gt;newWhen();
  $when-&amp;gt;startTime = $stime;
  $when-&amp;gt;endTime = $etime;
  if (isset($_POST[&#39;reminder_cbox&#39;])) {
   $time = $this-&amp;gt;input-&amp;gt;post(&#39;reminder_time&#39;, TRUE);
   $method = $this-&amp;gt;input-&amp;gt;post(&#39;reminder&#39;, TRUE);
   $reminders = array();
   switch ($method) {
    case &#39;m&#39;:
     $reminder = $gcal-&amp;gt;newReminder();
     $reminder-&amp;gt;method = &quot;email&quot;;
     $reminder-&amp;gt;minutes = $time;
     $reminders[] = $reminder;
     break;
    case &#39;p&#39;:
     $reminder = $gcal-&amp;gt;newReminder();
     $reminder-&amp;gt;method = &quot;alert&quot;;
     $reminder-&amp;gt;minutes = $time;
     $reminders[] = $reminder;
     break;
    case &#39;mp&#39;:
     $reminder = $gcal-&amp;gt;newReminder();
     $reminder-&amp;gt;method = &quot;email&quot;;
     $reminder-&amp;gt;minutes = $time;
     $reminders[] = $reminder;
     $reminder = $gcal-&amp;gt;newReminder();
     $reminder-&amp;gt;method = &quot;alert&quot;;
     $reminder-&amp;gt;minutes = $time;
     $reminders[] = $reminder;
     break;
   }
   $when-&amp;gt;reminders = $reminders;
  }
  $event-&amp;gt;when = array($when);
  $event-&amp;gt;where = array($gcal-&amp;gt;newWhere($this-&amp;gt;input-&amp;gt;post(&#39;where&#39;, TRUE)));
  $event-&amp;gt;content = $gcal-&amp;gt;newContent($this-&amp;gt;input-&amp;gt;post(&#39;content&#39;, TRUE));

  $event-&amp;gt;save();
 }catch(Exception $e){
  echo &quot;エラー:&quot;.$e-&amp;gt;getMessage();
 }
}
&lt;/pre&gt;&lt;br /&gt;
内容については登録時とほぼ同じですがeditキーを使ってEventEntryを取得しその内容を書き換えてsave()メソッドで登録しております。ここで注意が必要なのが削除時や個別イベントデータ取得時に利用するidとデータ修正を行うeditキーは別のデータということです。&lt;br /&gt;
&lt;br /&gt;
IBMのサンプルはbasicでデータを取得しているためこの違いには言及していませんでしたが以下のxmlデータをご覧ください。&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;&amp;lt;atom:id&amp;gt;http://www.google.com/calendar/feeds/default/private/full/57a84t1b243radd31209erdd9k&amp;gl;/atom:id&amp;gt;
&amp;lt;atom:link href=&quot;http://www.google.com/calendar/event?eid=NTdhODR0MWIyNDNyYWRkMzEyMDllcmRkOWtfMjAxMDEyMjdUMDIzMDAwWiB0ZXN0LmthZXBhcGFAbQ&quot; rel=&quot;alternate&quot; type=&quot;text/html&quot; title=&quot;alternate&quot;/&amp;gt;
&amp;lt;atom:link href=&quot;http://www.google.com/calendar/feeds/default/private/full/57a84t1b243radd31209erdd9k&quot; rel=&quot;self&quot; type=&quot;application/atom+xml&quot;/&amp;gt;
&amp;lt;atom:link href=&quot;http://www.google.com/calendar/feeds/default/private/full/57a84t1b243radd31209erdd9k/63429101549&quot; rel=&quot;edit&quot; type=&quot;application/atom+xml&quot;/&amp;gt;
&lt;/pre&gt;&lt;br /&gt;
最後のeditだけ数字のデータが付加されているのがおわかり頂けるかと思います。このデータを渡してあげないとデータ修正は上手くいかずエントリの先頭のデータが書き換えられてしまったりしましたのでご注意ください。&lt;br /&gt;
&lt;br /&gt;
さて実際のブラウザでの表示も掲載しておきたいと思います。&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a class=&quot;lightbox&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6skEqr78FGnaSZu93gav7GevGuMIce21kANLerD6jHhVR7Rzmt7eEy337pY_rFTfUDRHQw_vMBV2JHt5dF0fqrWdX6mxlmPp-zs5U6EtlBIvH4x34uoelgKCBROtvDBq2Ory1tRcLACA/s1600/google_calendar_test1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left:1em; margin-right:1em&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; width=&quot;209&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6skEqr78FGnaSZu93gav7GevGuMIce21kANLerD6jHhVR7Rzmt7eEy337pY_rFTfUDRHQw_vMBV2JHt5dF0fqrWdX6mxlmPp-zs5U6EtlBIvH4x34uoelgKCBROtvDBq2Ory1tRcLACA/s320/google_calendar_test1.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
こんな具合にイベントのタイトルと時間、説明と場所が表示されリマインダについてはアイコン表示にしてあります。下の削除と編集リンクからそれぞれの機能が利用できて一番下の「新しいイベントを追加」で新規イベント登録が出来ます。最下段の検索機能についてはまだ実装しておりません。この後実装予定です。&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a class=&quot;lightbox&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBVfYjKdOoE5bthFauGYYXt7O0LKCBXg2HQqGdwe7SCQB-nVzPuyayYsh7A9XKdt2Ph5a-Dy2EJaEyspiSh2FHj7ZiQWgLpHLeLbvxqf1OPpmxHQxgWxdwfqq9fMRm_c_5lLLHYq1rmRE/s1600/google_calendar_test2.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left:1em; margin-right:1em&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;288&quot; width=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBVfYjKdOoE5bthFauGYYXt7O0LKCBXg2HQqGdwe7SCQB-nVzPuyayYsh7A9XKdt2Ph5a-Dy2EJaEyspiSh2FHj7ZiQWgLpHLeLbvxqf1OPpmxHQxgWxdwfqq9fMRm_c_5lLLHYq1rmRE/s320/google_calendar_test2.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
上記はイベントの登録と修正に利用するフォームです。日時と時間の入力はjqueryを利用して入力補助をしています。またリマインダについてはチェックを入れるとセレクトフォームが表示されデータ登録が可能となります。いや…jsで遊んでみたかったんです。jqueryを使うととっても楽にいろいろと出来るようになりますねぇ。もっと勉強しないと！</content><link rel='replies' type='application/atom+xml' href='http://ikkandou.blogspot.com/feeds/7115555329805015635/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://ikkandou.blogspot.com/2010/12/codeignitergooglecalendarapi2.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8585981105500683948/posts/default/7115555329805015635'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8585981105500683948/posts/default/7115555329805015635'/><link rel='alternate' type='text/html' href='http://ikkandou.blogspot.com/2010/12/codeignitergooglecalendarapi2.html' title='CodeIgniterでGoogleCalendarAPIのテスト(2)'/><author><name>いのうえしげゆき</name><uri>http://www.blogger.com/profile/13282776910860697563</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4jOg9k9PA94jh2U-QMUKSn508dxoLDOSWZIPK7nQDJGHkMuznNHROdpci2TgtUj31D_6z_squlFDoOp0ZaE9FUKw_FoOxt2mV-CqXjXqbanWfp94dejC7GtJScBvaaz8/s220/kaepapa.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6skEqr78FGnaSZu93gav7GevGuMIce21kANLerD6jHhVR7Rzmt7eEy337pY_rFTfUDRHQw_vMBV2JHt5dF0fqrWdX6mxlmPp-zs5U6EtlBIvH4x34uoelgKCBROtvDBq2Ory1tRcLACA/s72-c/google_calendar_test1.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8585981105500683948.post-7908633245039866656</id><published>2010-12-27T17:20:00.002+09:00</published><updated>2010-12-29T12:28:44.875+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CodeIgniter"/><category scheme="http://www.blogger.com/atom/ns#" term="GoogleCalendarAPI"/><category scheme="http://www.blogger.com/atom/ns#" term="PHP"/><title type='text'>CodeIgniterでGoogleCalendarAPIのテスト(1)</title><content type='html'>さてGoogleContactsAPIに続いて今度はCalendarAPIのテストをCodeIgniter上で行なてみたいと思います。&lt;br /&gt;
&lt;br /&gt;
Contactsに比べZendFramework自身が直接対応していますし他の情報もいくつか存在しているので苦労の度合いは少ないように予想してます。今考えたら先にCalendarをテストしておいた方が楽だったのではないかと思わなくもありませんが後の祭りというやつですね。&lt;br /&gt;
&lt;br /&gt;
はてさてGoogleカレンダーは私も利用していますがAjaxがたっぷり使われていてとても使いやすいUIが提供されています。それを今さらならがwebアプリから使えるようにしたところで何になるんだ？という気もしなくもありませんがまあそれはそれとして今回はCodeIgniter上で動作するwebアプリからカレンダーの作成、修正やカレンダーを指定しての予定の追加、修正そして削除を実装してみる予定です。またContactsではClientLoginを使用しましたが実際のwebアプリではwebアプリ製作者である私にもユーザの認証情報の伝わらないAuthSubで実装してみたいと思います。まずはClientLogin認証で機能を実装してから最後にAuthSub認証に変更してみる予定です。&lt;br /&gt;
&lt;br /&gt;
それぞれの詳しい情報については以下のドキュメントをご参照ください。&lt;br /&gt;
&lt;br /&gt;
・ &lt;a href=&quot;http://framework.zend.com/manual/ja/zend.gdata.calendar.html&quot;&gt;Zend Framework GDataプログラマーズリファレンスガイド Google Calendar の使用法&lt;/a&gt;&lt;br /&gt;
・ &lt;a href=&quot;http://code.google.com/intl/ja/apis/calendar/data/1.0/developers_guide_protocol.html&quot;&gt;Google Calendar APIs and Tools Data API Developer&#39;s Guide: Protocol&lt;/a&gt;&lt;br /&gt;
・ &lt;a href=&quot;http://code.google.com/intl/ja/apis/calendar/data/1.0/reference.html&quot;&gt;Google Calendar APIs and Tools API Reference Guide&lt;/a&gt;&lt;br /&gt;
・ &lt;a href=&quot;http://code.google.com/intl/ja/apis/accounts/docs/AuthSub.html&quot;&gt;Authentication and Authorization for Google APIs AuthSub for Web Applications&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
なおGoogleCalendarAPIのドキュメントには「これは古いバージョンである」旨記載がありますがVer.2のPHPGuideはまだありませんし。ZendFrameworkがまだ対応してないような雰囲気なので古い方のドキュメントを参照してますが詳細はまだわかっていません。&lt;br /&gt;
コーディングを進めるうちになにかわかりましたら加筆予定です。&lt;br /&gt;
&lt;br /&gt;
また今回もIBM developerWorksの記事[http://www.ibm.com/developerworks/jp/xml/library/x-googleclndr/index.html]を参考に進めていきたいと思います。&lt;br /&gt;
&lt;br /&gt;
ではdWの記事を熟読した後今回もこのソースをCIに移植していく訳ですがその前にそのままCI上でviewを表示してみたいと思います。&lt;br /&gt;
&lt;br /&gt;
DL可能となっているソースのview.php(idとpassを書き換え)をCIのコントローラからloadするだけです。&lt;br /&gt;
CodeIgniterのsystemフォルダやindex.phpファイルを今回もeclipseを利用してコーディングするので作成したPHPプロジェクトフォルダ内にコピーしてconfig.phpやroutes.phpについては適切に設定を行なってください。&lt;br /&gt;
&lt;br /&gt;
まずはコントローラの./system/application/controllers/calendar.phpファイルから見ていきましょう。&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;&amp;lt;?php if ( ! defined(&#39;BASEPATH&#39;)) exit(&#39;No direct script access allowed&#39;);

class Calendar extends Controller {

 public function __construct() {

  parent::Controller();

  $this-&amp;gt;output-&amp;gt;set_header(&#39;Content-Type: text/html; charset=UTF-8&#39;);
 }

 /*
  * デフォルトメソッド
  */
 public function index() {
  $this-&amp;gt;load-&amp;gt;view(&#39;view&#39;);
 }
}

/* End of file calendar.php */
/* Location: ./system/application/controllers/calendar.php */
&lt;/pre&gt;&lt;br /&gt;
Controllerクラスを継承したCalendarクラスを作成してコンストラクタで親クラスのコンストラクタを呼び文字化け対策にUTF-8を指定しています。デフォルトメソッドのindex()ではIBMで配布されているview.phpファイルを一部手直ししたものをロードしているだけです。&lt;br /&gt;
&lt;br /&gt;
続いてはview.phpファイルを見てみましょう。&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;&amp;lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&amp;gt;
&amp;lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; xml:lang=&quot;ja&quot; lang=&quot;ja&quot;&amp;gt;
&amp;lt;head&amp;gt;
 &amp;lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&amp;gt;
 &amp;lt;title&amp;gt;Googleカレンダー予定一覧&amp;lt;/title&amp;gt;
 &amp;lt;style type=&quot;text/css&quot;&amp;gt;
 body {
  font-family: Verdana;
 }
 li {
  border-bottom: solid black 1px;
  margin: 10px;
  padding: 2px;
  width: auto;
  padding-bottom: 20px;
 }
 h2 {
  color: red;
  text-decoration: none;
 }
 span.attr {
  font-weight: bolder;
 }
 &amp;lt;/style&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
 &amp;lt;?php
    require_once &#39;Zend/Loader.php&#39;;
    Zend_Loader::loadClass(&#39;Zend_Gdata&#39;);
    Zend_Loader::loadClass(&#39;Zend_Gdata_ClientLogin&#39;);
    Zend_Loader::loadClass(&#39;Zend_Gdata_Calendar&#39;);
    Zend_Loader::loadClass(&#39;Zend_Http_Client&#39;);
    
    $gcal = Zend_Gdata_Calendar::AUTH_SERVICE_NAME;
    $user = &quot;username@gmail.com&quot;;
    $pass = &quot;password&quot;;
    $client = Zend_Gdata_ClientLogin::getHttpClient($user, $pass, $gcal);
    $gcal = new Zend_Gdata_Calendar($client);
    
    $query = $gcal-&amp;gt;newEventQuery();
    $query-&amp;gt;setUser(&#39;default&#39;);
    $query-&amp;gt;setVisibility(&#39;private&#39;);
    $query-&amp;gt;setProjection(&#39;basic&#39;);
    $query-&amp;gt;setOrderby(&#39;starttime&#39;);
    if(isset($_GET[&#39;q&#39;])) {
      $query-&amp;gt;setQuery($_GET[&#39;q&#39;]);      
    }
    
    try {
      $feed = $gcal-&amp;gt;getCalendarEventFeed($query);
    } catch (Zend_Gdata_App_Exception $e) {
      echo &quot;Error: &quot; . $e-&amp;gt;getResponse();
    }
    ?&amp;gt;
 &amp;lt;h1&amp;gt;&amp;lt;?php echo $title ?&amp;gt;&amp;lt;/h1&amp;gt;
 &amp;lt;?php echo $totalResults ?&amp;gt; 件の予定があります。
 &amp;lt;p/&amp;gt;
 &amp;lt;ol&amp;gt;
 &amp;lt;?php
  foreach ($feed as $event) {
   echo &quot;&amp;lt;li&amp;gt;\n&quot;;
   echo &quot;&amp;lt;h2&amp;gt;&quot; . stripslashes($event-&amp;gt;title) . &quot;&amp;lt;/h2&amp;gt;\n&quot;;
   echo stripslashes($event-&amp;gt;summary) . &quot; &amp;lt;br/&amp;gt;\n&quot;;
   $id = substr($event-&amp;gt;id, strrpos($event-&amp;gt;id, &#39;/&#39;)+1);
   echo &quot;&amp;lt;a href=\&quot;edit.php?id=$id\&quot;&amp;gt;編集&amp;lt;/a&amp;gt; | &quot;;
   echo &quot;&amp;lt;a href=\&quot;delete.php?id=$id\&quot;&amp;gt;削除&amp;lt;/a&amp;gt; &amp;lt;br/&amp;gt;\n&quot;;
   echo &quot;&amp;lt;/li&amp;gt;\n&quot;;
  }
  echo &quot;&amp;lt;/ul&amp;gt;&quot;;
 ?&amp;gt;
 &amp;lt;/ol&amp;gt;
 &amp;lt;p/&amp;gt;
 &amp;lt;a href=&quot;add.php&quot;&amp;gt;新しいイベントを追加&amp;lt;/a&amp;gt;&amp;lt;p/&amp;gt;
 &amp;lt;form action=&quot;&amp;lt;?php echo $_SERVER[&#39;PHP_SELF&#39;]; ?&amp;gt;&quot; method=&quot;get&quot;&amp;gt;
  予定の検索：&amp;lt;br/&amp;gt;
  &amp;lt;input type=&quot;text&quot; name=&quot;q&quot; size=&quot;10&quot;/&amp;gt;
  &amp;lt;input type=&quot;submit&quot; name=&quot;submit&quot; value=&quot;検索&quot;/&amp;gt;
 &amp;lt;/form&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;

&lt;/pre&gt;&lt;br /&gt;
ヘッダ部分を日本語対応とし表示を日本語化した以外はそのままのコードになっています。&lt;br /&gt;
&lt;br /&gt;
では簡単にphpスクリプト部分を読んでいってみましょう。&lt;br /&gt;
&lt;br /&gt;
最初に必要となるZendFrameworkのクラスをロード後、ClientLogin認証で$gcalインスタンスを生成しZend_Gdata_Calendarクラスを生成しています。さらにdefaultカレンダーのprivate領域のデータをbasicなデータ量で取得するというクエリを作成していますね。$_GET[&#39;q&#39;]を使っている部分が予定の検索時に利用する条件です。そしてtry～catch文の中でこの作成したクエリを発行してデータを取得しています。得られたfeedをhtml内に埋め込んでいき表示を行なうという実装ですね。ソースコード内の$userと$passについてはご自身のアカウント情報を入力してください。&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a class=&quot;lightbox&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGhdqqK5oP5blNQViAJPFHYQqEDnAxWQFWLTR4fyRaP7688ioUlnjitMHSkcQg2LQn4HCtVejiRVcyLlFNr9c0ydwMEoK0LsRGVkFsmer5MstTr9j4mg9PM_-9Unx3tlyHaV-J3LMztd8/s1600/calendarTest1.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGhdqqK5oP5blNQViAJPFHYQqEDnAxWQFWLTR4fyRaP7688ioUlnjitMHSkcQg2LQn4HCtVejiRVcyLlFNr9c0ydwMEoK0LsRGVkFsmer5MstTr9j4mg9PM_-9Unx3tlyHaV-J3LMztd8/s320/calendarTest1.jpg&quot; width=&quot;279&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
上記がこのview.phpを表示した状態です。表示されているEventは私が適当に作成したものです。今回もあっさりと表示されて安心しました。&lt;br /&gt;
&lt;br /&gt;
問題なく表示されましたのでCI化していきたいと思います。&lt;br /&gt;
&lt;br /&gt;
まずはモデルの./system/application/models/calendar_model.phpファイルから作成しました。&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;&amp;lt;?php if ( ! defined(&#39;BASEPATH&#39;)) exit(&#39;No direct script access allowed&#39;);

class Calendar_model extends Model {

 private $user;
 private $pass;

 public function __construct() {
  parent::Model();

  require_once &#39;Zend/Loader.php&#39;;
  Zend_Loader::loadClass(&#39;Zend_Gdata&#39;);
  Zend_Loader::loadClass(&#39;Zend_Gdata_ClientLogin&#39;);
  Zend_Loader::loadClass(&#39;Zend_Gdata_Calendar&#39;);
  Zend_Loader::loadClass(&#39;Zend_Http_Client&#39;);

  $this-&amp;gt;config-&amp;gt;load(&#39;calendar_config&#39;, TRUE);
  $this-&amp;gt;user = $this-&amp;gt;config-&amp;gt;item(&#39;username&#39;,&#39;calendar_config&#39;);
  $this-&amp;gt;pass = $this-&amp;gt;config-&amp;gt;item(&#39;password&#39;,&#39;calendar_config&#39;);
 }

 public function getCalendarEntryList() {

  try{
   $gcal = Zend_Gdata_Calendar::AUTH_SERVICE_NAME;
   $client =Zend_Gdata_ClientLogin::getHttpClient($this-&amp;gt;user, $this-&amp;gt;pass, $gcal);
   $gcal = new Zend_Gdata_Calendar($client);

   $query = $gcal-&amp;gt;newEventQuery();
   $query-&amp;gt;setUser(&#39;default&#39;);
   $query-&amp;gt;setVisibility(&#39;private&#39;);
   $query-&amp;gt;setProjection(&#39;basic&#39;);
   $query-&amp;gt;setOrderby(&#39;starttime&#39;);

   $feed=$gcal-&amp;gt;getCalendarEventFeed($query);

   $data[&#39;title&#39;] = (string)$feed-&amp;gt;title;
   $data[&#39;totalResults&#39;] = (String)$feed-&amp;gt;totalResults;

   $events = array();
   foreach ($feed as $event) {
    $obj = new stdClass;

    $obj-&amp;gt;title = $event-&amp;gt;title;
    $obj-&amp;gt;summary = $event-&amp;gt;summary;
    $obj-&amp;gt;id = $event-&amp;gt;id;

    $events[] = $obj;
   }

   $data[&#39;events&#39;] = $events;
  }catch(Zend_Gdata_App_Exception $e){
   echo &quot;エラー:&quot;.$e-&amp;gt;getResponse();
  }

  return $data;
 }
}

/* End of file calendar_model.php */
/* Location: ./system/application/model/calendar_model.php */
&lt;/pre&gt;&lt;br /&gt;
Modelクラスを継承したCalendar_modelクラスを作成してコンストラクタの中でZFの必要なクラスをロード、Contactsの時と同様にユーザ名とパスワードはcalender_config.php内に記述してあり、それをload後取得しています。&lt;br /&gt;
&lt;br /&gt;
getCalendarEntryList()メソッドでGoogleCalendarにアクセスしてfeedを取得し$dataに必要なデータを入れて返すというContactsのときとまったく同じ手法です。&lt;br /&gt;
&lt;br /&gt;
続いては変更を加えたコントローラクラスのcalender.phpを見てみます。&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;&amp;lt;?php if ( ! defined(&#39;BASEPATH&#39;)) exit(&#39;No direct script access allowed&#39;);

class Calendar extends Controller {

 public function __construct() {

  parent::Controller();

  $this-&amp;gt;load-&amp;gt;model(&#39;calendar_model&#39;);

  $this-&amp;gt;output-&amp;gt;set_header(&#39;Content-Type: text/html; charset=UTF-8&#39;);
 }

 /*
  * デフォルトメソッド
  */
 public function index() {
  $data = $this-&amp;gt;calendar_model-&amp;gt;getCalendarEntryList();
  $this-&amp;gt;load-&amp;gt;view(&#39;calendar_index&#39;,$data);
 }
}

/* End of file calendar.php */
/* Location: ./system/application/controllers/calendar.php */
&lt;/pre&gt;&lt;br /&gt;
コンストラクタメソッド内でCalendar_modelをロードして先程作成したgetCalendarEntryList()メソッドでデータを取得後view.phpから名称を変更したcalendar_index.phpファイルにデータを渡してロードするよう変更しました。&lt;br /&gt;
&lt;br /&gt;
最後にビューのcalendear_index.phpを見てみましょう。&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;&amp;lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&amp;gt;
&amp;lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; xml:lang=&quot;ja&quot; lang=&quot;ja&quot;&amp;gt;
&amp;lt;head&amp;gt;
 &amp;lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&amp;gt;
 &amp;lt;title&amp;gt;Googleカレンダー予定一覧&amp;lt;/title&amp;gt;
 &amp;lt;style type=&quot;text/css&quot;&amp;gt;
 body {
  font-family: Verdana;
 }
 li {
  border-bottom: solid black 1px;
  margin: 10px;
  padding: 2px;
  width: auto;
  padding-bottom: 20px;
 }
 h2 {
  color: red;
  text-decoration: none;
 }
 span.attr {
  font-weight: bolder;
 }
 &amp;lt;/style&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
 &amp;lt;h1&amp;gt;&amp;lt;?php echo $title ?&amp;gt;&amp;lt;/h1&amp;gt;
 &amp;lt;?php echo $totalResults ?&amp;gt; 件の予定があります。
 &amp;lt;p/&amp;gt;
 &amp;lt;ol&amp;gt;
 &amp;lt;?php
  foreach ($events as $e) {
   echo &quot;&amp;lt;li&amp;gt;\n&quot;;
   echo &quot;&amp;lt;h2&amp;gt;&quot; . stripslashes($e-&amp;gt;title) . &quot;&amp;lt;/h2&amp;gt;\n&quot;;
   echo stripslashes($e-&amp;gt;summary) . &quot; &amp;lt;br/&amp;gt;\n&quot;;
   $id = substr($e-&amp;gt;id, strrpos($e-&amp;gt;id, &#39;/&#39;)+1);
   echo &quot;&amp;lt;a href=\&quot;edit.php?id=$id\&quot;&amp;gt;編集&amp;lt;/a&amp;gt; | &quot;;
   echo &quot;&amp;lt;a href=\&quot;delete.php?id=$id\&quot;&amp;gt;削除&amp;lt;/a&amp;gt; &amp;lt;br/&amp;gt;\n&quot;;
   echo &quot;&amp;lt;/li&amp;gt;\n&quot;;
  }
  echo &quot;&amp;lt;/ul&amp;gt;&quot;;
 ?&amp;gt;
 &amp;lt;/ol&amp;gt;
 &amp;lt;p/&amp;gt;
 &amp;lt;a href=&quot;add.php&quot;&amp;gt;新しいイベントを追加&amp;lt;/a&amp;gt;&amp;lt;p/&amp;gt;
 &amp;lt;form action=&quot;&amp;lt;?php echo $_SERVER[&#39;PHP_SELF&#39;]; ?&amp;gt;&quot; method=&quot;get&quot;&amp;gt;
  予定の検索：&amp;lt;br/&amp;gt;
  &amp;lt;input type=&quot;text&quot; name=&quot;q&quot; size=&quot;10&quot;/&amp;gt;
  &amp;lt;input type=&quot;submit&quot; name=&quot;submit&quot; value=&quot;検索&quot;/&amp;gt;
 &amp;lt;/form&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/pre&gt;&lt;br /&gt;
実装部分がなくなりかなりすっきりした感がありますね。これぞMVCモデルの利点でしょうか。データ表示部を数カ所実装にある変数名に変更しただけですがこれでview.phpと同じ表示が得られるようになりました。&lt;br /&gt;
&lt;br /&gt;
3ヶ所ほどある他機能へのリンクはまだ実装していないのでそのままになっています。そもそもCIはデフォルトではGETを受け取らないのでこのままでは利用できません。&lt;br /&gt;
&lt;br /&gt;
さてここまででGoogleカレンダーにAPIを使ってアクセスしEventデータを取得する機能が実装できました。実装といってもそのままコピーしたような状態ではありますがまあ良しとしましょう。このあとEventの追加、削除そして修正を実装したりカレンダーの追加や修正等もチャレンジする予定です。</content><link rel='replies' type='application/atom+xml' href='http://ikkandou.blogspot.com/feeds/7908633245039866656/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://ikkandou.blogspot.com/2010/12/codeignitergooglecalendarapi1.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8585981105500683948/posts/default/7908633245039866656'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8585981105500683948/posts/default/7908633245039866656'/><link rel='alternate' type='text/html' href='http://ikkandou.blogspot.com/2010/12/codeignitergooglecalendarapi1.html' title='CodeIgniterでGoogleCalendarAPIのテスト(1)'/><author><name>いのうえしげゆき</name><uri>http://www.blogger.com/profile/13282776910860697563</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4jOg9k9PA94jh2U-QMUKSn508dxoLDOSWZIPK7nQDJGHkMuznNHROdpci2TgtUj31D_6z_squlFDoOp0ZaE9FUKw_FoOxt2mV-CqXjXqbanWfp94dejC7GtJScBvaaz8/s220/kaepapa.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGhdqqK5oP5blNQViAJPFHYQqEDnAxWQFWLTR4fyRaP7688ioUlnjitMHSkcQg2LQn4HCtVejiRVcyLlFNr9c0ydwMEoK0LsRGVkFsmer5MstTr9j4mg9PM_-9Unx3tlyHaV-J3LMztd8/s72-c/calendarTest1.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8585981105500683948.post-4882403671070539958</id><published>2010-12-26T15:52:00.000+09:00</published><updated>2010-12-26T15:52:39.091+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CodeIgniter"/><category scheme="http://www.blogger.com/atom/ns#" term="PHP"/><title type='text'>CodeIgniterでGoogleContactsAPIのテスト(8)</title><content type='html'>さてGoogleContactAPIを叩いての連絡先データをいじいじするテストですが今回で最終回です。連絡先の新規登録、修正及び削除、グループの新規登録、修正及び削除が出来るようになっています。未実装なのは連絡先のデータにグループデータを含める部分ということになりますね。今回の記事では連絡先データの中でのグループデータについて一覧取得、登録そして修正時のxmlデータ扱い方についてご紹介します。&lt;br /&gt;
&lt;br /&gt;
これまでのデータの扱い方が理解できていれば特に問題ない範疇だと思います。&lt;br /&gt;
&lt;br /&gt;
まずは一覧取得時のデータ取得方法です。&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;$group_data = $this-&amp;gt;gdata_groups_model-&amp;gt;getGroupsElement();
foreach ($xml-&amp;gt;groupMembershipInfo as $g) {
 foreach ($group_data as $key =&amp;gt; $val) {
  if ($key == $g[&#39;href&#39;]) {
   $obj-&amp;gt;groups[] = $val;
  }
 }
}
&lt;/pre&gt;&lt;br /&gt;
feedデータにはhrefとしてグループのidしか含まれていないのでgroupデータを扱うモデルからElementデータを配列で取得してグループ名を代入していますがやり方としてはおわかり頂けるかと思います。&lt;br /&gt;
&lt;br /&gt;
続いては登録時のxml要素追加方法です。&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;// add group elements
$groups = $this-&amp;gt;input-&amp;gt;post(&#39;groups&#39;, TRUE);
foreach ($groups as $g) {
 $group = $doc-&gt;createElement(&#39;gContact:groupMembershipInfo&#39;);
 $group-&amp;gt;setAttribute(&#39;deleted&#39;,&#39;false&#39;);
 $group-&amp;gt;setAttribute(&#39;href&#39;,$g);

 $entry-&gt;appendChild($group);
}
&lt;/pre&gt;&lt;br /&gt;
グループデータはwebサイトデータと同様にgContactに定義されているのでそれで指定してあげます。deleted要素は必要ないような気もしますがデベロッパーガイドに従い加えてあります。&lt;br /&gt;
&lt;br /&gt;
最後に修正時のxml要素追加方法ですが登録時とちょっとだけ違います。&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;// add group elements
$groups = $this-&gt;input-&gt;post(&#39;groups&#39;, TRUE);
foreach ($groups as $g) {
 $group = $doc-&gt;createElement(&#39;groupMembershipInfo&#39;);
 $group-&gt;setAttribute(&#39;xmlns&#39;,&#39;http://schemas.google.com/contact/2008&#39;);
 $group-&gt;setAttribute(&#39;deleted&#39;,&#39;false&#39;);
 $group-&gt;setAttribute(&#39;href&#39;,$g);

 $entry-&gt;appendChild($group);
}
&lt;/pre&gt;&lt;br /&gt;
違いはxmlns要素が追加になっているだけですのでお約束みたいなものでしょうか。&lt;br /&gt;
この要素がないとエラーが帰ってしまいますのでご注意ください。&lt;br /&gt;
&lt;br /&gt;
さてCodeIgniterでGoogleContactsAPIを叩きながらwebアプリから連絡先データを操作することが出来るようになりました。まだ連絡先データには様々なデータが扱えるようになっていますがリファレンスガイド等を見ればおそらく操作できるのではないかと思います。&lt;br /&gt;
&lt;br /&gt;
ZendFrameworkを利用したので本当に簡単にデータ操作が出来ました。フレームワークの中でフレームワークを使うような愚はどうかとも思いますがまあ軽量フレームワークのCodeIgniterの利点を活かしつつこのテストを活用したwebアプリをこれから製作する予定です。&lt;br /&gt;
&lt;br /&gt;
しかし連絡先だけでなくカレンダーのデータ操作も実や予定していまして次のシリーズは「CodeIgniterでGoogleCalenderAPIをテスト」シリーズが始まります。(笑</content><link rel='replies' type='application/atom+xml' href='http://ikkandou.blogspot.com/feeds/4882403671070539958/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://ikkandou.blogspot.com/2010/12/codeignitergooglecontactsapi8.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8585981105500683948/posts/default/4882403671070539958'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8585981105500683948/posts/default/4882403671070539958'/><link rel='alternate' type='text/html' href='http://ikkandou.blogspot.com/2010/12/codeignitergooglecontactsapi8.html' title='CodeIgniterでGoogleContactsAPIのテスト(8)'/><author><name>いのうえしげゆき</name><uri>http://www.blogger.com/profile/13282776910860697563</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4jOg9k9PA94jh2U-QMUKSn508dxoLDOSWZIPK7nQDJGHkMuznNHROdpci2TgtUj31D_6z_squlFDoOp0ZaE9FUKw_FoOxt2mV-CqXjXqbanWfp94dejC7GtJScBvaaz8/s220/kaepapa.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8585981105500683948.post-6642339622990449175</id><published>2010-12-26T11:38:00.000+09:00</published><updated>2010-12-26T11:38:17.203+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CodeIgniter"/><category scheme="http://www.blogger.com/atom/ns#" term="PHP"/><title type='text'>CodeIgniterでGoogleContactsAPIのテスト(7)</title><content type='html'>さていろいろとハマりまくっているCodeIgniterですがバリデーションにも一癖二癖ある感じです。既に使われている方々にはあたりまえの事かもしれませんがこれから始めて触ってみようという方のために記事にしておきたいと思います。&lt;br /&gt;
&lt;br /&gt;
まずはバリデーションを通らなかったときの対応について。&lt;br /&gt;
&lt;br /&gt;
一般的にはform画面に戻って入力結果をinput等に戻して表示という流れになるかと思います。今回複数のメールアドレスや電話番号登録が可能なように実装しているのでformのnameを配列としてCIに渡しております。&lt;br /&gt;
&lt;br /&gt;
このように配列を利用するとバリデーションに渡した結果を受けるときのset_valueメソッドが上手く動作していないようで値を得ることが出来ませんでした。&lt;br /&gt;
&lt;br /&gt;
仕方がないのでMy_Form_validation.phpを作成してForm_vaidationクラスを継承した独自バリデーションクラスを作成してちょこっとset_validationをいじりました。&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;function set_value($field = &#39;&#39;, $default = &#39;&#39;) {
 if ( ! isset($this-&amp;gt;_field_data[$field]))
 {
  return $default;
 }

 if ( ! isset($this-&amp;gt;_field_data[$field][&#39;postdata&#39;])) {
  return $default;
 } else {
  return $this-&amp;gt;_field_data[$field][&#39;postdata&#39;];
 }
}
&lt;/pre&gt;&lt;br /&gt;
バリデーション後にviewを呼びだす前に$_POSTに必要データを突っ込んでおいて&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;set_value(&#39;edit&#39;, $this-&amp;gt;input-&gt;post(&#39;edit&#39;));
&lt;/pre&gt;&lt;br /&gt;
のような感じでデフォルト値として$_POSTからのデータを入れておいてあげると上手く行きました。&lt;br /&gt;
&lt;br /&gt;
また複数formのバリデーションを行なう場合にユーザガイドでは http://codeigniter.jp/user_guide_ja/libraries/form_validation.html#savingtoconfig の「検証ルールのセットを作る」に従ってセット名を付けて呼びだすようになっています。&lt;br /&gt;
&lt;br /&gt;
例えば…&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;if ($this-&amp;gt;form_validation-&amp;gt;run(&#39;contacts&#39;) == TRUE) {
 $this-&amp;gt;gdata_model-&gt;post();
 $data = $this-&amp;gt;gdata_model-&amp;gt;getContactsList();
 $this-&amp;gt;load-&amp;gt;view(&#39;contacts_index&#39;, $data);
} else {
 $this-&amp;gt;load-&amp;gt;view(&#39;form_contacts_view&#39;, $this-&amp;gt;gdata_model-&amp;gt;getFormData());
}
&lt;/pre&gt;&lt;br /&gt;
こんな感じで呼びだすことになる訳です。&lt;br /&gt;
&lt;br /&gt;
このときに利用するルールをApplication/config/form_validation.phpに配列として記載する訳ですがユーザドキュメントでは2010/12/25現在「=&gt;」とすべきところが「=」となってしまっています。&lt;br /&gt;
こんな間違いに30分もハマるのは私くらいのものかと思いますが念のため書いておきます。(笑&lt;br /&gt;
&lt;br /&gt;
軽快なCodeIgniterなだけあって痒いところに手が届くという機能は実装されてない感じもありますが個人的にはわりと気に入ったのでもうちょっと深く勉強してみたいと思っています。</content><link rel='replies' type='application/atom+xml' href='http://ikkandou.blogspot.com/feeds/6642339622990449175/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://ikkandou.blogspot.com/2010/12/codeignitergooglecontactsapi7.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8585981105500683948/posts/default/6642339622990449175'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8585981105500683948/posts/default/6642339622990449175'/><link rel='alternate' type='text/html' href='http://ikkandou.blogspot.com/2010/12/codeignitergooglecontactsapi7.html' title='CodeIgniterでGoogleContactsAPIのテスト(7)'/><author><name>いのうえしげゆき</name><uri>http://www.blogger.com/profile/13282776910860697563</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4jOg9k9PA94jh2U-QMUKSn508dxoLDOSWZIPK7nQDJGHkMuznNHROdpci2TgtUj31D_6z_squlFDoOp0ZaE9FUKw_FoOxt2mV-CqXjXqbanWfp94dejC7GtJScBvaaz8/s220/kaepapa.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8585981105500683948.post-2398003869910944796</id><published>2010-12-25T18:17:00.000+09:00</published><updated>2010-12-25T18:17:05.247+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CodeIgniter"/><category scheme="http://www.blogger.com/atom/ns#" term="PHP"/><title type='text'>CodeIgniterでGoogleContactsAPIのテスト(6)</title><content type='html'>時間がかかると云ってた割にはすぐに更新がきました。もっと苦労するかと思っていましたがすんなりと実装することが出来ました。ん？すんなり？嘘です。思いきりどハマりしたところが何箇所かありましたねぇ。&lt;br /&gt;
&lt;br /&gt;
ということで今回はGoogleContactsのグループデータの取得、登録、更新そして削除についてまとめてご紹介します。&lt;br /&gt;
&lt;br /&gt;
まずは一覧の取得方法です。&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;try {
 // perform login and set protocol version to 3.0
 $client = Zend_Gdata_ClientLogin::getHttpClient($this-&amp;gt;user, $this-&amp;gt;pass, &#39;cp&#39;);
 $gdata = new Zend_Gdata($client);
 $gdata-&amp;gt;setMajorProtocolVersion(3);

 // perform query and get feed of all results
 $query = new Zend_Gdata_Query(&#39;http://www.google.com/m8/feeds/groups/default/full&#39;);
 $query-&amp;gt;maxResults = 0;
 $query-&amp;gt;setParam(&#39;orderby&#39;, &#39;lastmodified&#39;);
 $query-&amp;gt;setParam(&#39;sortorder&#39;, &#39;descending&#39;);
 $feed = $gdata-&amp;gt;getFeed($query);

 $data[&#39;title&#39;] = (string)$feed-&amp;gt;id;
 $data[&#39;totalResults&#39;] = (String)$feed-&amp;gt;totalResults;

 // parse feed and extract contact information
 // into simpler objects
 $groups = array();
 foreach($feed as $entry){
  $obj = new stdClass;
  $xml = simplexml_load_string($entry-&amp;gt;getXML());
  if (! isset($xml-&amp;gt;systemGroup)) {
   $obj-&amp;gt;edit = (string)$entry-&amp;gt;getEditLink()-&amp;gt;href;
   $obj-&amp;gt;group_name = (string) $entry-&amp;gt;title;
  } else {
   $obj-&amp;gt;edit = &#39;system_group&#39;;
   $val = $this-&amp;gt;config-&amp;gt;item(&#39;system_groups&#39;,&#39;config_contacts&#39;);
   $obj-&amp;gt;group_name = $val[(string)$xml-&amp;gt;systemGroup[&#39;id&#39;]];
  }
  $groups[] = $obj;
 }

} catch (Exception $e) {
 die(&#39;ERROR:&#39; . $e-&amp;gt;getMessage());
}

$data[&#39;groups&#39;] = $groups;

return $data;
&lt;/pre&gt;&lt;br /&gt;
contactの時と何が違うかというと宛先URLが変っただけですね。グループデータの取得についてはhttp://www.google.com/m8/feeds/groups/default/fullこちらからの取得になります。それ以降はcontactsの時と同じ処理ですのでおわかり頂けるかと思います。&lt;br /&gt;
&lt;br /&gt;
続いては登録部分です。&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;try {
 // perform login and set protocol version to 3.0
 $client = Zend_Gdata_ClientLogin::getHttpClient($this-&amp;gt;user, $this-&amp;gt;pass, &#39;cp&#39;);
 $gdata = new Zend_Gdata($client);
 $gdata-&amp;gt;setMajorProtocolVersion(3);

 // create new entry
 $doc = new DOMDocument();
 $doc-&amp;gt;formatOutput = true;
 $entry = $doc-&amp;gt;createElement(&#39;atom:entry&#39;);
 $entry-&amp;gt;setAttributeNS(&#39;http://www.w3.org/2000/xmlns/&#39; ,&#39;xmlns:atom&#39;, &#39;http://www.w3.org/2005/Atom&#39;);
 $entry-&amp;gt;setAttributeNS(&#39;http://www.w3.org/2000/xmlns/&#39; ,&#39;xmlns:gd&#39;, &#39;http://schemas.google.com/g/2005&#39;);
 $doc-&amp;gt;appendChild($entry);

 // add category element
 $category = $doc-&amp;gt;createElement(&#39;atom:category&#39;);
 $category-&amp;gt;setAttribute(&#39;scheme&#39;, &#39;http://schemas.google.com/g/2005#kind&#39;);
 $category-&amp;gt;setAttribute(&#39;term&#39;,&#39;http://schemas.google.com/contact/2008#group&#39;);
 $entry-&amp;gt;appendChild($category);

 // add title element
 $title = $doc-&amp;gt;createElement(&#39;atom:title&#39;, $this-&amp;gt;input-&amp;gt;post(&#39;group_name&#39;, TRUE));
 $title-&amp;gt;setAttribute(&#39;type&#39;, &#39;text&#39;);
 $entry-&amp;gt;appendChild($title);

 $entryResult = $gdata-&amp;gt;insertEntry( $doc-&amp;gt;saveXML(), &#39;https://www.google.com/m8/feeds/groups/default/full&#39;);

} catch (Exception $e) {
 die(&#39;ERROR:&#39; . $e-&amp;gt;getMessage());
}

return $entryResult-&amp;gt;id;
&lt;/pre&gt;&lt;br /&gt;
登録もputするURLがgroups用になっているだけでそれ以外には項目がグループの方がかなり少ないといったところでしょうか。本来「gd:extendedProperty」という項目にグループの情報を登録することが出来るのですが登録自体は成功するもののデータ更新時にこのinfoデータをxmlから取得するのが上手くいかず登録から断念することになりました。取得した$feedの中に改行が入ってしまっていたりしたのでなにかバグがあるのかも？&lt;br /&gt;
作成するxmlはデベロッパーガイドを参考にして作成しています。&lt;br /&gt;
&lt;br /&gt;
続いては削除です。&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;try {
 // perform login and set protocol version to 3.0
 $client = Zend_Gdata_ClientLogin::getHttpClient($this-&amp;gt;user, $this-&amp;gt;pass, &#39;cp&#39;);
 // set GData delete headers
 $client-&amp;gt;setHeaders(&#39;If-Match: *&#39;);
 $gdata = new Zend_Gdata($client);
 $gdata-&amp;gt;setMajorProtocolVersion(3);

 // delete entry
 $gdata-&amp;gt;delete($this-&amp;gt;input-&amp;gt;post(&#39;edit&#39;,TRUE));
} catch (Exception $e) {
 die(&#39;ERROR:&#39; . $e-&amp;gt;getMessage());
}
&lt;/pre&gt;&lt;br /&gt;
削除もcontactsと同様editタグに指定されているキーを送ってあげることで簡単に削除が出来ます。今回もIf-Match:*を指定して簡単に削除を行なっています。&lt;br /&gt;
&lt;br /&gt;
最後に更新です。&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;try {
 // perform login and set protocol version to 3.0
 $client = Zend_Gdata_ClientLogin::getHttpClient($this-&amp;gt;user, $this-&amp;gt;pass, &#39;cp&#39;);
 $client-&amp;gt;setHeaders(&#39;If-Match: *&#39;);
 $gdata = new Zend_Gdata($client);
 $gdata-&amp;gt;setMajorProtocolVersion(3);

 $query = new Zend_Gdata_Query($this-&amp;gt;input-&amp;gt;post(&#39;edit&#39;));
 $entry = $gdata-&amp;gt;getEntry($query);
 $xml = simplexml_load_string($entry-&amp;gt;getXML());

 $xml-&amp;gt;title = $this-&amp;gt;input-&amp;gt;post(&#39;group_name&#39;);

 $entryResult = $gdata-&amp;gt;updateEntry($xml-&amp;gt;saveXML(), $entry-&amp;gt;getEditLink()-&amp;gt;href);

} catch (Exception $e) {
 die(&#39;ERROR:&#39; . $e-&amp;gt;getMessage());
}

return $entryResult-&amp;gt;id;
&lt;/pre&gt;&lt;br /&gt;
更新も項目が少ないのでとても短かなソースになっています。editデータを送りqueryを実行、取得したxmlデータの中でtitleタグに新しいグループ名を代入してZendFrameworkのupdateEntryコマンドで送信して完了です。&lt;br /&gt;
&lt;br /&gt;
contactsの方で苦労したせいかgroupデータについてはわりと簡単に実装することが出来ました。えっ？ハマったところ？データをjavascriptでいじる部分でハマっただけです。(笑</content><link rel='replies' type='application/atom+xml' href='http://ikkandou.blogspot.com/feeds/2398003869910944796/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://ikkandou.blogspot.com/2010/12/codeignitergooglecontactsapi6.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8585981105500683948/posts/default/2398003869910944796'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8585981105500683948/posts/default/2398003869910944796'/><link rel='alternate' type='text/html' href='http://ikkandou.blogspot.com/2010/12/codeignitergooglecontactsapi6.html' title='CodeIgniterでGoogleContactsAPIのテスト(6)'/><author><name>いのうえしげゆき</name><uri>http://www.blogger.com/profile/13282776910860697563</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4jOg9k9PA94jh2U-QMUKSn508dxoLDOSWZIPK7nQDJGHkMuznNHROdpci2TgtUj31D_6z_squlFDoOp0ZaE9FUKw_FoOxt2mV-CqXjXqbanWfp94dejC7GtJScBvaaz8/s220/kaepapa.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8585981105500683948.post-7743105611814606335</id><published>2010-12-24T21:11:00.001+09:00</published><updated>2010-12-25T18:17:23.393+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CodeIgniter"/><category scheme="http://www.blogger.com/atom/ns#" term="PHP"/><title type='text'>CodeIgniterでGoogleContactsAPIのテスト(5)</title><content type='html'>さてちょっと時間が空いてしまいましたが今回はContactsの更新です。&lt;br /&gt;
これまで一覧取得、登録そして削除ときましたので更新が出来たら一通りデータをいじれるようになる訳です。更新も削除と同じく一覧取得で得ているidをキーに行ないます。&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;$obj-&amp;gt;edit = (string)$entry-&amp;gt;getEditLink()-&amp;gt;href;
&lt;/pre&gt;&lt;br /&gt;
こんな感じで取得してましたね。&lt;br /&gt;
ZendFramework様々といったところでしょうか。&lt;br /&gt;
&lt;br /&gt;
今回時間が空いてしまったのはjavascript等をいじっていたせいなんですがこれはまあ他のサイトを参考にしてアレンジしていただけなので省略してContactsデータの更新に焦点をあててご紹介します。&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;// perform login and set protocol version to 3.0
$client = Zend_Gdata_ClientLogin::getHttpClient($this-&amp;gt;user, $this-&amp;gt;pass, &#39;cp&#39;);
$client-&amp;gt;setHeaders(&#39;If-Match: *&#39;);
$gdata = new Zend_Gdata($client);
$gdata-&amp;gt;setMajorProtocolVersion(3);

$query = new Zend_Gdata_Query($this-&amp;gt;input-&amp;gt;post(&#39;edit&#39;));
$org_entry = $gdata-&amp;gt;getEntry($query);
$xml = simplexml_load_string($org_entry-&amp;gt;getXML());
&lt;/pre&gt;&lt;br /&gt;
上記のような形でアクセスを行ないqueryのデータとしてeditキーを渡しています。&lt;br /&gt;
通常はheaderにETagの値を指定して更新を行うらしいですが自分しかデータをいじらないアカウントですのでアスタリスクを指定しETagはデータに含めていません。&lt;br /&gt;
&lt;br /&gt;
このqueryで得られたデータを上書きしていってputすることでデータが更新されるのですがデータ削除を行なうことを考えて一旦メールアドレス等のデータを全削除してからデータ登録を行なったのですがエレメントの順番が大切なようでエラーが出てしまい今回は全てのデータを新たなDOMDocumentに追加してくという手法を取りました。&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;// create new entry
$doc = new DOMDocument();
$doc-&amp;gt;formatOutput = true;
$entry = $doc-&amp;gt;createElement(&#39;atom:entry&#39;);
$entry-&amp;gt;setAttributeNS(&#39;http://www.w3.org/2000/xmlns/&#39; ,&#39;xmlns:atom&#39;, &#39;http://www.w3.org/2005/Atom&#39;);
$doc-&amp;gt;appendChild($entry);

// add name element
$name = $doc-&amp;gt;createElement(&#39;name&#39;);
$name-&amp;gt;setAttribute(&#39;xmlns&#39;, &#39;http://schemas.google.com/g/2005&#39;);
$entry-&amp;gt;appendChild($name);
//input-&amp;gt;post()メソッドを利用してXSS対策
$fullName = $doc-&amp;gt;createElement(&#39;fullName&#39;, $this-&amp;gt;input-&amp;gt;post(&#39;name&#39;, TRUE));
$name-&amp;gt;appendChild($fullName);

// add org name element
$org = $doc-&amp;gt;createElement(&#39;organization&#39;);
$org-&amp;gt;setAttribute(&#39;xmlns&#39;, &#39;http://schemas.google.com/g/2005&#39;);
$org-&amp;gt;setAttribute(&#39;rel&#39; ,&#39;http://schemas.google.com/g/2005#work&#39;);
$entry-&amp;gt;appendChild($org);
$orgName = $doc-&amp;gt;createElement(&#39;orgName&#39;, $this-&amp;gt;input-&amp;gt;post(&#39;org&#39;, TRUE));
$org-&amp;gt;appendChild($orgName);

// add email elements
$emails = $this-&amp;gt;input-&amp;gt;post(&#39;email&#39;, TRUE);
$epleces = $this-&amp;gt;input-&amp;gt;post(&#39;email_place&#39;, TRUE);
foreach ($emails as $key =&amp;gt; $e) {
 if ($e != &#39;&#39;) {
  $email = $doc-&amp;gt;createElement(&#39;email&#39;);
  $email-&amp;gt;setAttribute(&#39;xmlns&#39;,&#39;http://schemas.google.com/g/2005&#39;);
  if ($epleces[$key] == &#39;custom&#39;) {
   $email-&amp;gt;setAttribute(&#39;label&#39;, $this-&amp;gt;input-&amp;gt;post(&#39;email_custom&#39;, TRUE));
  } else {
   $email-&amp;gt;setAttribute(&#39;rel&#39;, &#39;http://schemas.google.com/g/2005#&#39; . $epleces[$key]);
  }
  $email-&amp;gt;setAttribute(&#39;address&#39;, $e);
  $entry-&amp;gt;appendChild($email);
 }
}

// add phone elements
$phones = $this-&amp;gt;input-&amp;gt;post(&#39;phone&#39;, TRUE);
$pplaces = $this-&amp;gt;input-&amp;gt;post(&#39;phone_place&#39;, TRUE);
foreach ($phones as $key =&amp;gt; $p) {
 if ($p != &#39;&#39;) {
  $phone = $doc-&amp;gt;createElement(&#39;phoneNumber&#39;, $p);
  $phone-&amp;gt;setAttribute(&#39;xmlns&#39;,&#39;http://schemas.google.com/g/2005&#39;);
  if ($pplaces[$key] == &#39;custom&#39;) {
   $phone-&amp;gt;setAttribute(&#39;label&#39;, $this-&amp;gt;input-&amp;gt;post(&#39;phone_custom&#39;, TRUE));
  } else {
   $phone-&amp;gt;setAttribute(&#39;rel&#39;, &#39;http://schemas.google.com/g/2005#&#39; . $pplaces[$key]);
  }
  $entry-&amp;gt;appendChild($phone);
 }
}

// add web elements
$webs =$this-&amp;gt;input-&amp;gt;post(&#39;web&#39;, TRUE);
$wplaces = $this-&amp;gt;input-&amp;gt;post(&#39;web_place&#39;, TRUE);
foreach ($webs as $key =&amp;gt; $w) {
 if ($w != &#39;&#39;) {
  $web = $doc-&amp;gt;createElement(&#39;website&#39;);
  $web-&amp;gt;setAttribute(&#39;xmlns&#39;,&#39;http://schemas.google.com/contact/2008&#39;);
  $web-&amp;gt;setAttribute(&#39;href&#39;,$w);
  if ($wplaces[$key] == &#39;custom&#39;) {
   $web-&amp;gt;setAttribute(&#39;label&#39;, $this-&amp;gt;input-&amp;gt;post(&#39;web_custom&#39;, TRUE));
  } else {
   $web-&amp;gt;setAttribute(&#39;rel&#39;, $wplaces[$key]);
  }
  $entry-&amp;gt;appendChild($web);
 }
}

foreach ($org_entry-&amp;gt;category as $category) {
 $categorys = $doc-&amp;gt;createElement(&#39;atom:category&#39;);
 $categorys-&amp;gt;setAttribute(&#39;term&#39;, $category-&amp;gt;getTerm());
 $categorys-&amp;gt;setAttribute(&#39;scheme&#39;, $category-&amp;gt;getScheme());
 $entry-&amp;gt;appendChild($categorys);
}


$id = $doc-&amp;gt;createElement(&#39;atom:id&#39;, $org_entry-&amp;gt;id);
$entry-&amp;gt;appendChild($id);

foreach ($org_entry-&amp;gt;link as $link) {
 $links = $doc-&amp;gt;createElement(&#39;atom:link&#39;);
 $links-&amp;gt;setAttribute(&#39;href&#39;, $link-&amp;gt;getHref());
 $links-&amp;gt;setAttribute(&#39;rel&#39;, $link-&amp;gt;getRel());
 $links-&amp;gt;setAttribute(&#39;type&#39;, $link-&amp;gt;getType());
 $entry-&amp;gt;appendChild($links);
}

$title = $doc-&amp;gt;createElement(&#39;atom:title&#39;,$this-&amp;gt;input-&amp;gt;post(&#39;name&#39;, TRUE));
$entry-&amp;gt;appendChild($title);

$updated = $doc-&amp;gt;createElement(&#39;atom:updated&#39;, $org_entry-&amp;gt;updated);
$entry-&amp;gt;appendChild($updated);

$edited = $doc-&amp;gt;createElement(&#39;atom:edited&#39;, $org_entry-&amp;gt;edited);
$entry-&amp;gt;appendChild($edited);
&lt;/pre&gt;&lt;br /&gt;
更新データ以外のデータについては先程行なったqueryの結果をそのまま入れるようにしてあります。じっくりコードを見るとわかると思いますがGmailではメール等の付随データとして仕事や自宅等が選べるようになっていますがその機能にも対応しています。コード中にcustomの文字が見えるかと思います。カスタムデータの場合にはrel要素ではなくlabel要素としてデータをタグに含めて送ることでデータが登録されます。&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;$entryResult = $gdata-&gt;updateEntry($entry_data, $org_entry-&amp;gt;getEditLink()&amp;gt;href);
&lt;/pre&gt;&lt;br /&gt;
最後にZendFrameworkGDataAPIのupdateEntryメソッドでデータを送って更新が完了です。一緒に送っているのは冒頭で述べたlinkタグに含まれるeditキーです。&lt;br /&gt;
&lt;br /&gt;
これでContactsについては一通りデータのやりとりが出来るようになりました。次の予定ではこれら連絡先を管理するには大切なグループについて登録や更新、削除を出来るようにしてみたいと思います。この部分についてはIBMのサンプルがないので英語ドキュメントを読みながらの作業になります。さらに時間がかかってしまうかも？</content><link rel='replies' type='application/atom+xml' href='http://ikkandou.blogspot.com/feeds/7743105611814606335/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://ikkandou.blogspot.com/2010/12/codeignitergooglecontactsapi5.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8585981105500683948/posts/default/7743105611814606335'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8585981105500683948/posts/default/7743105611814606335'/><link rel='alternate' type='text/html' href='http://ikkandou.blogspot.com/2010/12/codeignitergooglecontactsapi5.html' title='CodeIgniterでGoogleContactsAPIのテスト(5)'/><author><name>いのうえしげゆき</name><uri>http://www.blogger.com/profile/13282776910860697563</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4jOg9k9PA94jh2U-QMUKSn508dxoLDOSWZIPK7nQDJGHkMuznNHROdpci2TgtUj31D_6z_squlFDoOp0ZaE9FUKw_FoOxt2mV-CqXjXqbanWfp94dejC7GtJScBvaaz8/s220/kaepapa.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8585981105500683948.post-5787853246012139808</id><published>2010-12-18T10:21:00.002+09:00</published><updated>2010-12-29T00:29:05.677+09:00</updated><title type='text'>CodeIgniterでGoogleContactsAPIのテスト(4)</title><content type='html'>IBMのGoogleContactsサンプルのCI化第三弾はデータ削除です。&lt;br /&gt;
&lt;br /&gt;
削除機能実装についてはわりとスムーズに行きました。&lt;br /&gt;
&lt;br /&gt;
formタグで削除する連絡先のデータをhiddenで隠し持ちsubmitボタンで確認ダイアログを出しOKボタンで削除実行という流れです。&lt;br /&gt;
&lt;br /&gt;
確認ダイアログのjavascriptは以下のようになっています。&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;&amp;lt;script language=&quot;JavaScript&quot;&amp;gt;
&amp;lt;!--
function check(){
    if(window.confirm(&#39;削除して宜しいですか？&#39;)){
        return true;
    } else {
        window.alert(&#39;削除を中止しました。&#39;);
        return false;
    }
}
//--&amp;gt;
&lt;/pre&gt;&lt;br /&gt;
一般的なスクリプトですから説明はいらないと思いますがOKボタンを押したときにtrueを返し呼び出し側でそれを検知してsubmitを実行するか判断するというものです。&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a class=&quot;lightbox&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIhJfqUOI9T1OLPR2RjdiB5enYKwdGoP6R2AxnU0URKvBNu1iWJkzTQavWyXtY9IXX5gW4AGMxyxPRMRpQ3Fkw_Wc3gbwblW68gBGOzQI-d6D-EwbjZUbPwbIRupLUTBDJHzTujesXER4/s1600/GoogleContactsTestDelete_1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left:1em; margin-right:1em&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;226&quot; width=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIhJfqUOI9T1OLPR2RjdiB5enYKwdGoP6R2AxnU0URKvBNu1iWJkzTQavWyXtY9IXX5gW4AGMxyxPRMRpQ3Fkw_Wc3gbwblW68gBGOzQI-d6D-EwbjZUbPwbIRupLUTBDJHzTujesXER4/s320/GoogleContactsTestDelete_1.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
表示した画像は上記のようになっています。リンククリックで即座に削除はちょっと怖いかな？とこんな機構を取り入れてみました。&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;&amp;lt;div class=&quot;name&quot;&amp;gt;
    &amp;lt;?php echo $r-&amp;gt;name; ?&amp;gt;
    &amp;lt;span class=&quot;links&quot;&amp;gt;
        &amp;lt;?php echo form_open(&#39;contacts/delete&#39;,&#39;onSubmit=&quot;return check()&quot;&#39;); ?&amp;gt;
        &amp;lt;?php echo form_hidden(&#39;id&#39;,$r-&amp;gt;edit)?&amp;gt;
        &amp;lt;?php echo form_submit(&#39;submit&#39;, &#39;削除&#39;); ?&amp;gt;
        &amp;lt;?php echo form_close(); ?&amp;gt;
    &amp;lt;/span&amp;gt;
&amp;lt;/div&amp;gt;
&lt;/pre&gt;&lt;br /&gt;
上記がその判断を行なうformタグ部分です。CodeIgniterのformヘルパーを利用しているのでちょっとわかりにくいかもしれませんがsubmit先がcontacts.phpのdeleteメソッドで連絡先のidを送っていることがおわかり頂けますでしょうか。&lt;br /&gt;
&lt;br /&gt;
続いてはコントローラのdelete()メソッドを見てみましょう。&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;public function delete() {
    $this-&amp;lt;gdata_model-&amp;lt;delete();

    $data = $this-&amp;lt;gdata_model-&amp;lt;getContactsList();
    $this-&amp;lt;load-&amp;lt;view(&#39;contacts-index&#39;, $data);
}
&lt;/pre&gt;&lt;br /&gt;
gdata_modelのdeleteメソッドを呼びだしそちらでデータを削除後一覧表示画面を呼びだしている形になっています。削除すべき連絡先のIDについては$_POSTから受けとるため引数として渡しておりません。このあたりのお作法がよくわかっていませんがmodelでも$_POSTが受けとれるようになっているので問題ないかな？&lt;br /&gt;
&lt;br /&gt;
続いてはmodelのdelete()メソッドです。メソッド名がかぶってしまっていますがまあ気にしない方向で…。(笑&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;public function delete() {
    try {
        // perform login and set protocol version to 3.0
        $client = Zend_Gdata_ClientLogin::getHttpClient($this-&amp;lt;user, $this-&amp;lt;pass, &#39;cp&#39;);
        // set GData delete headers
        $client-&amp;lt;setHeaders(&#39;If-Match: *&#39;);
        $gdata = new Zend_Gdata($client);
        $gdata-&amp;lt;setMajorProtocolVersion(3);

        // delete entry
        $gdata-&amp;lt;delete($this-&amp;lt;input-&amp;lt;post(&#39;id&#39;,TRUE));
    } catch (Exception $e) {
        die(&#39;ERROR:&#39; . $e-&amp;lt;getMessage());
    }
}
&lt;/pre&gt;&lt;br /&gt;
こちらも登録に比べると非常にシンプルに完了しています。ログインしてプロトコルバージョンの指定およびdelete()メソッドの実行です。たったこれだけで削除については実装できてしまいました。&lt;br /&gt;
&lt;br /&gt;
残すはデータ修正ですがこれは再び苦労しそうな予感がします。CIの使い方の問題とGoogleDataAPIともにまだはっきりと指針を詰められていません。じっくりドキュメントを読んで実装方法を考えてみたいと思います。IBMのサンプルプログラムに修正はないんですよねぇ。(笑</content><link rel='replies' type='application/atom+xml' href='http://ikkandou.blogspot.com/feeds/5787853246012139808/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://ikkandou.blogspot.com/2010/12/codeignitergooglecontactsapi4.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8585981105500683948/posts/default/5787853246012139808'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8585981105500683948/posts/default/5787853246012139808'/><link rel='alternate' type='text/html' href='http://ikkandou.blogspot.com/2010/12/codeignitergooglecontactsapi4.html' title='CodeIgniterでGoogleContactsAPIのテスト(4)'/><author><name>いのうえしげゆき</name><uri>http://www.blogger.com/profile/13282776910860697563</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4jOg9k9PA94jh2U-QMUKSn508dxoLDOSWZIPK7nQDJGHkMuznNHROdpci2TgtUj31D_6z_squlFDoOp0ZaE9FUKw_FoOxt2mV-CqXjXqbanWfp94dejC7GtJScBvaaz8/s220/kaepapa.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIhJfqUOI9T1OLPR2RjdiB5enYKwdGoP6R2AxnU0URKvBNu1iWJkzTQavWyXtY9IXX5gW4AGMxyxPRMRpQ3Fkw_Wc3gbwblW68gBGOzQI-d6D-EwbjZUbPwbIRupLUTBDJHzTujesXER4/s72-c/GoogleContactsTestDelete_1.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8585981105500683948.post-1155131186076112045</id><published>2010-12-17T15:26:00.006+09:00</published><updated>2010-12-29T00:27:58.906+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CodeIgniter"/><category scheme="http://www.blogger.com/atom/ns#" term="PHP"/><title type='text'>CodeIgniterでGoogleContactsAPIのテスト(3)</title><content type='html'>IBMのGoogleContactsサンプルのCI化第三弾はデータ登録です。&lt;br /&gt;
&lt;br /&gt;
さて続いてはデータ登録部分を実装することにしたいと思います。&lt;br /&gt;
&lt;br /&gt;
IBMのサンプルでは前記事でも書いたようにcontacts-save.php1ファイルで完結しています。これをmodelとviewに分けてCodeIgniter上で動くように変更します。サンプルでは登録出来る項目と表示している項目に違いがあるのでとりあえず表示している項目については登録を出来るようにしました。&lt;br /&gt;
&lt;br /&gt;
contacts-save.phpでは$_POSTで受けとったデータをhtmlentities()を使ってサニタイズしていますがこれが原因で日本語が通らなくなっていたのでCodeIgniterのバリデーション機能に置き換えて実装しています。また入力フォームの生成にCodeIgniterのformヘルパーを利用するよう変更しています。&lt;br /&gt;
&lt;br /&gt;
いやぁ…やたら苦労しましたこの部分。ハマりどころ満載というか英語が読めないというか。一応希望するデータ項目については登録が出来るようになったので記事化します。&lt;br /&gt;
&lt;br /&gt;
まずは登録フォームから見ていきましょう。&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;&amp;lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&amp;gt;
&amp;lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; xml:lang=&quot;ja&quot; lang=&quot;ja&quot;&amp;gt;
&amp;lt;head&amp;gt;
    &amp;lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&amp;gt;
    &amp;lt;title&amp;gt;新規連絡先登録&amp;lt;/title&amp;gt;
    &amp;lt;style type=&quot;text/css&quot;&amp;gt;
        body {
            font-family: &quot;ＭＳ Ｐゴシック&quot;, Osaka, &quot;ヒラギノ角ゴ Pro W3&quot;;
        }
        div.red {
            color: red;
            text-decoration: none;
            font-weight: bold;
        }
    &amp;lt;/style&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
    &amp;lt;h2&amp;gt;連絡先新規登録&amp;lt;/h2&amp;gt;
    &amp;lt;?php echo validation_errors(); ?&amp;gt;
    &amp;lt;?php echo form_open(&#39;contacts/post&#39;); ?&amp;gt;
        &amp;lt;p&amp;gt;
            名前(必須): &amp;lt;br/&amp;gt;
            &amp;lt;?php echo form_input(&#39;name&#39;, set_value(&#39;name&#39;), &#39;size=&quot;20&quot;&#39;); ?&amp;gt;&amp;lt;br/&amp;gt;
        &amp;lt;/p&amp;gt;
        &amp;lt;p&amp;gt;
            会社名: &amp;lt;br/&amp;gt;
            &amp;lt;?php echo form_input(&#39;org&#39;, set_value(&#39;org&#39;), &#39;size=&quot;35&quot;&#39;); ?&amp;gt;&amp;lt;br/&amp;gt;
        &amp;lt;/p&amp;gt;
        &amp;lt;p&amp;gt;メールアドレスもしくは電話番号は必ず入力してください。
        &amp;lt;/p&amp;gt;
        &amp;lt;p&amp;gt;
            メールアドレス:&amp;lt;br/&amp;gt;
            &amp;lt;?php echo form_dropdown(&#39;mail1_place&#39;, $mail_options); ?&amp;gt;
            &amp;lt;?php echo form_input(&#39;mail1&#39;, set_value(&#39;mail1&#39;), &#39;size=&quot;35&quot;&#39;); ?&amp;gt;&amp;lt;br/&amp;gt;
        &amp;lt;/p&amp;gt;
        &amp;lt;p&amp;gt;
            電話番号:&amp;lt;br/&amp;gt;
            &amp;lt;?php echo form_dropdown(&#39;phone1_place&#39;, $phone_options); ?&amp;gt;
            &amp;lt;?php echo form_input(&#39;phone1&#39;, set_value(&#39;phone1&#39;), &#39;size=&quot;35&quot;&#39;); ?&amp;gt;&amp;lt;br/&amp;gt;
            &amp;lt;br/&amp;gt;ハイフンは含めず数字のみで入力してください。
        &amp;lt;/p&amp;gt;
        &amp;lt;p&amp;gt;
            webサイト:&amp;lt;br/&amp;gt;
            &amp;lt;?php echo form_dropdown(&#39;web1_place&#39;, $web_options); ?&amp;gt;
            &amp;lt;?php echo form_input(&#39;web1&#39;, set_value(&#39;web1&#39;), &#39;size=&quot;35&quot;&#39;); ?&amp;gt;&amp;lt;br/&amp;gt;
        &amp;lt;/p&amp;gt;
        &amp;lt;?php echo form_submit(&#39;submit&#39;, &#39;登録&#39;); ?&amp;gt;
        &amp;lt;?php echo form_reset(&#39;reset&#39;, &#39;リセット&#39;); ?&amp;gt;
    &amp;lt;?php echo form_close(); ?&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/pre&gt;&lt;br /&gt;
説明が必要そうなところとしては&amp;lt;?php echo validation_errors(); ?&amp;gt;と云う部分でしょうか。validatitonの時は個々の項目についてエラー時にメッセージが指定できたのですがform_validationになってまだその機能が実装されていないようで一箇所にエラーが集まって表示されます。またformヘルパーを利用してformタグを生成しています。&lt;br /&gt;
selectタグのoptionについてはController上で配列を用意してviewに渡しviewでformヘルパーを利用して展開している感じです。set_value()メソッドを使ってエラー時に入力済みデータを保持するようにしています。&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a class=&quot;lightbox&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8G9pLg7_KufKQC5kkab2tof7ZkLM8fB0HVd4-TwzEH8Ow2ng3D9fpC2OHu-FVm4cb4IpWCcY1m5XS-0MwdAXy3JrxAH2Hxl8lfJGHthRpiP_CM32gvYo9J09tpN-ZAaNMgcvymrOl9q8/s1600/GoogleContactsTestAdd_1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; width=&quot;214&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8G9pLg7_KufKQC5kkab2tof7ZkLM8fB0HVd4-TwzEH8Ow2ng3D9fpC2OHu-FVm4cb4IpWCcY1m5XS-0MwdAXy3JrxAH2Hxl8lfJGHthRpiP_CM32gvYo9J09tpN-ZAaNMgcvymrOl9q8/s320/GoogleContactsTestAdd_1.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
続いてはこのviewを呼びだすcontrollerに追加した関数です。&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;public function add() {
    $this-&gt;load-&gt;view(&#39;add_contacts_view&#39;, $this-&gt;_get_option_data());
}
    
public function _get_option_data() {
    $mail_options = array(
                            &#39;work&#39; =&gt; &#39;仕事&#39;,
                            &#39;home&#39; =&gt; &#39;自宅&#39;
                        );
    $data[&#39;mail_options&#39;] = $mail_options;

    $phone_options = array(
                            &#39;mobile&#39;=&gt; &#39;携帯電話&#39;,
                            &#39;work&#39; =&gt; &#39;仕事&#39;,
                            &#39;home&#39; =&gt; &#39;自宅&#39;,
                            &#39;main&#39; =&gt; &#39;メイン&#39;,
                            &#39;work_fax&#39; =&gt; &#39;FAX(勤務先)&#39;,
                            &#39;home_fax&#39; =&gt; &#39;FAX(自宅)&#39;,
                            &#39;pager&#39; =&gt; &#39;ポケベル&#39;
                        );
    $data[&#39;phone_options&#39;] = $phone_options;

    $web_options = array(
                            &#39;profile&#39; =&gt; &#39;プロフィール&#39;,
                            &#39;blog&#39; =&gt; &#39;ブログ&#39;,
                            &#39;home-page&#39; =&gt; &#39;ホームページ&#39;,
                            &#39;work&#39; =&gt; &#39;仕事&#39;
                        );
    $data[&#39;web_options&#39;] = $web_options;

    return $data;
}
&lt;/pre&gt;&lt;br /&gt;
add()メソッドはブラウザからアクセス可能なメソッドとして新規連絡先登録画面として呼びだされます。このメソッド内で先程作成した登録フォームのhtmlを呼びだし_get_option_data()メソッドでselectタグで利用する配列を生成しています。メソッド名の頭にアンダースコアがついているのはCodeIgniterの機能を利用してこのメソッドにブラウザからアクセスするのを防ぐためです。&lt;br /&gt;
&lt;br /&gt;
続いてはブラウザにて登録フォームにデータを入力しそのデータを受けとるpost()メソッドを見ていきたいと思います。&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;public function post() {
 //バリデーション導入
 //XSSサニタイズはmodelにて行う
 $this-&amp;gt;form_validation-&amp;gt;set_rules(&#39;name&#39;,&#39;名前&#39;,&#39;trim|required|max_length[40]&#39;);
 $this-&amp;gt;form_validation-&amp;gt;set_rules(&#39;org&#39;,&#39;会社名&#39;,&#39;trim|max_length[40]&#39;);
 $this-&amp;gt;form_validation-&amp;gt;set_rules(&#39;email1&#39;,&#39;メールアドレス&#39;,&#39;trim|callback__mail_require_check|valid_email&#39;);
 $this-&amp;gt;form_validation-&amp;gt;set_rules(&#39;email1_place&#39;,&#39;メールアドレスの場所&#39;,&#39;trim|alpha_dash&#39;);
 $this-&amp;gt;form_validation-&amp;gt;set_rules(&#39;phone1&#39;,&#39;電話番号&#39;,&#39;trim|numeric|callback__phone_require_check|max_length[11]&#39;);
 $this-&amp;gt;form_validation-&amp;gt;set_rules(&#39;phone1_place&#39;,&#39;電話番号の場所&#39;,&#39;trim|alpha_dash&#39;);
 $this-&amp;gt;form_validation-&amp;gt;set_rules(&#39;web1&#39;,&#39;webサイト&#39;,&#39;trim|max_length[50]&#39;);
 $this-&amp;gt;form_validation-&amp;gt;set_rules(&#39;web1_place&#39;,&#39;webサイトの場所&#39;,&#39;trim|alpha_dash&#39;);

 $this-&amp;gt;error_enable = FALSE;

 if ($this-&amp;gt;form_validation-&amp;gt;run() == TRUE) {
  $this-&amp;gt;gdata_model-&amp;gt;post();
  $data = $this-&amp;gt;gdata_model-&amp;gt;getContactsList();
 $this-&amp;gt;load-&amp;gt;view(&#39;contacts-index&#39;, $data);
 } else {
  $this-&amp;gt;load-&amp;gt;view(&#39;add_contacts_view&#39;, $this-&amp;gt;_get_option_data());
 }
}

public function _mail_require_check($str) {
if ($this-&amp;gt;data_require_check()==FALSE) {
  $this-&amp;gt;error_enable = TRUE;
  $this-&amp;gt;form_validation-&amp;gt;set_message(&#39;_mail_require_check&#39;, &#39;メールアドレスもしくは電場番号が必須です。&#39;);
  return FALSE;
 } else {
  return TRUE;
 }
}

public function _phone_require_check($str) {
 if ($this-&amp;gt;error_enable == FALSE) {
  if ($this-&amp;gt;data_require_check()==FALSE){
   $this-&amp;gt;form_validation-&amp;gt;set_message(&#39;_phone_require_check&#39;, &#39;メールアドレスもしくは電場番号が必須です。&#39;);
   return FALSE;
  } else {
   return TRUE;
  }
 }
 return TRUE;
}

public function data_require_check() {
 if (($_POST[&#39;mail1&#39;]==&#39;&#39;) AND ($_POST[&#39;phone1&#39;]==&#39;&#39;)) {
  return FALSE;
 } else {
  return TRUE;
 }
}
&lt;/pre&gt;&lt;br /&gt;
まずpost()メソッドを見ていただくとCodeIgniterのバリデーションクラスを利用してデータ検証を行なっているのがわかるかと思います。名前データは必須でメールアドレスもしくは電話番号の入力が必要としたかったのでユーザ定義のバリデーションを行なっています。&lt;br /&gt;
&lt;br /&gt;
ユーザ定義のバリデーションはcontrollerの中に書けという風にドキュメントにも記載されているのですがそれだとブラウザからのアクセスを許可してしまうことになるので先程ご紹介したメソッド名にアンダースコアを付ける方法を採用。実際にバリデーションするときにはcallback_を付加するとのことでアンダースコアが2重になってしまっていますがいわゆるバッドノウハウってやつでしょうかねぇ。本来なら別ファイルに定義したデータを読み込むとかの手法の方がよいように思うのですがどうなんでしょう？controllerに定義を記述するのってなんとなくイヤンな感じがします。&lt;br /&gt;
&lt;br /&gt;
また個別にバリデーション定義をし片方のバリデーションで一度エラーがとなった時には再度エラーメッセージを追加しないようにしています。もうちょっとスマートな記述方法がありそうですが私のスキルではこれが精一杯でした。(汗&lt;br /&gt;
&lt;br /&gt;
$this-&amp;gt;form_validation-&amp;gt;run()という部分でバリデーションを実行している訳ですがバリデーションを通ったら連絡先一覧をviewとして読込み通らなかった場合はadd_contacts_viewを読み込んでエラー表示をしています。&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a class=&quot;lightbox&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiGanZX4U5RHRhjGbXjW0hEgiNQvJrQzLfo7ox6M2tO_RLNkIOQmfLslXFhCTSFJNuabnqzl0zCCu8s9HmnWbVe9gGKaDPGausxC1hHOZU941F4qiOF3anna41HdMloxtgfvFbxiYMNAV0/s1600/GoogleContactsTestAdd_2.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; width=&quot;194&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiGanZX4U5RHRhjGbXjW0hEgiNQvJrQzLfo7ox6M2tO_RLNkIOQmfLslXFhCTSFJNuabnqzl0zCCu8s9HmnWbVe9gGKaDPGausxC1hHOZU941F4qiOF3anna41HdMloxtgfvFbxiYMNAV0/s320/GoogleContactsTestAdd_2.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
続いては実際にGoogleDataAPIを通じてデータ登録を行なっているpost()メソッドを見てみましょう&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;public function post() {
    // check for required input
    /* バリデーションを実施するので削除
    if (empty($this-&amp;gt;input-&amp;gt;post(&#39;name&#39;))) {
        die(&#39;ERROR: Missing name&#39;);
    }

    if (empty($_POST[&#39;email&#39;])) {
        die(&#39;ERROR: Missing email address&#39;);
    }

    if (empty($_POST[&#39;org&#39;])) {
        die(&#39;ERROR: Missing organization&#39;);
    }
    */

    try {
        // perform login and set protocol version to 3.0
        $client = Zend_Gdata_ClientLogin::getHttpClient($this-&amp;gt;user, $this-&amp;gt;pass, &#39;cp&#39;);
        $gdata = new Zend_Gdata($client);
        $gdata-&amp;gt;setMajorProtocolVersion(3);

        // create new entry
        $doc = new DOMDocument();
        $doc-&amp;gt;formatOutput = true;
        $entry = $doc-&amp;gt;createElement(&#39;atom:entry&#39;);
        $entry-&amp;gt;setAttributeNS(&#39;http://www.w3.org/2000/xmlns/&#39; ,&#39;xmlns:atom&#39;, &#39;http://www.w3.org/2005/Atom&#39;);
        $entry-&amp;gt;setAttributeNS(&#39;http://www.w3.org/2000/xmlns/&#39; ,&#39;xmlns:gd&#39;, &#39;http://schemas.google.com/g/2005&#39;);
        $entry-&amp;gt;setAttributeNS(&#39;http://www.w3.org/2000/xmlns/&#39; ,&#39;xmlns:gContact&#39;, &#39;http://schemas.google.com/contact/2008&#39;);
        $doc-&amp;gt;appendChild($entry);

        // add name element
        $name = $doc-&amp;gt;createElement(&#39;gd:name&#39;);
        $entry-&amp;gt;appendChild($name);
        //input-&amp;gt;post()メソッドを利用してXSS対策
        $fullName = $doc-&amp;gt;createElement(&#39;gd:fullName&#39;, $this-&amp;gt;input-&amp;gt;post(&#39;name&#39;, TRUE));
        $name-&amp;gt;appendChild($fullName);

        // add org name element
        $org = $doc-&amp;gt;createElement(&#39;gd:organization&#39;);
        $org-&amp;gt;setAttribute(&#39;rel&#39; ,&#39;http://schemas.google.com/g/2005#work&#39;);
        $entry-&amp;gt;appendChild($org);
        $orgName = $doc-&amp;gt;createElement(&#39;gd:orgName&#39;, $this-&amp;gt;input-&amp;gt;post(&#39;org&#39;, TRUE));
        $org-&amp;gt;appendChild($orgName);

        // add email elements
        $email = $doc-&amp;gt;createElement(&#39;gd:email&#39;);
        $email-&amp;gt;setAttribute(&#39;address&#39;, $this-&amp;gt;input-&amp;gt;post(&#39;mail1&#39;, TRUE));
        $email-&amp;gt;setAttribute(&#39;rel&#39;, &#39;http://schemas.google.com/g/2005#&#39; . (String)$this-&amp;gt;input-&amp;gt;post(&#39;mail1_place&#39;, TRUE));
        $entry-&amp;gt;appendChild($email);

        // add phone elements
        $phone = $doc-&amp;gt;createElement(&#39;gd:phoneNumber&#39;, $this-&amp;gt;input-&amp;gt;post(&#39;phone1&#39;, TRUE));
        $phone-&amp;gt;setAttribute(&#39;rel&#39;, &#39;http://schemas.google.com/g/2005#&#39; . (String)$this-&amp;gt;input-&amp;gt;post(&#39;phone1_place&#39;, TRUE));
        $entry-&amp;gt;appendChild($phone);

        // add web elements
        $web = $doc-&amp;gt;createElement(&#39;gContact:website&#39;);
        $web-&amp;gt;setAttribute(&#39;href&#39;, $this-&amp;gt;input-&amp;gt;post(&#39;web1&#39;, TRUE));
        $web-&amp;gt;setAttribute(&#39;rel&#39;, $this-&amp;gt;input-&amp;gt;post(&#39;web1_place&#39;, TRUE));
        $entry -&amp;gt;appendChild($web);

        // insert entry
        $hoge = $doc-&amp;gt;saveXML();
        //$fp = fopen(&quot;c:\sampleEntry.txt&quot;, &quot;w&quot;);
        //fwrite($fp, $hoge);
        //fclose($fp);

        $entryResult = $gdata-&amp;gt;insertEntry($hoge, &#39;http://www.google.com/m8/feeds/contacts/default/full&#39;);

    } catch (Exception $e) {
        die(&#39;ERROR:&#39; . $e-&amp;gt;getMessage());
    }

    return $entryResult-&amp;gt;id;
}
&lt;/pre&gt;&lt;br /&gt;
頭の部分のコメントアウトはデータ未入力チェックですがバリデーションでデータチェックは行なっているので必要ありません。入力データをxmlにしてgoogleに送るって登録する訳ですがかなり苦労しました。websiteのデータや記念日等についてはgContactというプレフィックスを付けないと登録できないなどドキュメントが英語だったので読んでいない弊害をまざまざと見せつけられちゃんと読まないとなぁと思ってはいますがどうなることやら。&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;&amp;lt;?xml version=&quot;1.0&quot;?&amp;gt;
&amp;lt;atom:entry xmlns:atom=&quot;http://www.w3.org/2005/Atom&quot; xmlns:gd=&quot;http://schemas.google.com/g/2005&quot; xmlns:gContact=&quot;http://schemas.google.com/contact/2008&quot;&amp;gt;
  &amp;lt;gd:name&amp;gt;
    &amp;lt;gd:fullName&amp;gt;&amp;#x85AC;&amp;#x5264; &amp;#x4E09;&amp;#x90CE;&amp;lt;/gd:fullName&amp;gt;
  &amp;lt;/gd:name&amp;gt;
  &amp;lt;gd:organization rel=&quot;http://schemas.google.com/g/2005#work&quot;&amp;gt;
    &amp;lt;gd:orgName&amp;gt;&amp;#xD7;&amp;#xD7;&amp;#x682A;&amp;#x5F0F;&amp;#x4F1A;&amp;#x793E;&amp;lt;/gd:orgName&amp;gt;
  &amp;lt;/gd:organization&amp;gt;
  &amp;lt;gd:email address=&quot;fuga@gmail.com&quot; rel=&quot;http://schemas.google.com/g/2005#work&quot;/&amp;gt;
  &amp;lt;gd:phoneNumber rel=&quot;http://schemas.google.com/g/2005#work_fax&quot;&amp;gt;0300000000&amp;lt;/gd:phoneNumber&amp;gt;
  &amp;lt;gContact:website href=&quot;http://www.fuga.com&quot; rel=&quot;profile&quot;/&amp;gt;
&amp;lt;/atom:entry&amp;gt;
&lt;/pre&gt;&lt;br /&gt;
上記はmodelのpost()メソッドで作成したgoogleに投げるxmlファイルです。こんな形にして登録を行なっています。&lt;br /&gt;
&lt;br /&gt;
またXSS対策として$this-&amp;gt;input-&amp;gt;post()メソッドつかってサニタイズしています。google contactsに登録できる項目はもっと沢山あるので徐々に登録方法を検証していきたいと思っています。また複数のメールアドレスや電話番号そしてwebサイトの登録機能を後で追加したいと思います。&lt;br /&gt;
&lt;br /&gt;
さて大分機能が実装されてきましたがとりあえず次はデータ削除部分を実装する予定です。登録部分ももうちょっと後でモディファイしさらには修正も出来るようにテスト実装する予定です。しかしテストにいったい何日かかってるんだろう？(汗</content><link rel='replies' type='application/atom+xml' href='http://ikkandou.blogspot.com/feeds/1155131186076112045/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://ikkandou.blogspot.com/2010/12/codeignitergooglecontactsapi3.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8585981105500683948/posts/default/1155131186076112045'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8585981105500683948/posts/default/1155131186076112045'/><link rel='alternate' type='text/html' href='http://ikkandou.blogspot.com/2010/12/codeignitergooglecontactsapi3.html' title='CodeIgniterでGoogleContactsAPIのテスト(3)'/><author><name>いのうえしげゆき</name><uri>http://www.blogger.com/profile/13282776910860697563</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4jOg9k9PA94jh2U-QMUKSn508dxoLDOSWZIPK7nQDJGHkMuznNHROdpci2TgtUj31D_6z_squlFDoOp0ZaE9FUKw_FoOxt2mV-CqXjXqbanWfp94dejC7GtJScBvaaz8/s220/kaepapa.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8G9pLg7_KufKQC5kkab2tof7ZkLM8fB0HVd4-TwzEH8Ow2ng3D9fpC2OHu-FVm4cb4IpWCcY1m5XS-0MwdAXy3JrxAH2Hxl8lfJGHthRpiP_CM32gvYo9J09tpN-ZAaNMgcvymrOl9q8/s72-c/GoogleContactsTestAdd_1.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8585981105500683948.post-8264770271219970186</id><published>2010-12-15T14:42:00.002+09:00</published><updated>2010-12-15T14:44:17.157+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CodeIgniter"/><category scheme="http://www.blogger.com/atom/ns#" term="PHP"/><title type='text'>CodeIgniterでGoogleContactsAPIのテスト(2)</title><content type='html'>さてIBMのサイトで公開されているZendFrameworkでGoogleContactsにアクセスするサンプルをCodeIgniter上で動かすテスト本番です。&lt;br /&gt;
&lt;br /&gt;
配布されているサンプルはcontacts-index.phpにて一覧表示を行ないcontacts-delete.php(削除)とcontacts-save.php(新規追加)にリンクが貼られています。削除についてはそれぞれの連絡先のIDが埋め込まれておりそのまま削除を実行し結果を表示。新規追加については入力フォームを表示し自身を呼びだしGoogleへデータ追加した後その追加されたIDを表示するという構造になっています。&lt;br /&gt;
&lt;br /&gt;
これをCodeIgniterに移植するにあたって以下のような方針を立てました。&lt;br /&gt;
&lt;br /&gt;
・メールアドレスとパスワードはconfig_contacts.phpを作成して登録&lt;br /&gt;
・GoogleDataAPIにアクセスするモデルはgdata_model.php。&lt;br /&gt;
このモデル内でのみGoogleDataAPIにアクセスし結果をコントローラcontactsに返す。&lt;br /&gt;
&lt;br /&gt;
○作成するメソッドデータ&lt;br /&gt;
&lt;table&gt;&lt;tr&gt;   &lt;th&gt;ページ&lt;/th&gt;   &lt;th&gt;メソッド名&lt;/th&gt;   &lt;th&gt;URL&lt;/th&gt;   &lt;th&gt;ビュー名&lt;/th&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td&gt;一覧&lt;/td&gt;   &lt;td&gt;index()&lt;/td&gt;   &lt;td&gt;http://localhost/test/&lt;/td&gt;   &lt;td&gt;contacts_view&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td&gt;入力&lt;/td&gt;   &lt;td&gt;add()&lt;/td&gt;   &lt;td&gt;http://localhost/test/add/&lt;/td&gt;   &lt;td&gt;add_contacts_view&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td&gt;登録&lt;/td&gt;   &lt;td&gt;post()&lt;/td&gt;   &lt;td&gt;http://localhost/test/post/&lt;br /&gt;
登録後は一覧表示に遷移&lt;/td&gt;   &lt;td&gt;contacts_view&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td&gt;削除&lt;/td&gt;   &lt;td&gt;delete()&lt;/td&gt;   &lt;td&gt;http://localhost/test/delete/&lt;br /&gt;
削除確認ダイアログを表示&lt;br /&gt;
削除後は一覧表示に遷移&lt;/td&gt;   &lt;td&gt;delete_view&lt;/td&gt;  &lt;/tr&gt;
&lt;/table&gt;&lt;br /&gt;
こんな形で実装していくことにしました。&lt;br /&gt;
&lt;br /&gt;
そんなこんなでまずはindexメソッドを実装してみたいと思います。&lt;br /&gt;
indexメソッドではGoogleDataAPIにアクセスして一覧を取得するという動作を予定しています。&lt;br /&gt;
つまりはIBMサンプルの中のcontacsts-index.phpの内容をmodelに移動して動作させればいいということになりますね。まずはGmailアドレスとパスワードを保持するconfig_contacts.phpから作成しましょう。&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;&amp;lt;?php  if ( ! defined(&#39;BASEPATH&#39;)) exit(&#39;No direct script access allowed&#39;);

$config[&#39;contacts_user&#39;] = &#39;test.kaepapa@gmail.com&#39;;
$config[&#39;contacts_pass&#39;] = &#39;********&#39;;

/* End of file config_contacts.php */
/* Location: ./system/application/config/config_contacts.php */
&lt;/pre&gt;&lt;br /&gt;
パスワードについては*で伏せてあります。これでcontrollerやmodelそしてviewから以下の手法でアクセスすることが出来るようになります。&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;$this-&gt;config-&gt;load(&#39;config_contacts&#39;, TRUE);
$user = $this-&gt;config-&gt;item(&#39;contacts_user&#39;,&#39;config_contacts&#39;);
$pass = $this-&gt;config-&gt;item(&#39;contacts_pass&#39;,&#39;config_contacts&#39;);
&lt;/pre&gt;&lt;br /&gt;
そしてcontacs_index.phpのロジック部分をgdata_model.phpに移設しました。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;&amp;lt;?php

class Gdata_model extends Model {

    private $user;
    private $pass;

    public function __construct() {
        parent::Model();
        // load Zend Gdata libraries
        require_once &#39;Zend/Loader.php&#39;;
        Zend_Loader::loadClass(&#39;Zend_Gdata&#39;);
        Zend_Loader::loadClass(&#39;Zend_Gdata_ClientLogin&#39;);
        Zend_Loader::loadClass(&#39;Zend_Http_Client&#39;);
        Zend_Loader::loadClass(&#39;Zend_Gdata_Query&#39;);
        Zend_Loader::loadClass(&#39;Zend_Gdata_Feed&#39;);

        $this-&gt;config-&gt;load(&#39;config_contacts&#39;, TRUE);
        $this-&gt;user = $this-&gt;config-&gt;item(&#39;contacts_user&#39;,&#39;config_contacts&#39;);
        $this-&gt;pass = $this-&gt;config-&gt;item(&#39;contacts_pass&#39;,&#39;config_contacts&#39;);

    }

    public function getContactsList() {

        try {
            // perform login and set protocol version to 3.0
            $client = Zend_Gdata_ClientLogin::getHttpClient($this-&gt;user, $this-&gt;pass, &#39;cp&#39;);
            $gdata = new Zend_Gdata($client);
            $gdata-&gt;setMajorProtocolVersion(3);

            // perform query and get feed of all results
            $query = new Zend_Gdata_Query(&#39;http://www.google.com/m8/feeds/contacts/default/full&#39;);
            $query-&gt;maxResults = 0;
            $query-&gt;setParam(&#39;orderby&#39;, &#39;lastmodified&#39;);
            $query-&gt;setParam(&#39;sortorder&#39;, &#39;descending&#39;);
            $feed = $gdata-&gt;getFeed($query);

            $data[&#39;title&#39;] = $feed-&gt;title;
            $data[&#39;totalResults&#39;] = $feed-&gt;totalResults;

            // parse feed and extract contact information
            // into simpler objects
            $contacts = array();
            foreach($feed as $entry){
                $obj = new stdClass;
                $xml = simplexml_load_string($entry-&gt;getXML());
                $obj-&gt;edit = $entry-&gt;getEditLink()-&gt;href;
                $obj-&gt;name = (string) $entry-&gt;title;
                $obj-&gt;orgName = (string) $xml-&gt;organization-&gt;orgName;
                $obj-&gt;orgTitle = (string) $xml-&gt;organization-&gt;orgTitle;

                foreach ($xml-&gt;email as $e) {
                    $obj-&gt;emailAddress[] = (string) $e[&#39;address&#39;];
                }

                foreach ($xml-&gt;phoneNumber as $p) {
                    $obj-&gt;phoneNumber[] = (string) $p;
                }
                foreach ($xml-&gt;website as $w) {
                    $obj-&gt;website[] = (string) $w[&#39;href&#39;];
                }

                $contacts[] = $obj;
            }
        } catch (Exception $e) {
            die(&#39;ERROR:&#39; . $e-&gt;getMessage());
        }
        $data[&#39;contacts&#39;] = $contacts;
        return $data;
    }
}

/* End of file gdata_model.php */
/* Location: ./system/application/models/gdata_model.php */
&lt;/pre&gt;&lt;br /&gt;
コンストラクタにてZendGdataライブラリを読み込みと独自設定ファイルを読み込んでいます。それ以外のgetContactsListメソッドについてはほぼcontacts_index.phpをそのまま利用している状況です。&lt;br /&gt;
&lt;br /&gt;
続いてはcontrollerであるcontacts.phpを作成しました。&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;&amp;lt;?php

class Contacts extends Controller {

 public function __construct(){
  parent::Controller();
  $this-&gt;load-&gt;model(&#39;gdata_model&#39;);
 }

 public function index(){
  $data = $this-&gt;gdata_model-&gt;getContactsList();
  $this-&gt;load-&gt;view(&#39;contacts-index&#39;, $data);
 }
}

/* End of file contacts.php */
/* Location: ./system/application/controllers/contacts.php */
&lt;/pre&gt;&lt;br /&gt;
コンストラクタで先程作成したmodelをロードしています。そしてデフォルトメソッドでcontactsの一覧配列を取得してviewに渡しています。&lt;br /&gt;
&lt;br /&gt;
続いてcontacts-index.phpの内容を見てみます。&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;&amp;lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&amp;gt;
&amp;lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; xml:lang=&quot;ja&quot; lang=&quot;ja&quot;&amp;gt;
&amp;lt;head&amp;gt;
 &amp;lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&amp;gt;
&amp;lt;title&amp;gt;Listing contacts&amp;lt;/title&amp;gt;
&amp;lt;style&amp;gt;
 body {
  font-family: Verdana;
 }
 div.name {
  color: red;
  text-decoration: none;
  font-weight: bolder;
 }
 div.entry {
  display: inline;
  float: left;
  width: 450px;
  height: 150px;
  border: 2px solid;
  margin: 10px;
  padding: 5px;
 }
 td {
  vertical-align: top;
 }
 span.links {
  float: right;
 }
&amp;lt;/style&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
 &amp;lt;h2&amp;gt;Contacts&amp;lt;/h2&amp;gt;
 &amp;lt;h2&amp;gt;&amp;lt;?php echo $title ?&amp;gt;&amp;lt;/h2&amp;gt;
 &amp;lt;div&amp;gt;
 &amp;lt;?php echo $totalResults ?&amp;gt; contact(s) found.
 &amp;lt;/div&amp;gt;
 &amp;lt;div&amp;gt;
  &amp;lt;a href=&quot;contacts/add&quot;&amp;gt;Add a new contact&amp;lt;/a&amp;gt;
 &amp;lt;/div&amp;gt;

 &amp;lt;?php
 // display results
 foreach ($contacts as $r) {
 ?&amp;gt;
 &amp;lt;div class=&quot;entry&quot;&amp;gt;
  &amp;lt;div class=&quot;name&quot;&amp;gt;&amp;lt;?php echo (!empty($r-&amp;gt;name)) ? $r-&amp;gt;name : &#39;Name not available&#39;; ?&amp;gt;
  &amp;lt;span class=&quot;links&quot;&amp;gt;&amp;lt;a href=&quot;contacts-delete.php?id=&amp;lt;?php echo $r-&amp;gt;edit; ?&amp;gt;&quot;&amp;gt;Delete&amp;lt;/a&amp;gt;&amp;lt;/span&amp;gt;
  &amp;lt;/div&amp;gt;
  &amp;lt;div class=&quot;data&quot;&amp;gt;
  &amp;lt;table&amp;gt;
   &amp;lt;tr&amp;gt;
   &amp;lt;td&amp;gt;Organization:&amp;lt;/td&amp;gt;
   &amp;lt;td&amp;gt;&amp;lt;?php echo $r-&amp;gt;orgName; ?&amp;gt;&amp;lt;/td&amp;gt;
   &amp;lt;/tr&amp;gt;
   &amp;lt;tr&amp;gt;
   &amp;lt;td&amp;gt;Email:&amp;lt;/td&amp;gt;
   &amp;lt;td&amp;gt;&amp;lt;?php echo @join(&#39;, &#39;, $r-&amp;gt;emailAddress); ?&amp;gt;&amp;lt;/td&amp;gt;
   &amp;lt;/tr&amp;gt;
   &amp;lt;tr&amp;gt;
   &amp;lt;td&amp;gt;Phone:&amp;lt;/td&amp;gt;
   &amp;lt;td&amp;gt;&amp;lt;?php echo @join(&#39;, &#39;, $r-&amp;gt;phoneNumber); ?&amp;gt;&amp;lt;/td&amp;gt;
   &amp;lt;/tr&amp;gt;
   &amp;lt;tr&amp;gt;
   &amp;lt;td&amp;gt;Web:&amp;lt;/td&amp;gt;
   &amp;lt;td&amp;gt;&amp;lt;?php echo @join(&#39;, &#39;, $r-&amp;gt;website); ?&amp;gt;&amp;lt;/td&amp;gt;
   &amp;lt;/tr&amp;gt;
  &amp;lt;/table&amp;gt;
  &amp;lt;/div&amp;gt;
 &amp;lt;/div&amp;gt;
 &amp;lt;?php
 }
 ?&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/pre&gt;&lt;br /&gt;
サンプルからphpコードをごっそりと抜いて一部変数名が変更になっているくらいで済んでしまいました。&lt;br /&gt;
&lt;br /&gt;
これでばっちりと当初と同様連絡先一覧の取得が出来ていますのでCI化が進んでいるといった感じでしょうか。すんなりと進んだように書いてあいますがもちろんいろいろとハマりまくっての結果です。どうも私はまだPHP自体を理解できていないようで変数が空になっていてエラーを乱発してしまったのは内緒です。(汗</content><link rel='replies' type='application/atom+xml' href='http://ikkandou.blogspot.com/feeds/8264770271219970186/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://ikkandou.blogspot.com/2010/12/googlecontactsapi2.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8585981105500683948/posts/default/8264770271219970186'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8585981105500683948/posts/default/8264770271219970186'/><link rel='alternate' type='text/html' href='http://ikkandou.blogspot.com/2010/12/googlecontactsapi2.html' title='CodeIgniterでGoogleContactsAPIのテスト(2)'/><author><name>いのうえしげゆき</name><uri>http://www.blogger.com/profile/13282776910860697563</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4jOg9k9PA94jh2U-QMUKSn508dxoLDOSWZIPK7nQDJGHkMuznNHROdpci2TgtUj31D_6z_squlFDoOp0ZaE9FUKw_FoOxt2mV-CqXjXqbanWfp94dejC7GtJScBvaaz8/s220/kaepapa.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8585981105500683948.post-6701824519949676298</id><published>2010-12-14T16:03:00.006+09:00</published><updated>2010-12-29T00:23:01.334+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CodeIgniter"/><category scheme="http://www.blogger.com/atom/ns#" term="PHP"/><title type='text'>CodeIgniterでGoogleContactsAPIのテスト(1)</title><content type='html'>さてGoogleContactsへPHPからアクセスしてもげもげという話の続きです。&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.ibm.com/developerworks/jp/xml/library/x-phpgooglecontact/index.html&quot;&gt;IBMのサイトにある情報&lt;/a&gt;を参考にGoogleDataAPIとZendFrameworkの使い方を理解すべくちょっとテストです。&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a class=&quot;lightbox&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh61xH5F-IlyRzpPwGQbnBe_YgyR8nAb1ln1f-52V2YYRRiPZiWo6oi0o-fcQVmrjcO3HoMcZSvZeSL-2_Rgc8qsVHkW0UQUSCq9XBHLOIc1UMu2xvljmWjE7pPfPoW0xrW7pq0QeeCy74/s1600/GoogleContactsTest_1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh61xH5F-IlyRzpPwGQbnBe_YgyR8nAb1ln1f-52V2YYRRiPZiWo6oi0o-fcQVmrjcO3HoMcZSvZeSL-2_Rgc8qsVHkW0UQUSCq9XBHLOIc1UMu2xvljmWjE7pPfPoW0xrW7pq0QeeCy74/s1600/GoogleContactsTest_1.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
まずはテストプロジェクトを作成して本日公開されたばかりの&lt;a href=&quot;http://sourceforge.jp/projects/codeigniter/releases/&quot;&gt;CodeIgniter日本語パック&lt;/a&gt;のindex.htmlとsystemフォルダをコピりました。&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a class=&quot;lightbox&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhCZ8B-QUserRRWP5ZkVLw1kPXis2uRjekvqAGTTMuBIUuhrB8Og66aykm4-snNiqTDAOYpWcAZ-9ReWQd83t_SJODTLHWl7e5IH0mulLtbo6rKpBP7mK6Cx6f2XpXHhrC0ZNQLvBntFzM/s1600/GoogleContactsTest_2.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhCZ8B-QUserRRWP5ZkVLw1kPXis2uRjekvqAGTTMuBIUuhrB8Og66aykm4-snNiqTDAOYpWcAZ-9ReWQd83t_SJODTLHWl7e5IH0mulLtbo6rKpBP7mK6Cx6f2XpXHhrC0ZNQLvBntFzM/s320/GoogleContactsTest_2.png&quot; width=&quot;203&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
もちろんtestフォルダの中には&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;RewriteEngine on
RewriteCond $1 !^(index\.php|css|user_guide|.+\.gif$|.+\.jpg$|.+\.png$|.+\.js$|robots\.txt)
RewriteRule ^(.*)$ /test/index.php/$1 [L]
&lt;/pre&gt;&lt;br /&gt;
という内容の.htaccessファイルも作っておきます。&lt;br /&gt;
&lt;br /&gt;
デフォルトのwelcome関係のファイルはとりあえずサクっと削除しておきました。&lt;br /&gt;
このままですと http://localhost/test/ へのアクセスでデフォルトコントローラがないと怒られると思うのでroutes.phpの内容を編集して&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;$route[&#39;default_controller&#39;] = &quot;contacts&quot;;
$route[&#39;scaffolding_trigger&#39;] = &quot;&quot;;
&lt;/pre&gt;&lt;br /&gt;
としてあります。&lt;br /&gt;
&lt;br /&gt;
またCodeIgniter徹底入門の通りconfig.phpの内容も&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;$config[&#39;base_url&#39;] = &quot;http://localhost/test/&quot;;
$config[&#39;index_page&#39;] = &quot;&quot;;
$config[&#39;uri_protocol&#39;] = &quot;PATH_INFO&quot;;
$config[&#39;language&#39;] = &quot;japanese&quot;;
$config[&#39;log_threshold&#39;] = 4;
&lt;/pre&gt;&lt;br /&gt;
とそれぞれ変更してある状態です。&lt;br /&gt;
&lt;br /&gt;
IBMで配布されているサンプルをとりあえずはそのまま使ってみるためにcontacts.phpコントローラを以下のように編集しました。&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;&amp;lt;?php

class Contacts extends Controller {

 function __construct()
 {
  parent::Controller();
 }

 function index()
 {
  $this-&amp;gt;load-&amp;gt;view(&#39;contacts-index&#39;);
 }
}

/* End of file contacts.php */
/* Location: ./system/application/controllers/contacts.php */
&lt;/pre&gt;&lt;br /&gt;
そして http://localhost/test/ にアクセスすると&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a class=&quot;lightbox&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhr4Keh30gmyH_EQbiBzCTNNhnnYIw0pcUAT2OMhemnxxM8IeoxJJq5buReduS9BKRya4KLba13g3l1Zt3Qd0r6KGUZzHlCYLJDPpfkqURE4vAXO8Bee0kTkTV5ZMcGtmJeJ-5ckRveLFk/s1600/GoogleContactsTest_3.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;300&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhr4Keh30gmyH_EQbiBzCTNNhnnYIw0pcUAT2OMhemnxxM8IeoxJJq5buReduS9BKRya4KLba13g3l1Zt3Qd0r6KGUZzHlCYLJDPpfkqURE4vAXO8Bee0kTkTV5ZMcGtmJeJ-5ckRveLFk/s320/GoogleContactsTest_3.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
ばっちりテスト用アカウントに登録されている連絡先情報を取得出来ることが確認できました！ちょっと前の記事なので仕様の変更とかあったら動かないよなぁと思っていたのですがそのまま動いて良かったぁ。じっくりとソースを読み勉強しようと思います。&lt;br /&gt;
&lt;br /&gt;
さてこれを今後ちまちまといじっていく訳ですがとりあえずCodeIgniter上でのDeleteやAdd a new contact.がちゃんと動くようにしてGoogleDataAPIでのアクセスをModelで行なうように変更。取得したデータをViewに表示という風にMVCアプリらしく変更してみる予定です。&lt;br /&gt;
&lt;br /&gt;
wordpressも勉強中だしこのブログのcssやjsもちょっといじりたいし時間が足りません。(汗</content><link rel='replies' type='application/atom+xml' href='http://ikkandou.blogspot.com/feeds/6701824519949676298/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://ikkandou.blogspot.com/2010/12/googlecontactsphp-ibm.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8585981105500683948/posts/default/6701824519949676298'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8585981105500683948/posts/default/6701824519949676298'/><link rel='alternate' type='text/html' href='http://ikkandou.blogspot.com/2010/12/googlecontactsphp-ibm.html' title='CodeIgniterでGoogleContactsAPIのテスト(1)'/><author><name>いのうえしげゆき</name><uri>http://www.blogger.com/profile/13282776910860697563</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4jOg9k9PA94jh2U-QMUKSn508dxoLDOSWZIPK7nQDJGHkMuznNHROdpci2TgtUj31D_6z_squlFDoOp0ZaE9FUKw_FoOxt2mV-CqXjXqbanWfp94dejC7GtJScBvaaz8/s220/kaepapa.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh61xH5F-IlyRzpPwGQbnBe_YgyR8nAb1ln1f-52V2YYRRiPZiWo6oi0o-fcQVmrjcO3HoMcZSvZeSL-2_Rgc8qsVHkW0UQUSCq9XBHLOIc1UMu2xvljmWjE7pPfPoW0xrW7pq0QeeCy74/s72-c/GoogleContactsTest_1.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8585981105500683948.post-2808447309634585675</id><published>2010-12-13T14:03:00.001+09:00</published><updated>2010-12-13T14:04:27.216+09:00</updated><title type='text'>PHPからGoogleDataAPIをいじる。</title><content type='html'>仕事で使うためにPHPとCodeIgniterを勉強しているところでな訳です。&lt;br /&gt;
&lt;br /&gt;
あまり好きなタイプの言語ではないもののやはりユーザが多いということは環境構築ノウハウやレンタルサーバでの対応等についても良好なのでこの選択をしました。&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://code.google.com/intl/ja/apis/gdata/index.html&quot;&gt;GoogleDataAPI&lt;/a&gt;を使ってちょっとGoogleカレンダーや連絡先管理ツールをほげほげするようなものを作る予定で&lt;a href=&quot;http://framework.zend.com/&quot;&gt;ZendFramework&lt;/a&gt;を使ってアクセスする予定。しかしあまり情報がないですなぁ。&lt;br /&gt;
&lt;a href=&quot;http://framework.zend.com/manual/ja/&quot;&gt;ドキュメント&lt;/a&gt;が一部日本語化されていることと&lt;a href=&quot;http://www.ibm.com/developerworks/jp/xml/library/x-phpgooglecontact/index.html&quot;&gt;IBMが公開している情報&lt;/a&gt;等を手掛りになんとか頑張る予定。&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://tokyo-gtug.org/&quot;&gt;TokyoGoogleTechnologyUsersGroup&lt;/a&gt;という団体にも行きついたものの現在はあまり活動していない様子。&lt;br /&gt;
&lt;br /&gt;
webアプリからGoogle提供のサービスをいじろうという需要ってあまりないのかな？とりあえず勉強がてらいろいろテストをする予定です。</content><link rel='replies' type='application/atom+xml' href='http://ikkandou.blogspot.com/feeds/2808447309634585675/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://ikkandou.blogspot.com/2010/12/phpcodeigniter-googledataapi-google.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8585981105500683948/posts/default/2808447309634585675'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8585981105500683948/posts/default/2808447309634585675'/><link rel='alternate' type='text/html' href='http://ikkandou.blogspot.com/2010/12/phpcodeigniter-googledataapi-google.html' title='PHPからGoogleDataAPIをいじる。'/><author><name>いのうえしげゆき</name><uri>http://www.blogger.com/profile/13282776910860697563</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4jOg9k9PA94jh2U-QMUKSn508dxoLDOSWZIPK7nQDJGHkMuznNHROdpci2TgtUj31D_6z_squlFDoOp0ZaE9FUKw_FoOxt2mV-CqXjXqbanWfp94dejC7GtJScBvaaz8/s220/kaepapa.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8585981105500683948.post-2351639294944225931</id><published>2010-12-09T10:33:00.000+09:00</published><updated>2010-12-09T10:33:10.171+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CodeIgniter"/><category scheme="http://www.blogger.com/atom/ns#" term="PHP"/><category scheme="http://www.blogger.com/atom/ns#" term="web製作"/><title type='text'>CodeIgniterでindex.phpを省略する</title><content type='html'>さて先日からCodeIgniterをいじってみている訳ですが先日のHelloWorldの後ようやく購入した徹底入門を読んでいます。&lt;br /&gt;
それに従っていろいろと設定をいじったりしている訳ですがよくもまあここまでと云うほどハマりまくり。&lt;br /&gt;
&lt;br /&gt;
先日のHelloWorldなプロジェクトでアクセスしたlocalhostのURIは&lt;br /&gt;
&lt;br /&gt;
http://localhost/helloWorld/ もしくは http://localhost/index.php/helloWorld/hello/index&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
などとアクセスしていた訳ですが後者のindex.phpが邪魔くさい訳でapacheを利用している場合は.htaccessを使うことで省略することが可能らしいことを知りやってみた訳です。&lt;br /&gt;
&lt;br /&gt;
実際に用いた.htaccessファイルの内容は&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;RewriteEngine on
RewriteCond $1 !^(index\.php|css|user_guide|.+\.gif$|.+\.jpg$|.+\.png$|.+\.js$|robots\.txt)
RewriteRule ^(.*)$ /helloworld/index.php/$1 [L]
&lt;/pre&gt;&lt;br /&gt;
ですが中のドットが一つ抜けてしまっていて30分もハマってしまいましたとさ。&lt;br /&gt;
&lt;br /&gt;
あまりにも一般的な内容ですが自分の忘備録として記事にしました。(笑&lt;br /&gt;
&lt;br /&gt;
なにはともあれ徹底入門を熟読してしっかりとCodeIgniterをマスターしないといけません。ってかその前にPHPがわかっていないという噂もちらほら。加えてhtml+cssやらFireworksとかも覚えたいとかちょっと欲張りすぎかも？(汗</content><link rel='replies' type='application/atom+xml' href='http://ikkandou.blogspot.com/feeds/2351639294944225931/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://ikkandou.blogspot.com/2010/12/codeigniterindexphp.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8585981105500683948/posts/default/2351639294944225931'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8585981105500683948/posts/default/2351639294944225931'/><link rel='alternate' type='text/html' href='http://ikkandou.blogspot.com/2010/12/codeigniterindexphp.html' title='CodeIgniterでindex.phpを省略する'/><author><name>いのうえしげゆき</name><uri>http://www.blogger.com/profile/13282776910860697563</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4jOg9k9PA94jh2U-QMUKSn508dxoLDOSWZIPK7nQDJGHkMuznNHROdpci2TgtUj31D_6z_squlFDoOp0ZaE9FUKw_FoOxt2mV-CqXjXqbanWfp94dejC7GtJScBvaaz8/s220/kaepapa.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8585981105500683948.post-2647065293201993558</id><published>2010-12-07T16:20:00.007+09:00</published><updated>2010-12-29T00:21:00.204+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CodeIgniter"/><category scheme="http://www.blogger.com/atom/ns#" term="PHP"/><title type='text'>HelloWorld of CodeIgniter on eclipse.</title><content type='html'>さて技術ネタ一発目として&lt;a href=&quot;http://codeigniter.com/&quot;&gt;CodeIgniter&lt;/a&gt;ってのを使ってみようとしております。web系の言語としてはいままで&lt;a href=&quot;http://www.oracle.com/technetwork/java/index.html&quot;&gt;Java&lt;/a&gt;一辺倒でしたがそれだけじゃイカンだろってことで&lt;a href=&quot;http://www.php.net/&quot;&gt;php&lt;/a&gt;もと欲張った結果です。&lt;br /&gt;
&lt;br /&gt;
まあJavaもOSSに喧嘩を売りまくっている&lt;a href=&quot;http://www.oracle.com/index.html&quot;&gt;Oracle&lt;/a&gt;の手中に落ちて今後どうなるかわかりませんし他のものも出来たほうがいいのかな？とも思わなくもありませんでしたしね。&lt;br /&gt;
&lt;br /&gt;
phpは以前にもテンプレートエンジンの&lt;a href=&quot;http://www.smarty.net/&quot;&gt;smarty&lt;/a&gt;を使ってちょこっといじったことはあったのですが数年前の話で今元気がありそうなテンプレートエンジンはなんぞや！？と探していたところ行き着いたのがCodeIgniterでした。&lt;br /&gt;
&lt;br /&gt;
まだ国内ではあまり使われてない様子ですが世界ではわりと人気のテンプレートエンジンのようで&lt;a href=&quot;http://codeigniter.jp/&quot;&gt;国内ユーザ会&lt;/a&gt;が提供する&lt;a href=&quot;http://codeigniter.jp/user_guide_ja/&quot;&gt;ユーザーズガイド&lt;/a&gt;がしっかりしているのが利点でしょうか。&lt;br /&gt;
&lt;br /&gt;
php再入門にあたり今回構築した環境はWindows上に&lt;a href=&quot;http://www.apachefriends.org/jp/xampp-windows.html&quot;&gt;xampp&lt;/a&gt;でphpとApacheそしてMySQLをお手軽にインストールしてJavaで使い慣れたeclipseのPDT環境です。インストール先はそれぞれC:\直下としてあります。eclipseのworkspaceはそのままApacheでアクセス出来るようにC:\xampp\htdocsとしてあります。&lt;br /&gt;
&lt;br /&gt;
途中xamppのapacheが起動しなくなってハマりましたが原因はskypeを起動していたからでした。skypeがポート80を使っていたので設定を変更することで回避できましたとさ。(汗&lt;br /&gt;
ってなことでeclipseを起動してさっさとプロジェクトを作成してみましょう。&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a class=&quot;lightbox&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqF4ZdLqwHECKcztoadZDFBqwLAmP0fIJrcdJBSaJvhnyveH2RQpe5qCyYiyzjSJzcXuckxBzlCwdLh9eHo0QnvHUd-WjfvDMMLX6RJBMtms0L2AnhWEZqWxGGayBsDvZ8ZmOCqhBtWkY/s1600/CodeIgniterHelloWorld_1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;219&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqF4ZdLqwHECKcztoadZDFBqwLAmP0fIJrcdJBSaJvhnyveH2RQpe5qCyYiyzjSJzcXuckxBzlCwdLh9eHo0QnvHUd-WjfvDMMLX6RJBMtms0L2AnhWEZqWxGGayBsDvZ8ZmOCqhBtWkY/s320/CodeIgniterHelloWorld_1.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
PHPエクスプローラのウインドウで右クリック[新規]-[PHPプロジェクト]を選択します。すると以下の新規PHPプロジェクトウインドウが開きます。&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a class=&quot;lightbox&quot;  href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfoAcf2rfDd3_AnpoxfptfPES92fBc-nmp-zXnmxTVK1kF2llmkFW35o6rDKqf7CwvgsAvEQyGSGNSoLXLk5HHwtozvTE-sucCtp3MoGNan_lC5I8nB6ZVqfZeNNK7-BuquutN9OJhKcc/s1600/CodeIgniterHelloWorld_2.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfoAcf2rfDd3_AnpoxfptfPES92fBc-nmp-zXnmxTVK1kF2llmkFW35o6rDKqf7CwvgsAvEQyGSGNSoLXLk5HHwtozvTE-sucCtp3MoGNan_lC5I8nB6ZVqfZeNNK7-BuquutN9OJhKcc/s320/CodeIgniterHelloWorld_2.png&quot; width=&quot;260&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
プロジェクト名はとりあえず「helloWorld」とありきたりな名称で。完了ボタンでプロジェクトが作成されます。Wを大文字にするあたりphpのお作法がわかっていませんがとりあえずってことでお許しください。&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a class=&quot;lightbox&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhggiy9uIEqeuJcfRS6oU3Atb9oJf8Nu62nmvcgDdV08Fens9vbOuUCQj8lDxJmIXGimBcMbS4QspT8sDU_k5F9XDwhwgr0_qZbu6_Wz5G6IC0VZnM0JE-p_1xD6sMF5XI7stm5mCY1TaQ/s1600/CodeIgniterHelloWorld_3.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhggiy9uIEqeuJcfRS6oU3Atb9oJf8Nu62nmvcgDdV08Fens9vbOuUCQj8lDxJmIXGimBcMbS4QspT8sDU_k5F9XDwhwgr0_qZbu6_Wz5G6IC0VZnM0JE-p_1xD6sMF5XI7stm5mCY1TaQ/s1600/CodeIgniterHelloWorld_3.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
これでhelloWorldプロジェクトが作成されました。&lt;br /&gt;
&lt;br /&gt;
ではCodeIgniterのファイル群を突っ込みます。一つのファイル群を複数プロジェクトから参照することも出来ると思いますがバージョン依存等のことも考えたりするととても小さなCodeIgniterですからプロジェクトにそのまま含めてしまうのも一つの手かな？とこの方法を選択しました。&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a class=&quot;lightbox&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTBpcGZuMRVpkXGc57DoTdWLbuvcrpqU7nyJt93-zOkcY-zR25qgqPNb4OWV-vbxjGkIq7kHzTR0q9lS3_IptFFYpby7vo7ZOPhRy8saNT-sqX6rDnf3C3SfEqQ8kaQ1yRLmQEOoXg0sQ/s1600/CodeIgniterHelloWorld_4.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;228&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTBpcGZuMRVpkXGc57DoTdWLbuvcrpqU7nyJt93-zOkcY-zR25qgqPNb4OWV-vbxjGkIq7kHzTR0q9lS3_IptFFYpby7vo7ZOPhRy8saNT-sqX6rDnf3C3SfEqQ8kaQ1yRLmQEOoXg0sQ/s320/CodeIgniterHelloWorld_4.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
最新のCodeIgniterを日本語ドキュメントが欲しい場合にはこちら[http://sourceforge.jp/projects/codeigniter/releases]からそして現在のように最新版が本家にある場合はこちら[http://codeigniter.com/]からダウンロードしてzipファイルの中にあるsystemフォルダとindex.phpファイルをプロジェクトフォルダ内にコピーしてください。&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a class=&quot;lightbox&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhF-IDKqJ-qPjA8NdtBDauDOglKFm_0VR08xEkB4n5hgJBfcjRuc_SrrCBmHrO0pDjuZODb94gZa7VfV-rzpFreRFj4dyN2_YhzTEN-cJDOg94FQz_2yNlFQWn9rckZg028xQztMBxFTLg/s1600/CodeIgniterHelloWorld_5.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhF-IDKqJ-qPjA8NdtBDauDOglKFm_0VR08xEkB4n5hgJBfcjRuc_SrrCBmHrO0pDjuZODb94gZa7VfV-rzpFreRFj4dyN2_YhzTEN-cJDOg94FQz_2yNlFQWn9rckZg028xQztMBxFTLg/s320/CodeIgniterHelloWorld_5.png&quot; width=&quot;268&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
そしてPHPエクスプローラ上でプロジェクトをリフレッシュすると先程コピーしたsystemフォルダとindex.phpファイルが表示されます。&lt;br /&gt;
&lt;br /&gt;
&lt;div cclass=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a class=&quot;lightbox&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjp4TGN49Hp3ro6TrwQLMzF2QouUesSzyuoKy2A_Iv-4sxJPNWaE5Z1wThk8yncVS2KBOOcfE1QNswSqqQxdiADkHuZ8JXeakKqTFjpxfhC7PoWjgg9rLHfOYfAL69vW0fJfPmqxwoSjtw/s1600/CodeIgniterHelloWorld_6.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjp4TGN49Hp3ro6TrwQLMzF2QouUesSzyuoKy2A_Iv-4sxJPNWaE5Z1wThk8yncVS2KBOOcfE1QNswSqqQxdiADkHuZ8JXeakKqTFjpxfhC7PoWjgg9rLHfOYfAL69vW0fJfPmqxwoSjtw/s1600/CodeIgniterHelloWorld_6.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
ではちゃんとCodeIgniterが動くかどうかの確認をしてみたいと思います。&lt;br /&gt;
http://localhost/helloWorld/ にアクセスしてみると&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a class=&quot;lightbox&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgr9j2qsJ4XlQE1xxuroM9_xxDkID9ioI4mfbQ1bfp1U3EPLfpMtUN1IZkQHnALwMS2b7goLzDyL3AtDhii1gmH-Szk7oJaozg0CcCnngJ-9YExFWh1rCk6bgSjSlOnzfXjEphqdOCElgU/s1600/CodeIgniterHelloWorld_7.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;266&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgr9j2qsJ4XlQE1xxuroM9_xxDkID9ioI4mfbQ1bfp1U3EPLfpMtUN1IZkQHnALwMS2b7goLzDyL3AtDhii1gmH-Szk7oJaozg0CcCnngJ-9YExFWh1rCk6bgSjSlOnzfXjEphqdOCElgU/s320/CodeIgniterHelloWorld_7.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
上記のようにデフォルトのwelcomeクラスが表示されちゃんと動いていることが確認できました。めでたし!&lt;br /&gt;
&lt;br /&gt;
もしも表示されないときはapacheがちゃんと動いているか等xamppのコントロールパネルで確認してみてください。&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a class=&quot;lightbox&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6k4GCIYUnKsmTWngm9duudvOJe_UqoaeA-k-TI7cT6lOsWuz4hcF9WLRvoofw4_1RVXDHsBa_-KyN8axyZhyqs8xRjslNwlWwMl4zNCMPgPKTklL7PIZPgsF9gnvPcFP23BgV_3wEtic/s1600/CodeIgniterHelloWorld_8.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;270&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6k4GCIYUnKsmTWngm9duudvOJe_UqoaeA-k-TI7cT6lOsWuz4hcF9WLRvoofw4_1RVXDHsBa_-KyN8axyZhyqs8xRjslNwlWwMl4zNCMPgPKTklL7PIZPgsF9gnvPcFP23BgV_3wEtic/s320/CodeIgniterHelloWorld_8.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
で終わってしまってはちょと理解というものがなさすぎなので検証してみましょう。&lt;br /&gt;
&lt;br /&gt;
http://localhost/helloWorld/ にアクセスした時に読み込まれるファイルはプロジェクトの中にコピーしたCodeIgniterに含まれていたhelloWorld/index.phpです。このファイルを覗いてみるとsystemフォルダやapplicationフォルダ等が指定されています。systemフォルダの場所を指定できるということは今回のようにプロジェクトにsystemファイルをごっそり入れない場合はここで指定してあげるのでしょうねぇ。&lt;br /&gt;
&lt;br /&gt;
index.phpの中でapplicationフォルダが読み込まれる環境があるってことはその中にブラウザに表示されたsystem/application/controllers/welcome.php等のファイルを読み込む鍵があるはずってことで探してみるとsyste/application/config/routes.phpの中にありましたよ。&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;$route[&#39;default_controller&#39;] = &quot;welcome&quot;;
$route[&#39;scaffolding_trigger&#39;] = &quot;&quot;;
&lt;/pre&gt;&lt;br /&gt;
ここでデフォルトで読み込まれるコントローラが指定されていました。自分で作ったコントローラをデフォルトで表示させたいときはここで指定してあげればよさそうです。syste/application/configフォルダには他にもconfig.phpやdatabase.php等の設定ファイルがあるのでここでいろいろと設定することが出来るのでしょう。&lt;br /&gt;
&lt;br /&gt;
ではwelcome_message.phpとwelcome.phpを覗いてみましょう。&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;&amp;lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&amp;gt;
&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
&amp;lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&amp;gt;
&amp;lt;title&amp;gt;CodeIgniterへようこそ&amp;lt;/title&amp;gt;

&amp;lt;style type=&quot;text/css&quot;&amp;gt;
～省略～
&amp;lt;/style&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;

&amp;lt;h1&amp;gt;CodeIgniterへようこそ!&amp;lt;/h1&amp;gt;

&amp;lt;p&amp;gt;今ご覧のこのページは、CodeIgniterによって動的に生成されました。&amp;lt;/p&amp;gt;

&amp;lt;p&amp;gt;このページを編集したい場合は、次の場所にあります:&amp;lt;/p&amp;gt;
&amp;lt;code&amp;gt;system/application/views/welcome_message.php&amp;lt;/code&amp;gt;

&amp;lt;p&amp;gt;このページのコントローラは次の場所にあります:&amp;lt;/p&amp;gt;
&amp;lt;code&amp;gt;system/application/controllers/welcome.php&amp;lt;/code&amp;gt;

&amp;lt;p&amp;gt;CodeIgniterを使うのが初めてなら、&amp;lt;a href=&quot;user_guide_ja/&quot;&amp;gt;ユーザガイド&amp;lt;/a&amp;gt;を読むことから始めてください。&amp;lt;/p&amp;gt;


&amp;lt;p&amp;gt;&amp;lt;br /&amp;gt;このページは、{elapsed_time} 秒でレンダリングされました。&amp;lt;/p&amp;gt;

&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/pre&gt;&lt;br /&gt;
見ればそのままなんのことはなく普通のhtmlファイルな内容でした。&lt;br /&gt;
じゃあコントローラの方はなにをやってるの？と覗くと&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;&amp;lt;?php

class Welcome extends Controller {

    function Welcome(){
        parent::Controller(); 
    }
 
    function index(){
        $this-&amp;gt;load-&amp;gt;view(&#39;welcome_message&#39;);
    }
}

/* End of file welcome.php */
/* Location: ./system/application/controllers/welcome.php */
&lt;/pre&gt;&lt;br /&gt;
Controllerクラスを継承したWolcomeクラス内でコンストラクタとindexメソッドが存在してindexメソッドの中でviewを呼びだしているだけでした。&lt;br /&gt;
&lt;br /&gt;
しかしここまで来てなんとなくHelloWorldしてみるときにやる必要のありそうなことがだいたい把握出来たような気がします。&lt;br /&gt;
&lt;br /&gt;
では実際にHelloWorldに挑戦といってみましょう。&lt;br /&gt;
&lt;br /&gt;
上記の例を見る限りcontrollerからprint &quot;Hello World!!!&quot;；とかでもいいような気もしますがCodeIgniterはMVCアプリケーショを作るためのテンプレートエンジンですからちゃんとmodelとviewも使ったものにしてみましょう。といってもmodelでなにをやるかが一番の問題ではありますが…。&lt;br /&gt;
&lt;br /&gt;
ということでまずはmodelから作成します。helloWorld/system/application/models/hello_model.phpファイルを作成しました。&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;&amp;lt;?php

class Hello_model extends Model{

    function __construct(){
        parent::Model();
    }

    function hello(){
        return &quot;Hello World!!!&quot;;
    }
}
/* End of file hello_model.php */
/* Location: ./helloWorld/models/hello_model.php */
&lt;/pre&gt;&lt;br /&gt;
Modelクラスを継承したHello_modelクラスを作成。コンストラクタメソッドの__construct()と表示する文字列を返すHello()メソッドを作りました。コンストラクタはphp5でのお作法に乗っ取っております。結局やれることといったら文字列返すくらいしか思いつきませんでした。(笑&lt;br /&gt;
&lt;br /&gt;
続いてはviewの作成です。helloWorld/system/application/views/hello_message.phpを作成します。&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;&amp;lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot; &quot;http://www.w3.org/TR/html4/loose.dtd&quot;&amp;gt;
&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
    &amp;lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot;&amp;gt;
    &amp;lt;title&amp;gt;&amp;lt;?php echo $title;?&amp;gt;&amp;lt;/title&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
    &amp;lt;?php echo $hello;?&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/pre&gt;&lt;br /&gt;
としました。titleと挨拶の文字列を展開するだけのものです。&lt;br /&gt;
&lt;br /&gt;
最後にcontrollerの作成です。helloWorld/system/application/controllers/hello.phpを作成します。&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;&amp;lt;?php
class Hello extends Controller{

    function __construct(){
        parent::Controller();
    }

    function index(){
        //hello_modelの呼出し
        $this-&amp;gt;load-&amp;gt;model(&#39;hello_model&#39;);
        //hello_modelのhelloメソッドを呼びだして文字列を代入
        $data[&#39;hello&#39;] = $this-&amp;gt;hello_model-&amp;gt;hello();
        //titleを指定
        $data[&#39;title&#39;] = &quot;HelloWorld of CodeIgniter on eclipse.&quot;;
        // viewを呼んで値を渡す
        $this-&amp;gt;load-&amp;gt;view(&#39;hello_message&#39;,$data);
    }
}
/* End of file hello.php */
/* Location: ./helloWorld/controllers/hello.php */
&lt;/pre&gt;&lt;br /&gt;
としました。Controllerクラスを継承したHelloクラスでコンストラクタメソッドの__construct()では親クラスControllerのコンストラクタを呼びだしています。またデフォルトで呼ばれるとのことのindex()メソッドを実装してここでモデルを呼びだし配列に文字列をセットしてviewに渡すという処理を行なっています。&lt;br /&gt;
&lt;br /&gt;
これで動くはず…。確認に http://localhost/helloworld/index.php/hello/index/ へアクセスしてみると。&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a class=&quot;lightbox&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzuXvRHcI0VSqGFFTZ2rXd_YxdgAjRIuY2w2T5b3WtfefWM0DcI5TnfO0B7uH-zjwRGm2OC9Z1OsLJg20NUHk5H5k8u-U9kn_xRpnNPWqd-3DRRc8zqjoP4lNk8xtXi2FNXlaS9J6KCzM/s1600/CodeIgniterHelloWorld_9.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;176&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzuXvRHcI0VSqGFFTZ2rXd_YxdgAjRIuY2w2T5b3WtfefWM0DcI5TnfO0B7uH-zjwRGm2OC9Z1OsLJg20NUHk5H5k8u-U9kn_xRpnNPWqd-3DRRc8zqjoP4lNk8xtXi2FNXlaS9J6KCzM/s320/CodeIgniterHelloWorld_9.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
ばっちり動いてくれました。&lt;br /&gt;
&lt;br /&gt;
ではこのhelloクラスがデフォルトで表示されるように先程のdefault_controllerにhelloクラスを指定してみましょう。&lt;br /&gt;
&lt;br /&gt;
syste/application/config/routes.phpの中で&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;$route[&#39;default_controller&#39;] = &quot;hello&quot;;
$route[&#39;scaffolding_trigger&#39;] = &quot;&quot;;
&lt;/pre&gt;&lt;br /&gt;
と変更し http://localhost/helloworld/ にアクセスしてみると先程のwelcomeメッセージに代わって作成したhelloクラスが動作していることが確認できました。&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a class=&quot;lightbox&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTkez1Yk9NchYA7dZHJ9CBemELKwrMjFJ2Lzy_XiwVpbSe-zCfCFYkkJ-N6l1I-tHSZk_hykG9Ud5FIahTpUdWP8J31sKOpX612FAhyguFAkOxExhHtPfdBN1w7qToW261dVcNZ_E1kl4/s1600/CodeIgniterHelloWorld_10.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;222&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTkez1Yk9NchYA7dZHJ9CBemELKwrMjFJ2Lzy_XiwVpbSe-zCfCFYkkJ-N6l1I-tHSZk_hykG9Ud5FIahTpUdWP8J31sKOpX612FAhyguFAkOxExhHtPfdBN1w7qToW261dVcNZ_E1kl4/s320/CodeIgniterHelloWorld_10.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
いろいろとハマりどころがありそうですがなんとかHelloWorldしてみることが出来たようです。ちょっと安堵。(笑</content><link rel='replies' type='application/atom+xml' href='http://ikkandou.blogspot.com/feeds/2647065293201993558/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://ikkandou.blogspot.com/2010/12/helloworld-of-codeigniter-on-eclipse.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8585981105500683948/posts/default/2647065293201993558'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8585981105500683948/posts/default/2647065293201993558'/><link rel='alternate' type='text/html' href='http://ikkandou.blogspot.com/2010/12/helloworld-of-codeigniter-on-eclipse.html' title='HelloWorld of CodeIgniter on eclipse.'/><author><name>いのうえしげゆき</name><uri>http://www.blogger.com/profile/13282776910860697563</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4jOg9k9PA94jh2U-QMUKSn508dxoLDOSWZIPK7nQDJGHkMuznNHROdpci2TgtUj31D_6z_squlFDoOp0ZaE9FUKw_FoOxt2mV-CqXjXqbanWfp94dejC7GtJScBvaaz8/s220/kaepapa.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqF4ZdLqwHECKcztoadZDFBqwLAmP0fIJrcdJBSaJvhnyveH2RQpe5qCyYiyzjSJzcXuckxBzlCwdLh9eHo0QnvHUd-WjfvDMMLX6RJBMtms0L2AnhWEZqWxGGayBsDvZ8ZmOCqhBtWkY/s72-c/CodeIgniterHelloWorld_1.png" height="72" width="72"/><thr:total>0</thr:total></entry></feed>