<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>sharedhat - Personal blog of Noritaka Horio &#187; blog</title>
	<atom:link href="http://sharedhat.com/category/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://sharedhat.com</link>
	<description>WebデザインからPHP、Javascriptなどのプログラミングに関係する情報を掲載しています。活動中のプロジェクト情報も掲載しています。</description>
	<lastBuildDate>Mon, 11 Apr 2011 05:00:30 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Aptana3 Bundleを作成する – テンプレートの作成</title>
		<link>http://sharedhat.com/blog/1744/</link>
		<comments>http://sharedhat.com/blog/1744/#comments</comments>
		<pubDate>Mon, 11 Apr 2011 05:00:30 +0000</pubDate>
		<dc:creator>horry</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[aptana3]]></category>
		<category><![CDATA[bundle]]></category>
		<category><![CDATA[template]]></category>

		<guid isPermaLink="false">http://sharedhat.com/?p=1744</guid>
		<description><![CDATA[今回はテンプレートの作成について解説します。 テンプレートを作成すると、いつもよく利用しているファイルなどをテンプレートから作成することができます。 また、テンプレート内にプレースホルダーを指定すると、ファイル作成時に特 [...]]]></description>
			<content:encoded><![CDATA[<p>今回はテンプレートの作成について解説します。<br />
テンプレートを作成すると、いつもよく利用しているファイルなどをテンプレートから作成することができます。</p>
<p>また、テンプレート内にプレースホルダーを指定すると、ファイル作成時に特定の値を埋め込んで、新しいファイルを作成してくれます。</p>
<p>今回のサンプルバンドルを作成したので、参考にしてください。<br />
<a href="http://dl.dropbox.com/u/603849/example.ruble-template.zip">http://dl.dropbox.com/u/603849/example.ruble-template.zip</a></p>
<p><span id="more-1744"></span></p>
<h3>テンプレート定義</h3>
<h4>テンプレートファイルの作成</h4>
<p><strong>templatesディレクトリの直下</strong>にテンプレートファイルを作成します。<br />
テンプレートファイル名やテンプレートファイルは何でもかまわないです。</p>
<p>ここではHTML5のテンプレートファイルを作成します。<br />
templatesディレクトリにテンプレートファイルを作成します。</p>
<p>[shell]<br />
templates/html5_default_template.html<br />
[/shell]</p>
<h4>テンプレートの定義</h4>
<p>次にテンプレートの定義ファイルを作成します。<br />
テンプレート定義ファイルは<strong>templatesディレクトリの直下にtemplates.rbという名前で作成します。</strong></p>
<p>スニペットと同様に最初にrubleモジュールを読み込みます。</p>
<p>[ruby]<br />
require &#8216;ruble&#8217;<br />
[/ruby]</p>
<p>そして肝心のテンプレート定義を記述します。<br />
ここではテンプレート中のプレースフォルダーを環境変数で置換して結果をテンプレートの内容として返しています。<br />
プレースフォルダーは${変数名}という形式でテンプレート内に記述します。</p>
<p>環境変数は下記のページに掲載されています。</p>
<p><strong>環境変数一覧:</strong><br />
<a href="http://wiki.appcelerator.org/display/tis/Ruble+environment+variables">http://wiki.appcelerator.org/display/tis/Ruble+environment+variables</a></p>
<p>[ruby]<br />
require &#8216;ruble&#8217;</p>
<p>template [template_name] do |tmpl|</p>
<p>	template_file = &#8220;#{ENV['TM_BUNDLE_SUPPORT']}/../templates/[template_file_name]&#8221;</p>
<p>	tmpl.filetype = [file_type]<br />
	tmpl.invoke do |context|<br />
		raw_contents = IO.read(template_file)<br />
		raw_contents.gsub(/\$\{([^}]*)\}/) { |match| ENV[match[2..-2]] }<br />
	end</p>
<p>end<br />
[/ruby]</p>
<p>各項目は下記の通りになります。</p>
<table>
<tr>
<th>template_name</th>
<td>テンプレート名です。<br />この名称でメニューに表示されます。</td>
</tr>
<tr>
<th>template_file_name</th>
<td>テンプレートのファイル名です。</td>
</tr>
<tr>
<th>file_type</th>
<td>テンプレートのファイルタイプです。<br />*.htmlと指定した場合はhtmlファイルの作成時にテンプレートの選択肢に表示されます。</td>
</tr>
</table>
<p>最終的なテンプレート定義は下記の通りです。</p>
<p>[ruby]<br />
require &#8216;ruble&#8217;</p>
<p>#HTML5 Template file<br />
template &#8216;HTML5 Template file&#8217; do |tmpl|<br />
	tmpl.filetype = &#8216;*.html&#8217;<br />
	tmpl.invoke do |context|<br />
		template_file = &#8220;#{ENV['TM_BUNDLE_SUPPORT']}/../templates/html5_default_template.html&#8221;<br />
		raw_contents = IO.read(template_file)<br />
		raw_contents.gsub(/\$\{([^}]*)\}/) { |match| ENV[match[2..-2]] }<br />
	end<br />
