Wednesday, October 8, 2014

Sandy's first day with Plone and the Plone Newbie Developer Kit



"Plone add-ons?".

Sandy had never heard of Plone before, now she had a weekend to become familiar with it.

It started when she finally got a call back to work with a medium sized non-profit looking to add a full stack developer to their team. She had applied because she figured her experience with both backend and frontend development made here a good fit. It was now Friday and they wanted her to start next Monday.

No problem. Except for that little Plone thing. During the last discussion the head of the development team mentioned that they expected her to be able to "build Plone add-ons".

So she did what any sensible developer would do. She turned to Google.

After a bit of googling she was able to determine that Plone is a content management system written in Python and Javascript with some XML involved here and there. Thankfully she knew enough Python to help herself, having done a bit of Flask development in the past. With some further exploration she discovered that Plone runs on an application server called Zope, this made her a bit uneasy, she had never had to interact with an application server before. A bit more googling and she discovered the Plone Newbie Developer Kit (PNDK), what a relief!

Update Oct 8, 2014: If you'd like to get updates about the PNDK, fill out the sign up form.


After ensuring that her machine had all the recommended dependencies she followed the instructions in the guide.

pip install plock
plock -e http://goo.gl/2aVZTB helloplone

Woah, a 7 minute install, that's faster than when she tried out Node.js. She then launched the application server and created her first Plone instance. Adding Dexterity content types she was able to create a deceptively simple looking "staff profile" content type and a few minutes later she had deployed the whole thing to Heroku. Not bad for her first day.

All in all the PNDK was just enough to kick start her Plone journey, not too fiddly with additional side notes that helped to fill in some of her newbie gaps. She was especially thankful for the screenshots, which she would constantly compare to her screen to confirm that she was on the right track.

This is the story I now carry in my head as I work on my latest personal project, the Plone Newbie Developer Kit. For more information about the rationale read the background to the PNDK. At the time of writing the PNDK is a work in progress and certainly has some gaps. All of that will change as it is refined over the next 3 to 6 months to make it match the experience of the story told above.

Monday, October 6, 2014

A Spontaneous Weekend Plone Sprint

TLDR; I unintentionally did a Plone sprint this weekend with Alex Clark on the fantastic Plone installer called Plock.

How I came to Plock

I'm working on something called the Plone Newbie Developer Kit (PNDK), more about that in another post. My philosophy in developing the Plone Newbie Developer Kit (PNDK) is to make use of tools that have already been developed. Where necessary this may involve contributing to the development of those tools. One such tools is a Plone installer called Plock developed by Alex Clark.

I had tried Plock in the past and it worked, however, because it used a methodology of pulling each dependent package as an individual download, it just took too long to do an install. So I contributed some code that allows a user to harvest the packages from Plone's Unified Installer cache. Yeah, I know that last sentence or two was basically jargon for 99% of the world but the bottom line is that Plock can now do faster installs. On my machines (Chromebook in devmode and an iMac) that translated to a 6 minute installation time down from 17 minutes with the old Plock way.


How the sprint was conducted

All communication was conducted via the Plone IRC channel on freenode. The Plock code was already in a repository at Github.com so I basically forked the code to my own repository, added my unified installer related changes and did a pull request and alerted Alex about it. and the conversation 



By the afternoon of the day we had a new release of Plock and Alex was inspired enough to start hacking on getting a pure pip deployment approach for Plone to Heroku using the new features.



 Alex added an issue tracker to which we've added a growing list of "todos" in the form of future features and fixes.



Summary of tasks accomplished

The following is a bullet list of what we got done on the weekend.
Given that this was a spontaneous and virtual sprint, just imagine what we can get done with a bit more planning. I think Plock is a good project for a motivated newbie who knows enough Python, one thing that I'd like to see is making Plock work on the Windows operating system, there's an entry in the issue tracker for that.

Wednesday, April 16, 2014

Install Plone in under 5 minutes on Codio.com

I was introduced to Codio.com by +Rok Garbas. It turns out to be a very nice platform for developing Plone projects. So far what I like is that every Codio box pretty much ships with all the Plone dependencies while at the same time having a full suite of Node based tools (important for modern Javascript development), this is a great time saver on new projects.

