<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><atom:link rel="hub" href="http://tumblr.superfeedr.com/" xmlns:atom="http://www.w3.org/2005/Atom"/><description>Israel is a geek for hire and a Complete Web Strategy Consultant. He’s so good at programming he was once called a “god of programming” by his grand ma.</description><title>!Neutral Ground</title><generator>Tumblr (3.0; @israelcanasa)</generator><link>http://israelcanasa.com/</link><item><title>Update: Yes I'm still here</title><description>&lt;p&gt;What happened to the &amp;#8220;Learning Nooku&amp;#8221; series from last year? Yes it stopped. It stopped abruptly.&lt;/p&gt;
&lt;p&gt;Why? Because I got overwhelmed by the torrent of improvements in the Nooku Framework. Yes friends, since I wrote my journey a year ago a lot of things have changed. A lot of things I wrote are now obsolete! So I will archive my posts, and maybe write another one.&lt;/p&gt;
&lt;p&gt;Here&amp;#8217;s a VERY brief summary of what&amp;#8217;s new.&lt;/p&gt;
&lt;h2&gt;REST&lt;/h2&gt;
&lt;p&gt;REST is the architecture that powers Web 2.0 and beyond. Any application that is properly using Nooku will automatically be RESTful without extra work. Just use the Nooku&amp;#8217;s controller and database package, and you&amp;#8217;re all set. Your app is already compliant on REST specifications. Even if you don&amp;#8217;t completely understand REST, just understand Nooku(which is really easy) and everything will be taken care of for you!&lt;/p&gt;
&lt;h2&gt;Controller Behaviors&lt;/h2&gt;
&lt;p&gt;Another powerful and fun improvement in Nooku is the Controller behavior. This is really neat concept that will make your Nooku code even more reusable. One year ago, Nooku developers are already praising Nooku for helping them reuse and organize their code. How much more now! Controller behaviors puts some weight and clutter off your main controller&amp;#8217;s code and forces you to code beautifully by reducing tight coupling and increasing reusablity!&lt;/p&gt;
&lt;h2&gt;View and Template Improvements&lt;/h2&gt;
&lt;p&gt;Basically, nothing much have changed in how views and templates work. But some improvements are notable like the new &amp;#8216;Chrome&amp;#8217; and &amp;#8216;Module&amp;#8217; filters.&lt;/p&gt;
&lt;p&gt;The Chrome filter wraps your template&amp;#8217;s output into a Joomla module wrapper. This will make your app look more compatible with the current template that Joomla is using. This concept is already implemented by Ninjaboard. Did you notice how Ninjaboard adapts(like a Chameleon) to any Joomla template with dark or light theme? Amazing isn&amp;#8217;t it? You can use that same technology in your Nooku Apps with just one piece of code!&lt;/p&gt;
&lt;p&gt;The new Module filter allows you to insert a piece of output to any Module position in Joomla. This is another neat concept that gives power to developers. More information about this change can be found here: &lt;a href="http://blog.nooku.org/2011/08/say-hello-to-the-dynamic-module-injector/."&gt;http://blog.nooku.org/2011/08/say-hello-to-the-dynamic-module-injector/.&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;KFactory, KIdentifier Refactoring - KService&lt;/h2&gt;
&lt;p&gt;One big change that can break your old Nooku code is the KFactory refactoring. It is now renamed to KService. The refactoring was done to complete the implementation of the Service Oriented Architecture. Before this refactor, services(which are actually objects) are accessed through an identifier using this format: &lt;/p&gt;
&lt;p&gt;[application::]type.package.path.name&lt;/p&gt;
&lt;p&gt;Now it&amp;#8217;s using a more standardized format which everyone is familar with. The Uniform Resource Locator(URL) &lt;a href="http://www.ietf.org/rfc/rfc1738.txt."&gt;http://www.ietf.org/rfc/rfc1738.txt.&lt;/a&gt; The format now looks like this:&lt;/p&gt;
&lt;p&gt;type:[//application/]package.path.name&lt;/p&gt;
&lt;p&gt;Another change is the removal of KFactory::tmp. Use KService::get() instead. KService::get() will always instantiate a new object much like KFactory::tmp().  But if the class is intentionally a singleton(implementing the KServiceInstantiatable interface), KService::get() will return the single instantiated object.&lt;/p&gt;
&lt;p&gt;So how does this help you? Well, for one, the object identifiers are now more familiar and is actually following a standard. Which means it&amp;#8217;s easier to explain. And of course, this improvement has also allowed some optimizations that makes KService more efficient.&lt;/p&gt;
&lt;p&gt;Better look inside the Nooku code to see it in action or check the &lt;a href="https://nooku.assembla.com/spaces/nooku-framework/wiki/KService" title="Nooku KService" target="_blank"&gt;wiki&lt;/a&gt; about this change.&lt;/p&gt;
&lt;h3&gt;There are more improvements actually&lt;/h3&gt;
&lt;p&gt;But we can&amp;#8217;t list them all. These are just some of the significant improvements. But by the looks of it, I believe that the best time to learn Nooku is now. It has gotten more stable and a lot better than the version last year.&lt;/p&gt;
&lt;div&gt;&lt;/div&gt;
&lt;p&gt;&lt;span&gt;The new features of Nooku are so awesome! But of course it will take some learning curve. Once I feel that it reached a certain level of stability, I will continue writing about it in my blog. &lt;/span&gt;&lt;/p&gt;</description><link>http://israelcanasa.com/post/12840005530</link><guid>http://israelcanasa.com/post/12840005530</guid><pubDate>Wed, 16 Nov 2011 01:05:00 +0800</pubDate></item><item><title>are you still working with Nooku?  I read your articles on starting out with Nooku, but noticed they were entered a year ago.  I find myself in a VERY similar place as yourself (wanting a good PHP MVC (or HMVC) framework AND an existing CMS system combo).  Nooku looked like "CakePHP meets Joomla" and that was ideal for me.  Just wondering how it was going (if at all) with Nooku.</title><description>&lt;p&gt;Hi! Yes I’m still working on Nooku. In fact I got employed by Johan Janssens’s company which allowed me to get a little more intimate with Nooku’s developments and the privilege to learn from the master himself.&lt;/p&gt;
&lt;p&gt;Yes, Nooku is a great tool especially if you’re working on Web Applications inside a CMS shell like Joomla. But I’ll hardly compare it to CakePHP, Nooku is far more than that :).&lt;/p&gt;
&lt;p&gt;Nooku is being developed in a fast pace, right now it’s in Alpha 4. There will be one alpha left, then the Beta. I think we can expect a stable by mid 2012 but that’s just a guess!&lt;/p&gt;
&lt;p&gt;Thanks for getting in touch!&lt;/p&gt;</description><link>http://israelcanasa.com/post/12839477327</link><guid>http://israelcanasa.com/post/12839477327</guid><pubDate>Wed, 16 Nov 2011 00:46:00 +0800</pubDate></item><item><title>Simplest DB Access in Nooku</title><description>&lt;h1 id="part_3_accessing_and_displaying_database_records"&gt;Learning Nooku Part 3: Accessing and Displaying Database Records&lt;/h1&gt;
&lt;blockquote&gt;
&lt;p&gt;This is Part 3 of a series of posts where I document my learning process in studying Nooku. I’m a total Noob to Nooku so this might help other Nooku noobs to learn the framework. &lt;/p&gt;
&lt;p&gt;You can read the &lt;a href="http://israelcanasa.com/post/1115813980/learning-nooku"&gt;Introduction of Learning Nooku Here&lt;/a&gt;. &lt;/p&gt;
&lt;p&gt;Update: Download the component at this stage here - &lt;a href="http://dl.dropbox.com/u/1051568/nooku/com_awesome-part3.zip"&gt;com_awesome-part3.zip&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="http://israelcanasa.com/post/1119269918/simplest-nooku-component"&gt;In Part 2&lt;/a&gt;, I learned 3 things.  &lt;/p&gt;
&lt;ul&gt;&lt;li&gt;Nooku does many things automagically. If it doesn’t see an expected class or object in your component, it will fall back to layers of objects using its &lt;strong&gt;Cascading Class Override System&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;First layer of fall back is &lt;code&gt;com_default&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Nooku is a &lt;a href="http://en.wikipedia.org/wiki/Representational_State_Transfer"&gt;REST&lt;/a&gt;ful framework, which means that “Requests and responses are built around the transfer of &lt;strong&gt;representations of resources&lt;/strong&gt;”.  Because of the RESTful architecture, the URL used to access a Nooku application is meaningful. So when you try to access a singular or plural resource, Nooku will deal with it accordingly.&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;In this post I&amp;#8217;ll try to use some Nooku magic by accessing resources from the database.&lt;!-- more --&gt;&lt;/p&gt;
&lt;p&gt;Although I haven’t delved deeper into Nooku’s RESTful architecture, the first thing a noob will encounter is the significance of singular/plural resources.  In Nooku, we access a resource by specifying it in the &lt;code&gt;view&lt;/code&gt; variable in the request. If the &lt;code&gt;view&lt;/code&gt; is plural, Nooku will try to return a collection of resources. If thew &lt;code&gt;view&lt;/code&gt; is singular, Nooku will try to return a single object.&lt;/p&gt;
&lt;p&gt;This becomes more apparent when we use Models in Nooku. In Part 2, I was trying to simply display a “dashboard”. It’s not a resource but it’s supposed to display a collection of resources. A dashboard doesn’t fit the mold of “singular” or “plural”. I simply want to display anything in the dashboard, and in this case a simple text.&lt;/p&gt;
&lt;p&gt;But by default, Nooku will assume that I’m accessing a Database resource and it will automagically fetch data from a database table &lt;code&gt;jos_awesome_dashboards&lt;/code&gt;. To override this default behavior, I had to create &lt;code&gt;com_awesome/models/dashboards.php&lt;/code&gt; and then I created a class &lt;code&gt;ComAwesomeModelDashboards&lt;/code&gt; which extends the base non-magic Model in Nooku, &lt;code&gt;KModelAbstract&lt;/code&gt;. The magics happen in &lt;code&gt;KModelDefault&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id="magically_listing_a_collection_of_resources"&gt;Magically Listing a Collection of Resources&lt;/h2&gt;
&lt;p&gt;Now that I understand how plural/singular resources are handled in Nooku, I’ll try to put that knowledge into use. I will now make &lt;code&gt;com_awesome&lt;/code&gt; list resources from the database.&lt;/p&gt;
&lt;p&gt;I’ll make a generic resource named &lt;code&gt;item&lt;/code&gt;. If I try to access the “item” resources at this stage using &lt;code&gt;index.php?option=com_awesome&amp;amp;view=items&lt;/code&gt;,  I’ll get an error Table &lt;strong&gt;‘database.&lt;code&gt;jos_awesome_items&lt;/code&gt;’ doesn’t exist of the following query&amp;#160;: SHOW FULL COLUMNS FROM. &lt;code&gt;jos_awesome_items&lt;/code&gt;&lt;/strong&gt;.  So I created what it’s looking for, a table named &lt;code&gt;jos_awesome_items&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Now that the table has been created, Nooku is looking for &lt;code&gt;com_awesome/views/items/tmpl/default.php&lt;/code&gt;. So I also created it.&lt;/p&gt;
&lt;p&gt;I have to populate the table &lt;code&gt;jos_awesome_items&lt;/code&gt; with dummy content. But first I added 2 columns in the table: &lt;code&gt;awesome_item_id&lt;/code&gt;(according to Nooku’s table field naming convention) as primary key and &lt;code&gt;name&lt;/code&gt; as varchar. Then I populated the table with anything that came to my mind. I added &lt;code&gt;Duck&lt;/code&gt;, &lt;code&gt;Airplane&lt;/code&gt;, and &lt;code&gt;Juice&lt;/code&gt;.&lt;/p&gt;
&lt;p class="center"&gt;&lt;img src="http://media.tumblr.com/tumblr_l8rx90GmpC1qd11ge.png"/&gt;&lt;/p&gt;
&lt;p&gt;At this point, I’m assuming that Nooku’s magic will work. I haven’t created a Model for &lt;code&gt;items&lt;/code&gt; yet, nor have I created a View for it. I just created a Database table and populated it with random data. I am assuming that Nooku will display the data automagically if I create a template for it. Here’s the template that I created:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;com_awesome/views/items/tmpl/default.php&lt;/strong&gt;&lt;/p&gt;
&lt;pre class="brush: xml"&gt;&amp;lt;ul&amp;gt;
&amp;lt;?php foreach ($items as $item): ?&amp;gt;
    &amp;lt;li&amp;gt;&amp;lt;?= $item-&amp;gt;name;?&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;?php endforeach ?&amp;gt;
