<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Kamon Ayeva : Yet Another Blog &#187; plone</title>
	<atom:link href="http://kayeva.wordpress.com/tag/plone/feed/" rel="self" type="application/rss+xml" />
	<link>http://kayeva.wordpress.com</link>
	<description>Solutions &#62; Technology &#62; Open Source &#62; python.zope.plone</description>
	<lastBuildDate>Sat, 21 Nov 2009 11:44:50 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='kayeva.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/c778404bb8d61bc0449b558ffd07ba8b?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Kamon Ayeva : Yet Another Blog &#187; plone</title>
		<link>http://kayeva.wordpress.com</link>
	</image>
			<item>
		<title>Scratching my own documentation itch</title>
		<link>http://kayeva.wordpress.com/2009/03/21/scratching-my-own-documentation-itch/</link>
		<comments>http://kayeva.wordpress.com/2009/03/21/scratching-my-own-documentation-itch/#comments</comments>
		<pubDate>Sat, 21 Mar 2009 11:04:16 +0000</pubDate>
		<dc:creator>kamon</dc:creator>
				<category><![CDATA[archetypes]]></category>
		<category><![CDATA[documentation]]></category>
		<category><![CDATA[learning]]></category>
		<category><![CDATA[plone]]></category>
		<category><![CDATA[pycon]]></category>
		<category><![CDATA[zca]]></category>

		<guid isPermaLink="false">http://kayeva.wordpress.com/?p=114</guid>
		<description><![CDATA[A week ago, I finished updating the Archetypes Developer Manual for Plone 3. In case you have not seen it, the new version is interesting for any developer who has to develop or update an Archetypes-based product ; it tries to present our current coding practices (GenericSetup, ZCA techniques&#8230;) The manual is accompanied by a [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kayeva.wordpress.com&blog=827664&post=114&subd=kayeva&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>A week ago, I finished updating the <a href="http://plone.org/documentation/manual/archetypes-developer-manual" target="_blank">Archetypes Developer Manual</a> for Plone 3. In case you have not seen it, the new version is interesting for any developer who has to develop or update an Archetypes-based product ; it tries to present our current coding practices (GenericSetup, ZCA techniques&#8230;) The manual is accompanied by a new <a href="http://plone.org/products/example.archetype/" target="_blank">example package</a>. It is also useful, directly, for the &#8220;what does what/how to&#8221; when using the <a href="http://plone.org/products/zopeskel/">ZopeSkel</a> &#8220;archetype&#8221; template with paster to bootstrap your product package.</p>
<p><strong>What&#8217;s next ?</strong></p>
<p>I started another manual to give an overview of the Zope Component Architecture techniques and tools we use for Plone development. Part of the initial work is refactoring/merging existing howtos and tutorials written by the other documentation contributors, and updating them. Hopefully, a first cut of this manual will be reviewed and published in a few weeks.</p>
<p><strong>Sprinting at Pycon</strong></p>
<p>Next week, I am going to Pycon in Chicago and will have 2 days to participate to the post-conference sprints. My current plan is to just dedicate my time to documentation. Topics that I may start contributing on are &#8220;Dexterity content types&#8221; and &#8220;WSGI setup for Plone (3/4) + using middlewares to augment your deployment&#8221;. There may be other topics to give priority to, and I will discuss with others to find out. And of course, I will have some time to make progress on the ZCA manual.</p>
<p>Looking forward to meet other &#8220;Python Web&#8221; community members there!</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kayeva.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kayeva.wordpress.com/114/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kayeva.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kayeva.wordpress.com/114/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kayeva.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kayeva.wordpress.com/114/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kayeva.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kayeva.wordpress.com/114/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kayeva.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kayeva.wordpress.com/114/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kayeva.wordpress.com&blog=827664&post=114&subd=kayeva&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://kayeva.wordpress.com/2009/03/21/scratching-my-own-documentation-itch/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6777eaf2b0a56fd4645b3d1d48fddc7f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">kamon</media:title>
		</media:content>
	</item>
		<item>
		<title>More on using the EditForm</title>
		<link>http://kayeva.wordpress.com/2008/09/17/more-on-using-the-editform/</link>
		<comments>http://kayeva.wordpress.com/2008/09/17/more-on-using-the-editform/#comments</comments>
		<pubDate>Wed, 17 Sep 2008 20:03:41 +0000</pubDate>
		<dc:creator>kamon</dc:creator>
				<category><![CDATA[learning]]></category>
		<category><![CDATA[plone]]></category>
		<category><![CDATA[zope]]></category>
		<category><![CDATA[content types]]></category>
		<category><![CDATA[forms]]></category>

		<guid isPermaLink="false">http://kayeva.wordpress.com/?p=63</guid>
		<description><![CDATA[I now better understand this after reading z3c.form&#8217;s doctests: If the context object that you want to edit fulfills the interface used for your EditForm, the code for defining the form class could be as small as this (followed by the usual configure.zcml snippet):


class ContactEditForm(z3c.form.form.EditForm):
    """ Contact Edit Form """

   [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kayeva.wordpress.com&blog=827664&post=63&subd=kayeva&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I now better understand this after reading z3c.form&#8217;s doctests: If the context object that you want to edit fulfills the interface used for your EditForm, the code for defining the form class could be as small as this (followed by the usual configure.zcml snippet):</p>
<pre>
<blockquote>
class ContactEditForm(z3c.form.form.EditForm):
    """ Contact Edit Form """

    fields = z3c.form.field.Fields(IContactData)

# For wrapping the form presentation within Plone's layout
ContactEditFormView = layout.wrap_form(ContactEditForm, label="Edit Form")</blockquote>
</pre>
<p>If it does not, you get an error as the framework finds that the object does not match the schema or there is not an adapter to it.</p>
<p>The solution in such a case is to define an adapter to the interface, and override the getContent() method of the form to give the adapted object to the EditForm so it can do its job on it, i.e. update it.</p>
<p>Here is an example with an ATDocument used as the context.</p>
<pre>
<blockquote>
class ContactAdapter(object):
    zope.component.adapts(IATDocument)
    zope.interface.implements(IContactData)

    def __init__(self, document):
        self.document = document

    @apply
    def lastname():
        def get(self):
            return getTheLastname(self.document)
        def set(self, value):
            setTheLastname(self.document, value)
        return property(get, set)</blockquote>
</pre>
<pre>
<blockquote>
class ContactEditForm(z3c.form.form.EditForm):
    """ Contact Edit Form """

    fields = z3c.form.field.Fields(IContactData)

    def getContent(self):
        '''See interfaces.IForm'''
        return IContactData(self.context)</blockquote>
</pre>
<p>This approach is valid for cases where you don&#8217;t want to introduce a new content type. Hopefully, there will be a time when introducing a new type would be easier, not require too much things to change, and not add complexity to your Plone site with the risk of maintenance issues. (I&#8217;m thinking <em>plone.dexterity</em> here.) <em>Then, things should be straightforward.</em></p>
<p>You can find the detailed code of my z3c.form usage examples in the<br />
<a href="http://svn.plone.org/svn/collective/example.z3cform/" target="_blank"><em>example.z3cform</em></a> package in the Collective.</p>
<p><strong>Update</strong>: Do not forget to register the Adapter in the configure.zcml. (Thx to Gilles for informing me that I forgot to mention this bit.)</p>
<pre>
<blockquote>&lt;adapter factory=”.adapter.ContactAdapter” /&gt;</blockquote>
</pre>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/kayeva.wordpress.com/63/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/kayeva.wordpress.com/63/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kayeva.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kayeva.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kayeva.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kayeva.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kayeva.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kayeva.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kayeva.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kayeva.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kayeva.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kayeva.wordpress.com/63/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kayeva.wordpress.com&blog=827664&post=63&subd=kayeva&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://kayeva.wordpress.com/2008/09/17/more-on-using-the-editform/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6777eaf2b0a56fd4645b3d1d48fddc7f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">kamon</media:title>
		</media:content>
	</item>
	</channel>
</rss>