These are still early days so I can't say much more about the platform but I do love that Codio.com offers unlimited projects. The system feels like a good cross between Nitrous.io and Cloud9 IDE.

Here's a script (based on my Plone Nitrous.io installer) that will get you up and running on Codio.com in less than 5 minutes.

Once you've opened an account at Codio.com do the following:

Step 1 - create a new blank project


Step 2 - Open the terminal and run the script

Open a terminal by going to "Tools" > "Terminal".


Then paste the following command into the terminal.
curl -L http://goo.gl/5gwGgo | bash
You will see output similar to this:


Step 3  - Customize your Codio Project

Next to the help menu you should see the "Configure" option, if you don't see it click the little arrow near the end and then select "Configure".


This opens a .codio file which you can customize. Replace the existing text with the text below:
{
// Configure your Run and Preview buttons here.
// Run button configuration
  "commands": {
       "Start Plone":"plone-start.sh",
       "Stop Plone":"plone-stop.sh",
       "Debug Plone":"plone-debug.sh",
      "Admin Password": "cat $HOME/workspace/zeocluster/adminPassword.txt"
  },
// Preview button configuration
  "preview": {
        "Dynamic Site": "http://{{domain}}:8080/",
        "Static Index (static)": "https://{{domain}}/{{index}}",
        "Current File (static)": "https://{{domain}}/{{filepath}}"
  }
}

Now you're all set, you can manage Plone from the Codio menu.

Start and Set up of Plone

You can start Plone using the Codio menu. You should now see options such as:
Start Plone, Stop Plone, Debug Plone and Admin Password. 

To setup your first site "Start Plone" and wait about 20 seconds, make a note of your "Admin Password" and then select the "Dynamic Site" menu entry and click "Create a new Plone site". 

You should be good from there.

Monday, March 3, 2014

Video on getting a Plone Development Box up and running with Nitrous.io

This week at the March Jamaica Plone Meetup will be focused on learning about using the Robot Framework. This is a video designed to get participants up to speed before the event.




I've also prepared some slides and a github gist

The Gist




Sunday, March 2, 2014

After Digital Jam 3 - Take aways and next steps

Just a few photos from the recent "unofficial" After Digital Jam 3 meetup. This is not meant to be a faithful or exhaustive transcription of the meetup. Funny how this post echoes the idea from 2012 post that discusses how to figure out how we create "Digital Craftsmen".




The "unofficial" After Digital Jam 3 Meetup was small but worthwhile. We were able to put the events of Digital Jam 3 Day 1 into some perspective and discuss how members of the Jamaican developer community could act upon some of the initiatives that were indicated by the various speakers.


Introductions

We actually spent a lot of time in just introductions around the table. Present at the meetup were:
Rohan Smith a developer who has recently moved to Trindidad and Tobago pitched his new project Rastival, a "hear it later" app (my words), Rastival is a mobile app and chrome extension which will allow users to hear rather than read articles of their choice from around the web. 

Damien Harris - Managing Director at Unique Media Designs, his company is known for for Virtual Mall Jamaica and their online marketing services. They also also develop eCommerce websites for businesses in Jamaica including a payment gateway that works via National Commercial Bank.

Kaiton Williams - Technology Anthropologist, he's interested in understanding how Jamaicans are interacting with technology, previous to this he spent a decade working at Microsoft and has also worked with companies her in Jamaica including Pan Media and Jamaica Online, when it was around. 

Ramon McLaren - Software developer who has worked in media. He's now at the University of the West Indies as the coordinator for final projects in the Computer based management information systems programme (CBMIS) at the Mona School of Business and Management (MSBM). While he declares himself to be an "AntiSocial", he doesn't do Facebook or Twitter, he certainly can keep up a conversation.

Allistaire Mclaren - An engineer at CARIMAC and is wrapping up the CBMIS programme, he's working with a team to convert their final project into a software product. 

Daryl Baugh - An entrepreneur who works with web metrics, web design and building internet companies. There is lots more to say about Daryl like his ability to draw on obscure statistics to match every point he makes but we'll stop here for now.


