<?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>Morroni Blog</title>
	<atom:link href="http://blog.morroni.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.morroni.com</link>
	<description>Stuff We Like to Write About</description>
	<lastBuildDate>Mon, 14 May 2012 21:06:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Netbeans Features &amp; Plugins I Love</title>
		<link>http://blog.morroni.com/2012/05/14/netbeans-features-plugins-i-love-2/</link>
		<comments>http://blog.morroni.com/2012/05/14/netbeans-features-plugins-i-love-2/#comments</comments>
		<pubDate>Mon, 14 May 2012 21:06:01 +0000</pubDate>
		<dc:creator>jwatson</dc:creator>
				<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://blog.morroni.com/?p=444</guid>
		<description><![CDATA[It is always interesting when you find new features of a tool you use every day that you just never explored or knew existed before. Especially when they make your code navigation and work-flow better. My favorite find this week is the go-to-file function which searches your entire project path for file names matching your <a href='http://blog.morroni.com/2012/05/14/netbeans-features-plugins-i-love-2/' class='excerpt-more'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>It is always interesting when you find new features of a tool you use every day that you just never explored or knew existed before. Especially when they make your code navigation and work-flow better.</p>
<p>My favorite find this week is the go-to-file function which searches your entire project path for file names matching your input while also accepting wild card strings. *.install for instance. (Drupal anyone?) The default key binding is ctrl-shift-o to get the dialog, simply type your search string and hit enter to open your file. I like to avoid excessive back and forth from the keyboard to the mouse so anything that keeps me on the keys is a good deal.</p>
<div id="attachment_399" class="wp-caption alignnone" style="width: 837px"><a href="http://blog.morroni.com/wp-content/uploads/2012/05/Screen-Shot-2012-05-13-at-12.44.57-AM.png"><img class="size-full wp-image-399" title="Netbeans Go To File feature" src="http://blog.morroni.com/wp-content/uploads/2012/05/Screen-Shot-2012-05-13-at-12.44.57-AM.png" alt="Netbeans Go To File feature" width="827" height="541" /></a><p class="wp-caption-text">Netbeans Go To File feature</p></div>
<p>In a similar aspect, I&#8217;ve recently worked more in vim than days past and started actually enjoying some of its features. Skipping the editor flame war, if you don&#8217;t like vim then don&#8217;t install the jvi plugin. If it turns out it IS your thing, then definitely <a href="http://jvi.sourceforge.net/" target="_blank">check out jvi.</a> It has some kinks and features being worked on but I haven&#8217;t had it affect anything yet. I enjoy it for the vim style home-key navigations alone as well as the regex search and all your standard vim goodness.</p>
<div class='wb_fb_comment'><br/></div>]]></content:encoded>
			<wfw:commentRss>http://blog.morroni.com/2012/05/14/netbeans-features-plugins-i-love-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Drupal Tool Drush Eval</title>
		<link>http://blog.morroni.com/2012/05/14/drupal-tool-drush-eval/</link>
		<comments>http://blog.morroni.com/2012/05/14/drupal-tool-drush-eval/#comments</comments>
		<pubDate>Mon, 14 May 2012 20:57:31 +0000</pubDate>
		<dc:creator>jlongwill</dc:creator>
				<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://blog.morroni.com/?p=428</guid>
		<description><![CDATA[Drush is an essential command line tool for Drupal development. Drush favorites include quick and easy cache-clear via drush cc all and checking up on barking watchdog messages via drush watchdog-list. A lesser-known, yet incredibly useful Drush command is drush eval. This command provides the ability to call Drupal functions that live inside modules from <a href='http://blog.morroni.com/2012/05/14/drupal-tool-drush-eval/' class='excerpt-more'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://drush.ws/">Drush</a> is an essential command line tool for Drupal development. Drush favorites include quick and easy cache-clear via <a href="http://drush.ws/#cache-clear">drush cc all</a> and checking up on barking watchdog messages via <a href="http://drush.ws/#watchdog-list">drush watchdog-list</a>.</p>
<p>A lesser-known, yet incredibly useful Drush command is <a href="http://drush.ws/help/5#php-eval">drush eval</a>. This command provides the ability to call Drupal functions that live inside modules from the command line.</p>
<p>As a practical example, consider a module function that implements <a href="http://api.drupal.org/api/drupal/modules!system!system.api.php/function/hook_cron/7">hook_cron</a>. This function is called whenever cron is scheduled to run, along with all other functions that implement hook_cron. What if you just wanted to call one particular module instance of hook_cron outright, outside of the normal cron schedule, and without triggering all other scheduled cron functions? Drush eval can help.</p>
<pre><code> /* implements hook_cron */ module_name_cron(){ $arg = 'foo'; module_name_scheduled_task($arg); } function module_name_scheduled_task($arg){ echo $arg; } </code></pre>
<p>From the command line, call module_name_cron via drush eval. Note the single quotes around the code portion of drush eval.</p>
<pre><code> drush eval 'module_name_cron();' </code></pre>
<p>&nbsp;</p>
<p>Or, alternatively, call module_name_scheduled_task() directly with an argument. Note the single quote and double quote distinction.</p>
<pre><code> drush eval 'module_name_scheduled_task("hello world"); </code></pre>
<p>This statement prints &#8220;hello world&#8221; on the command line.</p>
<p>Drush eval can run command line php with multiple statements, too.</p>
<pre><code> drush eval '$condition = true; if($condition)echo "true\n"; else echo "false\n";' </code></pre>
<p>This statement prints &#8220;true&#8221; on the command line.</p>
<div class='wb_fb_comment'><br/></div>]]></content:encoded>
			<wfw:commentRss>http://blog.morroni.com/2012/05/14/drupal-tool-drush-eval/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>10 Tips for HTML Email Marketing</title>
		<link>http://blog.morroni.com/2012/04/13/10-tips-for-html-email-marketing/</link>
		<comments>http://blog.morroni.com/2012/04/13/10-tips-for-html-email-marketing/#comments</comments>
		<pubDate>Fri, 13 Apr 2012 13:57:55 +0000</pubDate>
		<dc:creator>moldham</dc:creator>
				<category><![CDATA[business]]></category>
		<category><![CDATA[marketing]]></category>

		<guid isPermaLink="false">http://blog.morroni.com/?p=365</guid>
		<description><![CDATA[Email marketing is a great way to target prospects and provide your current clients information of value and special offers. The associated costs with sending out an email campaign dwarfs in comparison to direct mail initiatives and offers a much greater ROI. While there are many facets to a successful email campaign, the list below <a href='http://blog.morroni.com/2012/04/13/10-tips-for-html-email-marketing/' class='excerpt-more'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>Email marketing is a great way to target prospects and provide your current clients information of value and special offers. The associated costs with sending out an email campaign dwarfs in comparison to direct mail initiatives and offers a much greater ROI. While there are many facets to a successful email campaign, the list below attempts to provide a broad overview of items to take into consideration while coordinating your email marketing campaign.</p>
<p>&nbsp;</p>
<ol>
<li><strong>Build Your Own Email List</strong>– Integrate a Newsletter Subscription form into your website that is visible in a consistent location on each page of your site. Provide the visitor an incentive to subscribe to your email list by informing them they will receive news updates and special offers available only to newsletter subscribers. Build trust from your subscribers with a transparent opt-in process, not one that is pre-checked during a process (like making a purchase) that a visitor must complete while on your website.It may be tempting to purchase a list of email addresses from a third-party, but in most cases this can result a large number of unqualified addresses or the recipient may feel that they are being spammed. There are certainly instances when renting a list from a third-party to send out an email blast is well warranted. For example, if your target recipients are financial advisors, consider reaching out to a publisher that specializes on that topic. However, make sure you understand the difference between List Rental and List Buying. There is a clear difference when purchasing a list of emails from a clearing house in which you are provided an actual list for you to retain, than a service which send the email for you and you never see the list. For more on the topic of List Buying and List Rental, <a href="http://www.email-marketing-reports.com/basics/bulk-email-lists.htm">check out this article</a> from Email Marketing Reports.</li>
<li><strong>Designing Your Email </strong>– There are many considerations to take into account when designing your email; your company&#8217;s brand attributes, pixel dimensions, preview panes and last but certainly not least, a well constructed relevant message. Just like a business card, brochure or website, an email is an extension of your brand. Brand recognition takes time to build and sending an email that does not include your brand&#8217;s attributes will cause an immediate disconnect.</li>
</ol>
<ul>
<ul>
<li>As a general rule of thumb, the width of your email should be no wider than 600px</li>
<li>Build your email using tables. Yes, I said it… tables. Using tables will give you much greater control over your display as most email clients do not support a CSS layout.</li>
<li>Use nested tables to help with padding and margins as they can be rendered a bit quirky by email clients</li>
<li>Make it easy for readers to skim your message by formatting Headlines and Sub-Headlines</li>
<li>Prioritize what content is most important and make sure it is displayed</li>
<li>Use inline CSS instead of using and external stylesheet to add style to your message (a great <a href="http://www.campaignmonitor.com/css/">reference guide</a> to CSS support in email can be found at Campaign Monitor)</li>
<li>Keep in mind that not all CSS declarations will work in an HTML email. For example, background images will not display in some email clients.</li>
<li>Use a limited number of images to help reduce load time</li>
<li>Be sure to have your organization&#8217;s name and logo visible in the valuable real estate of the preview pane to help readers make an immediate association</li>
<li>Be sure to provide an alternative way for readers to view your email by adding a link to a web page version of the message</li>
<li>Make sure to provide an opt-out button with your company contact information at the bottom of the email</li>
<li>Send a plain text version of your email for subscribers who block HTML formatted emails</li>
<li>If you are new to designing HTML emails, try starting with a free template.</li>
</ul>
</ul>
<ol start="3">
<li><strong>Design for the Preview Pane</strong>– When designing your HTML email, take the preview pane into consideration. Many people who receive their emails in a program like Outlook, Eudora, Thunderbird, Entourage or Mail view the message in a preview pane. The content that appears in this limited viewing area should be your most important to help draw the readers attention.The preview pane can be vertical or horizontal, and in most cases will not show images unless the user decides they want to view them. This means that if your text is contained in an image, the recipient won&#8217;t ever see it unless they decide to download the images. If your text must be embedded in an image to get that fancy special effect, use an ALT Tag with relevant text. Then, when the message is previewed, the recipient can read what the message may contain instead of viewing only an image placeholder. For more information about designing emails for the preview pane, <a href="http://www.ravelrumba.com/blog/email-design-preview-pane/">check out this </a><a href="http://www.ravelrumba.com/blog/email-design-preview-pane/">article</a>.</li>
<li><strong>Include a Call to Action</strong> – If the goal of your email is to make a reader to take action, make sure your message contains a clear call-to-action. Offer the reader a reason to click and take the next step by providing an incentive like a discount on a product or a downloadable relevant case study via a landing page.</li>
<li><strong>Content </strong>– When considering what type of message you want to send to your subscribers, make sure it&#8217;s something that provides them value. Avoid self-serving emails that only promote your business or product. When you offer your readers information that they perceive as something of value, they are more likely to be continued subscribers. Offer insight on topics that your readers find interesting. This will help establish your organization as a quality source for reliable information and helps position you as a knowledgeable leader on the topics discussed. Also, be sure to keep your message short and to the point, nobody wants to read a longwinded email.</li>
<li><strong>Email Message Formatting </strong>– Competing for attention in an email inbox is tricky business due to the sheer volume of emails that many receive on a daily basis. Here are a few suggestions to help your message be read.</li>
</ol>
<ul>
<ul>
<li>Make sure your subject line is related to the content in your message</li>
<li>Instead of using a generic “from” email address like <a href="mailto:info@foo.com">info@foo.com</a>, use a person&#8217;s name from your company like jane.doe@foo.com.</li>
<li>Avoid using language like “Win a Free iPad” or, “Take this Short Survey”</li>
<li>Do not use excessive punctuation and special characters</li>
</ul>
</ul>
<ol start="7">
<li><strong>Landing Pages</strong>– Now that the user has read your email, what steps do you want them to take next? If you included a compelling call-to-action to engage your readers as suggested above, direct them to a landing page that offers more information on the topic discussed in your email.Let&#8217;s say you offered your readers a free case study available for download through a landing page on your website. In most cases, you may not have much information about the subscribers on your email list. A landing page provides the ability to collect more information that your company or organization can leverage for future marketing. Take this opportunity to gather data about your prospect by asking questions that can be used to target your lead types with content they are most interested in.</li>
<li><strong>Test Before Sending</strong> – Create email addresses with multiple providers like <a href="http://www.gmail.com/">Gmail</a>, <a href="http://www.yahoo.com/">Yahoo</a>, <a href="http://www.hotmail.com/">Hotmail</a> and <a href="http://www.aol.com/">AOL</a>, and send them each a test to see how your email renders. Since there are numbers of email clients and it can be quite difficult to test them all. This process can become quite cumbersome and can take countless hours. Fortunately there are a few tools that will test the email for you, like <a href="http://www.litmus.com/">litmus</a>. Litmus automates the testing process and allows you to preview your email campaign across 30+ email clients and devices in minutes.</li>
<li><strong>Check Your Spam Score</strong> – If you are using one of the many third-party email blast service like <a href="http://www.mailchimp.com/">MailChimp</a>, <a href="http://www.campaignmonitor.com/">Campaign Monitor</a> or <a href="http://www.constantcontact.com/">Constant Contact</a>, chances are there is a built-in spam checker. Make sure that your email passes the spam score test, otherwise the chances of your message getting caught in a filter will be increased.</li>
<li><strong>Sending Your Blast</strong>– The best time to send an email blast depends on your target audience. If your audience is more of the business type, a good time to schedule your email blast is Tuesday morning at 10am. Reason being, most people spend their Monday morning catching up on emails from over the weekend and it can be easy to get lost in the shuffle. Also, sending your message around 10am allows time for people to have settled in to work, get their coffee and start their day. If Monday happens to be a holiday, try sending your email on Wednesday morning.You can also try segmenting your list and sending out tests at different times of the day to compare your open and click-through rates. Going further, if your email list also contains information about where the recipient is located you can segment your list to send at specific times for different locations.</li>
</ol>
<p>&nbsp;</p>
<p>In conclusion, there are many factors that must be addressed in order to conduct a successful HTML email campaign. Remember, keep it simple and make sure your message is clear and concise. Provide your subscribers value, include a call-to-action and test diligently. Once the campaign is complete, evaluate the campaign&#8217;s analytics and make adjustments where necessary for your next campaign.</p>
<div class='wb_fb_comment'><br/></div>]]></content:encoded>
			<wfw:commentRss>http://blog.morroni.com/2012/04/13/10-tips-for-html-email-marketing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress -&gt; Facebook Integration</title>
		<link>http://blog.morroni.com/2012/03/22/wordbooker/</link>
		<comments>http://blog.morroni.com/2012/03/22/wordbooker/#comments</comments>
		<pubDate>Thu, 22 Mar 2012 20:19:38 +0000</pubDate>
		<dc:creator>lmorroni</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.morroni.com/?p=362</guid>
		<description><![CDATA[We recently installed a plugin for our blog that will allow authors to easily publish teasers from articles to FB and Twitter. Now I just need to get the crew to start writing some meaningful blog entries! Wordbooker: http://wordpress.org/extend/plugins/wordbooker/ Larry]]></description>
			<content:encoded><![CDATA[<p>We recently installed a plugin for our blog that will allow authors to easily publish teasers from articles to FB and Twitter.  Now I just need to get the crew to start writing some meaningful blog entries!</p>
<p>Wordbooker:  http://wordpress.org/extend/plugins/wordbooker/</p>
<p>Larry</p>
<div class='wb_fb_comment'><br/></div>]]></content:encoded>
			<wfw:commentRss>http://blog.morroni.com/2012/03/22/wordbooker/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Official Percolator Coffee Ratios</title>
		<link>http://blog.morroni.com/2011/11/10/official-percolator-coffee-ratios/</link>
		<comments>http://blog.morroni.com/2011/11/10/official-percolator-coffee-ratios/#comments</comments>
		<pubDate>Thu, 10 Nov 2011 15:43:29 +0000</pubDate>
		<dc:creator>jwatson</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.morroni.com/?p=347</guid>
		<description><![CDATA[The new percolator is to be loaded in the following ratio: 1/8 cup (metal scoop) per 2 cups water. Review pending.]]></description>
			<content:encoded><![CDATA[<p>The new percolator is to be loaded in the following ratio:</p>
<p>1/8 cup (metal scoop) per 2 cups water.</p>
<p>Review pending.</p>
<div class='wb_fb_comment'><br/></div>]]></content:encoded>
			<wfw:commentRss>http://blog.morroni.com/2011/11/10/official-percolator-coffee-ratios/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Allowing blank submissions for MappedEmail</title>
		<link>http://blog.morroni.com/2011/08/10/allowing-blank-submissions-for-mappedemail/</link>
		<comments>http://blog.morroni.com/2011/08/10/allowing-blank-submissions-for-mappedemail/#comments</comments>
		<pubDate>Wed, 10 Aug 2011 22:13:11 +0000</pubDate>
		<dc:creator>jwatson</dc:creator>
				<category><![CDATA[Lift]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://blog.morroni.com/?p=342</guid>
		<description><![CDATA[The MappedEmail class does not take kindly to blank submissions in it&#8217;s default form, however with a simple override you can retain all the goodness of the validations built into MappedEmail, while ignoring these requirements if there is no value submitted: object emailAddress extends MappedEmail(this, 100) { override def validate = if (this.is == "") <a href='http://blog.morroni.com/2011/08/10/allowing-blank-submissions-for-mappedemail/' class='excerpt-more'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>The MappedEmail class does not take kindly to blank submissions in it&#8217;s default form, however with a simple override you can retain all the goodness of the validations built into MappedEmail, while ignoring these requirements if there is no value submitted:<br />
<code><br />
object emailAddress extends MappedEmail(this, 100) {<br />
    override def validate = if (this.is == "") Nil else super.validate<br />
}<br />
</code></p>
<div class='wb_fb_comment'><br/></div>]]></content:encoded>
			<wfw:commentRss>http://blog.morroni.com/2011/08/10/allowing-blank-submissions-for-mappedemail/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Debugging Scala projects in IntelliJ</title>
		<link>http://blog.morroni.com/2011/06/30/debugging-scala-projects-in-intellij/</link>
		<comments>http://blog.morroni.com/2011/06/30/debugging-scala-projects-in-intellij/#comments</comments>
		<pubDate>Thu, 30 Jun 2011 18:25:05 +0000</pubDate>
		<dc:creator>jwatson</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.morroni.com/?p=331</guid>
		<description><![CDATA[Open up your preferences, and go to your SBT settings. You want to add this to your VM Parameters: &#8220;-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005&#8243; Now to debug, you need to create a new debugging profile of type &#8220;Remote&#8221; And make sure that it is running with your sbt debug line &#8221; -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005&#8243;, and verify that the settings <a href='http://blog.morroni.com/2011/06/30/debugging-scala-projects-in-intellij/' class='excerpt-more'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>Open up your preferences, and go to your SBT settings. You want to add this to your VM Parameters: &#8220;-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005&#8243;</p>
<p><a href="http://blog.morroni.com/wp-content/uploads/2011/06/Screen-shot-2011-06-30-at-2.18.17-PM.png"><img class="alignnone size-large wp-image-332" title="IntelliJ Preferences" src="http://blog.morroni.com/wp-content/uploads/2011/06/Screen-shot-2011-06-30-at-2.18.17-PM-1024x363.png" alt="" width="1024" height="363" /></a></p>
<p>Now to debug, you need to create a new debugging profile of type &#8220;Remote&#8221;</p>
<p><a href="http://blog.morroni.com/wp-content/uploads/2011/06/debug_menu.png"><img class="alignnone size-full wp-image-333" title="debug_menu" src="http://blog.morroni.com/wp-content/uploads/2011/06/debug_menu.png" alt="" width="475" height="431" /></a></p>
<p>And make sure that it is running with your sbt debug line &#8221; -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005&#8243;, and verify that the settings are set to transport:socket, debugger mode: Attach, and host:localhost on port 5005.</p>
<p><a href="http://blog.morroni.com/wp-content/uploads/2011/06/debug_settings.png"><img class="alignnone size-full wp-image-334" title="debug_settings" src="http://blog.morroni.com/wp-content/uploads/2011/06/debug_settings.png" alt="" width="819" height="678" /></a></p>
<p>Set breakpoints and enjoy.</p>
<div class='wb_fb_comment'><br/></div>]]></content:encoded>
			<wfw:commentRss>http://blog.morroni.com/2011/06/30/debugging-scala-projects-in-intellij/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Sorted Pagination with Lift Framework</title>
		<link>http://blog.morroni.com/2011/06/20/sorted-pagination-with-lift/</link>
		<comments>http://blog.morroni.com/2011/06/20/sorted-pagination-with-lift/#comments</comments>
		<pubDate>Mon, 20 Jun 2011 14:43:52 +0000</pubDate>
		<dc:creator>acoimbra</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.morroni.com/?p=327</guid>
		<description><![CDATA[Lift provides built in snippets to allow easy pagination of data. Here is a brief reference for the SortedMapperPaginatorSnippet (SMPS henceforth). As you can tell from the name, it specifically allows sorted pagination of mapper data. The Lift documentation provides more general information on PaginatorSnippets here. Let&#8217;s say you have a snippet called listProducts. You&#8217;d <a href='http://blog.morroni.com/2011/06/20/sorted-pagination-with-lift/' class='excerpt-more'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>Lift provides built in snippets to allow easy pagination of data. Here is a brief reference for the SortedMapperPaginatorSnippet (SMPS henceforth). As you can tell from the name, it specifically allows sorted pagination of mapper data.</p>
<p><em>The Lift documentation provides more general information on PaginatorSnippets <a href="http://www.assembla.com/spaces/liftweb/wiki/Pagination">here</a>.</em></p>
<p>Let&#8217;s say you have a snippet called listProducts. You&#8217;d like listProducts to display a sorted pagination of all your products, which are stored in your database. Of course, you&#8217;ve already created <a href="http://www.assembla.com/spaces/liftweb/wiki/Mapper">Mapper</a> classes to relate to the data. The very first thing to do is add a couple of imports to your snippet:</p>
<blockquote><p>import net.liftweb.mapper.{By, OrderBy, MaxRows, Like,Cmp,NotNullRef,NullRef, QueryParam, StartAt, Ascending, Descending}<br />
import net.liftweb.mapper.view.{MapperPaginatorSnippet, SortedMapperPaginatorSnippet}</p></blockquote>
<p>Now let&#8217;s create the paginator.</p>
<blockquote><p>val paginator = new SortedMapperPaginatorSnippet(Product, Product.createdAt, &#8220;createdAt&#8221; -&gt; Product.createdAt, &#8220;price&#8221; -&gt; Product.price) {</p>
<p>}</p></blockquote>
<p>The first argument sets the mapper class we are querying. The next one specifies the column we want to sort by initially. Finally we have the two columns we will allow the user to sort by. These are actually both part of the third argument, but thanks to scala&#8217;s <a href="http://blog.darevay.com/2009/01/remedial-scala-repeated-parameters-and-initializing-collections/">repeated parameters</a>, we can have as many choices as we&#8217;d like. The third argument(s) should be pair(s) of column labels [String] and MappedFields.</p>
<p>Now let&#8217;s say we want to add some custom query criteria. For example, let&#8217;s only return products who have their inStock field set to true. To do this, we must set the constantParams var that is built into SMPS. This variable takes the format of a Seq[QueryParam]. So inside our paginator, add the following code:</p>
<blockquote><p>var params: List[net.liftweb.mapper.QueryParam[Product]] = Nil<br />
params = By(Product.inStock, true) :: Nil<br />
constantParams = params</p></blockquote>
<p>The first line sets up the Seq[QueryParam] format of the variable. Then, we set the list to have 2 elements: first is a By QueryParam and second is a Nil. If we had set the variable to just the QueryParam, then Scala would have changed the variable type to QueryParam. By prepending a Nil to the end, it maintains its status as a sequence of elements. The By param takes two arguments. First is the Mapper field to check and second is the value it must be. So in this case, we are checking the inStock is true. Finally set constantParams equal to params. This adds our custom query to the SMPS&#8217;s logic.</p>
<p>This is all you need to do to set up an SMPS in a snippet. To add it to a template, you need to bind each page to something in the xhtml. An example of how to do this would be to add this code to the snippet (outside of the paginator!):</p>
<blockquote><p>def all(xhtml: NodeSeq) : NodeSeq = paginator.page.flatMap(a =&gt; bind(&#8220;p&#8221;,xhtml,&#8221;createdAt&#8221; -&gt; a.createdAt, &#8220;price&#8221; -&gt; a.price, &#8220;inStock&#8221; -&gt; a.inStock))</p></blockquote>
<p>Paginator creates a &#8220;page&#8221; that is essentially a list of Products that is sorted and offset based on which page the user has selected. The code above simply binds each product in the paginator.page to some xhtml code. We could use this on a Lift template like this:</p>
<blockquote><p>
&lt;lift:listProducts.paginator.paginate&gt;<br />
&lt;tr&gt;&lt;th&gt;&lt;sort:createdAt /&gt;&lt;/th&gt;&lt;th&gt;&lt;sort:price /&gt;&lt;/th&gt;&lt;/tr&gt;<br />
&lt;/lift:listProducts.paginator.paginate&gt;</p>
<p>&lt;lift:listProducts.all&gt;<br />
&lt;tr&gt;&lt;td&gt;&lt;p:createdAt /&gt;&lt;/td&gt;&lt;td&gt;&lt;p:price /&gt;&lt;/td&gt;&lt;td&gt;&lt;p:inStock /&gt;&lt;/td&gt;&lt;/tr&gt;<br />
&lt;/lift:listProducts.all&gt;<br />
&lt;lift:listProducts.paginator.paginate&gt;            &lt;nav:first/&gt;            |            &lt;nav:prev/&gt;            |           &lt;nav:allpages/&gt;          |            &lt;nav:next/&gt;            |            &lt;nav:last/&gt;            |            &lt;nav:records/&gt;<br />
&lt;/lift:listProducts.paginator.paginate&gt;</p></blockquote>
<p>Note that all of the tags inside both the &lt;lift:listProducts.paginator.paginate&gt; areas are built into SMPS, which the code inside &lt;lift:listProducts.all&gt; is populated by the custom all function we defined above. Also note that all this can (and should) be customized for your own needs.</p>
<p>A final point about SMPS is that the current sort field, offset, and sort order can all be set by url query strings:</p>
<p>paginatorpage?sort=0 would cause our SMPS above to sort by the createdAt field. sort=1 would cause it to sort by price.</p>
<p>paginatorpage?offset=100 would cause our SMPS&#8217;s current page to start at record 100.</p>
<p>paginatorpage?asc=false would cause our SMPS to sort in descending order.</p>
<p>Of course these can be combined such as: paginatorpage?sort=1&amp;asc=true</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div class='wb_fb_comment'><br/></div>]]></content:encoded>
			<wfw:commentRss>http://blog.morroni.com/2011/06/20/sorted-pagination-with-lift/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting up your iPhone with Morroni email</title>
		<link>http://blog.morroni.com/2011/05/09/setting-up-your-iphone-with-morroni-email/</link>
		<comments>http://blog.morroni.com/2011/05/09/setting-up-your-iphone-with-morroni-email/#comments</comments>
		<pubDate>Mon, 09 May 2011 17:50:31 +0000</pubDate>
		<dc:creator>acoimbra</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.morroni.com/?p=289</guid>
		<description><![CDATA[Before you start this tutorial, make sure you have the following handy: An email address hosted by Morroni Technologies (For this tutorial, we will use info@morroni.com as an example) A username (For this tutorial, we will use mor0127 as an example) A password Once you are ready, go to your iPhone home screen and tap the <a href='http://blog.morroni.com/2011/05/09/setting-up-your-iphone-with-morroni-email/' class='excerpt-more'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>Before you start this tutorial, make sure you have the following handy:</p>
<ul>
<li>An email address hosted by Morroni Technologies<br />
(For this tutorial, we will use info@morroni.com as an example)</li>
<li>A username<br />
(For this tutorial, we will use mor0127 as an example)</li>
<li>A password</li>
</ul>
<p>Once you are ready, go to your iPhone home screen and tap the <strong>Settings</strong> icon.</p>
<p><a href="http://blog.morroni.com/wp-content/uploads/2011/05/1.png"><img class="size-medium wp-image-291 alignnone" title="Home screen" src="http://blog.morroni.com/wp-content/uploads/2011/05/1-200x300.png" alt="" width="200" height="300" /></a></p>
<p>In settings, scroll to and tap <strong>Mail, Contacts, Calendars</strong></p>
<p><strong><a href="http://blog.morroni.com/wp-content/uploads/2011/05/2.png"><img class="alignnone size-medium wp-image-292" title="Settings&gt;Mail,Contacts,Calendars" src="http://blog.morroni.com/wp-content/uploads/2011/05/2-200x300.png" alt="" width="200" height="300" /></a></strong></p>
<p>Tap <strong>Add Account</strong></p>
<p><strong><a href="http://blog.morroni.com/wp-content/uploads/2011/05/3.png"><img class="alignnone size-medium wp-image-293" title="Add Account" src="http://blog.morroni.com/wp-content/uploads/2011/05/3-200x300.png" alt="" width="200" height="300" /></a></strong></p>
<p>Tap<strong> Other</strong></p>
<p><strong> </strong><a href="http://blog.morroni.com/wp-content/uploads/2011/05/4.png"><img class="alignnone size-medium wp-image-294" title="Other" src="http://blog.morroni.com/wp-content/uploads/2011/05/4-200x300.png" alt="" width="200" height="300" /></a></p>
<p><a href="http://blog.morroni.com/wp-content/uploads/2011/05/4.png"></a>Tap <strong>Add Mail Account</strong></p>
<p><strong> </strong><a href="http://blog.morroni.com/wp-content/uploads/2011/05/5.png"><img class="alignnone size-medium wp-image-295" title="Add Mail Account" src="http://blog.morroni.com/wp-content/uploads/2011/05/5-200x300.png" alt="" width="200" height="300" /></a></p>
<p><a href="http://blog.morroni.com/wp-content/uploads/2011/05/5.png"></a>At this next screen, you will need to enter the name you want associated with your email account. The sample image below uses &#8220;Morroni Technologies&#8221; but you can enter anything you want.</p>
<p>For the <strong>Address </strong>and <strong>Password </strong>please enter the email address and password you were provided with.</p>
<p>Tap <strong>Next </strong>when finished.</p>
<p><a href="http://blog.morroni.com/wp-content/uploads/2011/05/6.png"><img class="alignnone size-medium wp-image-296" title="Entering Account Info" src="http://blog.morroni.com/wp-content/uploads/2011/05/6-200x300.png" alt="" width="200" height="300" /></a></p>
<p>The next step is to set up the Incoming/Outgoing mail servers. First, set up the <strong>Incoming Mail Server</strong> (IMAP).</p>
<ul>
<li><strong>Host Name</strong>: mailserver.morroni.com</li>
<li><strong>User Name:</strong> Enter the User Name (not the email address!) you were sent by Morroni Technologies. In the sample image below, mor0127 is the user name.</li>
<li><strong>Password</strong>: Enter the password you were sent.</li>
</ul>
<p><a href="http://blog.morroni.com/wp-content/uploads/2011/05/IMG_0178.png"><img class="alignnone size-medium wp-image-297" title="Incoming" src="http://blog.morroni.com/wp-content/uploads/2011/05/IMG_0178-200x300.png" alt="" width="200" height="300" /></a></p>
<p>Now, scroll down to set up the <strong>Outgoing</strong><strong> Mail Server</strong> (SMTP).</p>
<ul>
<li><strong>Host Name</strong>: smtpserver.morroni.com</li>
<li><strong>User Name:</strong> Enter the User Name (not the email address!) you were sent by Morroni Technologies. In the sample image below, mor0127 is the user name.</li>
<li><strong>Password</strong>: Enter the password you were sent.</li>
</ul>
<p><strong> </strong></p>
<p><strong> </strong></p>
<p><strong> </strong></p>
<p><strong> </strong></p>
<p><strong></p>
<div><a href="http://blog.morroni.com/wp-content/uploads/2011/05/IMG_0179.png"><img class="alignnone size-medium wp-image-299" title="Outgoing" src="http://blog.morroni.com/wp-content/uploads/2011/05/IMG_0179-200x300.png" alt="" width="200" height="300" /></a></div>
<div><span style="font-weight: normal;">Tap </span>Next<span style="font-weight: normal;"> when finished.</span></div>
<div><em><span style="font-weight: normal;">Note: If you get a message saying </span>Cannot Verify Server Identity <span style="font-weight: normal;">tap </span>Continue<span style="font-weight: normal;"> as shown below.</span></em></div>
<div><span style="font-weight: normal;"><a href="http://blog.morroni.com/wp-content/uploads/2011/05/cannot.png"><img class="alignnone size-full wp-image-300" title="cannot" src="http://blog.morroni.com/wp-content/uploads/2011/05/cannot.png" alt="" width="275" height="288" /></a><br />
</span></div>
<div><span style="font-weight: normal;">When the </span>Verifying&#8230;<span style="font-weight: normal;"> is finished, you will be greeted with the following screen. Tap </span>Save.</div>
<div><a href="http://blog.morroni.com/wp-content/uploads/2011/05/IMG_0181.png"><img class="alignnone size-medium wp-image-301" title="IMG_0181" src="http://blog.morroni.com/wp-content/uploads/2011/05/IMG_0181-200x300.png" alt="" width="200" height="300" /></a></div>
<div><span style="font-weight: normal;">At this point, your iPhone can send and receive messages using your Morroni account. </span></div>
<div><span style="font-weight: normal;">However, we need to instruct it to use your Morroni Trash, Drafts, and Sent folders instead of sharing with your other email accounts. To do so, first return to your home screen and open the <strong>Mail</strong> app.</span></div>
<div><span style="font-weight: normal;"><br />
</span></div>
<div><span style="font-weight: normal;">Scroll down to </span>Accounts <span style="font-weight: normal;">(not inboxes!).</span></div>
<div><span style="font-weight: normal;"><br />
</span></div>
<div><em><span style="font-weight: normal;">Note: On the New Account screen from before, there was a Description field. If you made any changes to that field, the description you entered will be the name of the account you want to tap. Otherwise, tap the account that is labelled with your new email address. For the tutorial images, we did not make a change to the Description field, so the Account to select is simply the info@morroni.com email address.</span></em></div>
<div><span style="font-weight: normal;">Select your newly created account.</span></div>
<div><span style="font-weight: normal;"><a href="http://blog.morroni.com/wp-content/uploads/2011/05/accounts.png"><img class="alignnone size-medium wp-image-302" title="accounts" src="http://blog.morroni.com/wp-content/uploads/2011/05/accounts-200x300.png" alt="" width="200" height="300" /></a></span></div>
<div><span style="font-weight: normal;">Ensure that under Inbox is a list of email folders as is show below. If the only item listed is Inbox, you may need to tap the <strong>refresh</strong> icon in the lower left corner of the screen.</span></div>
<div><span style="font-weight: normal;"><a href="http://blog.morroni.com/wp-content/uploads/2011/05/photo.png"><img class="alignnone size-medium wp-image-303" title="photo" src="http://blog.morroni.com/wp-content/uploads/2011/05/photo-200x300.png" alt="" width="200" height="300" /></a><br />
</span></div>
<p></strong></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>Scroll down and tap <strong>Mail, Contacts, Calendars</strong>. Tap your newly created account in the list as shown below. <em>Again, it will be labelled with either your email address or, your description if you entered one.</em></p>
<p><em><a href="http://blog.morroni.com/wp-content/uploads/2011/05/photo2.png"><img class="alignnone size-medium wp-image-304" title="photo2" src="http://blog.morroni.com/wp-content/uploads/2011/05/photo2-200x300.png" alt="" width="200" height="300" /></a><br />
</em></p>
<p>You will arrive at the account settings screen pictured below. Tap the account under <strong>IMAP.</strong></p>
<p><strong><a href="http://blog.morroni.com/wp-content/uploads/2011/05/8.png"><img class="alignnone size-medium wp-image-305" title="8" src="http://blog.morroni.com/wp-content/uploads/2011/05/8-200x300.png" alt="" width="200" height="300" /></a></strong></p>
<p>Scroll to the bottom of this screen and tap <strong>Advanced</strong>.</p>
<p><a href="http://blog.morroni.com/wp-content/uploads/2011/05/9.png"><img class="alignnone size-medium wp-image-306" title="9" src="http://blog.morroni.com/wp-content/uploads/2011/05/9-200x300.png" alt="" width="200" height="300" /></a></p>
<p>Tap <strong>Drafts Mailbox</strong></p>
<p><strong><a href="http://blog.morroni.com/wp-content/uploads/2011/05/drafts.png"><img class="alignnone size-medium wp-image-307" title="drafts" src="http://blog.morroni.com/wp-content/uploads/2011/05/drafts-200x300.png" alt="" width="200" height="300" /></a></strong></p>
<p>Scroll to the <strong>On The Server </strong>list and select <strong>Drafts. </strong></p>
<p><strong><a href="http://blog.morroni.com/wp-content/uploads/2011/05/drafts2.png"><img class="alignnone size-medium wp-image-308" title="drafts2" src="http://blog.morroni.com/wp-content/uploads/2011/05/drafts2-200x300.png" alt="" width="200" height="300" /></a></strong></p>
<p><strong><span style="font-weight: normal;">Tap the <strong>Advanced</strong> button in the upper left corner of the screen.<br />
Tap </span>Sent Mailbox.</strong></p>
<p><strong><span style="font-weight: normal;"><a href="http://blog.morroni.com/wp-content/uploads/2011/05/sent.png"><img class="alignnone size-medium wp-image-309" title="sent" src="http://blog.morroni.com/wp-content/uploads/2011/05/sent-200x300.png" alt="" width="200" height="300" /></a> </span></strong></p>
<p><strong><span style="font-weight: normal;">Scroll to the <strong>On The Server </strong>list and select <strong>Sent. </strong></span></strong></p>
<p><strong><span style="font-weight: normal;"><strong><a href="http://blog.morroni.com/wp-content/uploads/2011/05/sent2.png"><img class="alignnone size-medium wp-image-310" title="sent2" src="http://blog.morroni.com/wp-content/uploads/2011/05/sent2-200x300.png" alt="" width="200" height="300" /></a></strong></span></strong></p>
<p><strong><span style="font-weight: normal;"><strong><span style="font-weight: normal;">Tap the <strong>Advanced</strong> button in the upper left corner of the screen.<br />
Tap </span>Deleted Mailbox<span style="font-weight: normal;">.</span></strong></span></strong></p>
<p><strong><span style="font-weight: normal;"><strong><span style="font-weight: normal;"><a href="http://blog.morroni.com/wp-content/uploads/2011/05/deleted.png"><img class="alignnone size-medium wp-image-311" title="deleted" src="http://blog.morroni.com/wp-content/uploads/2011/05/deleted-200x300.png" alt="" width="200" height="300" /></a></span></strong></span></strong></p>
<p><strong><span style="font-weight: normal;"><strong><span style="font-weight: normal;">Scroll to the <strong>On The Server</strong> list and select </span>Trash<span style="font-weight: normal;">.</span></strong></span></strong></p>
<p><strong><span style="font-weight: normal;"><strong><span style="font-weight: normal;"><a href="http://blog.morroni.com/wp-content/uploads/2011/05/trash2.png"><img class="alignnone size-medium wp-image-313" title="trash2" src="http://blog.morroni.com/wp-content/uploads/2011/05/trash2-200x300.png" alt="" width="200" height="300" /></a><br />
</span></strong></span></strong></p>
<p><strong><span style="font-weight: normal;"><strong><span style="font-weight: normal;">At this point, you are ready to use the iPhone Mail app with your Morroni Email account. Simply press the home button and tap the Mail app to begin!</span></strong></span></strong></p>
<div class='wb_fb_comment'><br/></div>]]></content:encoded>
			<wfw:commentRss>http://blog.morroni.com/2011/05/09/setting-up-your-iphone-with-morroni-email/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Best Lift / SBT / IntelliJ Startup Process</title>
		<link>http://blog.morroni.com/2011/03/11/the-best-lift-sbt-intellij-startup-process/</link>
		<comments>http://blog.morroni.com/2011/03/11/the-best-lift-sbt-intellij-startup-process/#comments</comments>
		<pubDate>Fri, 11 Mar 2011 16:33:13 +0000</pubDate>
		<dc:creator>lmorroni</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://blog.morroni.com/?p=279</guid>
		<description><![CDATA[I&#8217;ve been searching for the ideal startup process when building a lift project and I might have just found it! I am using simple-build-tool(sbt) and two sbt processors.  The processors are: lifty:  http://lifty.github.com/Lifty/ sbt-idea:  https://github.com/mpeltonen/sbt-idea Here are the steps: amore:wheels lmorroni$ sbt Project does not exist, create new project? (y/N/s) y Name: appName Organization: com.morroni <a href='http://blog.morroni.com/2011/03/11/the-best-lift-sbt-intellij-startup-process/' class='excerpt-more'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been searching for the ideal startup process when building a lift project and I might have just found it!</p>
<p>I am using simple-build-tool(sbt) and two sbt processors.  The processors are:</p>
<p>lifty:  http://lifty.github.com/Lifty/<br />
sbt-idea:  https://github.com/mpeltonen/sbt-idea</p>
<p>Here are the steps:</p>
<p><code>amore:wheels lmorroni$ sbt<br />
Project does not exist, create new project? (y/N/s) y<br />
Name: appName<br />
Organization: com.morroni<br />
Version [1.0]:<br />
Scala version [2.7.7]: 2.8.1<br />
sbt version [0.7.4]:<br />
...<br />
&gt;*lifty is org.lifty lifty 1.6<br />
&gt;*sbtIdeaRepo at http://mpeltonen.github.com/maven/<br />
&gt;*idea is com.github.mpeltonen sbt-idea-processor 0.3.0<br />
&gt;lifty create project-blank with user<br />
&gt;reload<br />
&gt;update<br />
&gt;idea<br />
&gt;~jetty-run</p>
<p>References:</p>
<p>http://lifty.github.com/Lifty/</p>
<p>https://github.com/mpeltonen/sbt-idea</code></p>
<div class='wb_fb_comment'><br/></div>]]></content:encoded>
			<wfw:commentRss>http://blog.morroni.com/2011/03/11/the-best-lift-sbt-intellij-startup-process/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