&amp;lt;/ul&amp;gt;
&lt;/pre&gt;
&lt;p&gt;Trying to access it using &lt;code&gt;index.php?option=com_awesome&amp;amp;view=items&lt;/code&gt;, bahm! The list is there, Magically!&lt;/p&gt;
&lt;p class="center"&gt;&lt;img src="http://media.tumblr.com/tumblr_l8rxcjQMEF1qd11ge.png"/&gt;&lt;/p&gt;
&lt;p&gt;Now I hear many people saying “amazingly awesomeful!”&lt;/p&gt;
&lt;h3 id="but_i8217m_afraid_of_magic"&gt;But I’m afraid of Magic&lt;/h3&gt;
&lt;p&gt;As of this stage, my feelings are mixed. In one hand I’m delighted that the most basic and elementary functionalities are taken care of by Nooku.  On the other hand, I dread the time when I have to do something unconventional, I’ll need to override the Magics first so I can proceed with my unique app freely.&lt;/p&gt;
&lt;p&gt;I already have a bad feeling when I created an empty &lt;code&gt;ComAwesomeModelDashboards&lt;/code&gt; whose only purpose is to disable magic so I can display a dashboard.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Magic Frameworks make simple things really simple, but complicated things really hard.&lt;/strong&gt; I can only hope it’s not true in Nooku. I’ll learn as I go on.&lt;/p&gt;
&lt;p&gt;I just have to accept that there are Tradeoffs… I can’t have everything. But I can’t help but wonder if I can easily disable all the Magic that Nooku does and simply start with the bare minimum.&lt;/p&gt;
&lt;h2 id="magically_displaying_a_single_object"&gt;Magically Displaying a Single Object&lt;/h2&gt;
&lt;p&gt;So now I’m just dealing with 2 files to display a collection of resources from the database. The dispatcher file and the template file. Everything else is automagically handled by Nooku. I guess it’s the same when displaying a single resource from the database. So now I’ll access a singular &lt;code&gt;index.php?option=com_awesome&amp;amp;view=item&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;In Part 2, I learned that accessing a singular item will make Nooku assume that you’re editing an object. In this case, Nooku is now looking for &lt;code&gt;/com_awesome/views/item/tmpl/form.php&lt;/code&gt;.  I created this file, and put this code there:&lt;/p&gt;
&lt;pre class="brush: php"&gt;&amp;lt;?php echo $item-&amp;gt;name; ?&amp;gt;
&lt;/pre&gt;
&lt;p&gt;I accessed it by specifying an &lt;code&gt;id&lt;/code&gt; in the URL &lt;code&gt;index.php?option=com_awesome&amp;amp;view=item&amp;amp;id=1&lt;/code&gt;.&lt;/p&gt;
&lt;p class="center"&gt;&lt;img src="http://media.tumblr.com/tumblr_l8s59hdXqV1qd11ge.png"/&gt;&lt;/p&gt;
&lt;p&gt;Great! It worked as expected. It displayed the text &lt;code&gt;Duck&lt;/code&gt; which is the &lt;code&gt;name&lt;/code&gt; of an entry in the database with &lt;code&gt;id = 1&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id="summary"&gt;Summary&lt;/h2&gt;
&lt;p&gt;In this session, I learned that Nooku is a Database centric framework. Most of the Magic I encountered in Nooku seems to revolve around Database CRUD(Create Read Update Delete).  At this stage, I was able to experience how easy the “Read” part is. By simply creating database entries and accessing those entries directly from the Template, I was able to display data.  I had no need to create controller, model, and view classes.&lt;/p&gt;
&lt;p&gt;However, I also had a bad feeling about it. As a programmer, my experience has always been that CRUD is not as simple as it sounds. When dealing with real world apps, I usually customize every bit of the app.  Basic CRUD goes to the trash. What I want to know is how Nooku can help me create complicated, unconventional apps.&lt;/p&gt;
&lt;p&gt;I haven’t decided yet what to tackle next. It seems that I don’t want to delve on CRUD anymore as it is so elementary I might be wasting my time. So my next entry could be any topic, and it should be a little more advanced.&lt;/p&gt;</description><link>http://israelcanasa.com/post/1125078952</link><guid>http://israelcanasa.com/post/1125078952</guid><pubDate>Wed, 15 Sep 2010 13:38:00 +0800</pubDate><category>nooku</category><category>PHP Frameworks</category><category>learning nooku</category><category>joomla</category></item><item><title>Simplest Nooku Component </title><description>&lt;h1 id="part_2_displaying_a_simple_text"&gt;Learning Nooku Part 2: Displaying a Simple Text&lt;/h1&gt;
&lt;blockquote&gt;
&lt;p&gt;This is Part 2 of a series of posts where I document my learning process in studying Nooku. I’m a total Noob to Nooku so this might help other Nooku noobs to learn the framework.&lt;/p&gt;
&lt;p&gt;You can read the &lt;a title="Learning Nooku" target="_blank" href="http://israelcanasa.com/post/1115813980/learning-nooku"&gt;Introduction of Learning Nooku Here&lt;/a&gt;. &lt;/p&gt;
&lt;p&gt;Update: Download the component at this stage here - &lt;a href="http://dl.dropbox.com/u/1051568/nooku/com_awesome-part2.zip"&gt;com_awesome-part2.zip&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;In order to understand the Nooku Framework, I want to know what it does for me so I’ll also know what’s left for me to do. The first thing I want to know are the Magics that I can use.&lt;/p&gt;
&lt;p&gt;In documenting this learning process, I’m looking at &lt;code&gt;com_harbour&lt;/code&gt;. It&amp;#8217;s a &lt;a target="_blank" href="http://nooku.assembla.com/spaces/nooku-examples/wiki?id=nooku-examples&amp;amp;wiki_id=com_harbour"&gt;sample component for Nooku&lt;/a&gt;. But I won’t reference code examples from &lt;code&gt;com_harbour&lt;/code&gt; here.  I’ll just use it as a jumpstart, then anything I want to do for my first simple app, I’ll find out through experimentation.&lt;/p&gt;
&lt;p&gt;In order to fully understand how Magic works in Nooku, I need a bit of experimenting. What is the bare minimum amount of files needed to display a simple text, “Whatever”? Of course you can simply echo text from the entry point. But if we want to use the MVC, we’ll follow the convention.&lt;/p&gt;
&lt;p&gt;So I&amp;#8217;ll make my first Joomla Component powered by Nooku. I&amp;#8217;ll name it &lt;code&gt;com_awesome&lt;/code&gt;. As a start, I&amp;#8217;ll just make it display any text like &amp;#8220;Hello World&amp;#8221;.&lt;!-- more --&gt;&lt;/p&gt;
&lt;h2 id="the_dispatcher"&gt;The Dispatcher&lt;/h2&gt;
&lt;p&gt;In my entry point for Joomla(the first file that Joomla executes when running the component), I&amp;#8217;ll put the dispatcher.&lt;/p&gt;
&lt;h4 id="administrator_components_com_awesome_awesonephp"&gt;administrator/components/com_awesome/awesone.php&lt;/h4&gt;
&lt;pre class="brush: php"&gt;&amp;lt;?php
// Check if Koowa is active
if(!defined('KOOWA')) {
    JError::raiseWarning(0, JText::_("Koowa wasn't found. Please install the Koowa plugin and enable it."));
    return;
}

