Hello, I've been playing around with dexterity on both Plone 4.0b3 and Plone
4.0b4 as of tonight. I've created some types and one of them locks up
everything often. I'm having a hard time figuring out what's going on; the
browser freezes and 'bin/instance fg' doesn't say anything.

The type I'm having problems with looks like this

from five import grok
from zope import schema
from zope.component import getUtility
from zope.intid.interfaces import IIntIds

from plone.directives import form
from plone.dexterity.content import Item

from z3c.relationfield.schema import RelationChoice
from plone.app.content.interfaces import INameFromTitle

from plone.formwidget.contenttree import ObjPathSourceBinder

from reamedia.customercenter import _


class TrackerResource(Item):

    def Title(self):
        return INameFromTitle(self).title

    @property
    def resource_id(self):
        intid = getUtility(IIntIds)
        return intid.getId(self)


class ITrackerResource(form.Schema):
    """A TrackerResource
    """

    name = schema.TextLine(
        title=_(u'Name'),
        readonly=False,
        required=True)

    catalog_product = RelationChoice(
        title=_(u'Catalog product'),
        source=ObjPathSourceBinder(),
        required=True)

    destination_url = schema.URI(
        title=_(u'Destination URL'),
        required=True)

    source_url = schema.URI(
        title=_(u'Source URL'),
        required=False)

    resource_id = schema.Int(
        title=_(u'Resource ID'),
        description=_(u'Identifier used to link up against SQL database.'),
        readonly=True,
        required=False)


class TitleAdapter(grok.Adapter):
    grok.context(ITrackerResource)
    grok.provides(INameFromTitle)

    @property
    def title(self):
        return self.context.name


This type is not globally addable, I can only add it in another
plone.dexterity.content.
Container type.

My genericsetup definition looks like this

<?xml version="1.0"?>
<object name="reamedia.customercenter.trackerresource" meta_type="Dexterity
FTI"
   i18n:domain="reamedia.customercenter" xmlns:i18n="
http://xml.zope.org/namespaces/i18n";>

 <!-- Basic metadata -->
 <property name="title" i18n:translate="">Tracker resource</property>
 <property name="description" i18n:translate=""></property>
 <property
name="content_icon">++resource++reamedia.customercenter/chart.png</property>
 <property name="allow_discussion">False</property>
 <property name="global_allow">False</property>
 <property name="filter_content_types">False</property>

 <!-- schema interface -->
 <property
name="schema">reamedia.customercenter.trackerresource.ITrackerResource</property>


 <!-- class used for content items -->
 <property
name="klass">reamedia.customercenter.trackerresource.TrackerResource</property>

 <!-- add permission -->
 <property name="add_permission">cmf.AddPortalContent</property>

 <!-- enabled behaviors -->
 <property name="behaviors">
 </property>

 <!-- View information -->
 <property name="default_view">view</property>
 <property name="default_view_fallback">False</property>
 <property name="view_methods">
  <element value="view"/>
 </property>

 <!-- Method aliases -->
 <alias from="(Default)" to="(selected layout)"/>
 <alias from="edit" to="@@edit"/>
 <alias from="sharing" to="@@sharing"/>
 <alias from="view" to="@@view"/>

 <!-- Actions -->
 <action title="View" action_id="view" category="object" condition_expr=""
    url_expr="string:${object_url}" visible="True">
  <permission value="View"/>
 </action>
 <action title="Edit" action_id="edit" category="object" condition_expr=""
    url_expr="string:${object_url}/edit" visible="True">
  <permission value="Modify portal content"/>
 </action>
</object>

It's getting frustrating, anyone got any suggestions on what happen or how I
should investigate it further?
_______________________________________________
Product-Developers mailing list
[email protected]
http://lists.plone.org/mailman/listinfo/product-developers

Reply via email to