<?xml version="1.0"?>
<!DOCTYPE rss PUBLIC "-//Netscape Communications//DTD RSS 0.91//EN" "http://my.netscape.com/publish/formats/rss-0.91.dtd">
<!-- RSS generated by site builder on 2013-06-20 20:05:04 -->
<!-- $Revision: 1.1 $ -->
<!-- $Date: 2005/09/09 07:06:28 $ -->
<rss version="0.91">
  <channel>
    <title>jason</title>
    <link>http://jason.mindsocket.com.au</link>
    <description>Jason Nicholls' weblog</description>
    <language>en</language>
    <item>
  <pubDate>Thu, 18 Aug 2011 00:00:00 GMT</pubDate>
  <title>Popup Form with Plone 4</title>
  <link>http://jason.mindsocket.com.au/pages/blog/entry.html?id=436</link>
  <guid isPermaLink='true'>http://jason.mindsocket.com.au/pages/blog/entry.html?id=436</guid>
  <comments isPermaLink='true'>http://jason.mindsocket.com.au/pages/blog/entry.html?id=436</comments>
  <description>&lt;p&gt;The mission today was to create an online form to collect membership 
information. The submitted info needed to be sent to a hardcoded recipient as 
well as the person filling out the form.&lt;/p&gt; 
 
&lt;p&gt;I installed and used PloneFormGen to create the form. This was mostly 
straight forward, I just added a &quot;Form Folder&quot; and proceeded to add/edit 
fields as needed.&lt;/p&gt; 
 
&lt;p&gt;The first hurdle I ran into was wanting to verify the email address. 
PloneFormGen nicely handles basic validation, so I could make sure the email 
address was valid syntax but that doesn't catch silly typos. In the end I added a 
2nd &quot;verify&quot; email field and used a &lt;em&gt;Custom Validator&lt;/em&gt; to compare. If the first 
email field is called &quot;email&quot; and the verify field is called &quot;verify_email&quot; 
then the customer validator line looks like this:&lt;/p&gt; 
 
&lt;pre&gt;python:test(request.email==request.verify_email,False,'E-Mail Addresses 
do no match')&lt;/pre&gt; 
 
&lt;p&gt;The next hurdle was the default formatting is a bit plain. That was easily 
fixed by a bit of extra CSS in my existing ploneCustom.css file.&lt;/p&gt; 
 
&lt;p&gt;The 3rd hurdle was having the email go out with all the to/from fields as I 
wanted them. Basically I wanted it &lt;em&gt;From&lt;/em&gt; a specific address (not the default 
which is pulled out of your Plone site configuration), I wanted it &lt;em&gt;To&lt;/em&gt; the user 
supplied email address, and I wanted a copy to be sent to another specific 
email address. The solution was to edit the Mailer Adapter and:&lt;/p&gt; 
 
&lt;ul&gt; 
  &lt;li&gt;Fix the From address by setting the &lt;em&gt;Sender Expression&lt;/em&gt; override 
  to: &lt;tt&gt;string:email_address@here.com&lt;/tt&gt;&lt;/li&gt; 
  &lt;li&gt;Fix the To address (and recipient) by setting the &lt;em&gt;Recipient 
  Expression&lt;/em&gt; override to: &lt;tt&gt;request/email&lt;/tt&gt;&lt;/li&gt; 
  &lt;li&gt;Have a copy of the email address sent to a specific address by adding a 
  BCC in the Addressing section.&lt;/li&gt; 
&lt;/ul&gt; 
 
&lt;p&gt;OK great, form is all done and works as I want. On hindsight there isn't 
much to it but it actually took quite a while to work out everything.&lt;/p&gt; 
 
&lt;p&gt;The next step was to make this available and it was fine as-is but I 
decided I wanted to make it appear in a popup dialog box versus a page on it's 
own. It turns out Plone 4 supports this already and an example is the login 
dialog. What wasn't clear, at all, was how to do it myself on content that I 
created...&lt;/p&gt; 
 
&lt;p&gt;It's actually done with a bit of javascript and using jquerytools. 
jquerytools supports overlays of images, iframes, and ajax. I started off 
using iframes because it seemed like the correct choice but that was wrong 
since it didn't deal with form submission properly (i.e. it'd navigate away). 
The solution was to use the ajax mode with the formselector option which 
incorporates a bit of smarts to know you're displaying a form and to handle 
the buttons with ajax goodness (submitting and displaying results in-place).&lt;/p&gt; 
 