// Create the controller dispatcher
echo 
KFactory::get('admin::com.awesome.dispatcher')-&amp;gt;dispatch(KRequest::get('get.view', 'cmd', 'dashboard'));&lt;/pre&gt;
&lt;p&gt;From the code alone, I can see that &lt;code&gt;KFactory is used&lt;/code&gt; to call a dispatcher object. Inside &lt;code&gt;KFactory::get()&lt;/code&gt; is a key or identifier that maps to the dispatch object. I noticed that &lt;code&gt;KFactory::get&lt;/code&gt; is commonly used in Nooku applications. Looking at the code, I think &lt;code&gt;KFactory::get&lt;/code&gt; instantiates and returns objects according to the identifier, if the object is already instantiated, &lt;code&gt;KFactory::get&lt;/code&gt; will return the same instance.&lt;/p&gt;
&lt;p&gt;So in the entry point, the controller is dispatched. This is the first magic that I encountered. I am calling a dispatcher, but I don’t need to create a dispatcher file.  If Nooku doesn’t find a dispatcher in your component, it will fall back to its default dispatcher. If I want to override the dispatcher, I just have to create &lt;code&gt;com_awesome/dispatcher.php&lt;/code&gt; and extend the &lt;code&gt;ComDefaultDispatcherDefault&lt;/code&gt; class.&lt;/p&gt;
&lt;pre class="brush: php"&gt;&amp;lt;?php

