Author Archive

Google Summer of Code

Matt Wilkes - March 3rd, 2008

I’m guessing most of you will be aware of the Google Summer of Code project. Plone has participated for the last two years and will be applying to participate again this year. I’ve taken up the job of bothering people until they help out, so consider yourself bothered!

Mentoring

Are you interested in mentoring a student? If you’re chosen as a mentor you’ll be assigned a student who has submitted a proposal to participate in SoC. It’ll be your job to get this student involved and up to speed as a Plone developer. You should expect to commit between 30 and 60 minutes a day, with up to an additional two hours a week for testing and commenting on the student’s code.

You’re acting as the face of the Plone Foundation, supporting somebody who may be about to start university, or may be a post-doctoral student. They’ll be passionate, willing to learn but not necessarily
experienced with Plone.

Above all, you’ll be ensuring the student stays motivated and on trac, giving praise and helping with problems and helping him integrate with the community by shouting successes to the whole planet (see what I did there? icon wink Google Summer of Code )

Join our OpenPlans project to get more information on volunteering.

Ideas

Students submit their own ideas for projects, but we need to provide a list of possibilities to get their brains churning. Do you have an itch with Plone that you want scratched? Submit it as a possible idea and you may pique a student’s interest. There’s no need for you to mentor a project you suggest if you don’t want to or feel you’re not able, but we really appreciate the ideas.

Students

We’re glad to hear you’re interested in working with Plone! Please stop by #plone-soc on freenode and join our open plans, we’d love to hear your feedback on our ideas so far, but more importantly, we want to meet you!

A taste of GHOP

Matt Wilkes - January 2nd, 2008

Something slightly less rubbery is the GHOP competition I mentioned a few weeks back. I thought I’d update everyone and put up some screenshots of the themes that our GHOP participants have created to date. These are all plone 3 themes, and in the collective to play with right now.
mw 1 A taste of GHOP
mw 2 A taste of GHOP
mw 3 A taste of GHOP
mw 4 A taste of GHOP

GHOP help needed (with pretty graph)

Matt Wilkes - December 12th, 2007

If you haven’t heard of GHOP yet, check out optilude’s blog post on the subject.

… right, now everyone’s up to speed, here’s a pretty graph from the statistics that have been sent around everyone on the admin email list:

graph2 GHOP help needed (with pretty graph)

You’ll notice we’re dead last in terms of students claiming tasks. I don’t accept that plone is inherently less interesting than these other projects, so we’ve just not got the right tasks.

Please, take the time to have a look at the list of available tasks and submit new ideas to the wiki. If you’ve got some more free time, email optilude and volunteer to help out by maintaining the task list and helping students.

This is a great opportunity to get young people involved in the community and have some niggling issues fixed, let’s not waste it.

Cookin’ with traverse_subpath

Matt Wilkes - October 21st, 2007

I’ve heard a few people mention this, so I thought I’d post this recipe. We’re using a simpler version in Vice to prettify some URLs, but it was so easily generalised I knocked an example together.

The idea is that the traverse_subpath variable from Script (Python) was a nice recipe for getting information from URLs. You might have a URL http://127.0.0.1:8080/test/traverse_subpath/a/v/121/a/a/a/ 1213 and want the list ["a", "v" "121", "a", "a", "a", "1213"].

It turns out that as z3 views are based on their own traversal mechanism, it’s really easy to override to get something to emulate this behaviour.

So, set up your view as you usually would, but note the subtle differences from the boilerplate:

traversesubpath.py

from Products.Five.browser.pagetemplatefile
import ViewPageTemplateFile
from zope.publisher.browser import BrowserPage

class subpath(BrowserPage):

 def __init__(self, context, request):
     self.context = context  # Use Martin's aq_magic
     self.request = request
     self._path = []

 def publishTraverse(self, request, name):
     self._path.append(name)
     return self

 @property
 def traverse_subpath(self):
     return self._path

 __call__ = ViewPageTemplateFile('traversesubpath.pt')

traversesubpath.pt

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
    xmlns:tal="http://xml.zope.org/namespaces/tal"
    xmlns:metal="http://xml.zope.org/namespaces/metal"
    xmlns:i18n="http://xml.zope.org/namespaces/i18n"
    lang="en"
    i18n:domain="plone">

  <ul>
  <li
 tal:repeat="pathitem view/traverse_subpath"
 tal:content="pathitem" />
  </ul>

</html>

With the URL I gave above, I get the following page rendered:

  • a
  • v
  • 121
  • a
  • a
  • a
  • 1213

It’s that simple.

Miami, er, Bristol Vice

Matt Wilkes - September 28th, 2007

We’ve been working on the new Vice syndication project, integrating it into our new Viral Content Manager system. Although the system is still pre-alpha it is very impressive! The basic structure of our content types is:

ContentItems are contained in a folderish portal tool, and contain a reference to 0..* ContentChannels which can be anywhere.

We now have working RSS and ATOM feeds for the ContentItems associated with a given ContentChannel, looking like this:

from zope.interface import implements
from zope.component import adapts, queryMultiAdapter, getMultiAdapter
from zope.interface import Interface
from Products.VCNArchetypes.interfaces import IChannel, IViral
from plone.syndication.outbound.interfaces import IFeed, IFeedItem
import logging

from plone.app.syndication.outbound.adapters.atct import ATFeedBase, ATFeedItemBase

class ContentFeed(ATFeedBase):
"""Adapter from IChannel to IFeed.
>>> from zope.interface.verify import verifyClass
>>> verifyClass(IFeed, ContentFeed)
True
"""

implements(IFeed)
adapts(IChannel, str)

def __iter__(self):
items = self.context.getContentItems()
while 1:
yield queryMultiAdapter((items.next(), self), IFeedItem)

class ViralFeedItem(ATFeedItemBase):
"""Adapter from IViral to IFeedItem.
Make sure that ViralFeedItem implements the IFeedItem
interface
>>> from zope.interface.verify import verifyClass
>>> verifyClass(IFeedItem, ViralFeedItem)
True
"""
implements(IFeedItem)
adapts(IViral, IFeed)

@property
def url(self):
return self.context.getViral_url()

@property
def body(self):
return self.context.getViral_description()

and called in with:

<configure>
xmlns="http://namespaces.zope.org/zope"
xmlns:zcml="http://namespaces.zope.org/zcml"
xmlns:five="http://namespaces.zope.org/five"></configure>

<class class="Products.VCNArchetypes.ContentChannel.ContentChannel">
<implements interface="plone.syndication.outbound.interfaces.IFeedable"></implements>
</class>

<!-- Adapt IChannel to IFeed -->
<adapter>
</adapter>    factory=".contentfeed.ContentFeed"
trusted="true" />
<class class=".contentfeed.ContentFeed">
<require>
permission="plone.syndication.ViewFeeds"
interface="plone.syndication.outbound.interfaces.IFeed" />
</require></class>

<!-- Adapt IViral to IFeedItem -->
<adapter>
</adapter>    factory=".contentfeed.ViralFeedItem"
trusted="true" />
<class class=".contentfeed.ViralFeedItem">
<require>
permission="plone.syndication.ViewFeeds"
interface="plone.syndication.outbound.interfaces.IFeedItem" />
</require></class>

One of the sprint tasks is creating an easy to follow, doctested, readme. Until that comes out hopefully this will help people use this brilliant addition to Plone!

Thanks derek_richardson, pbugni and everyone else who’s contributed!