&lt;p&gt;That's fine, but how do you actually get it to work?&lt;/p&gt; 
 
&lt;ul&gt; 
  &lt;li&gt;You need a link to the form from somewhere (a page). Do it and edit the 
  HTML to give the link an id, let's say &quot;myForm&quot;. e.g. &lt;tt&gt;&amp;lt;a href='' 
  id='myForm'&amp;gt;&lt;/tt&gt;&lt;/li&gt; 
  &lt;li&gt;Now you need some javascript called when the page is loaded that looks 
  for the link and uses jquerytools to do the overlay instead of navigating 
  away like normal. Do this by creating a new javascript file via the Zope 
  Management Interface: 
  &lt;ul&gt; 
    &lt;li&gt;In ZMI navigate to /portal_skins/custom&lt;/li&gt; 
    &lt;li&gt;Add a new &lt;em&gt;Page Template&lt;/em&gt;, call it something like 'myform.js', 
    and then &lt;em&gt;Add and Edit&lt;/em&gt;.&lt;/li&gt; 
    &lt;li&gt;Replace the default content with below: 
    &lt;pre&gt;jQuery(function ($) { 
    $('#myForm') 
        .prepOverlay({ 
            subtype: 'ajax', 
            filter: '#content &amp;gt; *', 
            formselector: 'form[name=&quot;edit_form&quot;]' 
        }); 
});&lt;/pre&gt;&lt;/li&gt; 
    &lt;li&gt;Register the new javascript file in ZMI at 
    &lt;tt&gt;/portal_javascripts&lt;/tt&gt;. You can probably set a condition so it only 
    appears for the specific page the form link is on but I was having trouble 
    doing that so left it.&lt;/li&gt; 
  &lt;/ul&gt; 
&lt;/ul&gt; 
 
&lt;p&gt;And that's it, now the link should open in a popup overlay and submitting 
it will work even in the case of errors/validation problems. The results will 
be shown in the same dialog without navigating away from the page.&lt;/p&gt;</description>
</item>
<item>
  <pubDate>Sat, 30 Jul 2011 00:00:00 GMT</pubDate>
  <title>iCalendar (.ics) from Plone</title>
  <link>http://jason.mindsocket.com.au/pages/blog/entry.html?id=435</link>
  <guid isPermaLink='true'>http://jason.mindsocket.com.au/pages/blog/entry.html?id=435</guid>
  <comments isPermaLink='true'>http://jason.mindsocket.com.au/pages/blog/entry.html?id=435</comments>
  <description>&lt;p&gt;&lt;em&gt;If you didn't know you can get an ICS view of a collection of events 
from Plone by appending the URL with &quot;/ics_view&quot;.&lt;/em&gt;&lt;/p&gt; 
 
&lt;p&gt;I've been unhappy with the ICS view of events from the Plone 4 
implementation we have for PermacultureWest. The problem is 1. the 
timezone isn't exported so that makes some things unhappy, and 2. the 
URL exported is the event URL (user supplied field) and in our case 
that's mostly empty as there is no where to link to.&lt;/p&gt; 
 
&lt;p&gt;I guess the other problem is it's hard to work out wtf is going on in 
Plone in order to change something. So while there's a templating 
language and all that, it turns out the ICS stuff is all done in code. 
After a bit of digging around I worked out what to change (on a Plone 
4.0.7 deployment):&lt;/p&gt; 
 
&lt;p&gt;&lt;tt&gt;/usr/local/Plone/buildout-cache/eggs/Products.ATContentTypes-.../Products/ATContentTypes/browser/calendar.py&lt;/tt&gt; 
is the higher level wrapper to produce the ICS output, here you'll need 
to add the X-WR-TIMEZONE line after the X-WR-CALNAME line. I haxed it up 
here and hard-coded the value I needed (Australia/Perth).&lt;/p&gt; 
 