class ComAwesomeDispatcher extends ComDefaultDispatcherDefault 
{

}
&lt;/pre&gt;
&lt;p&gt;While finding out about this pattern, I was overwhelmed by the many things that was going on in the source code. &lt;code&gt;ComDefaultDispatcherDefault&lt;/code&gt; extends &lt;code&gt;KDispatcherDefault&lt;/code&gt; extends &lt;code&gt;KDispatcherAbstract&lt;/code&gt; which extends &lt;code&gt;KControllerAbstract&lt;/code&gt; which extends &lt;code&gt;KObject&lt;/code&gt; and implements &lt;code&gt;KObjectIdentifiable&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Whew! I initially thought that I’ll find a &lt;code&gt;dispatch&lt;/code&gt; method somewhere along the hierarchy. But I didn’t find it. Digging deeper, I found out that I was actually calling &lt;code&gt;_actionDispatch&lt;/code&gt; from &lt;code&gt;ComDefaultDispatcherDefault&lt;/code&gt;.  Maybe I don’t need to explain in detail what I found out but suffice it to say that the more I dig deeper, the more I find awesomeness. It is simply “genius”! I can already imagine how I can put those things into good use!&lt;/p&gt;
&lt;p&gt;So we don’t need to create a dispatcher file unless you really really need to override Nooku’s default dispatcher.&lt;/p&gt;
&lt;p&gt;While going through this learning process, I learned this very important concept in Nooku: &lt;strong&gt;For things you don’t create, Nooku has a fall back&lt;/strong&gt;.  What you’re actually writing is the code that’s unique to your application!&lt;/p&gt;
&lt;h2&gt;The Model&lt;/h2&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: This section is now irrelevant. The 99-toolbar branch of Nooku(which will soon be merged with the 0.7 trunk) has fixed this issue. &lt;em&gt;(Edited Sept 29, 2010)&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;One thing I realized while experimenting on Nooku is that it is very Database-centric framework. Most of the Magic happens by automagically doing the most common tasks in accessing and displaying database data. &lt;/p&gt;
&lt;p&gt;So by now I&amp;#8217;ve just created one file. That is the component&amp;#8217;s entry point. From there I called the dispatcher. By default, the dispatcher tries to access the &amp;#8220;dashboard&amp;#8221; view. The second magic that I encountered was when I tried to access the component without creating any other files. I encountered this error:&lt;/p&gt;
&lt;p&gt;Table &lt;strong&gt;&amp;#8216;database.jos_awesome_dashboards&amp;#8217; doesn&amp;#8217;t exist of the following query&amp;#160;: SHOW FULL COLUMNS FROM `jos_awesome_dashboards`&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;img src="http://media.tumblr.com/tumblr_l8s5dv0MlP1qd11ge.png"/&gt;&lt;br/&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;I soon realized that Nooku is trying to do its magic by falling back to a default model object for me which seems to automagically gets data from the database. But I don&amp;#8217;t want this yet as I simply want to display text. So I had to override the default Model by creating an empty base Model.&lt;/p&gt;
&lt;p&gt;So here&amp;#8217;s what I did. I created &lt;code&gt;/com_awesome/models/dashboards.php&lt;/code&gt; and created this class&lt;/p&gt;
&lt;pre class="brush: php"&gt;&amp;lt;?php
class ComAwesomeModelDashboards extends KModelAbstract
{
	
}
&lt;/pre&gt;
&lt;p&gt;By creating this class, Nooku doesn&amp;#8217;t fall back to the default Model. It uses this Model which extends the most basic and core Model Class in Nooku which doesn&amp;#8217;t have any Magic in it. &lt;/p&gt;
&lt;p&gt;This removed the error but I encountered another error which is related to the View.&lt;/p&gt;
&lt;h2 id="the_view"&gt;The View&lt;/h2&gt;
&lt;p&gt;If there is nothing different in what you want to do, you don’t need to create a controller and a model, and a view class. All I want to do here is to display text. I&amp;#8217;ll proceed in creating a view template. Going back to the dispatcher I noticed that I&amp;#8217;m passing a default view variable.&lt;/p&gt;
&lt;pre class="brush: php"&gt;KFactory::get('admin::com.awesome.dispatcher')-&amp;gt;dispatch(KRequest::get('get.view', 'cmd', 'dashboard'));&lt;/pre&gt;
&lt;p&gt;If no &lt;code&gt;view&lt;/code&gt; variable is passed through &lt;code&gt;$_GET&lt;/code&gt;, the default value &lt;code&gt;dashboard&lt;/code&gt; will be used. From my readings about Nooku, I found out that passing the &lt;code&gt;controller&lt;/code&gt; value through &lt;code&gt;$_GET&lt;/code&gt; is a bad practice.  So what Nooku expects is the &lt;code&gt;view&lt;/code&gt; which makes your application “RESTful”(as Johan puts it).&lt;/p&gt;
&lt;p&gt;So to create a view, I created &lt;code&gt;/com_awesome/views&lt;/code&gt; directory. Then I created &lt;code&gt;/com_awesome/views/dashboard&lt;/code&gt; directory, then I created &lt;code&gt;/com_awesome/views/dashboard/tmpl&lt;/code&gt; directory,  and finally, I mistakenly created a &lt;code&gt;/com_awesome/views/dashboard/tmpl/default.php&lt;/code&gt; file. I said it’s a mistake, I initially thought it was the most natural thing to do, but this mistake helped me understand another fundamental concept in Nooku.&lt;/p&gt;
&lt;p&gt;If you also commit my mistake you’ll get this error &lt;code&gt;Template "com_awesome/views/dashboard/tmpl/form.php" not found&lt;/code&gt;. Why? Because &lt;code&gt;dashboard&lt;/code&gt; is singular.  And by default, when you access a singular &lt;code&gt;view&lt;/code&gt;, Nooku assumes that you are trying to edit an object. So I went ahead and created a &lt;code&gt;/com_awesome/views/dashboard/tmpl/form.php&lt;/code&gt; file. I placed a text like “This is form.php” in that file.&lt;/p&gt;
&lt;p&gt;Now if I access my component using &lt;code&gt;index.php?option=com_awesome,&lt;/code&gt; the text I put in &lt;code&gt;/com_awesome/views/dashboard/tmpl/form.php&lt;/code&gt; is displayed  and l also noticed that there are 3 standard action buttons on the top right corner - Save, Apply, Cancel.&lt;/p&gt;
&lt;p&gt;&lt;img src="http://media.tumblr.com/tumblr_l8q666PgmN1qd11ge.png"/&gt;&lt;/p&gt;
&lt;p&gt;This seems to be the default Nooku behavior if I don’t override the fallback classes. In this case, since I did not create controller, model and view classes, Nooku uses the default classes from &lt;code&gt;com_default&lt;/code&gt; - the first layer of fallback.  If I don’t have &lt;code&gt;com_default&lt;/code&gt; Nooku will fallback even deeper using classes from its core.&lt;/p&gt;
&lt;p&gt;So I don’t need to create classes, I just created 2 files and a directory hierarchy, and bahm! I am displaying something.&lt;/p&gt;
&lt;h2 id="what_is_8220com_default8221"&gt;What is “com_default”?&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;com_default&lt;/code&gt; is Nooku’s first layer of fallback. It is located in Joomla’s site and admin component directory. It contains many “common” things found in Joomla applications  so it’s the developer’s responsibility to extend it or even ignore it completely if you don’t need any of its functionality. This is where many of the Nooku magic for Joomla is located.  I am yet to tap the pool of magic that can be found here, but I’ll learn as I go on.&lt;/p&gt;
&lt;p&gt;So now I know that if I want to do something unique for my application, I’ll extend the classes found in &lt;code&gt;com_default&lt;/code&gt;. That’s great! It&amp;#8217;s like auto-pilot with easy manual override.&lt;/p&gt;
&lt;h2 id="extending_8220com_default8221"&gt;Extending or Overriding “com_default”&lt;/h2&gt;
&lt;p&gt;The first thing I want to do is to make dashboard be a dashboard. I don’t want Nooku to assume that I’m accessing an Object’s form template. So I want Nooku to display &lt;code&gt;/views/dashboard/tmpl/default.php&lt;/code&gt; by default.&lt;/p&gt;
&lt;p&gt;Digging the code, I found out that I should change the &lt;code&gt;layout&lt;/code&gt; by creating a “dashboard controller”. Create &lt;code&gt;com_awesome/controllers/dashboard.php&lt;/code&gt; and put this code:&lt;/p&gt;
&lt;pre class="brush: php"&gt;&amp;lt;?php