General Discussion

From the days' proceedings I personally singled out a comment by Chris Zacca who pointed out that investors are looking for alternatives to government paper and may be more willing than previously to invest in tech businesses. I think we're all waiting to see what happens with "Startup Jamaica" the incubator that Julian Robinson says will become a reality in the near future.

We spent time listening to Rohan's pitch for his new app http://rastival.com which will help you to "hear the internet".

Take Aways

It would be impossible to curtail the discussion to things related to Digital Jam 3, some take aways from the meetup:
  • Persons liked the idea of meetups where we actually get to build stuff (less talk more action), the actual implementation details will need to be decided upon. 
  • There is a need for a more accessible community of coders/mentors. While there are systems, even informal that mentor musicians and athletes but no equivalent at any significant scale exists for up and coming developers. Rohan shared how in his early days he wanted to code but had no idea where to go to or who to speak to.
  • Mobile money could be a good thing but there was a fear of silos, we think that the best possible outcome would be interoperability standards so that you don't get locked into XYZ's mobile cash that can't be exchanged with ABC's own.


Most people at this meetup weren't as impressed with the Crowdflower, crowd working thing. Perhaps we weren't the right audience. The Crowdflower type model does make room for those who may not be higher level information workers to begin to tap into an internet based revenue but it's likely to be dull and repetitive tasks.

Where do we go from here?

Echoing a question that was raised at the Digital Jam 3.0 event, we started to discuss where we might want to take things. In terms of value to the developer community there seem to be two things to deal with:
1. A way for newbies to connect with mentors
2. A community where developers can grow their skills and learn best practices

Kaiton suggested that we look at a simple model where developers meet to code on and learn about interesting problems, similar to Kitchen Table Coders.  I think spaces like what "Startup Jamaica" will hopefully be will help towards this. In the meantime, I'm off to scheme to see how I can begin to contribute to some of this.

Saturday, February 1, 2014

Plone Newbie Advice 2014 - Learn the big picture, Trust the blackbox

If I had just 20 minutes with a Plone newbie, eager to become a competent Plone developer, this is the advice that I would give to them today. I strongly believe that after the release of Plone 5, later this year, the specifics of this advice will be slightly different as projects like Mockup become the standard, but hopefully the general advice will hold true.

I'm assuming that you've already installed and played around a bit with Plone. If not start by doing a quick cloud installation of Plone.

Fundamentals are assumed so make sure you understand them

In my experience persons trip up on things like Unix fundamentals, Networking and Protocols. So before you invest time in Plone make sure you know your basic web technology.

The Plone stack touches many pieces and the deeper you go the more you learn. The good news is that understanding these things will benefit you with other projects.

My checklist of fundamentals that you'll want to be comfortable with include:

  • HTML
  • CSS
  • XML
  • Linux/Unix Command line
  • Basic Python
  • Networking Fundamentals (TCP/IP, Application Protocols, Browsers)

As an example, recently I prototyped a system that relied on both Heroku and Google App Engine, the development was done using webapp2 for App Engine and Flask on Heroku. It involved  XML, Javascript and required becoming familiar with a couple APIs. My experience with Plone's Dexterity Framework and even the buildout system was a useful reference point. The system will eventually integrate back into an enterprise Plone deployment AFTER I'm comfortable that the parts all work.

Be an expert in your core

Being able to learn new technology quickly is not an excuse for learning things superficially. For Plone the core includes understanding things like user permissions, roles, content type schemas, browser views, templates and ZCML.

My checklist of Plone fundamentals

  • Page Templates
  • Content Type Schemas with Dexterity
  • Generic Setup Configuration with XML
  • ZCML
  • Browser Views
  • User permissions
  • Roles

Learn these well and you won't regret it.

Be systematic about your development process

My recommended posture would be the same no matter the technology stack. I'll explain them in more detail below:
  • Learn the big picture: learn about the tools available in your toolbox.
  • Trust the blackbox: learn only what you need to know.
  • Organically absorb the stack.