&lt;p&gt;&lt;tt&gt;/usr/local/Plone/buildout-cache/eggs/Products.ATContentTypes-.../Products/ATContentTypes/lib/calendarsupport.py&lt;/tt&gt; 
is where each event is rendered in ICS format. Here I changed the line 
&quot;url = self.event_url()&quot; to &quot;url = self.absolute_url()&quot; and that was it 
since I always want the events to link back to our website.&lt;/p&gt; 
 
&lt;p&gt;All done and a restart later we're back in business.&lt;/p&gt; 
</description>
</item>
<item>
  <pubDate>Sat, 19 Feb 2011 20:00:00 GMT</pubDate>
  <title>Integrating Planet into Plone by cheating</title>
  <link>http://jason.mindsocket.com.au/pages/blog/entry.html?id=432</link>
  <guid isPermaLink='true'>http://jason.mindsocket.com.au/pages/blog/entry.html?id=432</guid>
  <comments isPermaLink='true'>http://jason.mindsocket.com.au/pages/blog/entry.html?id=432</comments>
  <description>&lt;p&gt;I've been working on a website for an association I'm a part of and 
wanted to setup &lt;a href='http://planetplanet.org'&gt;Planet&lt;/a&gt; software to 
aggregate blogs of people within the association. The website is based on 
Plone 4 and while I'm sure there are ways to do proper integration I just 
couldn't find any easy examples. After digging around I came up with this 
solution which could suit any situation with content generated externally from 
Plone but which you'd like to include within Plone.&lt;/p&gt; 
 
&lt;ul&gt; 
  &lt;li&gt;Set up Planet as normal, set up cron job, etc... Tweak template such 
  that it spits out a HTML page fragment, i.e. just the content bit and not 
  a full HTML page.&lt;/li&gt; 
  &lt;li&gt;In my case I also set up a 2nd template which produces just a list of 
  feeds which I wanted to include in Plone using the standard &quot;static text 
  portlet&quot;. I have to update the portlet manually at this point but that'll 
  be fairly rare and i'll just do it when blogs are added/removed.&lt;/li&gt; 
  &lt;li&gt;Make sure you've enabled WebDAV in Plone (see the docs).&lt;/li&gt; 
  &lt;li&gt;Make sure you've already created a page in Plone where you want the 
  Planet content to be.&lt;/li&gt; 
  &lt;li&gt;Write a script that talks WebDAV to PUT your Planet HTML fragment to the 
  page in Plone. Note that the script needs to add a couple header lines and 
  an empty line prior to the content, do a GET on the page first to take a 
  look - you really only need the &quot;id&quot; and &quot;content type&quot; ones...&lt;/li&gt; 
&lt;/ul&gt; 
 
&lt;p&gt;In my case I wrote the script in Perl and used the HTTP::DAV module to talk 
to Plone. The script incorporated running Planet, checking for a difference in 
output (no need to keep updating Plone unless needed), filtering the content a 
little, then updating Plone. This was then set to run from cron. So far so 
good!&lt;/p&gt; 
 
&lt;p&gt;I also cheat a little bit with the RSS and Atom feeds produced as we have 
Apache sitting in front of Plone so I put these files somewhere accessible and 
provide links within Plone.&lt;/p&gt; 
 
&lt;p&gt;This is for the &lt;a 
href='http://permaculturewest.org.au/community/blogs'&gt;Community Blogs&lt;/a&gt; section on the Permaculture West 
website.&lt;/p&gt;</description>
</item>
<item>
  <pubDate>Thu, 02 Dec 2010 00:00:00 GMT</pubDate>
  <title>(Old) System Upgrade</title>
  <link>http://jason.mindsocket.com.au/pages/blog/entry.html?id=431</link>
  <guid isPermaLink='true'>http://jason.mindsocket.com.au/pages/blog/entry.html?id=431</guid>
  <comments isPermaLink='true'>http://jason.mindsocket.com.au/pages/blog/entry.html?id=431</comments>
  <description>&lt;p&gt;Back in January I upgraded from my ASUS M2NPV-VM Athlon X2 4800+ 
