<?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>mFabrik - mobile sites, apps, HTML5 and CMS software development &#187; tutorial</title>
	<atom:link href="http://blog.mfabrik.com/tag/tutorial/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.mfabrik.com</link>
	<description>Freedom delivered.</description>
	<lastBuildDate>Wed, 03 Aug 2011 09:47:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Tutorial: create and theme mobile Plone site with Web and Mobile</title>
		<link>http://blog.mfabrik.com/2011/04/11/tutorial-create-and-theme-mobile-plone-site-with-web-and-mobile/</link>
		<comments>http://blog.mfabrik.com/2011/04/11/tutorial-create-and-theme-mobile-plone-site-with-web-and-mobile/#comments</comments>
		<pubDate>Mon, 11 Apr 2011 19:41:16 +0000</pubDate>
		<dc:creator>Mikko Ohtamaa</dc:creator>
				<category><![CDATA[mobile]]></category>
		<category><![CDATA[plone]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[zope]]></category>
		<category><![CDATA[cms]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[footer]]></category>
		<category><![CDATA[install]]></category>
		<category><![CDATA[logo]]></category>
		<category><![CDATA[lxml]]></category>
		<category><![CDATA[theme]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[web and mobile]]></category>
		<category><![CDATA[webkit]]></category>

		<guid isPermaLink="false">http://blog.mfabrik.com/?p=1055</guid>
		<description><![CDATA[This is a short tutorial how to mobilize your Plone web site using Web and Mobile CMS and apply some custom theming on it. Web and Mobile 1.0 has now been independently deployed by various organizations in  Switzerland, Netherlands, USA and German. If you get stuck in a point please ask questions on the gomobile-dev [...]]]></description>
			<content:encoded><![CDATA[<p>This is a short tutorial how to mobilize your Plone web site using <a href="http://webandmobile.mfabrik.com">Web and Mobile CMS</a> and apply some custom theming on it. <a href="http://plone.org/products/web-and-mobile">Web and Mobile 1.0</a> has now been independently deployed by various organizations in  <a href="http://www.seantis.ch/news/mobile.amtsblatt.ch">Switzerland</a>, <a href="http://m.zestsoftware.nl/">Netherlands</a>, <a href="http://m.tsachoice.com/">USA</a> and <a href="http://m.veit-schiele.de/">German</a>.</p>
<p>If you get stuck in a point <a href="http://groups.google.com/group/gomobile-dev">please ask questions on the gomobile-dev discussion forum</a>.</p>
<h2>Prerequisites</h2>
<ul>
<li>Basic Plone development skills</li>
<li><a href="http://plone.org/products/zopeskel">Basic ZopeSkel knowledge</a></li>
<li>Basic <a href="http://plone.org/products/dexterity/documentation/manual/five.grok">five.grok knowledge</a> (<a href="http://grok.zope.org/">Grok framework</a> integration for Plone)</li>
</ul>
<p>This tutorial is little rough on details, but links to authoritative sources for more in-depth information. I hope to further polish this tutorial based on the user comments.</p>
<p><em>Note: currently the installation process does not work from China, as the local access to code.google.com and appspot.com servers is limited.<br />
</em></p>
<h2>Installation</h2>
<p><a href="http://webandmobile.mfabrik.com/docs/web-and-mobile/user-manual/installation#plone-4-buildout-cfg-changes">Install Web and Mobile to your buildout</a>.</p>
<p><a href="http://groups.google.com/group/gomobile-dev/browse_thread/thread/7f5e34e991cfdaa9">Possibly fight with lxml to get it running</a>.</p>
<p>Create a Plone site (if you don&#8217;t already have an existing site).</p>
<p>Then install following add-ons, in this order in the site control panel</p>
<ul>
<li>Go Mobile</li>
<li>Go Mobile Default Theme</li>
</ul>
<p>Now your website should have a basic mobile experience with a default Web and Mobile theme.</p>
<p><a href="http://blog.mfabrik.com/wp-content/uploads/2011/04/Screen-shot-2010-10-27-at-1.38.42-PM.png"><img class="alignnone size-medium wp-image-1207" title="Screen shot 2010-10-27 at 1.38.42 PM" src="http://blog.mfabrik.com/wp-content/uploads/2011/04/Screen-shot-2010-10-27-at-1.38.42-PM-287x300.png" alt="" width="287" height="300" /></a></p>
<h2>Test mobile site</h2>
<p><a href="http://webandmobile.mfabrik.com/docs/web-and-mobile/user-manual/installation#modifying-your-local-hosts-file">You can visit the mobile version of your site by putting a m.localhost domain in your /etc/hosts file</a>. You don&#8217;t need a mobile browser, as the mobile site is detected by a domain name by default. Your mobile site should be available from http://m.localhost:8080/Plone</p>
<p><a href="http://webandmobile.mfabrik.com/docs/web-and-mobile/user-manual/redirector">If you access the website with a mobile browser you will be automatically redirected to a mobile site</a>.</p>
<h2>Creating a mobile theme</h2>
<p>Install the ZopeSkel based mobile theme template to your buildout.cfg.</p>
<pre>parts =
   ...
   paster

[paster]
recipe = zc.recipe.egg
eggs =
  PasteScript
  gomobile.templates
  ${instance:eggs}</pre>
<p>Rerun buildout to enable <em>bin/paster</em> command:</p>
<pre>bin/buildout</pre>
<p>Create a theme skeleton using paster. We use a Python package named <em>gomobiletheme.yourcompanyname</em> here as an example name for the theme package. If it asks for &#8220;override files&#8221; answer yes:</p>
<pre>cd src
 ../bin/paster create -t gomobile_theme gomobiletheme.yourcompanyname</pre>
<p>List your new theme egg in buildout in develop-eggs. (Alternatively: use mr.developer  if you indent to put it directly under version control.)</p>
<pre>eggs =
    gomobiletheme.yourcompany
develop =
   src/gomobiletheme.yourcompan</pre>
<p>Rerun buildout.</p>
<h2>Test theme skeleton</h2>
<p>Test the theme installs and works. Restart Plone and install your theme add-on in the add-on installer.</p>
<p>Navigate to m.localhost again and see that the mobile site still opens.</p>
<h2>Theme theory</h2>
<p>The generated mobile theme includes five.grok based <em>viewlets.py</em> and <em>view.py</em> files where you are to place</p>
<ul>
<li>Mobile theme viewlets (note: mobile theme does not use viewlet managers)</li>
<li>Mobile specific view overrides</li>
<li>Mobile specific page template overrides</li>
</ul>
<p>All <a href="http://collective-docs.plone.org/views/layers.html">visual code registered against</a> <em>gomobiletheme.yourcompany.interfaces.IThemeLayer</em> is available and used when your site is browser in mobile mode.</p>
<h2>Changing logo</h2>
<p>Change the generated <em>gomobile.yourcompany.viewlets.Logo</em> class.  In the example below we set it to use logo image file from our web theme.</p>
<pre>class Logo(base.Logo):

 # Change logo URI here
 def getLogoPath(self):
 return "++resource++plonetheme.yourwebtheme.images/logo.png"</pre>
<p>If you are using logo from the web theme resource directory, make sure &lt;resourceDirectory&gt; in theme browser/configure.zcml does not have &lt;resourceDirectory layer=&#8221;"&gt; set. If it&#8217;s set the resource directory is not activate for the mobile theme and the mobile theme cannot access the logo file.</p>
<p>The logo image is resized automatically by <em>gomobiletheme.basic.viewlets.Logo</em> base class for different mobile screen resolutions.</p>
<h2>Changing footer text</h2>
<p>In <em>viewlets.py</em> add:</p>
<pre>class FooterText(base.FooterText):
 """ Free-form HTML text at the end of the page """

 # the presence of this viewlet includes a new page template
 # and overrides default footertext</pre>
<p>Then include the page template itself. Add new file to the your theme package <em>templates/footertext.pt</em>:</p>
<pre>&lt;div id="footer-text" i18n:domain="isleofback.app"&gt;
 Your text goes here.
&lt;/div&gt;</pre>
<h2>Change the default colours and CSS</h2>
<p>Mobile theme static CSS and Javascript resources are provided by five.grok <em>static</em> folder mechanism. <a href="http://webandmobile.mfabrik.com/docs/web-and-mobile/developer-manual/transformations">Transformations document provides some in-sight for different CSS files used by different handsets</a>: <em>common.css</em> is served to all mobile phones, <em>highend.css</em> for Webkit and Firefox based browsers, <em>lowend.css</em> for limited browsers.</p>
<p>The default <a href="http://plonegomobile.googlecode.com/svn/gomobiletheme.basic/trunk/gomobiletheme/basic/static/">gomobiletheme.basic</a> CSS resources are included by default with the theme skeleton. You need override only the CSS rules you specifically want to change for your own  theme. <a href="http://code.google.com/p/plonegomobile/source/browse/#svn%2Fgomobile.templates%2Ftrunk%2Fgomobile%2Ftemplates%2Ftemplates%2Fgomobile_theme%2F%2Bnamespace_package%2B%2F%2Bpackage%2B%2Fstatic">This can be done by adding rules to common.css, lowend.css and highend.css files which you can find from the generated theme package.</a></p>
<h2>Further info</h2>
<ul>
<li><a href="http://webandmobile.mfabrik.com/docs/web-and-mobile/developer-manual/theming">Read theming manual in Web and Mobile documentation section</a>.</li>
<li><a href="http://www.slideshare.net/miohtama/mad-about-mobile">See Web and Mobile presentation in Plone Conference 2010</a></li>
<li><a href="http://code.google.com/p/plonegomobile/source/browse/#svn%2Fplonecommunity.app%2Ftrunk%2Fplonecommunity%2Fapp">See plonecommunity.app package for an open source example</a></li>
<li><a href="http://code.google.com/p/plonegomobile/source/browse/gomobile.docs/trunk/gomobile/docs/manual/developer-manual/theming.txt">SVN trunk version of the theming manual for the latest instructions</a></li>
<li><a href="http://groups.google.com/group/gomobile-dev">Subscribe to Web and Mobile discussion group for further questions</a></li>
</ul>
<p>&nbsp;
<p class="signature">
<a href="http://mfabrik.com/@@zoho-contact-form"><img valign="middle"  src="http://blog.mfabrik.com/wp-content/uploads/mfabrik-24.png"></a> <a href="http://mfabrik.com/@@zoho-contact-form">Get developers</a> <a href="http://feeds.feedburner.com/mFabrikWebAndMobileDevelopment" rel="alternate" type="application/rss+xml"><img valign="middle" src="http://www.feedburner.com/fb/images/pub/feed-icon16x16.png" alt="" style="vertical-align:middle;border:0"/></a> <a href="http://feeds.feedburner.com/mFabrikWebAndMobileDevelopment" rel="alternate" type="application/rss+xml">Subscribe mFabrik blog in a reader</a> <a href="http://twitter.com/mfabrik"> <img valign="middle"  src="http://blog.mfabrik.com/wp-content/uploads/twitter-24.png"></a> <a href="http://twitter.com/moo9000">Follow me on Twitter</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mfabrik.com/2011/04/11/tutorial-create-and-theme-mobile-plone-site-with-web-and-mobile/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to encode h264 video files for Nokia Series 60 standalone playback</title>
		<link>http://blog.mfabrik.com/2008/09/23/how-to-encode-h264-video-files-for-nokia-series-60-standalone-playback/</link>
		<comments>http://blog.mfabrik.com/2008/09/23/how-to-encode-h264-video-files-for-nokia-series-60-standalone-playback/#comments</comments>
		<pubDate>Mon, 22 Sep 2008 23:27:32 +0000</pubDate>
		<dc:creator>Mikko Ohtamaa</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[series 60]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[aac]]></category>
		<category><![CDATA[build]]></category>
		<category><![CDATA[dvd]]></category>
		<category><![CDATA[encoding]]></category>
		<category><![CDATA[ffmpeg]]></category>
		<category><![CDATA[h264]]></category>
		<category><![CDATA[libfaac]]></category>
		<category><![CDATA[libx264]]></category>
		<category><![CDATA[movie]]></category>
		<category><![CDATA[n95]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[video]]></category>
		<category><![CDATA[x264]]></category>

		<guid isPermaLink="false">http://blog.redinnovation.com/?p=118</guid>
		<description><![CDATA[Bored with Spiderman 3 which came with your Nokia N95 8 GB? This guide shortly tells how to get movies into your N95 on Ubuntu Linux using ffmpeg video encoder. The aim is to encode video suitable for playback from Nokia N-series (N95, N78, others) mobile phone memory card. We use h264 + AAC codecs [...]]]></description>
			<content:encoded><![CDATA[<p>Bored with Spiderman 3 which came with your Nokia N95 8 GB? This guide shortly tells how to get movies into your N95 on Ubuntu Linux using <a href="http://ffmpeg.mplayerhq.hu/">ffmpeg</a> video encoder. The aim is to encode video suitable for playback from Nokia N-series (N95, N78, others) mobile phone memory card. We use <a href="http://en.wikipedia.org/wiki/H.264">h264</a> + AAC codecs which provides the best quality/compression rate for Nokia phones currently.</p>
<p>Ubuntu does not distribute proprietary codes. First thing you need to do is to <a href="https://wiki.ubuntu.com/ffmpeg">rebuild ffmpeg</a>.  Since Ubuntu 8.04 Hardy Heron ships with ffmpeg from 2007, which is aeons old in video codec years, <strong>you need to build libx264 and ffmpeg from SVN sources</strong>. <a href="http://ubuntuforums.org/showthread.php?t=786095&amp;highlight=libx264">Here are detailed, valid, instructions</a>. Note that FFMPEG trunk is not currently stable (September 2008), so <a href="http://ffmpeg.mplayerhq.hu/">you need to use revision 15261</a> which needs <a href="http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/2008-September/053527.html">this little patch</a>. Indeed, this is a very difficult month to start your career in the dark world of video encoders.</p>
<p>To make it legal and support open source codec development,  please <a href="http://blog.canonical.com/?p=37">pay for your codecs</a>.</p>
<p>Then we use this guide by <a href="http://rob.opendot.cl/index.php/useful-stuff/ffmpeg-x264-encoding-guide/">Robert Swain</a>. We have a tiny sub 2,4&#8243; screen, we do not care about the quality and do one pass encoding. By empirical research, I have found that the following MPEG-4 profile parameters are compatible with N95 8 GB and provide the optimal result. You can vary video and audio bitrate depending on your taste.</p>
<p>Here is a script which recursivelu encodes all detected video files suitable for mobile format:</p>
<pre>#!/bin/sh
#
# Optimal movie encoding for Nokia N-series mobile phones
#
# Copyright 2008 Red Innovation Ltd.
#
# Say hi if you find this useful.
# We do some professional mobile video publishing, so if you
# need a helping hand please call us.
#
# Usage: Run encode.sh in any folder and all video files are recursively converted to mobile phone suitable format
#
# Note: We expect all the source material be in 16:9 aspect ration
#
# Also see http://www.nseries.com/index.html#l=support,search,faq,general,video%20encoding,53848
#

VIDEO_BITRATE=300k

AUDIO_BITRATE=72k

# Assume locally build ffmpeg + x264 in /usr/local/bin
# http://ubuntuforums.org/showthread.php?t=786095
export LD_LIBRARY_PATH=/usr/local/lib

# Search all source AVI, MPG and WMV video files
# Place all encoded files to the same folder with the source, with added .mp4 extension
find . -iname "*.avi" -or -iname "*.wmv" -or -iname "*.mpg" | while read src ; do
        srcfile=`basename "$src"`
	srcfolder=`dirname "$src"`
	dstfile="$srcfolder"/"$srcfile".mp4

	# The magical string!
	# Size and cropping is for 16:9 source material, so that 320:240 display will have black bars.
	# Fex pixels off... note that h264 sizes must be multiplies of 16, use 256x144 for streaming
	# N95 RealMedia player does not seem to respect MPEG-4 embedded aspect ration info.
	/usr/local/bin/ffmpeg -y -i "$srcfile" -acodec libfaac -ab $AUDIO_BITRATE -s 320x176 -aspect 16:9 -vcodec libx264 -b $VIDEO_BITRATE -qcomp 0.6 -qmin 16 -qmax 51 -qdiff 4 -flags +loop -cmp +chroma -subq 7 -refs 6 -g 250 -keyint_min 25 -rc_eq 'blurCplx^(1-qComp)' -sc_threshold 40 -me_range 12 -i_qfactor 0.71 -directpred 3 "$dstfile"

done</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.mfabrik.com/2008/09/23/how-to-encode-h264-video-files-for-nokia-series-60-standalone-playback/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