end<br />
[/ruby]</p>
<h3>テンプレートの動作確認</h3>
<p>バンドルのディレクトリからcache.yamlを削除して、Bundlesビューより再読み込みしてみます。<br />
そして、ファイルメニューのNew From Templateからテンプレートを選択します。</p>
<p><a href="http://sharedhat.com/wp-content/uploads/2011/04/img_template.png"><img src="http://sharedhat.com/wp-content/uploads/2011/04/img_template.png" alt="" title="テンプレートメニュー" width="734" height="150" class="aligncenter size-full wp-image-1756" /></a></p>
<p>無事テンプレートからファイルが作成され、プレースホルダーが置き換わっていたら完了です。<br />
<strong>Similar Posts:</strong>
<ul class="similar-posts">
<li><a href="http://sharedhat.com/blog/1731/" title="Aptana3 Bundleを作成する &#8211; バンドル作成の準備">Aptana3 Bundleを作成する &#8211; バンドル作成の準備</a></li>
<li><a href="http://sharedhat.com/blog/1178/" title="concrete5でTinyMCEのテンプレートプラグインを使用する">concrete5でTinyMCEのテンプレートプラグインを使用する</a></li>
<li><a href="http://sharedhat.com/blog/1759/" title="Aptana3 Bundleを作成する – スニペット作成">Aptana3 Bundleを作成する – スニペット作成</a></li>
<li><a href="http://sharedhat.com/blog/1318/" title="Concrete5で翻訳ファイルを作る早いやり方">Concrete5で翻訳ファイルを作る早いやり方</a></li>
<li><a href="http://sharedhat.com/blog/1218/" title="Concrete5のテーマについての基礎知識">Concrete5のテーマについての基礎知識</a></li>
</ul>
<p><!-- Similar Posts took 4.498 ms --></p>
<div class="wp-social-bookmark-menu"><ul class="socials"><li class="script-style"><a href="http://scriptandstyle.com/submit?url=http://sharedhat.com/blog/1744/&title=Aptana3 Bundleを作成する – テンプレートの作成" title="Submit this to Script & Style"> </a></li><li class="blinklist"><a href="http://www.blinklist.com/index.php?Action=Blink/addblink.php&Url=http://sharedhat.com/blog/1744/&Title=Aptana3 Bundleを作成する – テンプレートの作成" title="Share this on Blinklist"> </a></li><li class="delicious"><a href="http://del.icio.us/post?url=http://sharedhat.com/blog/1744/&title=Aptana3 Bundleを作成する – テンプレートの作成" title="Share this on del.icio.us"> </a></li><li class="digg"><a href="http://digg.com/submit?phase=2&url=http://sharedhat.com/blog/1744/&title=Aptana3 Bundleを作成する – テンプレートの作成" title="Digg this!"> </a></li><li class="furl"><a href="http://www.furl.net/storeIt.jsp?t=Aptana3 Bundleを作成する – テンプレートの作成&u=http://sharedhat.com/blog/1744/" title="Share this on Furl"> </a></li><li class="reddit"><a href="http://reddit.com/submit?url=http://sharedhat.com/blog/1744/&title=Aptana3 Bundleを作成する – テンプレートの作成" title="Share this on Reddit"> </a></li><li class="yahoo"><a href="http://myweb2.search.yahoo.com/myresults/bookmarklet?t=Aptana3 Bundleを作成する – テンプレートの作成&u=http://sharedhat.com/blog/1744/" title="Save this to Yahoo MyWeb"> </a></li><li class="stumble"><a href="http://www.stumbleupon.com/submit?url=http://sharedhat.com/blog/1744/&title=Aptana3 Bundleを作成する – テンプレートの作成" title="Stumble upon something good? Share it on StumbleUpon"> </a></li><li class="technorati"><a href="http://technorati.com/faves?add=http://sharedhat.com/blog/1744/" title="Share this on Technorati"> </a></li><li class="mixx"><a href="http://www.mixx.com/submit?page_url=http://sharedhat.com/blog/1744/&amp;title=Aptana3 Bundleを作成する – テンプレートの作成" title="Share this on Mixx"> </a></li><li class="myspace"><a href="http://www.myspace.com/Modules/PostTo/Pages/?u=http://sharedhat.com/blog/1744/&amp;t=Aptana3 Bundleを作成する – テンプレートの作成" title="Post this to MySpace"> </a></li><li class="designfloat"><a href="http://www.designfloat.com/submit.php?url=http://sharedhat.com/blog/1744/&amp;title=Aptana3 Bundleを作成する – テンプレートの作成" title="Submit this to DesignFloat"> </a></li><li class="facebook"><a href="http://www.facebook.com/share.php?u=http://sharedhat.com/blog/1744/&amp;t=Aptana3 Bundleを作成する – テンプレートの作成" title="Share this on Facebook"> </a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://sharedhat.com/blog/1744/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Aptana3 Bundleを作成する – スニペット作成</title>
		<link>http://sharedhat.com/blog/1759/</link>
		<comments>http://sharedhat.com/blog/1759/#comments</comments>
		<pubDate>Mon, 11 Apr 2011 03:53:03 +0000</pubDate>
		<dc:creator>horry</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[aptana3]]></category>
		<category><![CDATA[bundle]]></category>
		<category><![CDATA[snippets]]></category>

		<guid isPermaLink="false">http://sharedhat.com/?p=1759</guid>
		<description><![CDATA[今回はスニペットの作成について解説します。 スニペットはよく使うコードの断片を挿入できる便利な機能です。 挿入位置はファイルのカーソル位置に挿入します。 今回のスニペットのサンプルを作成したので、興味のある人は解凍してb [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://sharedhat.com/wp-content/uploads/2011/04/img_scope.png"><img src="http://sharedhat.com/wp-content/uploads/2011/04/img_scope.png" alt="" title="スニペット" width="734" height="187" class="aligncenter size-full wp-image-1766" /></a></p>
<p>今回はスニペットの作成について解説します。<br />
スニペットはよく使うコードの断片を挿入できる便利な機能です。<br />
挿入位置はファイルのカーソル位置に挿入します。</p>
<p>今回のスニペットのサンプルを作成したので、興味のある人は解凍してbundlesディレクトリにおいてください。<br />
メニューにExample Bundleと表示されるはずです。</p>
<p><strong>スニペットサンプル:</strong><br />
<a href="http://dl.dropbox.com/u/603849/example.ruble-snippets.zip">http://dl.dropbox.com/u/603849/example.ruble-snippets.zip</a></p>
<p><span id="more-1759"></span></p>
<h3>スニペットファイルを作る</h3>
<p>まず、スニペットを記述するファイルを作成します。<br />
ファイル名はsnippets.rbもしくは、サフィックスが_snippets.rbとなる形にします。</p>
<p>ファイルはsnippetsディレクトリに格納します。</p>
<p>使い分けはスニペットが少ない場合と複数のスニペットを分割して管理したい場合とで分けるといいと思います。</p>
<h4>例1 スニペットが少ない場合</h4>
<p>snippets.rbを作成して、すべてのスニペットをこのファイルに記述します。<br />
[shell]<br />
/snippets/snippets.rb<br />
[/shell]</p>
<h4>例2 スニペットを分類して管理する場合</h4>
<p>データベース、ビュー、その他などに分類する場合はファイルをそれぞれ分けて、ファイル名の最後が_snippets.rbになるようにします。</p>
<p>[shell]<br />
/snippets/db_snippets.rb<br />
/snippets/utils_snippets.rb<br />
/snippets/view_snippets.rb<br />
[/shell]</p>
<h3>スニペットを記述する</h3>
<p>スニペットファイルを開いて、コードを記述します。</p>
<h4>モジュールの読み込み</h4>
<p>ファイルの先頭に下記のコードを記述して、モジュールを読み込みます。</p>
<p>[ruby]<br />
require &#8216;ruble&#8217;<br />
[/ruby]</p>
<h4>スニペットの定義</h4>
<p>フォーマットは下記のような形になります。</p>
<p>[ruby]<br />
snippet [name] do |s|<br />
	s.scope = [scope]<br />
	s.trigger = [trigger]<br />
	s.expansion = [expansion]<br />
end<br />
[/ruby]</p>
<p>それぞれの項目の説明は次のようになります。</p>
<table>
<tr>
<th>name</th>
<td>スニペットの名称です。<br />バンドル毎にユニークな名称である必要があります。メニューの表示にも利用されるのでわかりやすい名称がいいと思います。</td>
</tr>
<tr>
<th>scope</th>
<td>
スニペットの有効範囲です。<br />
スニペットを利用できる条件を指定することができます。<br />
<strong>Shift + Control + Pを押すことで、カーソル位置のスコープをチェックすることができます。</strong>
</td>
</tr>
<tr>
<th>trigger</th>
<td>スニペットを挿入するトリガーになる文字列です。<br />
.fooとした場合は、.fooとタイプした後にTABキーを押すとスニペットがカーソル位置に挿入されます。
</td>
</tr>
<tr>
<th>expansion</th>
<td>スニペットコードです。<br />
ここで指定した内容が、スニペットとして挿入されます。<br />
${[number]:[placeholder]}の形式でプレースホルダーを指定することができます。<br />
また、${0}を記述すると挿入後のカーソルキーの位置も指定できます。<br />
PHPのスニペットなどでは変数に$がつく場合バックスラッシュでエスケープしてください。
</td>
</tr>
</table>
<h4>スニペットの定義の例</h4>
<p>次の例ではjavascriptファイルのみで有効な&#8221;Element inject&#8221;というスニペットを定義しています。<br />
.injectとタイプしてTABキーを押すと、2つのプレースホルダー付でスニペットを挿入します。</p>
<p>[ruby]<br />
snippet &#8216;Element inject&#8217; do |s|<br />
	s.scope = &#8216;source.js&#8217;<br />
	s.trigger = &#8216;.inject&#8217;<br />
	s.expansion = &#8216;$(${1:element}).inject(${2:container});${0}&#8217;<br />
end<br />
[/ruby]</p>
<h4>スニペット定義の応用</h4>
<p>with_defaultsを利用するとスニペットにまとめてデフォルト値を設定することができます。</p>
<p>[ruby]<br />
with_defaults :scope => &#8216;source.js&#8217; do</p>
<p>	snippet &#8216;inject&#8217; do |s|<br />
		s.trigger = &#8216;.inject&#8217;<br />
		s.expansion = &#8216;\$(${1:element}).inject(${2:container});${0}&#8217;<br />
	end</p>
<p>	snippet &#8216;adopt&#8217; do |s|<br />
		s.trigger = &#8216;.adopt&#8217;<br />
		s.expansion = &#8216;\$(${1:container}).adopt(${2:elements});${0}&#8217;<br />
	end</p>
<p>end<br />
[/ruby]</p>
<h3>スニペットメニューの定義</h3>
<p>メニューからスニペットを挿入できるようにするには、bundle.rbを編集してメニューを定義する必要があります。<br />
フォーマットは下記のような形になります。</p>
<p>[ruby]<br />
bundle.menu [bundle] do |main_menu|</p>
<p>	main_menu.command [sunippet_name]</p>
<p>	main_menu.separator</p>
<p>	main_menu.menu [submenu] do |submenu|<br />
		submenu.command [sunippet_name]<br />
		submenu.separator<br />
		submenu.command [sunippet_name]<br />
	end</p>
<p>end<br />
[/ruby]</p>
<p>コマンドの指定にはスニペットの名称を指定します。</p>
<p>[ruby]<br />
main_menu.command [sunippet_name]<br />
[/ruby]</p>
<p>メニューに区切りを線をいれたい場合はseparatorを指定します。</p>
<p>[ruby]<br />
main_menu.separator<br />
[/ruby]</p>
<p>サブメニューを作成したい場合はメインメニューと同じように作成します。</p>
<p>[ruby]<br />
main_menu.menu [submenu] do |submenu|<br />
	submenu.command [sunippet_name]<br />
	submenu.separator<br />
	submenu.command [sunippet_name]<br />
end<br />
[/ruby]</p>
<h4>スニペットメニューの例</h4>
<p>下記の例ではExampleメニューの中に3つのスニペット挿入のメニューを定義しています。</p>
<p>[ruby]<br />
bundle.menu &#8216;Example&#8217; do |main_menu|</p>
<p>	main_menu.command &#8216;example_snippet1&#8242;</p>
<p>	main_menu.separator</p>
<p>	main_menu.menu &#8216;example_snippet_list&#8217; do |submenu|<br />
		submenu.command &#8216;example_snippet2&#8242;<br />
		submenu.separator<br />
		submenu.command &#8216;example_snippet3&#8242;<br />
	end</p>
<p>end<br />
[/ruby]</p>
<p>メニューの階層は下記の通りになります。</p>
<p>[shell]<br />
	/Example<br />
		/example_snippet1<br />
		/example_snippet_list<br />
			/example_snippet2<br />
			/example_snippet3<br />
[/shell]</p>
<h3>スニペットの動作確認</h3>
<p>Bundlesビューを開いて、対象のバンドル名を選択し、マウスを右クリックして、コンテキストメニューのReloadを選択します。<br />
ツリーに定義したスニペットが表示されていれば、読み込みはできています。</p>
<p>定義したスニペットが有効なファイルを開いて、トリガー文字列を入力し、TABキーを押すとスニぺットが挿入されるはずです。</p>
<p>スニペットがうまく動かない場合は下記のことを試してみてください。</p>
<h4>1. キャッシュファイルの削除</h4>
<p>Aptana3は一度バンドルを読み込むとキャッシュファイルを作成するので、キャッシュを削除します。<br />
キャッシュファイルのファイル名はcache.yamlです。</p>
<p>キャッシュファイルを削除したら、Bundlesビューを再読み込みしてみてください。</p>
<h4>2. キャッシュファイルの削除とAptana3再起動</h4>
<p>キャッシュファイルを削除して、再読み込みしてもうまく動かない場合は<br />
もう一度キャッシュファイルを削除して、Aptana3を再起動してみてください。</p>
<p>これでうまく動くはずです。</p>
<p>次回はテンプレートの作成を解説します。</p>
<p><strong>Similar Posts:</strong>
<ul class="similar-posts">
<li><a href="http://sharedhat.com/blog/1731/" title="Aptana3 Bundleを作成する &#8211; バンドル作成の準備">Aptana3 Bundleを作成する &#8211; バンドル作成の準備</a></li>
<li><a href="http://sharedhat.com/blog/1744/" title="Aptana3 Bundleを作成する – テンプレートの作成">Aptana3 Bundleを作成する – テンプレートの作成</a></li>
<li><a href="http://sharedhat.com/review/364/" title="Snippely1.1がリリースされていた。">Snippely1.1がリリースされていた。</a></li>
<li><a href="http://sharedhat.com/review/1463/" title="AptanaにMarkdown Editerプラグインをインストールしてみた">AptanaにMarkdown Editerプラグインをインストールしてみた</a></li>
<li><a href="http://sharedhat.com/blog/1218/" title="Concrete5のテーマについての基礎知識">Concrete5のテーマについての基礎知識</a></li>
</ul>
<p><!-- Similar Posts took 5.083 ms --></p>
<div class="wp-social-bookmark-menu"><ul class="socials"><li class="script-style"><a href="http://scriptandstyle.com/submit?url=http://sharedhat.com/blog/1759/&title=Aptana3 Bundleを作成する – スニペット作成" title="Submit this to Script & Style"> </a></li><li class="blinklist"><a href="http://www.blinklist.com/index.php?Action=Blink/addblink.php&Url=http://sharedhat.com/blog/1759/&Title=Aptana3 Bundleを作成する – スニペット作成" title="Share this on Blinklist"> </a></li><li class="delicious"><a href="http://del.icio.us/post?url=http://sharedhat.com/blog/1759/&title=Aptana3 Bundleを作成する – スニペット作成" title="Share this on del.icio.us"> </a></li><li class="digg"><a href="http://digg.com/submit?phase=2&url=http://sharedhat.com/blog/1759/&title=Aptana3 Bundleを作成する – スニペット作成" title="Digg this!"> </a></li><li class="furl"><a href="http://www.furl.net/storeIt.jsp?t=Aptana3 Bundleを作成する – スニペット作成&u=http://sharedhat.com/blog/1759/" title="Share this on Furl"> </a></li><li class="reddit"><a href="http://reddit.com/submit?url=http://sharedhat.com/blog/1759/&title=Aptana3 Bundleを作成する – スニペット作成" title="Share this on Reddit"> </a></li><li class="yahoo"><a href="http://myweb2.search.yahoo.com/myresults/bookmarklet?t=Aptana3 Bundleを作成する – スニペット作成&u=http://sharedhat.com/blog/1759/" title="Save this to Yahoo MyWeb"> </a></li><li class="stumble"><a href="http://www.stumbleupon.com/submit?url=http://sharedhat.com/blog/1759/&title=Aptana3 Bundleを作成する – スニペット作成" title="Stumble upon something good? Share it on StumbleUpon"> </a></li><li class="technorati"><a href="http://technorati.com/faves?add=http://sharedhat.com/blog/1759/" title="Share this on Technorati"> </a></li><li class="mixx"><a href="http://www.mixx.com/submit?page_url=http://sharedhat.com/blog/1759/&amp;title=Aptana3 Bundleを作成する – スニペット作成" title="Share this on Mixx"> </a></li><li class="myspace"><a href="http://www.myspace.com/Modules/PostTo/Pages/?u=http://sharedhat.com/blog/1759/&amp;t=Aptana3 Bundleを作成する – スニペット作成" title="Post this to MySpace"> </a></li><li class="designfloat"><a href="http://www.designfloat.com/submit.php?url=http://sharedhat.com/blog/1759/&amp;title=Aptana3 Bundleを作成する – スニペット作成" title="Submit this to DesignFloat"> </a></li><li class="facebook"><a href="http://www.facebook.com/share.php?u=http://sharedhat.com/blog/1759/&amp;t=Aptana3 Bundleを作成する – スニペット作成" title="Share this on Facebook"> </a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://sharedhat.com/blog/1759/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Aptana3 Bundleを作成する &#8211; バンドル作成の準備</title>
		<link>http://sharedhat.com/blog/1731/</link>
		<comments>http://sharedhat.com/blog/1731/#comments</comments>
		<pubDate>Thu, 31 Mar 2011 01:00:53 +0000</pubDate>
		<dc:creator>horry</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[aptana3]]></category>
		<category><![CDATA[bundle]]></category>

		<guid isPermaLink="false">http://sharedhat.com/?p=1731</guid>
		<description><![CDATA[Aptana3では新しくBundleが利用できるようになりました。 Bundleは特定のプログラミング言語やマークアップ言語などのスニペットやテンプレート、便利なコマンドを作成することができます。 これを作成するにはRu [...]]]></description>
			<content:encoded><![CDATA[<p>Aptana3では新しくBundleが利用できるようになりました。<br />
Bundleは特定のプログラミング言語やマークアップ言語などのスニペットやテンプレート、便利なコマンドを作成することができます。<br />
これを作成するにはRubyで開発する必要があります。</p>
<p>開発自体は簡単で、スニペットを定義したり、コマンドを実行した時の処理を少しだけ書くだけです。<br />
Rubyで開発したことがある人はすぐに作成できると思います。</p>
<p>今回はBundle作成の最初の作業を解説します。</p>
<p><span id="more-1731"></span></p>
<h3>ディレクトリの作成</h3>
<p>作成するバンドル名の後に.rubleというサフィックスをつけたディレクトリを作成します。<br />
たとえば、Zend Frameworkのバンドルを作成したい場合はzend-framwork.rubleやzend_framwork.rubleになります。</p>
<p>次にその直下にassets、snippets、commands、templates、libというディレクトリを作成します。</p>
<p>作成後はこのようなディレクトリ構造になります。</p>
<p>[shell]<br />
	/zend-framwork.ruble<br />
		/assets<br />
		/snippets<br />
		/commands<br />
		/templates<br />
		/lib<br />
[/shell]</p>
<ul class="simpleList">
<li>assets &#8211; バンドルで利用する画像を格納するディレクトリ</li>
<li>snippets &#8211; スニペット定義ファイルを格納するディレクトリ</li>
<li>commands &#8211; コマンド定義ファイルを格納するディレクトリ</li>
<li>templates &#8211; テンプレート定義ファイルやテンプレートファイルを格納するディレクトリ</li>
<li>lib &#8211; バンドルで利用するライブラリを格納するディレクトリ</li>
</ul>
<h3>Bundle定義ファイルの作成</h3>
<p>次にBundleの定義ファイルを<a href="https://aptanastudio.tenderapp.com/kb/scripting-aptana-studio/ruble-programming-guide">Scripting Studio 3: Ruble Programming Guide</a>を元に作成します。<br />
ファイルはrubyのソースファイルで、bundle.rbという名前でbundleディレクトリ直下に置きます。</p>
<p>コードは下記のようなコードを書きます。<br />
[ruby]<br />
	require &#8216;ruble&#8217;</p>
<p>	bundle do |bundle|</p>
<p>		#バンドル名<br />
		bundle.display_name = &#8216;Zend Framework&#8217;</p>
<p>		#バンドルの詳細<br />
		bundle.description = <<END<br />
	Bundle for development with <a href="http://framework.zend.com/">Zend Framework</a><br />
	END</p>
<p>		#バンドルの作成者<br />
		bundle.author = &#8216;Noritka Horio<holy.shared.design@gmail.com>&#8216;</p>
<p>		#バンドルの著作権<br />
		bundle.copyright = &#8216;Copyrights 2010-2011 Noritaka Horio All Rights Reserved&#8217;</p>
<p>		#バンドルのリポジトリURL<br />
		bundle.repository = &#8216;https://holyshared@github.com/holyshared/zend-framework.ruble.git&#8217;</p>
<p>	end<br />
[/ruby]</p>
<h3>Bundleの配置</h3>
<p>定義ファイルが正しく読み込まれるか確認するために、一旦バンドルを適切なディレクトリの配置します。<br />
配置するディレクトリはAptana Bundlesの直下です。</p>
<p>Windows XPの場合はAptana BundlesがMy Documentの直下にあると思います。<br />
VistaやMacはちょっと分からないので、検索で探してもらうか、次のやり方でBundleディレクトリを指定することができます。</p>
<h4>Bundleディレクトリの変更</h4>
<p>ここの内容を参考に<a href="https://aptanastudio.tenderapp.com/kb/aptana-studio-configuration/changing-your-user-bundle-path">Aptana Studio Configuration</a>Bundleディレクトリを変更します。</p>
<p>内容はAptanaStudio3.iniという設定ファイルに次のディレクトリの設定を追記します。</p>
<p>[text]<br />
	-Daptana.ruble.user.location=path/to/bundles<br />
[/text]</p>
<p>最終的な設定ファイルはこんな感じになると思います。<br />
[text]<br />
	&#8211;launcher.XXMaxPermSize<br />
	256m<br />
	-vmargs<br />
	-Xms40m<br />
	-Xmx384m<br />
	-Djava.awt.headless=true<br />
	-Daptana.ruble.user.location=C:/storage/aptana/bundles<br />
[/text]</p>
<h3>Bundleの読み込み確認</h3>
<p>配置が無事完了したら、一旦Aptana3を再起動してください。<br />
メニューのWindow -> Show View -> Other..よりAptana/Bundlesを選択してビューを表示します。</p>
<p>ビューにBundleが表示されれば読み込めています。</p>
<p>以上で下準備は完了です。<br />
次回はスニペットを作成します。<br />
<strong>Similar Posts:</strong>
<ul class="similar-posts">
<li><a href="http://sharedhat.com/blog/1744/" title="Aptana3 Bundleを作成する – テンプレートの作成">Aptana3 Bundleを作成する – テンプレートの作成</a></li>
<li><a href="http://sharedhat.com/blog/1759/" title="Aptana3 Bundleを作成する – スニペット作成">Aptana3 Bundleを作成する – スニペット作成</a></li>
<li><a href="http://sharedhat.com/blog/1244/" title="SkinnyMVCでユーザー認証モジュールを作る下準備">SkinnyMVCでユーザー認証モジュールを作る下準備</a></li>
<li><a href="http://sharedhat.com/blog/1318/" title="Concrete5で翻訳ファイルを作る早いやり方">Concrete5で翻訳ファイルを作る早いやり方</a></li>
<li><a href="http://sharedhat.com/review/1562/" title="Mootools Forgeで使用されているPluginsKitをインストールしてみた">Mootools Forgeで使用されているPluginsKitをインストールしてみた</a></li>
</ul>
<p><!-- Similar Posts took 4.446 ms --></p>
<div class="wp-social-bookmark-menu"><ul class="socials"><li class="script-style"><a href="http://scriptandstyle.com/submit?url=http://sharedhat.com/blog/1731/&title=Aptana3 Bundleを作成する &#8211; バンドル作成の準備" title="Submit this to Script & Style"> </a></li><li class="blinklist"><a href="http://www.blinklist.com/index.php?Action=Blink/addblink.php&Url=http://sharedhat.com/blog/1731/&Title=Aptana3 Bundleを作成する &#8211; バンドル作成の準備" title="Share this on Blinklist"> </a></li><li class="delicious"><a href="http://del.icio.us/post?url=http://sharedhat.com/blog/1731/&title=Aptana3 Bundleを作成する &#8211; バンドル作成の準備" title="Share this on del.icio.us"> </a></li><li class="digg"><a href="http://digg.com/submit?phase=2&url=http://sharedhat.com/blog/1731/&title=Aptana3 Bundleを作成する &#8211; バンドル作成の準備" title="Digg this!"> </a></li><li class="furl"><a href="http://www.furl.net/storeIt.jsp?t=Aptana3 Bundleを作成する &#8211; バンドル作成の準備&u=http://sharedhat.com/blog/1731/" title="Share this on Furl"> </a></li><li class="reddit"><a href="http://reddit.com/submit?url=http://sharedhat.com/blog/1731/&title=Aptana3 Bundleを作成する &#8211; バンドル作成の準備" title="Share this on Reddit"> </a></li><li class="yahoo"><a href="http://myweb2.search.yahoo.com/myresults/bookmarklet?t=Aptana3 Bundleを作成する &#8211; バンドル作成の準備&u=http://sharedhat.com/blog/1731/" title="Save this to Yahoo MyWeb"> </a></li><li class="stumble"><a href="http://www.stumbleupon.com/submit?url=http://sharedhat.com/blog/1731/&title=Aptana3 Bundleを作成する &#8211; バンドル作成の準備" title="Stumble upon something good? Share it on StumbleUpon"> </a></li><li class="technorati"><a href="http://technorati.com/faves?add=http://sharedhat.com/blog/1731/" title="Share this on Technorati"> </a></li><li class="mixx"><a href="http://www.mixx.com/submit?page_url=http://sharedhat.com/blog/1731/&amp;title=Aptana3 Bundleを作成する &#8211; バンドル作成の準備" title="Share this on Mixx"> </a></li><li class="myspace"><a href="http://www.myspace.com/Modules/PostTo/Pages/?u=http://sharedhat.com/blog/1731/&amp;t=Aptana3 Bundleを作成する &#8211; バンドル作成の準備" title="Post this to MySpace"> </a></li><li class="designfloat"><a href="http://www.designfloat.com/submit.php?url=http://sharedhat.com/blog/1731/&amp;title=Aptana3 Bundleを作成する &#8211; バンドル作成の準備" title="Submit this to DesignFloat"> </a></li><li class="facebook"><a href="http://www.facebook.com/share.php?u=http://sharedhat.com/blog/1731/&amp;t=Aptana3 Bundleを作成する &#8211; バンドル作成の準備" title="Share this on Facebook"> </a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://sharedhat.com/blog/1731/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Google Maps API V3のMVCObjectについて</title>
		<link>http://sharedhat.com/blog/1625/</link>
		<comments>http://sharedhat.com/blog/1625/#comments</comments>
		<pubDate>Thu, 09 Dec 2010 00:34:49 +0000</pubDate>
		<dc:creator>horry</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[Google Maps]]></category>
		<category><![CDATA[version3]]></category>

		<guid isPermaLink="false">http://sharedhat.com/?p=1625</guid>
		<description><![CDATA[Google Maps API Version 3からMVCObjectが追加されました。 Google Maps APIのマーカーやオーバーレイのベースになっている下位クラスです。 普段マーカーやストリートビューしかあ [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://sharedhat.com/wp-content/uploads/2010/12/img_mvcobject.jpg"><img src="http://sharedhat.com/wp-content/uploads/2010/12/img_mvcobject.jpg" alt="" title="img_mvcobject" width="734" height="220" class="aligncenter size-full wp-image-1638" /></a></p>
<p>Google Maps API Version 3からMVCObjectが追加されました。<br />
Google Maps APIのマーカーやオーバーレイのベースになっている下位クラスです。</p>
<p>普段マーカーやストリートビューしかあまり使わないので、あまり気にしていなかったのですが、このクラスを継承してコントローラーやウィジットを作ると便利じゃないかと思ったので軽くご紹介します。<br />
ちなみに自作のMootoolsプラグインMMap 0.2はMVCObjectを利用した設計に変更中です。<br />
今は新しいバージョンのデモページを作成しています。</p>
<p><span id="more-1625"></span></p>
<h3>bindToメソッド</h3>
<p>MVCObjectのbindToメソッドを利用すると、<strong>特定のオブジェクトのプロパティが変更された時、自分自身のプロパティに変更された値を反映させることができます。</strong><br />
たとえば、監視しているオブジェクトのvisibleプロパティが非表示(false)に変更された時、自分自身も同じように非表示にすることが可能です。</p>
<h3>property_changed</h3>
<p>MVCObjectのprototypeプロパティに<strong>[プロパティ名]_changedという名称でメソッドを定義すると、プロパティの変更があった場合に定義されたメソッドが実行される。</strong><br />
これを利用すると変更があった際に、ウィジットの表示などのへの反映が自動化できますし、表示の変更をイベントハンドリングで対応しなくてもよくなります。</p>
<h3>イベントリスナー</h3>
<p>MVCObjectのイベントリスナーにproperty_changedと指定してイベントリスナーを追加することでプロパティの変更をイベントハンドリングできるようになります。<br />
これは自分の自作ウィジットなどのsetterメソッドでイベントを手動で発火させて、プロパティの変更があったことを他のオブジェクトへ通知するなどの処理が不要になります。</p>
<p>実際に試してみた結果が下記の通りです。<br />
ボタンをクリックするとプロパティの変更があった場合にアラートを表示するようなものです。</p>
<p><iframe style="width: 100%; height: 300px" src="http://jsfiddle.net/holyshared/5UTxs/embedded/"></iframe></p>
<p>解説した動きが再現されていると思います。<br />
これをうまく活用すると、少ない工数で複雑なアプリケーションを作成することが可能です。<br />
積極的に使っていこうと思います。</p>
<p><strong>Similar Posts:</strong>
<ul class="similar-posts">
<li><a href="http://sharedhat.com/project/1644/" title="MootoolsのGoogle Mapsプラグイン、MMap0.2をリリースしました。">MootoolsのGoogle Mapsプラグイン、MMap0.2をリリースしました。</a></li>
<li><a href="http://sharedhat.com/blog/1547/" title="StaticMapsとMicroformat(hCalender)をセットで利用する">StaticMapsとMicroformat(hCalender)をセットで利用する</a></li>
<li><a href="http://sharedhat.com/blog/900/" title="MootoolsのForm.Validater.Extraについて">MootoolsのForm.Validater.Extraについて</a></li>
<li><a href="http://sharedhat.com/project/1653/" title="MootoolsのGoogle Mapsプラグイン、MMap 0.2.1をリリースしました。">MootoolsのGoogle Mapsプラグイン、MMap 0.2.1をリリースしました。</a></li>
<li><a href="http://sharedhat.com/project/1673/" title="MootoolsとPowerToolsでPC、iPadに対応したギャラリーサイトのテンプレートを作りました。">MootoolsとPowerToolsでPC、iPadに対応したギャラリーサイトのテンプレートを作りました。</a></li>
</ul>
<p><!-- Similar Posts took 4.449 ms --></p>
<div class="wp-social-bookmark-menu"><ul class="socials"><li class="script-style"><a href="http://scriptandstyle.com/submit?url=http://sharedhat.com/blog/1625/&title=Google Maps API V3のMVCObjectについて" title="Submit this to Script & Style"> </a></li><li class="blinklist"><a href="http://www.blinklist.com/index.php?Action=Blink/addblink.php&Url=http://sharedhat.com/blog/1625/&Title=Google Maps API V3のMVCObjectについて" title="Share this on Blinklist"> </a></li><li class="delicious"><a href="http://del.icio.us/post?url=http://sharedhat.com/blog/1625/&title=Google Maps API V3のMVCObjectについて" title="Share this on del.icio.us"> </a></li><li class="digg"><a href="http://digg.com/submit?phase=2&url=http://sharedhat.com/blog/1625/&title=Google Maps API V3のMVCObjectについて" title="Digg this!"> </a></li><li class="furl"><a href="http://www.furl.net/storeIt.jsp?t=Google Maps API V3のMVCObjectについて&u=http://sharedhat.com/blog/1625/" title="Share this on Furl"> </a></li><li class="reddit"><a href="http://reddit.com/submit?url=http://sharedhat.com/blog/1625/&title=Google Maps API V3のMVCObjectについて" title="Share this on Reddit"> </a></li><li class="yahoo"><a href="http://myweb2.search.yahoo.com/myresults/bookmarklet?t=Google Maps API V3のMVCObjectについて&u=http://sharedhat.com/blog/1625/" title="Save this to Yahoo MyWeb"> </a></li><li class="stumble"><a href="http://www.stumbleupon.com/submit?url=http://sharedhat.com/blog/1625/&title=Google Maps API V3のMVCObjectについて" title="Stumble upon something good? Share it on StumbleUpon"> </a></li><li class="technorati"><a href="http://technorati.com/faves?add=http://sharedhat.com/blog/1625/" title="Share this on Technorati"> </a></li><li class="mixx"><a href="http://www.mixx.com/submit?page_url=http://sharedhat.com/blog/1625/&amp;title=Google Maps API V3のMVCObjectについて" title="Share this on Mixx"> </a></li><li class="myspace"><a href="http://www.myspace.com/Modules/PostTo/Pages/?u=http://sharedhat.com/blog/1625/&amp;t=Google Maps API V3のMVCObjectについて" title="Post this to MySpace"> </a></li><li class="designfloat"><a href="http://www.designfloat.com/submit.php?url=http://sharedhat.com/blog/1625/&amp;title=Google Maps API V3のMVCObjectについて" title="Submit this to DesignFloat"> </a></li><li class="facebook"><a href="http://www.facebook.com/share.php?u=http://sharedhat.com/blog/1625/&amp;t=Google Maps API V3のMVCObjectについて" title="Share this on Facebook"> </a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://sharedhat.com/blog/1625/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>StaticMapsとMicroformat(hCalender)をセットで利用する</title>
		<link>http://sharedhat.com/blog/1547/</link>
		<comments>http://sharedhat.com/blog/1547/#comments</comments>
		<pubDate>Sat, 30 Oct 2010 18:24:00 +0000</pubDate>
		<dc:creator>horry</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[hCalender]]></category>
		<category><![CDATA[map]]></category>
		<category><![CDATA[Microformat]]></category>
		<category><![CDATA[Mootools]]></category>
		<category><![CDATA[static]]></category>

		<guid isPermaLink="false">http://sharedhat.com/?p=1547</guid>
		<description><![CDATA[リリースしたStaticMaps0.1.1とMicroformatをパースできるjavascriptライブラリSumoを利用して、動的に地図を描画するサンプルコードをjsFiddleで書きました。 Sumoは他のjava [...]]]></description>
			<content:encoded><![CDATA[<p>リリースしたStaticMaps0.1.1とMicroformatをパースできるjavascriptライブラリ<a title="Sumo" rel="tag" href="http://github.com/holyshared/sumo">Sumo</a>を利用して、動的に地図を描画するサンプルコードを<a title="jsFiddle" rel="jsFiddle" href="http://jsfiddle.net/">jsFiddle</a>で書きました。</p>
<p><a title="Sumo" rel="tag" href="http://github.com/holyshared/sumo">Sumo</a>は他のjavascriptフレームワークと一緒に利用することができます。</p>
<p>javascriptでページ内に埋め込まれている<a title="hCalender" rel="tag" href="http://microformats.org/wiki/hcalendar">hCalender</a>を解析し、その結果を元に地図を描画します。<br />
地図を表示する項目はMicroformat(hCalender)の位置情報のlocationプロパティと、より詳細な座標情報のgeoプロパティ、latitudeプロパティ、longitudeプロパティを利用します。</p>
<p><a title="Sumo" rel="tag" href="http://github.com/holyshared/sumo">Sumo</a>のデフォルトでは解析対象にhCalenderのgeoプロパティ、latitudeプロパティ、longitudeプロパティが解析対象に含まれていなかったので、別途解析対象にしました。<br />
元のソースコードは<a title="Sumo" href='http://github.com/danwrong/sumo'>Daniel MorrisonのSumoリポジトリ</a>にあります。<br />
<span id="more-1547"></span></p>
<p><iframe style="width: 100%; height: 300px" src="http://jsfiddle.net/holyshared/k5rby/embedded/"></iframe></p>
<p>Microformatを利用したサンプルはMMapのデモページでも書いたのですが、一度記述しておけばテキストを修正するだけで対応が可能なのでメンテナンスが楽ですね。</p>
<p>javascriptでパースするので、無効にされていると動作しないのが厄介ですが、非常に便利なテクニックです。<br />
<strong>Microformatのうまみは機械と人間にやさしいことと、再利用できることだと思っているので、もっと普及すればいいと思います。</strong><strong>Similar Posts:</strong>
<ul class="similar-posts">
<li><a href="http://sharedhat.com/project/1527/" title="MootoolsのプラグインStaticMaps0.1.1をリリースしました。">MootoolsのプラグインStaticMaps0.1.1をリリースしました。</a></li>
<li><a href="http://sharedhat.com/blog/900/" title="MootoolsのForm.Validater.Extraについて">MootoolsのForm.Validater.Extraについて</a></li>
<li><a href="http://sharedhat.com/blog/924/" title="MootoolsのForm.Validaterのプロパティを動的に指定する">MootoolsのForm.Validaterのプロパティを動的に指定する</a></li>
<li><a href="http://sharedhat.com/blog/1625/" title="Google Maps API V3のMVCObjectについて">Google Maps API V3のMVCObjectについて</a></li>
<li><a href="http://sharedhat.com/blog/389/" title="iddy.jsをリリースしました。">iddy.jsをリリースしました。</a></li>
</ul>
<p><!-- Similar Posts took 4.111 ms --></p>
<div class="wp-social-bookmark-menu"><ul class="socials"><li class="script-style"><a href="http://scriptandstyle.com/submit?url=http://sharedhat.com/blog/1547/&title=StaticMapsとMicroformat(hCalender)をセットで利用する" title="Submit this to Script & Style"> </a></li><li class="blinklist"><a href="http://www.blinklist.com/index.php?Action=Blink/addblink.php&Url=http://sharedhat.com/blog/1547/&Title=StaticMapsとMicroformat(hCalender)をセットで利用する" title="Share this on Blinklist"> </a></li><li class="delicious"><a href="http://del.icio.us/post?url=http://sharedhat.com/blog/1547/&title=StaticMapsとMicroformat(hCalender)をセットで利用する" title="Share this on del.icio.us"> </a></li><li class="digg"><a href="http://digg.com/submit?phase=2&url=http://sharedhat.com/blog/1547/&title=StaticMapsとMicroformat(hCalender)をセットで利用する" title="Digg this!"> </a></li><li class="furl"><a href="http://www.furl.net/storeIt.jsp?t=StaticMapsとMicroformat(hCalender)をセットで利用する&u=http://sharedhat.com/blog/1547/" title="Share this on Furl"> </a></li><li class="reddit"><a href="http://reddit.com/submit?url=http://sharedhat.com/blog/1547/&title=StaticMapsとMicroformat(hCalender)をセットで利用する" title="Share this on Reddit"> </a></li><li class="yahoo"><a href="http://myweb2.search.yahoo.com/myresults/bookmarklet?t=StaticMapsとMicroformat(hCalender)をセットで利用する&u=http://sharedhat.com/blog/1547/" title="Save this to Yahoo MyWeb"> </a></li><li class="stumble"><a href="http://www.stumbleupon.com/submit?url=http://sharedhat.com/blog/1547/&title=StaticMapsとMicroformat(hCalender)をセットで利用する" title="Stumble upon something good? Share it on StumbleUpon"> </a></li><li class="technorati"><a href="http://technorati.com/faves?add=http://sharedhat.com/blog/1547/" title="Share this on Technorati"> </a></li><li class="mixx"><a href="http://www.mixx.com/submit?page_url=http://sharedhat.com/blog/1547/&amp;title=StaticMapsとMicroformat(hCalender)をセットで利用する" title="Share this on Mixx"> </a></li><li class="myspace"><a href="http://www.myspace.com/Modules/PostTo/Pages/?u=http://sharedhat.com/blog/1547/&amp;t=StaticMapsとMicroformat(hCalender)をセットで利用する" title="Post this to MySpace"> </a></li><li class="designfloat"><a href="http://www.designfloat.com/submit.php?url=http://sharedhat.com/blog/1547/&amp;title=StaticMapsとMicroformat(hCalender)をセットで利用する" title="Submit this to DesignFloat"> </a></li><li class="facebook"><a href="http://www.facebook.com/share.php?u=http://sharedhat.com/blog/1547/&amp;t=StaticMapsとMicroformat(hCalender)をセットで利用する" title="Share this on Facebook"> </a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://sharedhat.com/blog/1547/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mootoolsのビルドツールに自作パッケージを追加する方法</title>
		<link>http://sharedhat.com/blog/1508/</link>
		<comments>http://sharedhat.com/blog/1508/#comments</comments>
		<pubDate>Wed, 20 Oct 2010 14:15:20 +0000</pubDate>
		<dc:creator>horry</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[Mootools]]></category>
		<category><![CDATA[mootools forge]]></category>
		<category><![CDATA[packager]]></category>
		<category><![CDATA[packager-web]]></category>

		<guid isPermaLink="false">http://sharedhat.com/?p=1508</guid>
		<description><![CDATA[Mootools Forgeの使い方 – 登録する前にすることで書きましたが、MootoolsではMootools Forgeにプラグイン登録するときにディレクトリ構造、必要なファイルがあらかじめ定められています。 その [...]]]></description>
			<content:encoded><![CDATA[<p><a title="Mootools Forgeの使い方 – 登録する前にすること" href="http://sharedhat.com/blog/1027/">Mootools Forgeの使い方 – 登録する前にすること</a>で書きましたが、MootoolsではMootools Forgeにプラグイン登録するときにディレクトリ構造、必要なファイルがあらかじめ定められています。</p>
<p>その中で、package.yml(パッケージ定義ファイル)とソースヘッダーの話を書いたと思いますが、packager-webはビルドの際にこれらを参照し、ルールに則ってビルドを行います。<br />
若干、<a title="Mootools Forgeの使い方 – 登録する前にすること" href="http://sharedhat.com/blog/1027/">Mootools Forgeの使い方 – 登録する前にすること</a>で説明した内容のほかにファイルに記述する必要があります。</p>
<p>今回説明するパッケージ定義ファイルとソースヘッダーを記述したファイルを用意しましたので参考にしてください。<br />
解凍して、componentsにアップロード、config.ymlの書き換えを行ってください。<br />
packger-webにアップロードしたパッケージが表示されるはずです。</p>
<p><strong>サンプルデータ</strong><br />
<a href="http://dl.dropbox.com/u/603849/example-package.zip">サンプルファイルのダウンロード</a></p>
<p>具体的な内容はおさらいをかねて再度説明します。<br />
<span id="more-1508"></span></p>
<h3>パッケージ定義ファイル(package.yml)の作成</h3>
<p>1～8番までがpackagerで必要になる項目で9～14番がMootools Forgeで必要になる項目です。<br />
packager-webだけの場合、1～8番までの記述でOKです。</p>
<table>
<tr>
<th>No.</th>
<th>キー</th>
<th>項目名</th>
<th>内容</th>
</tr>
<tr>
<td>1</td>
<td>name</td>
<td>モジュール名</td>
<td>モジュールの名称</td>
</tr>
<tr>
<td>2</td>
<td>exports</td>
<td>出力ファイル名</td>
<td>出力するファイル名。packager利用時にこのファイル名でビルドされる。packager-webの場合はconfig.ymlで定義する</td>
</tr>
<tr>
<td>3</td>
<td>web</td>
<td>プロジェクトサイトURL</td>
<td>このプラグインのプロジェクトサイトのURL</td>
</tr>
<tr>
<td>4</td>
<td>description</td>
<td>プラグイン説明</td>
<td>プラグインの説明文</td>
</tr>
<tr>
<td>5</td>
<td>authors</td>
<td>著作者</td>
<td>プラグインの著作者。複数いる場合は列挙する。</td>
</tr>
<tr>
<td>6</td>
<td>license</td>
<td>ライセンス</td>
<td>ライセンスの説明</td>
</tr>
<tr>
<td>7</td>
<td>copyright</td>
<td>著作権</td>
<td>著作権の表記</td>
</tr>
<tr>
<td>8</td>
<td>sources</td>
<td>ソースコードのリスト</td>
<td>ソースコードのリスト。複数ある場合は列挙する</td>
</tr>
<tr>
<td>9</td>
<td>author</td>
<td>著作者</td>
<td>Mootools Forgeのユーザー名を記述する</td>
</tr>
<tr>
<td>10</td>
<td>category</td>
<td>Mootools Forgeのカテゴリ</td>
<td>Effects、Forms、Interface、Media、Native、Realtime、Request、Utilities、Widgetsのどれかひとつ</td>
</tr>
<tr>
<td>11</td>
<td>tags</td>
<td>タグ</td>
<td>このプラグインを分類するタグ</td>
</tr>
<tr>
<td>12</td>
<td>current</td>
<td>最新バージョン</td>
<td>現在の最新バージョンを記述する</td>
</tr>
<tr>
<td>13</td>
<td>docs</td>
<td>ドキュメントのURL</td>
<td>ドキュメントのあるURL</td>
</tr>
<tr>
<td>14</td>
<td>demo</td>
<td>デモのURL</td>
<td>デモページのあるURL</td>
</tr>
</table>
<p>実際のサンプルは下記のような感じになります。</p>
<p>[text]<br />
#&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
# Here is a section of Mootools Forge.<br />
#&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>name: Example Plugin Module</p>
<p>author: your forge username here</p>
<p>category: Interface</p>
<p>tags: [animation, canvas]</p>
<p>#docs: http://url.to.docs</p>
<p>#demo: http://url.to.demo</p>
<p>#current: 0.5</p>
<p>#&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
# Here is a section of packager.<br />
#&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>exports: &#8220;plugin.js&#8221;</p>
<p>web: &#8220;[http://sharedhat.com](http://sharedhat.com)&#8221;</p>
<p>description: &#8220;This is plugin sample&#8221;</p>
<p>authors: &#8220;[Noritaka Horio](http://sharedhat.com)&#8221;</p>
<p>license: &#8220;[public domain](http://en.wikipedia.org/wiki/Public_domain)&#8221;</p>
<p>copyright: &#8220;&copy; [Noritaka Horio](http://sharedhat.com)&#8221;</p>
<p>sources:<br />
  &#8211; &#8220;Source/Plugin.js&#8221;<br />
  &#8211; &#8220;Source/Plugin.ModuleA.js&#8221;<br />
  &#8211; &#8220;Source/Plugin.ModuleB.js&#8221;<br />
  &#8211; &#8220;Source/Plugin.ModuleC.js&#8221;<br />
[/text]</p>
<h3>ソースヘッダーの記述</h3>
<p>ソースヘッダーは<a title="Mootools Forgeの使い方 – 登録する前にすること" href="http://sharedhat.com/blog/1027/">Mootools Forgeの使い方 – 登録する前にすること</a>で書いた通りです。<br />
ここの記述は依存関係の解決に大きく影響するので注意が必要です。</p>
<table>
<tr>
<th>No.</th>
<th>キー</th>
<th>項目名</th>
<th>内容</th>
</tr>
<tr>
<td>1</td>
<td>name</td>
<td>モジュール名</td>
<td>モジュールの名称</td>
</tr>
<tr>
<td>2</td>
<td>description</td>
<td>モジュール詳細</td>
<td>モジュールの詳細を記述する。</td>
</tr>
<tr>
<td>3</td>
<td>license</td>
<td>ライセンス</td>
<td>ライセンスを記述する。</td>
</tr>
<tr>
<td>4</td>
<td>authors</td>
<td>著作者</td>
<td>著作者を記述する。複数人いる場合は列挙する。</td>
</tr>
<tr>
<td>5</td>
<td>requires</td>
<td>依存関係モジュールリスト</td>
<td>依存関係のあるモジュールをリストとして列挙する</td>
</tr>
<tr>
<td>6</td>
<td>provides</td>
<td>サブモジュール</td>
<td>このモジュールに含まれるサブモジュール</td>
</tr>
</table>
<p>実際のソースヘッダーは下記の通りになります。</p>
<p>[javascript]<br />
/*<br />
&#8212;<br />
name: Plugin</p>
<p>description: This plugin is a sample.</p>
<p>license: public domain</p>
<p>authors:<br />
- Noritaka Horio</p>
<p>requires:<br />
  &#8211; Core/Core<br />
  &#8211; Core/Array<br />
  &#8211; Core/String<br />
  &#8211; Core/Number<br />
  &#8211; Core/Function<br />
  &#8211; Core/Object<br />
  &#8211; Core/Event<br />
  &#8211; Core/Browser<br />
  &#8211; Core/Class<br />
  &#8211; Core/Class.Extras<br />
  &#8211; Core/Slick.Parser<br />
  &#8211; Core/Slick.Finder<br />
  &#8211; Core/Element<br />
  &#8211; Core/Element.Style<br />
  &#8211; Core/Element.Event<br />
  &#8211; Core/Element.Dimensions<br />
  &#8211; Core/Fx<br />
  &#8211; Core/Fx.Transitions<br />
  &#8211; More/Assets<br />
  &#8211; ImageDrawer/ImageDrawer<br />
  &#8211; ImageDrawer/ImageDrawer.Grid<br />
  &#8211; ImageDrawer/ImageDrawer.Expand</p>
<p>provides: Plugin</p>
<p>&#8230;<br />
*/<br />
[/javascript]</p>
<h3>packager-webの設定ファイル変更</h3>
<p>準備ができたら、packager-webのconfig.ymlを編集してpackagesに組み込みたいプラグインを追加します。</p>
<p>[text]<br />
packages:<br />
  &#8211; &#8220;components/mootools-core/&#8221;<br />
  &#8211; &#8220;components/mootools-more/&#8221;<br />
  &#8211; &#8220;components/example-package/&#8221;<br />
[/text]</p>
<p>これで、自作プラグインをpackager-webに組み込むことができます。<br />
packager-webにアクセスして、問題なくプラグインが表示されていれば終了です。<br />
簡単ですね。<br />
<strong>Similar Posts:</strong>
<ul class="similar-posts">
<li><a href="http://sharedhat.com/review/1479/" title="MootoolsのビルドツールPackager-Webはすごく便利">MootoolsのビルドツールPackager-Webはすごく便利</a></li>
<li><a href="http://sharedhat.com/project/652/" title="Mootoolsのプラグイン「Exhibition.js」をリリースしました。">Mootoolsのプラグイン「Exhibition.js」をリリースしました。</a></li>
<li><a href="http://sharedhat.com/blog/89/" title="MooTools 1.2リリース">MooTools 1.2リリース</a></li>
<li><a href="http://sharedhat.com/project/1653/" title="MootoolsのGoogle Mapsプラグイン、MMap 0.2.1をリリースしました。">MootoolsのGoogle Mapsプラグイン、MMap 0.2.1をリリースしました。</a></li>
<li><a href="http://sharedhat.com/review/1588/" title="Mootoolsをコマンドラインを使用してビルドする方法">Mootoolsをコマンドラインを使用してビルドする方法</a></li>
</ul>
<p><!-- Similar Posts took 4.834 ms --></p>
<div class="wp-social-bookmark-menu"><ul class="socials"><li class="script-style"><a href="http://scriptandstyle.com/submit?url=http://sharedhat.com/blog/1508/&title=Mootoolsのビルドツールに自作パッケージを追加する方法" title="Submit this to Script & Style"> </a></li><li class="blinklist"><a href="http://www.blinklist.com/index.php?Action=Blink/addblink.php&Url=http://sharedhat.com/blog/1508/&Title=Mootoolsのビルドツールに自作パッケージを追加する方法" title="Share this on Blinklist"> </a></li><li class="delicious"><a href="http://del.icio.us/post?url=http://sharedhat.com/blog/1508/&title=Mootoolsのビルドツールに自作パッケージを追加する方法" title="Share this on del.icio.us"> </a></li><li class="digg"><a href="http://digg.com/submit?phase=2&url=http://sharedhat.com/blog/1508/&title=Mootoolsのビルドツールに自作パッケージを追加する方法" title="Digg this!"> </a></li><li class="furl"><a href="http://www.furl.net/storeIt.jsp?t=Mootoolsのビルドツールに自作パッケージを追加する方法&u=http://sharedhat.com/blog/1508/" title="Share this on Furl"> </a></li><li class="reddit"><a href="http://reddit.com/submit?url=http://sharedhat.com/blog/1508/&title=Mootoolsのビルドツールに自作パッケージを追加する方法" title="Share this on Reddit"> </a></li><li class="yahoo"><a href="http://myweb2.search.yahoo.com/myresults/bookmarklet?t=Mootoolsのビルドツールに自作パッケージを追加する方法&u=http://sharedhat.com/blog/1508/" title="Save this to Yahoo MyWeb"> </a></li><li class="stumble"><a href="http://www.stumbleupon.com/submit?url=http://sharedhat.com/blog/1508/&title=Mootoolsのビルドツールに自作パッケージを追加する方法" title="Stumble upon something good? Share it on StumbleUpon"> </a></li><li class="technorati"><a href="http://technorati.com/faves?add=http://sharedhat.com/blog/1508/" title="Share this on Technorati"> </a></li><li class="mixx"><a href="http://www.mixx.com/submit?page_url=http://sharedhat.com/blog/1508/&amp;title=Mootoolsのビルドツールに自作パッケージを追加する方法" title="Share this on Mixx"> </a></li><li class="myspace"><a href="http://www.myspace.com/Modules/PostTo/Pages/?u=http://sharedhat.com/blog/1508/&amp;t=Mootoolsのビルドツールに自作パッケージを追加する方法" title="Post this to MySpace"> </a></li><li class="designfloat"><a href="http://www.designfloat.com/submit.php?url=http://sharedhat.com/blog/1508/&amp;title=Mootoolsのビルドツールに自作パッケージを追加する方法" title="Submit this to DesignFloat"> </a></li><li class="facebook"><a href="http://www.facebook.com/share.php?u=http://sharedhat.com/blog/1508/&amp;t=Mootoolsのビルドツールに自作パッケージを追加する方法" title="Share this on Facebook"> </a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://sharedhat.com/blog/1508/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Safariで発生するマーカーが表示されない問題の対処法</title>
		<link>http://sharedhat.com/blog/1448/</link>
		<comments>http://sharedhat.com/blog/1448/#comments</comments>
		<pubDate>Fri, 15 Oct 2010 05:00:08 +0000</pubDate>
		<dc:creator>horry</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[Google Map API]]></category>
		<category><![CDATA[marker]]></category>
		<category><![CDATA[problem]]></category>
		<category><![CDATA[version 3]]></category>

		<guid isPermaLink="false">http://sharedhat.com/?p=1448</guid>
		<description><![CDATA[Google Maps API Version 3を利用していて、Safari 5.0.2だけカスタムマーカーが表示されない問題にはまりました。 他のブラウザでは表示されるのに、Safariだけ表示されない。 IE6です [...]]]></description>
			<content:encoded><![CDATA[<p>Google Maps API Version 3を利用していて、Safari 5.0.2だけカスタムマーカーが表示されない問題にはまりました。<br />
他のブラウザでは表示されるのに、Safariだけ表示されない。<br />
IE6ですら表示できているのになぜだろうと、ずっと悩んでいました。</p>
<p>具体的な症状は、マーカーが生成されDOMツリーに反映されているのにもかかわらず、地図上に表示されないというものです。<br />
そんな時、Safariの開発ツールでDOMツリーを見ていると、少し気になる部分がありました。<br />
それは、マーカーの表示位置です。<br />
なんとleft値が-1.62986e+0006pxとか怪しい値になっていたのです。<br />
<span id="more-1448"></span><br />
<a href="http://sharedhat.com/wp-content/uploads/2010/10/img_safari_bug.jpg"><img src="http://sharedhat.com/wp-content/uploads/2010/10/img_safari_bug.jpg" alt="Safari5.0.2のデバッグ画面" title="Safari5.0.2のデバッグ画面" width="734" height="250" class="aligncenter size-full wp-image-1456" /></a></p>
<p>これは、オーバーフローでもしてるのかな、と思いleft値を10とかに変更してみると無事表示されるようになりました。<br />
なので、<strong>マーカーで表示されている範囲内のマーカー以外を非表示にするように修正を加えました。</strong></p>
<p>以下が、実際のソースコードです。<br />
displayMarkersがマーカーの表示制御部分です。</p>
<p>[javascript]<br />
this.map = new google.maps.Map(this.element, {<br />
	zoom: this.options.zoom,<br />
	center: new google.maps.LatLng(this.options.latlng.lat, this.options.latlng.lng),<br />
	mapTypeId: google.maps.MapTypeId.ROADMAP<br />
});</p>
<p>this.displayMarkers = function() {<br />
	//this.markersはマーカーをスタックしている配列<br />
	var bounds = this.map.getBounds();<br />
	for (var i = 0; l = this.markers.length &#8211; 1, i <= l; i++) {<br />
		var  marker = this.markers[i];<br />
		var mp = marker.getPosition(); //LatLngオブジェクト<br />
		if (bounds.contains(mp)) {<br />
			marker.setVisible(true);<br />
		} else {<br />
			marker.setVisible(false);<br />
		}<br />
	}<br />
}</p>
<p>//中心点とズームレベルの監視<br />
//変更が発生した場合は、マップに収まるマーカーだけを表示する<br />
var changed = $.proxy(this.displayMarkers, this);<br />
google.maps.event.addDomListener(this.map, 'center_changed', changed);<br />
google.maps.event.addDomListener(this.map, 'zoom_changed', changed);<br />
[/javascript]</p>
<p>これで問題解決です。<strong>Similar Posts:</strong>
<ul class="similar-posts">
<li><a href="http://sharedhat.com/blog/1377/" title="jQueryでGoogle Map API Version3のカスタムマーカーを作る">jQueryでGoogle Map API Version3のカスタムマーカーを作る</a></li>
<li><a href="http://sharedhat.com/project/1644/" title="MootoolsのGoogle Mapsプラグイン、MMap0.2をリリースしました。">MootoolsのGoogle Mapsプラグイン、MMap0.2をリリースしました。</a></li>
<li><a href="http://sharedhat.com/blog/1386/" title="Google Map APIのStreetViewServiceを使用し、座標近くのストリートビューを表示する方法">Google Map APIのStreetViewServiceを使用し、座標近くのストリートビューを表示する方法</a></li>
<li><a href="http://sharedhat.com/project/703/" title="Mootools Plugin 「MMap」をリリースしました。">Mootools Plugin 「MMap」をリリースしました。</a></li>
<li><a href="http://sharedhat.com/project/1653/" title="MootoolsのGoogle Mapsプラグイン、MMap 0.2.1をリリースしました。">MootoolsのGoogle Mapsプラグイン、MMap 0.2.1をリリースしました。</a></li>
</ul>
<p><!-- Similar Posts took 3.889 ms --></p>
<div class="wp-social-bookmark-menu"><ul class="socials"><li class="script-style"><a href="http://scriptandstyle.com/submit?url=http://sharedhat.com/blog/1448/&title=Safariで発生するマーカーが表示されない問題の対処法" title="Submit this to Script & Style"> </a></li><li class="blinklist"><a href="http://www.blinklist.com/index.php?Action=Blink/addblink.php&Url=http://sharedhat.com/blog/1448/&Title=Safariで発生するマーカーが表示されない問題の対処法" title="Share this on Blinklist"> </a></li><li class="delicious"><a href="http://del.icio.us/post?url=http://sharedhat.com/blog/1448/&title=Safariで発生するマーカーが表示されない問題の対処法" title="Share this on del.icio.us"> </a></li><li class="digg"><a href="http://digg.com/submit?phase=2&url=http://sharedhat.com/blog/1448/&title=Safariで発生するマーカーが表示されない問題の対処法" title="Digg this!"> </a></li><li class="furl"><a href="http://www.furl.net/storeIt.jsp?t=Safariで発生するマーカーが表示されない問題の対処法&u=http://sharedhat.com/blog/1448/" title="Share this on Furl"> </a></li><li class="reddit"><a href="http://reddit.com/submit?url=http://sharedhat.com/blog/1448/&title=Safariで発生するマーカーが表示されない問題の対処法" title="Share this on Reddit"> </a></li><li class="yahoo"><a href="http://myweb2.search.yahoo.com/myresults/bookmarklet?t=Safariで発生するマーカーが表示されない問題の対処法&u=http://sharedhat.com/blog/1448/" title="Save this to Yahoo MyWeb"> </a></li><li class="stumble"><a href="http://www.stumbleupon.com/submit?url=http://sharedhat.com/blog/1448/&title=Safariで発生するマーカーが表示されない問題の対処法" title="Stumble upon something good? Share it on StumbleUpon"> </a></li><li class="technorati"><a href="http://technorati.com/faves?add=http://sharedhat.com/blog/1448/" title="Share this on Technorati"> </a></li><li class="mixx"><a href="http://www.mixx.com/submit?page_url=http://sharedhat.com/blog/1448/&amp;title=Safariで発生するマーカーが表示されない問題の対処法" title="Share this on Mixx"> </a></li><li class="myspace"><a href="http://www.myspace.com/Modules/PostTo/Pages/?u=http://sharedhat.com/blog/1448/&amp;t=Safariで発生するマーカーが表示されない問題の対処法" title="Post this to MySpace"> </a></li><li class="designfloat"><a href="http://www.designfloat.com/submit.php?url=http://sharedhat.com/blog/1448/&amp;title=Safariで発生するマーカーが表示されない問題の対処法" title="Submit this to DesignFloat"> </a></li><li class="facebook"><a href="http://www.facebook.com/share.php?u=http://sharedhat.com/blog/1448/&amp;t=Safariで発生するマーカーが表示されない問題の対処法" title="Share this on Facebook"> </a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://sharedhat.com/blog/1448/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DooPHPをインストールしてみた。</title>
		<link>http://sharedhat.com/blog/1402/</link>
		<comments>http://sharedhat.com/blog/1402/#comments</comments>
		<pubDate>Tue, 12 Oct 2010 05:00:23 +0000</pubDate>
		<dc:creator>horry</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[DooPHP]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[install]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://sharedhat.com/?p=1402</guid>
		<description><![CDATA[軽量なPHPフレームワークを探していて、気になっていたPHPフレームワークをインストールしてみました。 サイト(DooPHPのページ)を見る限り、ドキュメントもまとまっていそうなので面白そうなフレームワークです。 速度が [...]]]></description>
			<content:encoded><![CDATA[<p>軽量なPHPフレームワークを探していて、気になっていたPHPフレームワークをインストールしてみました。<br />
サイト(<a title="DooPHP" href="http://www.doophp.com/">DooPHPのページ</a>)を見る限り、ドキュメントもまとまっていそうなので面白そうなフレームワークです。<br />
速度が速いらしいので、パフォーマンスも期待できそうなところです。</p>
<p>まず、<a title="DooPHP" href="http://www.doophp.com/">DooPHP</a>のサイトから最新版をダウンロードしてきます。<br />
<strong>この時点でバージョンは1.2でした。</strong><br />
<span id="more-1402"></span></p>
<h3>フレームワークの解凍と動作確認</h3>
<p>ダウンロードしたアーカイブを展開し、ドキュメントルートに配置します。<br />
この段階で、DooPHPの基本アプリケーションとDooPHPでできているデモアプリケーションにアクセスできます。</p>
<h4>デモアプリケーションへのアクセス</h4>
<p>http://localhost/demos/uri_routing/</p>
<h4>基本アプリケーションへのアクセス</h4>
<p>http://localhost/app/<br />http://localhost/app/index.php</p>
<h3>動作パスの変更(サブディレクトリ)</h3>
<p>DooPHPはアプリケーションのディレクトリを自由にできるみたいなので、ためしに設定ファイルを書き換えて見ます。<br />
動作を確認するために、demosディレクトリを削除し、appディレクトリをexmapleに変えます。</p>
<p>次に、exmapleディレクトリ内のprotected/config内の<strong>common.conf.php</strong>を編集します。</p>
<p>編集する場所は、$config['SITE_PATH']、$config['BASE_PATH']、$config['SUBFOLDER']です。</p>
<h4>編集内容</h4>
<ul class="simpleList">
<li>$config['SITE_PATH']にexmapleディレクトリまでの絶対パスを指定します。</li>
<li>$config['BASE_PATH']にdooframeworkディレクトリまでの絶対パスを指定します。</li>
<li>$config['SUBFOLDER']にexmapleディレクトリを指定します。</li>
</ul>
<p>編集後は下記のようになります。</p>
<p>[php]<br />
//framework use, must defined, user full absolute path and end with / eg. /var/www/project/<br />
$config['SITE_PATH'] = &#8220;C:/var/www/mercurial/doo/exmaple/&#8221;;<br />
$config['BASE_PATH'] = &#8220;C:/var/www/mercurial/doo/dooframework/&#8221;;<br />
$config['APP_MODE'] = &#8216;dev&#8217;;    //for production mode use &#8216;prod&#8217;</p>
<p>//&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; optional, if not defined, default settings are optimized for production mode &#8212;&#8212;&#8212;&#8212;&#8212;-<br />
//if your root directory is /var/www/ and you place this in a subfolder eg. &#8216;app&#8217;, define SUBFOLDER = &#8216;/app/&#8217;</p>
<p>$config['SUBFOLDER'] = &#8220;/exmaple/&#8221;;<br />
[/php]</p>
<p>これで、http://localhost/exmaple/にアクセスすると、基本アプリケーションが実行されるようになります。<br />
<strong>これは、WordpressやMTのようなブログシステムが動いている場合に便利ですね。</strong></p>
<h3>動作パスの変更 &#8211; 直下置き</h3>
<p>次に、サブフォルダを使用しない場合を試して見ます。<br />
exampleディレクトリの中身をドキュメントルートに移動します。<br />
移動が完了したら不要になったexampleディレクトリを削除します。</p>
<p>次にprotected/config内の<strong>common.conf.php</strong>を編集します。</p>
<p>編集する場所は、$config['SITE_PATH']、$config['BASE_PATH']、$config['SUBFOLDER']です。</p>
<h4>編集内容</h4>
<ul class="simpleList">
<li>$config['SITE_PATH']にドキュメントルートまでの絶対パスを指定します。</li>
<li><strong>$config['SUBFOLDER']の部分を削除します。</strong></li>
</ul>
<p>[php]<br />
//framework use, must defined, user full absolute path and end with / eg. /var/www/project/<br />
$config['SITE_PATH'] = &#8220;C:/var/www/mercurial/doo/&#8221;;<br />
$config['BASE_PATH'] = &#8220;C:/var/www/mercurial/doo/dooframework/&#8221;;<br />
$config['APP_MODE'] = &#8216;dev&#8217;;    //for production mode use &#8216;prod&#8217;</p>
<p>//&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; optional, if not defined, default settings are optimized for production mode &#8212;&#8212;&#8212;&#8212;&#8212;-<br />
//if your root directory is /var/www/ and you place this in a subfolder eg. &#8216;app&#8217;, define SUBFOLDER = &#8216;/app/&#8217;<br />
$config['SUBFOLDER'] = &#8220;&#8221;;<br />
[/php]</p>
<p>これで、http://localhost/にアクセスすると、基本アプリケーションが実行されるようになります。</p>
<p>以上でDooPHPのインストールと動作説明は終了です。</p>
<p>ここまでの、手順は下記のページ掲載されているので確認されることをお勧めします。<br />
<a href="http://www.doophp.com/doc/guide/start/install">DooPHPのインストールのページ</a><strong>Similar Posts:</strong>
<ul class="similar-posts">
<li><a href="http://sharedhat.com/project/414/" title="Prosessing Clockの公開を開始しました。">Prosessing Clockの公開を開始しました。</a></li>
<li><a href="http://sharedhat.com/review/1562/" title="Mootools Forgeで使用されているPluginsKitをインストールしてみた">Mootools Forgeで使用されているPluginsKitをインストールしてみた</a></li>
<li><a href="http://sharedhat.com/blog/1124/" title="SkinnyMVCをインストールしてみました。">SkinnyMVCをインストールしてみました。</a></li>
<li><a href="http://sharedhat.com/blog/268/" title="Mootools1.2.1リリース">Mootools1.2.1リリース</a></li>
<li><a href="http://sharedhat.com/review/1576/" title="CodezineのDjangoチュートリアルをやってみた">CodezineのDjangoチュートリアルをやってみた</a></li>
</ul>
<p><!-- Similar Posts took 4.491 ms --></p>
<div class="wp-social-bookmark-menu"><ul class="socials"><li class="script-style"><a href="http://scriptandstyle.com/submit?url=http://sharedhat.com/blog/1402/&title=DooPHPをインストールしてみた。" title="Submit this to Script & Style"> </a></li><li class="blinklist"><a href="http://www.blinklist.com/index.php?Action=Blink/addblink.php&Url=http://sharedhat.com/blog/1402/&Title=DooPHPをインストールしてみた。" title="Share this on Blinklist"> </a></li><li class="delicious"><a href="http://del.icio.us/post?url=http://sharedhat.com/blog/1402/&title=DooPHPをインストールしてみた。" title="Share this on del.icio.us"> </a></li><li class="digg"><a href="http://digg.com/submit?phase=2&url=http://sharedhat.com/blog/1402/&title=DooPHPをインストールしてみた。" title="Digg this!"> </a></li><li class="furl"><a href="http://www.furl.net/storeIt.jsp?t=DooPHPをインストールしてみた。&u=http://sharedhat.com/blog/1402/" title="Share this on Furl"> </a></li><li class="reddit"><a href="http://reddit.com/submit?url=http://sharedhat.com/blog/1402/&title=DooPHPをインストールしてみた。" title="Share this on Reddit"> </a></li><li class="yahoo"><a href="http://myweb2.search.yahoo.com/myresults/bookmarklet?t=DooPHPをインストールしてみた。&u=http://sharedhat.com/blog/1402/" title="Save this to Yahoo MyWeb"> </a></li><li class="stumble"><a href="http://www.stumbleupon.com/submit?url=http://sharedhat.com/blog/1402/&title=DooPHPをインストールしてみた。" title="Stumble upon something good? Share it on StumbleUpon"> </a></li><li class="technorati"><a href="http://technorati.com/faves?add=http://sharedhat.com/blog/1402/" title="Share this on Technorati"> </a></li><li class="mixx"><a href="http://www.mixx.com/submit?page_url=http://sharedhat.com/blog/1402/&amp;title=DooPHPをインストールしてみた。" title="Share this on Mixx"> </a></li><li class="myspace"><a href="http://www.myspace.com/Modules/PostTo/Pages/?u=http://sharedhat.com/blog/1402/&amp;t=DooPHPをインストールしてみた。" title="Post this to MySpace"> </a></li><li class="designfloat"><a href="http://www.designfloat.com/submit.php?url=http://sharedhat.com/blog/1402/&amp;title=DooPHPをインストールしてみた。" title="Submit this to DesignFloat"> </a></li><li class="facebook"><a href="http://www.facebook.com/share.php?u=http://sharedhat.com/blog/1402/&amp;t=DooPHPをインストールしてみた。" title="Share this on Facebook"> </a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://sharedhat.com/blog/1402/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google Map APIのStreetViewServiceを使用し、座標近くのストリートビューを表示する方法</title>
		<link>http://sharedhat.com/blog/1386/</link>
		<comments>http://sharedhat.com/blog/1386/#comments</comments>
		<pubDate>Sat, 09 Oct 2010 02:50:55 +0000</pubDate>
		<dc:creator>horry</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[Google Map API]]></category>
		<category><![CDATA[StreetViewPanorama]]></category>
		<category><![CDATA[StreetViewService]]></category>
		<category><![CDATA[version 3]]></category>

		<guid isPermaLink="false">http://sharedhat.com/?p=1386</guid>
		<description><![CDATA[Google Map APIのストリートビューは、座標の周辺を確認するに便利ですが、座標によってはストリートビューが対応していなかったりしますよね？。 そんなときにはStreetViewServiceクラスを利用して、近 [...]]]></description>
			<content:encoded><![CDATA[<p>Google Map APIのストリートビューは、座標の周辺を確認するに便利ですが、座標によってはストリートビューが対応していなかったりしますよね？。<br />
そんなときにはStreetViewServiceクラスを利用して、近くのストリートビューのポイントを探すとよいと思います。</p>
<p><strong>座標と探す半径を指定するだけで、近くにストリートビューのポイントを簡単に探すことができます。</strong></p>
<h3>jsfiddleのサンプル</h3>
<p><iframe style="width: 100%; height: 300px" src="http://jsfiddle.net/holyshared/GMWC4/14/embedded/"></iframe><br />
<span id="more-1386"></span></p>
<h3>解説</h3>
<p>ソースコードはこんな感じです。<br />
[javascript]<br />
        var gStreetView = new google.maps.StreetViewPanorama($(&#8220;gStreetView&#8221;), {<br />
            heading: 34,<br />
            pitch: 1,<br />
            zoom: 1<br />
        });</p>
<p>        //It looks for the point of the street view from specified coordinates position and radius.<br />
        var nearestLatLng = null, nearestPano = null;<br />
        var client = new google.maps.StreetViewService();</p>
<p>        client.getPanoramaByLocation(point, radius, function(result, status) {<br />
            if (status == google.maps.StreetViewStatus.OK) {<br />
                var location = result.location;<br />
                nearestLatLng = location.latLng;</p>
<p>                gStreetView.setPosition(nearestLatLng);<br />
            }<br />
        });</p>
<p>[/javascript]</p>
<p>まずはじめにStreetViewServiceをインスタンス化します。<br />
[javascript]<br />
var client = new google.maps.StreetViewService();<br />
[/javascript]</p>
<p>次に、getPanoramaByLocationメソッドを実行します。<br />
<strong>引数に座標、検索する半径(メートル)、コールバック関数をとります。<br />
コールバック関数の引数には、結果と結果ステータスが引き渡されます。</strong><br />
後は、結果のステータスを判別して、ストリートビューの座標位置にセットしてあげるだけです。<br />
簡単ですね。<br />
[javascript]<br />
client.getPanoramaByLocation(latlng, radius, callback);<br />
[/javascript]</p>
<p>V3になってからストリートビューの座標位置がわからない人は参考にしてください。</p>
<p><strong>StreetViewService</strong><br />
<a href="http://code.google.com/intl/ja/apis/maps/documentation/javascript/reference.html#StreetViewService">StreetViewServiceクラスのドキュメントはこちら</a><<br />
<!--more--><strong>Similar Posts:</strong>
<ul class="similar-posts">
<li><a href="http://sharedhat.com/blog/1448/" title="Safariで発生するマーカーが表示されない問題の対処法">Safariで発生するマーカーが表示されない問題の対処法</a></li>
<li><a href="http://sharedhat.com/blog/88/" title="ちょっと気になるGoogle Sites">ちょっと気になるGoogle Sites</a></li>
<li><a href="http://sharedhat.com/blog/1282/" title="SkinnyMVCでユーザー認証モジュールの画面フローを実装する">SkinnyMVCでユーザー認証モジュールの画面フローを実装する</a></li>
<li><a href="http://sharedhat.com/project/1653/" title="MootoolsのGoogle Mapsプラグイン、MMap 0.2.1をリリースしました。">MootoolsのGoogle Mapsプラグイン、MMap 0.2.1をリリースしました。</a></li>
<li><a href="http://sharedhat.com/blog/1625/" title="Google Maps API V3のMVCObjectについて">Google Maps API V3のMVCObjectについて</a></li>
</ul>
<p><!-- Similar Posts took 4.266 ms --></p>
<div class="wp-social-bookmark-menu"><ul class="socials"><li class="script-style"><a href="http://scriptandstyle.com/submit?url=http://sharedhat.com/blog/1386/&title=Google Map APIのStreetViewServiceを使用し、座標近くのストリートビューを表示する方法" title="Submit this to Script & Style"> </a></li><li class="blinklist"><a href="http://www.blinklist.com/index.php?Action=Blink/addblink.php&Url=http://sharedhat.com/blog/1386/&Title=Google Map APIのStreetViewServiceを使用し、座標近くのストリートビューを表示する方法" title="Share this on Blinklist"> </a></li><li class="delicious"><a href="http://del.icio.us/post?url=http://sharedhat.com/blog/1386/&title=Google Map APIのStreetViewServiceを使用し、座標近くのストリートビューを表示する方法" title="Share this on del.icio.us"> </a></li><li class="digg"><a href="http://digg.com/submit?phase=2&url=http://sharedhat.com/blog/1386/&title=Google Map APIのStreetViewServiceを使用し、座標近くのストリートビューを表示する方法" title="Digg this!"> </a></li><li class="furl"><a href="http://www.furl.net/storeIt.jsp?t=Google Map APIのStreetViewServiceを使用し、座標近くのストリートビューを表示する方法&u=http://sharedhat.com/blog/1386/" title="Share this on Furl"> </a></li><li class="reddit"><a href="http://reddit.com/submit?url=http://sharedhat.com/blog/1386/&title=Google Map APIのStreetViewServiceを使用し、座標近くのストリートビューを表示する方法" title="Share this on Reddit"> </a></li><li class="yahoo"><a href="http://myweb2.search.yahoo.com/myresults/bookmarklet?t=Google Map APIのStreetViewServiceを使用し、座標近くのストリートビューを表示する方法&u=http://sharedhat.com/blog/1386/" title="Save this to Yahoo MyWeb"> </a></li><li class="stumble"><a href="http://www.stumbleupon.com/submit?url=http://sharedhat.com/blog/1386/&title=Google Map APIのStreetViewServiceを使用し、座標近くのストリートビューを表示する方法" title="Stumble upon something good? Share it on StumbleUpon"> </a></li><li class="technorati"><a href="http://technorati.com/faves?add=http://sharedhat.com/blog/1386/" title="Share this on Technorati"> </a></li><li class="mixx"><a href="http://www.mixx.com/submit?page_url=http://sharedhat.com/blog/1386/&amp;title=Google Map APIのStreetViewServiceを使用し、座標近くのストリートビューを表示する方法" title="Share this on Mixx"> </a></li><li class="myspace"><a href="http://www.myspace.com/Modules/PostTo/Pages/?u=http://sharedhat.com/blog/1386/&amp;t=Google Map APIのStreetViewServiceを使用し、座標近くのストリートビューを表示する方法" title="Post this to MySpace"> </a></li><li class="designfloat"><a href="http://www.designfloat.com/submit.php?url=http://sharedhat.com/blog/1386/&amp;title=Google Map APIのStreetViewServiceを使用し、座標近くのストリートビューを表示する方法" title="Submit this to DesignFloat"> </a></li><li class="facebook"><a href="http://www.facebook.com/share.php?u=http://sharedhat.com/blog/1386/&amp;t=Google Map APIのStreetViewServiceを使用し、座標近くのストリートビューを表示する方法" title="Share this on Facebook"> </a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://sharedhat.com/blog/1386/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQueryでGoogle Map API Version3のカスタムマーカーを作る</title>
		<link>http://sharedhat.com/blog/1377/</link>
		<comments>http://sharedhat.com/blog/1377/#comments</comments>
		<pubDate>Mon, 04 Oct 2010 13:46:07 +0000</pubDate>
		<dc:creator>horry</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[Google Map API]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[marker]]></category>
		<category><![CDATA[OverlayView]]></category>
		<category><![CDATA[version 3]]></category>

		<guid isPermaLink="false">http://sharedhat.com/?p=1377</guid>
		<description><![CDATA[jsdo.itでGoogle Map API Version 3のOverlayviewをサブクラス化して、カスタムマーカーを作成するサンプルを書きました。 ライブラリはjQueryを使用しています。 Mootoolsの [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://jsdo.it/">jsdo.it</a>でGoogle Map API Version 3のOverlayviewをサブクラス化して、カスタムマーカーを作成するサンプルを書きました。<br />
ライブラリはjQueryを使用しています。</p>
<p>MootoolsのMMapプラグインでカスタムマーカーを作成したので、jQueryで書いてみることにしました。</p>
<p><script type="text/javascript" src="http://jsdo.it/blogparts/dAjQ/js"></script></p>
<p class="ttlBpJsdoit" style="width: 465px; margin: 0; text-align: right; font-size: 11px;"><a href="http://jsdo.it/holydesign/dAjQ" title="jQueryでGoogle Map API Version3のカスタムマーカーを作る">jQueryでGoogle Map API Version3のカスタムマーカーを作る &#8211; jsdo.it &#8211; share JavaScript, HTML5 and CSS</a></p>
<p><span id="more-1377"></span></p>
<p>Overlayviewをサブクラス化することで、自分なりの使いやすいマーカーやインフォメーションウィンドウが作成できるので便利です。<strong>Similar Posts:</strong>
<ul class="similar-posts">
<li><a href="http://sharedhat.com/blog/1448/" title="Safariで発生するマーカーが表示されない問題の対処法">Safariで発生するマーカーが表示されない問題の対処法</a></li>
<li><a href="http://sharedhat.com/project/703/" title="Mootools Plugin 「MMap」をリリースしました。">Mootools Plugin 「MMap」をリリースしました。</a></li>
<li><a href="http://sharedhat.com/project/1644/" title="MootoolsのGoogle Mapsプラグイン、MMap0.2をリリースしました。">MootoolsのGoogle Mapsプラグイン、MMap0.2をリリースしました。</a></li>
<li><a href="http://sharedhat.com/project/1527/" title="MootoolsのプラグインStaticMaps0.1.1をリリースしました。">MootoolsのプラグインStaticMaps0.1.1をリリースしました。</a></li>
<li><a href="http://sharedhat.com/blog/1625/" title="Google Maps API V3のMVCObjectについて">Google Maps API V3のMVCObjectについて</a></li>
</ul>
<p><!-- Similar Posts took 3.938 ms --></p>
<div class="wp-social-bookmark-menu"><ul class="socials"><li class="script-style"><a href="http://scriptandstyle.com/submit?url=http://sharedhat.com/blog/1377/&title=jQueryでGoogle Map API Version3のカスタムマーカーを作る" title="Submit this to Script & Style"> </a></li><li class="blinklist"><a href="http://www.blinklist.com/index.php?Action=Blink/addblink.php&Url=http://sharedhat.com/blog/1377/&Title=jQueryでGoogle Map API Version3のカスタムマーカーを作る" title="Share this on Blinklist"> </a></li><li class="delicious"><a href="http://del.icio.us/post?url=http://sharedhat.com/blog/1377/&title=jQueryでGoogle Map API Version3のカスタムマーカーを作る" title="Share this on del.icio.us"> </a></li><li class="digg"><a href="http://digg.com/submit?phase=2&url=http://sharedhat.com/blog/1377/&title=jQueryでGoogle Map API Version3のカスタムマーカーを作る" title="Digg this!"> </a></li><li class="furl"><a href="http://www.furl.net/storeIt.jsp?t=jQueryでGoogle Map API Version3のカスタムマーカーを作る&u=http://sharedhat.com/blog/1377/" title="Share this on Furl"> </a></li><li class="reddit"><a href="http://reddit.com/submit?url=http://sharedhat.com/blog/1377/&title=jQueryでGoogle Map API Version3のカスタムマーカーを作る" title="Share this on Reddit"> </a></li><li class="yahoo"><a href="http://myweb2.search.yahoo.com/myresults/bookmarklet?t=jQueryでGoogle Map API Version3のカスタムマーカーを作る&u=http://sharedhat.com/blog/1377/" title="Save this to Yahoo MyWeb"> </a></li><li class="stumble"><a href="http://www.stumbleupon.com/submit?url=http://sharedhat.com/blog/1377/&title=jQueryでGoogle Map API Version3のカスタムマーカーを作る" title="Stumble upon something good? Share it on StumbleUpon"> </a></li><li class="technorati"><a href="http://technorati.com/faves?add=http://sharedhat.com/blog/1377/" title="Share this on Technorati"> </a></li><li class="mixx"><a href="http://www.mixx.com/submit?page_url=http://sharedhat.com/blog/1377/&amp;title=jQueryでGoogle Map API Version3のカスタムマーカーを作る" title="Share this on Mixx"> </a></li><li class="myspace"><a href="http://www.myspace.com/Modules/PostTo/Pages/?u=http://sharedhat.com/blog/1377/&amp;t=jQueryでGoogle Map API Version3のカスタムマーカーを作る" title="Post this to MySpace"> </a></li><li class="designfloat"><a href="http://www.designfloat.com/submit.php?url=http://sharedhat.com/blog/1377/&amp;title=jQueryでGoogle Map API Version3のカスタムマーカーを作る" title="Submit this to DesignFloat"> </a></li><li class="facebook"><a href="http://www.facebook.com/share.php?u=http://sharedhat.com/blog/1377/&amp;t=jQueryでGoogle Map API Version3のカスタムマーカーを作る" title="Share this on Facebook"> </a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://sharedhat.com/blog/1377/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