class ComAwesomeControllerDashboard extends ComDefaultControllerDefault {

    protected function _initialize(KConfig $config) {
        $config-&amp;gt;append(array(
            'request' =&amp;gt; array('layout' =&amp;gt; 'default'),
        ));

        parent::_initialize($config);
    }
}
&lt;/pre&gt;
&lt;p&gt;Here I’m simply changing the layout to &lt;code&gt;default&lt;/code&gt; which would normally be &lt;code&gt;form&lt;/code&gt;. By doing this I can now create &lt;code&gt;/com_awesome/views/dashboard/tmpl/default.php&lt;/code&gt; and that’s what Nooku will display.&lt;/p&gt;
&lt;p&gt;How About the Toolbar Buttons? I just have to override the default view class by creating &lt;code&gt;/com_awesome/views/dashboard/html.php&lt;/code&gt; and I put this code:&lt;/p&gt;
&lt;pre class="brush: php"&gt;&amp;lt;?php
class ComAwesomeViewDashboardHtml extends ComDefaultViewHtml
{
    public function display()
    {
        //Reset the toolbar
        KFactory::get('admin::com.awesome.toolbar.dashboard')
            -&amp;gt;reset();

        return parent::display();
    }
}
&lt;/pre&gt;
&lt;p&gt;So here I have just overridden the default view class and “reset” the toolbar object. Just like everything else in Nooku, since I don’t have a &lt;code&gt;/com_awesome/toolbars/dashboard.php&lt;/code&gt; file, Nooku goes deeper.  &lt;code&gt;com_default&lt;/code&gt; doesn’t have it too, so it’s in the core, Nooku falls back deeper and used &lt;code&gt;KToolbarDefault&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id="conclusion"&gt;Summary&lt;/h2&gt;
&lt;p&gt;I have now created the simplest application in Nooku which simply displays text. This may be a very simple app, but by doing this, I understood some fundamental things which are very important in understanding Nooku:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;Nooku has layers of fallbacks. It is called “Cascading Class Override System”. To make things clearer, here’s the sequence from top to bottom:                            
&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Named Component Specific&lt;/strong&gt; - Your most specific class based on the view e.g. &lt;code&gt;ComAwesomeControllerDashboard&lt;/code&gt; in &lt;code&gt;com_awesone/controllers/dashboard.php&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Named Component Default&lt;/strong&gt; - Your app’s general class e.g. &lt;code&gt;ComAwesomeController&lt;/code&gt; in &lt;code&gt;/com_awesome/controller.php&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Default Component Default&lt;/strong&gt; - General class from &lt;code&gt;com_default&lt;/code&gt;, &lt;code&gt;ComDefaultControllerDefault&lt;/code&gt; in &lt;code&gt;/com_default/controllers/default.php&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Framework Default&lt;/strong&gt; - Found in the Nooku core e.g. &lt;code&gt;KControllerDefault&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;com_default&lt;/code&gt; is the first layer of fallback, it provides many common tasks found in Joomla. Developers would usually extend it and just change some things that are unique to their application.&lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;view&lt;/strong&gt; variable is important in Nooku. Making it singular or plural will cause Nooku to treat it accordingly. In this case, a singular view &lt;strong&gt;dashboard&lt;/strong&gt; makes Nooku assume that we&amp;#8217;re accessing an object, and it looks for the form.php file by default. To change this behavior, you have to override the controller, and the view class.&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;Have you also noticed? The Class naming convention is consistent with the file structure. Maybe you can figure it out already just by looking at the code. You also don’t need to “require_once” the files. Nooku auto-loads the files based on the ClassName.&lt;/p&gt;
&lt;p&gt;Next, I’ll learn more about &lt;a href="http://israelcanasa.com/post/1125078952/learning-nooku-3"&gt;how to display data from the Database&lt;/a&gt;. &lt;/p&gt;</description><link>http://israelcanasa.com/post/1119269918</link><guid>http://israelcanasa.com/post/1119269918</guid><pubDate>Tue, 14 Sep 2010 12:33:00 +0800</pubDate><category>learning nooku</category><category>nooku</category><category>PHP Frameworks</category><category>web development</category></item><item><title>How to Install Nooku</title><description>&lt;h1&gt;Learning Nooku Part 1: Installing Nooku&lt;/h1&gt;
&lt;blockquote&gt;
&lt;p&gt;This is Part 1 of a series of posts where I document my learning process in studying Nooku. I’m a total Noob to Nooku so this might help other Nooku noobs to learn the framework. &lt;/p&gt;
&lt;p&gt;You can read the &lt;a title="Learning Nooku" target="_blank" href="http://israelcanasa.com/post/1115813980/learning-nooku"&gt;Introduction of Learning Nooku Here&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Installing Nooku is not easy but it’s not difficult either. It’s just not a simple process. There is no official Nooku installer for Joomla. You have many options.&lt;!-- more --&gt;&lt;/p&gt;
&lt;p&gt;If you are familiar with SVN, the best way to install Nooku is to checkout the SVN Repository, and install the Nooku trunk to your Joomla installation.  You have to use a script to populate your Joomla installation with the symlinked directories going to your Nooku local repository.  You also have to manually insert the “Koowa” plugin in your Joomla database.&lt;/p&gt;
&lt;p&gt;Here’s how I did it in Mac OSX.&lt;/p&gt;
&lt;h2 id="checkout_the_svn_repository"&gt;Checkout the SVN Repository&lt;/h2&gt;
&lt;pre&gt;$ cd /somewhere/in/your/computer
$ svn checkout &lt;a href="http://svn2.assembla.com/svn/nooku-framework"&gt;http://svn2.assembla.com/svn/nooku-framework&lt;/a&gt;
$ svn checkout &lt;a href="http://svn2.assembla.com/svn/nooku-tools"&gt;http://svn2.assembla.com/svn/nooku-tools&lt;/a&gt;
&lt;/pre&gt;
&lt;h2 id="run_the_symlinker"&gt;Run the Symlinker&lt;/h2&gt;
&lt;pre&gt;$ sudo pear install --alldeps Console_CommandLine
$ cd nooku-tools/trunk/symlinker
$ chmod +x symlinker
$ ./symlinker ../../../nooku-framework/trunk/code/ /your/localhost/docroot/joomla
&lt;/pre&gt;
&lt;h2 id="run_this_sql_in_your_database"&gt;Run this SQL in your database&lt;/h2&gt;
&lt;pre class="brush: sql"&gt;INSERT INTO `jos_plugins` 
	(`id`,`name`,`element`,`folder`,`access`,`ordering`,`published`,`iscore`,`client_id`)