system to a Mac Mini with the main purpose being to save power. The Mac Mini 
(2009 model) idles at 13W plus another 5W for the external HDD, so 18W total. 
The old desktop system would idle at considerably more, something like 65W or 
more, although that's going from memory as I can't test it in the old 
configuration now.&lt;/p&gt; 
 
&lt;p&gt;I use the mini as my main system plus it does a bunch of other stuff like 
monitoring the solar panels so it's on 24/7 and hence the need for as low 
power usage as possible. However the old desktop might still come in useful so 
I've held onto it hoping I could upgrade the CPU at some stage since even 
the latest AMD processors (AM3 based) are backward compatible with AM2 
motherboards as long as the mobo has an upgraded BIOS to support the newer 
CPUs. With such an old mobo and seemingly nothing in it for ASUS I was 
surprised they actually came out with an updated &quot;beta&quot; BIOS recently. 
So for $110 I upgraded to a quad-core 2.8Ghz Phenom II 925 with a 95W TDP (old 
Athlon X2 had a 65W TDP). The desktop system with new CPU now idles at 90W 
although I will be able to reduce this once I work out how to &lt;i&gt;under&lt;/i&gt;volt 
the CPU, which seems easy to do in Windows but no good utils for Linux 
yet.&lt;/p&gt; 
 
&lt;p&gt;I'm not too worried about the increase in power consumption because I 
wouldn't have the old desktop on 24/7 anyway, just when I may need some extra 
horsepower or the extra RAM (it has 8GB in it).&lt;/p&gt; 
</description>
</item>
<item>
  <pubDate>Fri, 12 Nov 2010 00:00:00 GMT</pubDate>
  <title>Sunny Beam update</title>
  <link>http://jason.mindsocket.com.au/pages/blog/entry.html?id=430</link>
  <guid isPermaLink='true'>http://jason.mindsocket.com.au/pages/blog/entry.html?id=430</guid>
  <comments isPermaLink='true'>http://jason.mindsocket.com.au/pages/blog/entry.html?id=430</comments>
  <description>&lt;p&gt;Well since the v0.1 release I moved onto step 2 which is to log the 
data but I ran into some reliability issues. It wasn't much of a problem when 
testing around with the lib but I want things rock solid for data 
collection.&lt;/p&gt; 
 
&lt;p&gt;So that means back to the library . I ended up installing the 
Sunny Data Control software in a Windows VM and it's quite handy in that it 
includes a packet monitor so I can see what's going on between the computer 
and Sunny Beam. I got a couple important things from this: (1) it re-sends 
packets if no response, (2) some of the control flags were different, (3) you 
can communicate with the inverters (using the Sunny Beam as a gateway).&lt;/p&gt; 
 
&lt;p&gt;With this new information I went back to the library and added support to 
modify flags and made sure my requests matched Sunny Data Control. I also 
added support for re-sending packets, which led to adding support to discard 
incorrect responses (may be due to re-sending packets), and discarding corrupt 
packets (which happens more than you think). The discards are handled well 
because it's treated as if no packet was received (i.e. keep re-sending and 
waiting for a response). Lastly I added prelim support to read data from the 
Inverters. At this stage I can discover them and talk to them but the talking 
bit is a problematic as the received packets seem to be corrupt more often 
than not. I've left it for now though...&lt;/p&gt; 
 
&lt;p&gt;I'm now testing reliability with a script logging realtime values every 5 
mins and daily summaries into a MySQL database.&lt;/p&gt; 
 
&lt;p&gt;&lt;a href='http://jason.mindsocket.com.au/pages/linux/sunnybeam/'&gt;Sunny Beam Perl library version 0.2.&lt;/a&gt;&lt;/p&gt; 
</description>
</item>
<item>
  <pubDate>Mon, 08 Nov 2010 00:00:00 GMT</pubDate>
  <title>Sunny Beam Perl library - released!</title>
  <link>http://jason.mindsocket.com.au/pages/blog/entry.html?id=429</link>
  <guid isPermaLink='true'>http://jason.mindsocket.com.au/pages/blog/entry.html?id=429</guid>
  <comments isPermaLink='true'>http://jason.mindsocket.com.au/pages/blog/entry.html?id=429</comments>
  <description>&lt;p&gt;I have a &lt;a href='http://www.sma-australia.com.au/'&gt;SMA&lt;/a&gt; inverter 
