<?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>Kurt Jarchow&#039;s Blog &#187; drupal</title>
	<atom:link href="http://www.kurtjarchow.com/tag/drupal/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.kurtjarchow.com</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Fri, 02 Jul 2010 14:09:30 +0000</lastBuildDate>
	
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Add Drupal Forms using AJAX</title>
		<link>http://www.kurtjarchow.com/2009/01/28/add-drupal-forms-using-ajax-jquer/</link>
		<comments>http://www.kurtjarchow.com/2009/01/28/add-drupal-forms-using-ajax-jquer/#comments</comments>
		<pubDate>Wed, 28 Jan 2009 12:05:55 +0000</pubDate>
		<dc:creator>Kurt Jarchow</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[drupal]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://jarchowk.wordpress.com/?p=125</guid>
		<description><![CDATA[Something very easy to do in drupal is adding form object to the content of your page without doing a page refresh.  I needed to add functionality so that an application form was displayed to a user when they clicked the Apply link.
Using JQuery we can &#8220;intercept&#8221; a client click of a link.  Add a [...]]]></description>
			<content:encoded><![CDATA[<p>Something very easy to do in drupal is adding form object to the content of your page without doing a page refresh.  I needed to add functionality so that an application form was displayed to a user when they clicked the Apply link.</p>
<p>Using JQuery we can &#8220;intercept&#8221; a client click of a link.  Add a .js file to which ever module you are editing, and add the following:</p>
<p><a id="gn55_4" class="wi" title="Drag this note to move it"></a></p>
<div class="ui"><a id="gn55_2" class="qi"></a></div>
<div class="sh">
<blockquote>
<div id="gn55_0" class="qh"> if (Drupal.jsEnabled) {  </p>
<p>  $(document).ready(function () {<br />
    $(&#8217;a.apply-link&#8217;).click(function () {</p>
<p>      var submitApplication = function(data) {<br />
        $(&#8217;div.apply-link&#8217;).html(data.html);<br />
      }</p></div>
<div class="qh">    $.ajax({<br />
      type: &#8216;POST&#8217;,<br />
      url: this.href,<br />
      dataType: &#8216;json&#8217;,<br />
      success: submitApplication,<br />
      data: &#8216;js=1&#8242;<br />
    });<br />
    return false;<br />
  });<br />
  });<br />
}</div>
</blockquote>
<div class="qh">So when a link with a class &#8220;submit-application&#8221; is clicked an ajax/json call is made to the url.  Now make sure the js is included somewhere in your module code by using drupal_add_js(). </div>
</div>
<div class="qh">Now all we have to do is make sure the page renders as json if an ajax call is made.  Add this  code just before the _page exits (but not after the exit(); !).</div>
<blockquote>
<div class="qh"> if (!empty($_POST['js'])) {<br />
    $html = drupal_get_form(&#8217;job_posting_application_form&#8217;, array($node-&gt;nid, $node-&gt;title, $node-&gt;job_posting_email));<br />
    drupal_json(array(<br />
    &#8216;html&#8217; =&gt;  $html<br />
    )<br />
    );</div>
</blockquote>
<div class="qh">Your link should be replaced with the form.</div>
<div class="qh">If you want to add a little bit of animation use the jQuery animation options.  Instead of just replacing the link, make it fade in:</div>
<blockquote>
<div class="qh">$(&#8217;div.apply-link&#8217;).hide();<br />
$(&#8217;div.apply-link&#8217;).html(data.html);<br />
$(&#8217;div.apply-link&#8217;).fadeIn();</div>
</blockquote>
<div class="qh">Credit to <a href="http://www.drupalbook.com/">John K. VanDyk&#8217;s book</a> for breaking the back of this code.</div>
]]></content:encoded>
			<wfw:commentRss>http://www.kurtjarchow.com/2009/01/28/add-drupal-forms-using-ajax-jquer/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>SOLR, Drupal, and GEO Spatial Results</title>
		<link>http://www.kurtjarchow.com/2008/12/14/solr-drupal-geo-spatia/</link>
		<comments>http://www.kurtjarchow.com/2008/12/14/solr-drupal-geo-spatia/#comments</comments>
		<pubDate>Sun, 14 Dec 2008 22:05:38 +0000</pubDate>
		<dc:creator>Kurt Jarchow</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[drupal]]></category>
		<category><![CDATA[geo]]></category>
		<category><![CDATA[solr]]></category>
		<category><![CDATA[spatial]]></category>

		<guid isPermaLink="false">http://jarchowk.wordpress.com/?p=68</guid>
		<description><![CDATA[Our search needed to preform typical longitude and latitude geo-radius spatial results (I&#8217;ve mashed up all of those keywords because I really am not sure what someone will search for to find this post, apologies for the grammar!).  Since I took on SOLR as our search engine I needed to find an elegant solution.
After some [...]]]></description>
			<content:encoded><![CDATA[<p>Our search needed to preform typical longitude and latitude geo-radius spatial results (I&#8217;ve mashed up all of those keywords because I really am not sure what someone will search for to find this post, apologies for the grammar!).  Since I took on SOLR as our search engine I needed to find an elegant solution.</p>
<p>After some search, I found the holy grail: <a href="http://www.gissearch.com/localsolr">Local SOLR</a>.  Not finding much instruction on the official site, I found a <a href="http://www.nsshutdown.com/blog/index.php?itemid=87">great blog post</a> with an explanation and example.  Its fairly easy to install and integrate into drupal.</p>
<ol>
<li>Extract the files and copy them into your solr directory (if your main solr instance is under &#8220;example&#8221;, make it &#8220;example2&#8243;.</li>
<li>Stop your sorl instance (I&#8217;m assuming your on a dev box!) and start the local solr.</li>
<li>Test to see if its working using the localhost cinema example.</li>
<li>If it works find the java files and copy them into your solr project.</li>
<li>Update your solr.config and schema files.  Sorry I don&#8217;t have the exact lines (not at work) but its pretty obvious what lines are local solr related. &lt;edit: read below&gt;</li>
<li>Update the drupal code to send the extra fields (I&#8217;ll try to find the exact ones later) .</li>
<li>You&#8217;re done!</li>
</ol>
<p>The only gotcha I found, resulting in a few lost hairs and an increase in blood pressure, was a funny error concerning the comments field.  The error I received was a integer conversion error, which I eventually found out was the number of comments being blank.  Just make sure you adjust your apachesolr.module file to set comments to zero when it is null.</p>
<p>I&#8217;ll try to get the drupal developers to support local solr so we can have some official code for you to use.</p>
<p>That&#8217;s it for now!</p>
<p>&lt;update&gt;</p>
<p>As suggested I&#8217;ll post this on the Drupal website, but for anyone interested the updates to the solr.config and scheme files:</p>
<p>::schema.xml</p>
<p>&lt;field name=&#8221;lat&#8221; type=&#8221;sdouble&#8221; indexed=&#8221;true&#8221; stored=&#8221;true&#8221;/&gt;<br />
&lt;field name=&#8221;lng&#8221; type=&#8221;sdouble&#8221; indexed=&#8221;true&#8221; stored=&#8221;true&#8221;/&gt;<br />
&lt;field name=&#8221;geo_distance&#8221; type=&#8221;sdouble&#8221;/&gt;<br />
&lt;dynamicField name=&#8221;_local*&#8221; type=&#8221;sdouble&#8221; indexed=&#8221;true&#8221; stored=&#8221;true&#8221;/&gt;</p>
<p>::solr.config</p>
<p>line 177</p>
<p>&lt;searchComponent name=&#8221;localsolr&#8221;     class=&#8221;com.pjaol.search.solr.</p>
<div id="10m" class="ArwC7c ckChnd">component.LocalSolrQueryComponent&#8221; &gt;<br />
&lt;str name=&#8221;latField&#8221;&gt;lat&lt;/str&gt;<br />
&lt;str name=&#8221;lngField&#8221;&gt;lng&lt;/str&gt;<br />
&lt;/searchComponent&gt;</p>
<p>&lt;!&#8211; local lucene request handler &#8211;&gt;<br />
&lt;requestHandler name=&#8221;geo&#8221; class=&#8221;org.apache.solr.handler.component.SearchHandler&#8221;&gt;<br />
&lt;lst name=&#8221;defaults&#8221;&gt;<br />
&lt;str name=&#8221;echoParams&#8221;&gt;explicit&lt;/str&gt;<br />
&lt;/lst&gt;<br />
&lt;arr name=&#8221;components&#8221;&gt;<br />
&lt;str&gt;localsolr&lt;/str&gt;<br />
&lt;str&gt;facet&lt;/str&gt;<br />
&lt;str&gt;mlt&lt;/str&gt;<br />
&lt;str&gt;highlight&lt;/str&gt;<br />
&lt;str&gt;debug&lt;/str&gt;<br />
&lt;/arr&gt;<br />
&lt;/requestHandler&gt;</p></div>
<div class="ArwC7c ckChnd"></div>
<div class="ArwC7c ckChnd">line 574</div>
<div class="ArwC7c ckChnd">
&lt;searchComponent name=&#8221;localsolr&#8221;     class=&#8221;com.pjaol.search.solr.</p>
<div id="10m" class="ArwC7c ckChnd">component.LocalSolrQueryComponent&#8221; &gt;<br />
&lt;str name=&#8221;latField&#8221;&gt;lat&lt;/str&gt;<br />
&lt;str name=&#8221;lngField&#8221;&gt;lng&lt;/str&gt;<br />
&lt;/searchComponent&gt;</p>
<p>&lt;!&#8211; local lucene request handler &#8211;&gt;<br />
&lt;requestHandler name=&#8221;geo&#8221; class=&#8221;org.apache.solr.handler.component.SearchHandler&#8221;&gt;<br />
&lt;lst name=&#8221;defaults&#8221;&gt;<br />
&lt;str name=&#8221;echoParams&#8221;&gt;explicit&lt;/str&gt;<br />
&lt;/lst&gt;<br />
&lt;arr name=&#8221;components&#8221;&gt;<br />
&lt;str&gt;localsolr&lt;/str&gt;<br />
&lt;str&gt;facet&lt;/str&gt;<br />
&lt;str&gt;mlt&lt;/str&gt;<br />
&lt;str&gt;highlight&lt;/str&gt;<br />
&lt;str&gt;debug&lt;/str&gt;<br />
&lt;/arr&gt;<br />
&lt;/requestHandler&gt;</p></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.kurtjarchow.com/2008/12/14/solr-drupal-geo-spatia/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Building a Multinational Website</title>
		<link>http://www.kurtjarchow.com/2008/11/19/building-a-multinational-website/</link>
		<comments>http://www.kurtjarchow.com/2008/11/19/building-a-multinational-website/#comments</comments>
		<pubDate>Wed, 19 Nov 2008 22:28:26 +0000</pubDate>
		<dc:creator>Kurt Jarchow</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[drupal]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[LAMP]]></category>
		<category><![CDATA[sorl]]></category>

		<guid isPermaLink="false">http://jarchowk.wordpress.com/?p=53</guid>
		<description><![CDATA[There is nothing easy about building a multiple-location, multi-lingual website.  The options are getting better and better however to make this as smooth as possible.
I&#8217;ve been blogging about my experiences, starting from scratch, learning the LAMP stack and delivering a high quality, high performance solutions.  I&#8217;ve had my head in a few books lately; a [...]]]></description>
			<content:encoded><![CDATA[<p>There is nothing easy about building a multiple-location, multi-lingual website.  The options are getting better and better however to make this as smooth as possible.</p>
<p>I&#8217;ve been blogging about my experiences, starting from scratch, learning the LAMP stack and delivering a high quality, high performance solutions.  I&#8217;ve had my head in a few books lately; a php beginners book, a php advanced book, and a Drupal Pro book.  My eyes are heavy but I have a prototype to my end solution.</p>
<p>Building a solr search driven search site is completely painless, and getting faceted search options are completely customizable.  Out of the box, Drupal gives our website about 60% of our functionality.</p>
<p>However, be prepared: Drupal is a whole other language unto itself.  Coming from a nice SDK an a .Net environment, the vast number of function names you need to remember is quite dawnting.  .Net feels much cleaner- that being said I think I can do much more with the php code.</p>
<p>My next steps will be mastering the Jquery integration.  This site needs to feel real 2.0, and I plan on keeping up with key AJAX function.</p>
<p>That&#8217;s it for me tonight, time for some sleep.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kurtjarchow.com/2008/11/19/building-a-multinational-website/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