In general I've observed a mind-set in the Plone community that aims for systems that are "team scale" (not just "works for me"). I try to follow the following three rules as I develop, (not that I'm following them very well but...):
  • Aim to support iterating quickly 
  • Aim to support deploying reliably 
  • Aim to make your project so well documented and predictable that a knowledgeable Plone developer could pick up from you in less than 30 minutes

Learn the big picture

Find out what is available in your toolbox. I recommend these articles:

http://plone.org/products/plone/features/ - An overview of what Plone does out of the box
http://blog.dbain.com/2013/12/plone-big-picture.html - A non-exhaustive summary of the pieces of Plone
http://developer.plone.org/getstarted/index.html - Gives a realistic picture of Plone
http://developer.plone.org/#manuals - This is really a table of contents, but gives an idea of what's possible

Trust the blackbox

You don't need to understand the plumbing of your house in order to take a shower, the same is true with Plone. While there's a lot of plumbing going on you need only focus on how to connect your hose to the system. Some personalities find this difficult as they need to understand everything before proceeding but you'll need this approach to become productive quickly.  If you just want to use Plone as it was designed to be used (as a content management application and framework) then just grab some good examples and copy them.

Organically Absorb the stack

As you advance you will begin to discover that you need more parts of the stack. Learn these parts as you need to. Remember you can always dig deeper into more features of Plone and it certainly makes sense if you intend to become a core contributor to the project.

Wednesday, January 15, 2014

Continuous Documentation with Sphinx + AppEngine

Bitbucket is a great choice when you need to host a private code repository and have a small number of collaborators. Sphinx is excellent for developers who want to manage documentation, it is used by many Python projects including the Plone community and has been adopted by some in the Ruby and Java communities.

There are workflows that support public documentation of projects using these tools, but what if you want to also have a private documentation site?

I decided to see what was possible if my needs were as follows:
  • Private documentation
  • Continuous documentation
  • Needs to work with bitbucket
For public facing documentation I recommend Readthedocs.org. However, because I wanted to keep a private repository and private documentation, I decided to host my documentation on Google App Engine. There's a way to do something similar on Heroku, but I like what I was able to "stitch" together with App Engine.

Assumptions

I'll start with the assumption that you know enough about git and bitbucket to create a git repository at bitbucket and do checkouts, commits and pushes to the repository. If you're unfamiliar with this then you'll need to go and learn that first, then come back here.

I also assume that you have the python app  engine SDK installed and available in your path (meaning that it you can run the 'appcfg.py' command as a standalone command on the terminal.

The Pieces

Step 1 - Setup Sphinx

In your git checkout create your Sphinx documentation using the following command:
sphinx-quickstart

Accept the defaults for the first 3 options (Root path, Seperate source and build directories, Name prefix) presented:


Step 2 - Configure the repository for app engine deployment

Add the following app.yaml file to your repository (change the app engine id to match your own).


Note: If you don't want to force logins then change the lines that say 'login: admin' to 'login: optional'

You can now try a deployment by running the following command:
appcfg.py update . --oauth2 --oauth2_refresh_token=`cat .token`
If all went well, add that command to the .git/hooks/post-commit file in your repository ( I use post-commit because it is a client side hook, bitbucket isn't going to work for server side hooks in this use case)
appcfg.py update . --oauth2 --oauth2_refresh_token=`cat .token`
This will ensure that after each commit the documentation will be pushed to app engine, just before you do your next commit ensure that the command is executable:
chmod +x .git/hooks/post-commit

Step 3 - Enjoy

After your next commit you should be able to visit your shiny new app engine powered documentation site located at <your-app-id>.appspot.com.


Invite Collaborators

Now that you know that it's working, go to your app engine dashboard (http://appengine.google.com) and visit the app that you're using for documentation. Then in the permissions section invite new collaborators using their gmail or google apps email address.




They will receive a link to an authorization page that looks something like this:



Once they accept they will be able to view the documentation.

Possible Improvements

I'd like to make this into a script so that it is even faster to get going. Using the admin permissions and forcing is a bit of a work around. There are cases when this is not ideal, for example if the documentation needs to be shared with less trusted users.