VALUES
	(NULL, 'Koowa', 'koowa', 'system', 0, 8, 1, 0, 0);
&lt;/pre&gt;
&lt;p&gt;By using this process, you are sure that you have the cutting edge version. To update Nooku, you just update your repository using &lt;code&gt;svn update&lt;/code&gt;,  and the Nooku installation in your Joomla will also be updated because they are symlinked.&lt;/p&gt;
&lt;p&gt;If you have no idea how to use SVN, and the above steps is still very new and confusing for you, then I uploaded an &lt;a href="http://dl.dropbox.com/u/1051568/com_koowa.zip"&gt;Nooku installable package&lt;/a&gt; thanks to &lt;a href="http://twitter.com/stipsan"&gt;Stian Didriksen&lt;/a&gt; .  You can install Nooku as a Joomla extension using this installer. But this is not advisable, because Nooku’s API improves really fast. By next month this installer would contain an outdated version of Nooku.&lt;/p&gt;
&lt;h2&gt;Don&amp;#8217;t Forget, Nooku uses MySQLi&lt;/h2&gt;
&lt;p&gt;One little requirement that Nooku needs is MySQLi. It&amp;#8217;s really simple, just go to Joomla&amp;#8217;s Global Configuration, then under &amp;#8220;Server&amp;#8221; tab in the top right corner, you change the Database Type from &amp;#8220;mysql&amp;#8221; to &amp;#8220;mysqli&amp;#8221; if you haven&amp;#8217;t done so.&lt;/p&gt;
&lt;p class="center"&gt;&lt;img src="http://media.tumblr.com/tumblr_l8qahoK4Ns1qd11ge.png"/&gt;&lt;/p&gt;
&lt;p&gt;Now let’s &lt;a href="http://israelcanasa.com/post/1119269918/simplest-nooku-component"&gt;proceed to Part Two, my first Nooku component.&lt;/a&gt;&lt;/p&gt;</description><link>http://israelcanasa.com/post/1119166074</link><guid>http://israelcanasa.com/post/1119166074</guid><pubDate>Tue, 14 Sep 2010 12:11:00 +0800</pubDate><category>learning nooku</category><category>nooku</category><category>installing nooku</category><category>web development</category><category>php</category></item><item><title>Learning Nooku - Part Zero</title><description>&lt;blockquote&gt;
&lt;p&gt;During the coming days I&amp;#8217;ll be documenting how I am learning Nooku. I&amp;#8217;m a total Noob to Nooku so this might help other Nooku noobs to learn the framework. For those who doesn&amp;#8217;t know it, &lt;a title="Nooku" target="_blank" href="http://nooku.assembla.com"&gt;Nooku is a Rapid Application Development Framework for Joomla&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;This is Part Zero of my series of posts about Learning Nooku.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;This should be fun! I’m learning another PHP Framework - Nooku. I’ve had fun using Kohana 3 for a year but Kohana 3 is so easy and simple, there’s not much to learn anymore. I’ve heard many great things about Nooku, so I guess it’s time to see what the hype is all about.&lt;/p&gt;
&lt;p class="center"&gt;&lt;img src="http://media.tumblr.com/tumblr_l8p1fcyDZD1qd11ge.png"/&gt;&lt;!-- more --&gt;&lt;/p&gt;
&lt;p&gt;Since hearing about Nooku in 2009 until now, I’ve just been reading about it. I just browse the code, check the examples, read the mailing list, see how things were done so I’d have a general idea of what to do once I actually code something.&lt;/p&gt;
&lt;p&gt;As of the moment, Nooku lacks a solid documentation, or even a total beginner’s guide. So as my first contribution to the Nooku Community, I think it’s nice to document my learning process. I’m a total beginner to Nooku, coming from a Kohana background.&lt;/p&gt;
&lt;p&gt;Since I am coming from Kohana, the natural approach would be to compare Nooku with what I already know.  Something in the lines of “I do this and that in Kohana, now how do I do it in Nooku?”.  But Johan(chief architect of Nooku) advised me to unlearn what I know, and approach Nooku from a clean slate.&lt;/p&gt;
&lt;p&gt;I’ll take his advise. That’s gonna be the approach I’ll make. I’ll ask the most general questions and try to answer them,  without comparing Nooku with what I already know.&lt;/p&gt;
&lt;h1 id="part_zero_learning_the_principles_behind_nooku"&gt;Part Zero: Learning the Principles Behind Nooku&lt;/h1&gt;
&lt;p&gt;I’ve never written a Nooku App prior to this post. I’m writing this from a noob perspective. That means I am describing Nooku as I understand it, and I might be wrong. For sure this is also incomplete.&lt;/p&gt;
&lt;h2 id="nooku_is_a_magic_framework"&gt;Nooku is a Magic Framework&lt;/h2&gt;
&lt;p&gt;A magic framework is a framework that does many things for the developer “automagically”. Many developers like this approach, but there are some, particularly me, who doesn’t like it. I don’t like “automagic”.  One reason why I chose Django over Rails is because Rails does many things automagically. But Django still has many magics in it. One of the reasons why I settled on Kohana is because it doesn’t have any magic in it. Why don’t I like Magic?  I don’t like Magic frameworks because they make common things really easy, and uncommon things really hard. I usually end up writing uncommon tasks, so magic frameworks rarely help me.&lt;/p&gt;
&lt;p&gt;If I don’t like magic frameworks, why am I diving into Nooku? Because it’s a framework that doesn’t force me to use Magic. The magic is there when I need it, but if I don’t need it,  I can simply discard it and still enjoy the bare minimum features that Nooku Framework offers.&lt;/p&gt;
&lt;p&gt;I haven’t written any Nooku application yet, so I found this out when reading the Nooku source code. So maybe I’m wrong. But I’ll find out as I document my learning process.&lt;/p&gt;
&lt;h2 id="nooku_has_consistent_conventions"&gt;Nooku has Consistent Conventions&lt;/h2&gt;
&lt;p&gt;Although not fully consistent, Nooku’s directory structure, class naming, object mapping, and database table/column naming are consistent enough. Knowing the conventions helps developers understand what’s going on with the code. If you see a class, you know where to find it in the file system just by looking at its name. If you want to access database objects, you’ll easily know how to access it because the object’s properties aren’t different from their database counterpart. The number one feature of a Framework should be Consistency. Nooku is grade A (and will soon to be A+) when it comes to consistency.&lt;/p&gt;
&lt;h2 id="nooku_brings_modularization_to_the_highest_level"&gt;Nooku brings Modularization to the Highest Level&lt;/h2&gt;
&lt;p&gt;As far as I know, Nooku’s architecture allows developers to modularize their code to make it reusable, maintainable, and redistributable. Using OOP(Object Oriented Programming) makes frameworks naturally modular. If taken to the next level, we have an MVC(Model View Controller) architecture, take it again to the next level, and we have HMVC(Hierarchical MVC). Many frameworks nowadays stops at MVC. Nooku is one of the first, along with Kohana 3 to fully implement HMVC.&lt;/p&gt;
&lt;p&gt;But Nooku doesn’t stop there. Nooku gives you many other tools to help you modularize your code. It does so by helping you implement programming design patterns such as  Mixins, Chain of Command, Dependency Injection, BREAD, and many others. If you can’t see how these design patterns can help you, you must write an app. The best way to learn is to experience problems, and shoot them down with design patterns where applicable. You may have employed some of those design patterns without knowing it.&lt;/p&gt;
&lt;p&gt;Then again, Nooku doesn’t seem stop there. Nooku was designed with modularization to the core. From its core objects to its derivative classes, even in its file structure and naming conventions,  you’ll see how easy it is to modularize code!&lt;/p&gt;
&lt;p&gt;I Imagine Nooku as an onion with many layers. It has a powerful core, as you go up higher in each level you’ll find awesome things that you can use to mix and match to use in your app.  Each layer provides a certain kind of Magic!&lt;/p&gt;
&lt;p&gt;I was overwhelmed by these things at first, but I’m guessing that once I grasp the basics, it’s gonna be a smooth sailing. I haven’t used frameworks that has this kind of modularization so it’s new to me. I don’t know if these are unique to Nooku so it’s certainly eye popping for me. But of course, I have only used Django and Kohana, and just read about other frameworks so I’ll see how it goes.  Of course all frameworks are modular, what’s the use if they aren’t? But Nooku’s modularity seems to be different. I don’t know how to call it nor how to describe it in words.   It’s just different from the things I’ve used.&lt;/p&gt;
&lt;p&gt;Perhaps the best way to really understand all these things is to write an app. When you ask Nooku lovers to describe Nooku, they will use superlatives like “awesome”, “the best”, “amazing”, etc.  Let’s see what they really mean. In the coming days and weeks I’m having an adventure with Nooku!&lt;/p&gt;
&lt;p&gt;&lt;a href="http://israelcanasa.com/post/1119166074/installing-nooku"&gt;Next: Part One - Installing Nooku&lt;/a&gt;&lt;/p&gt;</description><link>http://israelcanasa.com/post/1115813980</link><guid>http://israelcanasa.com/post/1115813980</guid><pubDate>Tue, 14 Sep 2010 00:12:00 +0800</pubDate><category>nooku</category><category>learning nooku</category><category>php frameworks</category><category>web development</category></item><item><title>Resurrecting an old blog</title><description>&lt;p&gt;In the past 5 years, I tried to maintain a blog 3 times already. But everytime I move to a new server, my personal blog is usually the least of my priorities so it gets left out in Migration. Then came Tumblr. My blog has found a new home and hopefully, a permanent one. I don&amp;#8217;t have to manage it on my own server, and I don&amp;#8217;t have to worry about hackers. All I&amp;#8217;ll worry about is what to write.&lt;/p&gt;
&lt;p&gt;Well, this time I think I have new thoughts and ideas to publish.&lt;/p&gt;</description><link>http://israelcanasa.com/post/1034279491</link><guid>http://israelcanasa.com/post/1034279491</guid><pubDate>Mon, 30 Aug 2010 10:01:00 +0800</pubDate></item></channel></rss>