and wireless head-unit to view details about my PV power generation. The 
head-unit is a USB Sunny Beam (newer models are Bluetooth). Of course I need to 
plug this thing into Linux and start recording data but the included software 
is for Windows - bah! Thankfully some others had written some tools to run under 
Linux but I ran into some trouble.&lt;/p&gt; 
 
&lt;p&gt;The original Perl script (sbtool) was a little rough and didn't extract as 
much data as the C based sunnybeamtool. sunnybeamtool was much better but 
didn't work when compiled as a 64-bit executable, which I fixed, but I didn't 
feel like expanding the C code. So that led me to decided to implement a Perl 
based library instead and base it on the data specification and help from 
those tools just mentioned.&lt;/p&gt; 
 
&lt;p&gt;SMA also provide a library called &lt;a 
href='http://www.sma-australia.com.au/en_AU/products/software/yasdi.html'&gt;YASDI&lt;/a&gt; 
which is meant to work under linux but it's designed for communication over 
RS232, RS485, and Powerline rather than USB. It's also quite complex (much 
broader in scope) and wasn't much use to me.&lt;/p&gt; 
 
&lt;p&gt;The result is now available as version 0.1: &lt;a href='http://jason.mindsocket.com.au/pages/linux/sunnybeam/'&gt;Sunny Beam Perl library&lt;/a&gt; 
and released under the GPL.&lt;/p&gt; 
 
</description>
</item>
<item>
  <pubDate>Sun, 22 Aug 2010 00:00:00 GMT</pubDate>
  <title>DigitalNow TinyTwin on Ubuntu 10.04 (Lucid)</title>
  <link>http://jason.mindsocket.com.au/pages/blog/entry.html?id=428</link>
  <guid isPermaLink='true'>http://jason.mindsocket.com.au/pages/blog/entry.html?id=428</guid>
  <comments isPermaLink='true'>http://jason.mindsocket.com.au/pages/blog/entry.html?id=428</comments>
  <description>&lt;p&gt;Felix accidently broke my old DVB-T tuner so I replaced it with the 
DigitalNow TinyTwin USB receiver. Unfortunately it wasn't plug'n'play under 
Lucid and after a bit of searching it seems I have a later revision of this 
device with an updated USB ID:&lt;/p&gt; 
 
&lt;pre&gt;Bus 001 Device 002: ID 1b80:e402 Afatech&lt;/pre&gt; 
 
&lt;p&gt;To get it working was fairly simple once I worked out what was 
required:&lt;/p&gt; 
 
&lt;ul&gt; 
  &lt;li&gt;&lt;tt&gt;$ hg clone http://linuxtv.org/hg/v4l-dvb&lt;/tt&gt;&lt;/li&gt; 
  &lt;li&gt;&lt;tt&gt;$ cd v4l-dvb&lt;/tt&gt;&lt;/li&gt; 
  &lt;li&gt;&lt;tt&gt;$ make CONFIG_DVB_FIREDTV:=n&lt;/tt&gt;&lt;/li&gt; 
  &lt;li&gt;&lt;tt&gt;$ sudo make install&lt;/tt&gt;&lt;/li&gt; 
&lt;/ul&gt; 
 
&lt;p&gt;Note this may not work if there are (temporary) bugs in the source when you 
check it out.&lt;/p&gt; 
 
&lt;p&gt;&lt;em&gt;[update 2010-10]&lt;/em&gt; With the release of Ubuntu 10.10 it now works out of the 
box, so no need to download and reinstall...&lt;/p&gt;</description>
</item>
<item>
  <pubDate>Thu, 08 May 2008 14:34:00 GMT</pubDate>
  <title>VMware Workstation on Ubuntu 8.04</title>
  <link>http://jason.mindsocket.com.au/pages/blog/entry.html?id=424</link>
  <guid isPermaLink='true'>http://jason.mindsocket.com.au/pages/blog/entry.html?id=424</guid>
  <comments isPermaLink='true'>http://jason.mindsocket.com.au/pages/blog/entry.html?id=424</comments>
  <description>&lt;p&gt;Well I ran into a problem with VMware Workstation (v6.0.3) since the 
kernel modules wouldn't build on hardy. Thankfully &lt;a 
href='http://igordevlog.blogspot.com'&gt;Igor Guerrero Fonseca&lt;/a&gt; has already 
solved the problem and his fix worked for me. Take a look at his blog: &lt;a 
href='http://igordevlog.blogspot.com/2008/03/vmware-603-in-ubuntu-hardy-804-kernel.html'&gt;VMware 
6.0.3 in Ubuntu Hardy 8.04 kernel 2.6.24&lt;/a&gt;.&lt;/p&gt;</description>
</item>
<item>
  <pubDate>Sun, 04 May 2008 00:00:00 GMT</pubDate>
  <title>Upgraded to Ubuntu 8.04</title>
  <link>http://jason.mindsocket.com.au/pages/blog/entry.html?id=423</link>
  <guid isPermaLink='true'>http://jason.mindsocket.com.au/pages/blog/entry.html?id=423</guid>
  <comments isPermaLink='true'>http://jason.mindsocket.com.au/pages/blog/entry.html?id=423</comments>
  <description>&lt;p&gt;I upgraded my desktop from Ubuntu 7.10 to 8.04 on the weekend. I'm 
pleased to say it was a non event and everything is still working 
. Thanks to the iiNet mirror it only took 21 minutes to download 
the 1311 packages (install said ~1GB worth) - nice!.&lt;/p&gt; 
</description>
</item>
<item>
  <pubDate>Wed, 13 Feb 2008 17:35:00 GMT</pubDate>
  <title>Blog Neglect</title>
  <link>http://jason.mindsocket.com.au/pages/blog/entry.html?id=421</link>
  <guid isPermaLink='true'>http://jason.mindsocket.com.au/pages/blog/entry.html?id=421</guid>
  <comments isPermaLink='true'>http://jason.mindsocket.com.au/pages/blog/entry.html?id=421</comments>
  <description>&lt;p&gt;It's a new year and I haven't blogged for months - but we've been 
busy:&lt;/p&gt; 
 
&lt;ul class='plist'&gt; 
  &lt;li&gt;Felix is now 10 months old, already! He's crawling around everywhere, 
  standing up, standing and moving around holding onto things, his top 2 and 
  bottom 2 front teeth are through and he's bigger. I need to upload some more 
  current photos.&lt;/li&gt; 
  &lt;li&gt;We were in Sydney for Christmas with my family. It was great to see 
  everyone again.&lt;/li&gt; 
  &lt;li&gt;I was in Melbourne for linux.conf.au 2008. This was awesome as 
  always with too many talks to see but thankfully most were recorded. Go 
  check them out. Ruwani and Felix came along as we stayed with Ruwani's 
  sister who took the week off. There are plenty of great vegan and vegan 
  friendly restaurants in Melb which was nice.&lt;/li&gt; 
  &lt;li&gt;I finished out 2007 with 3000km on the bike. That was pretty good I 
  thought, although many months were a bit weak due to laziness and/or travel. 
  This year my goal is to double it to 6000km.&lt;/li&gt; 
  &lt;li&gt;Our house is finally moving along. Site works are complete, the slab is 
  down and they are preparing to start the (rammed earth) walls. Exciting 
  stuff and I'll put up photos of the progress soon.&lt;/li&gt; 
&lt;/ul&gt; 
 
&lt;div class='figure'&gt; 
&lt;img src='http://jason.mindsocket.com.au/images/diary/felix-10mo-sleeping.jpg' alt='Felix - 10 months'/&gt; 
&lt;p&gt;Sleeping: Shot with my old 2MP Canon IXUS - rather grainy and poor white balance. I 
only just found the battery charger after about 2 years!&lt;/p&gt; 
&lt;/div&gt; 
 
</description>
</item>

  </channel>
</rss>
