description_msgid = "help_text",
                                      label = "Text",
                                      label_msgid = "label_text",
                                      rows = 5,
                                      helper_css = ('ploneboard.css',)
                                      )),
    ReferenceField(
        name='reply_to',
        accessor='inReplyTo', # Suboptimal accessor naming here...
        edit_accessor='inReplyToUID',
        mutator='setInReplyTo',
        relationship=REPLY_RELATIONSHIP,
        widget=ReferenceWidget(visible=False),
        ),
    ))
utils.finalizeSchema(schema)


class PloneboardComment(BaseBTreeFolder):
    """A comment contains regular text body and metadata."""

    # Use RichDocument pattern for attachments
    # Don't inherit from btreefolder...

    implements(IComment, INonStructuralFolder)

    meta_type = 'PloneboardComment'

    schema = schema

    _replies = None       # OIBTree: { id -> 1 }
            'description',
            searchable=1,
            read_permission=ViewBoard,
            write_permission=EditComment,
            default_content_type='text/plain',
            default_output_type='text/plain',
            widget=TextAreaWidget(
                description="Enter a brief description of the conversation.",
                description_msgid="help_description_conversation",
                label="Description",
                label_msgid="label_description_conversation",
                i18n_domain="ploneboard",
                rows=5)
        ),
    ))
utils.finalizeSchema(schema)


class PloneboardConversation(BrowserDefaultMixin, BaseBTreeFolder):
    """Conversation contains comments."""

    implements(IConversation, INonStructuralFolder)
    meta_type = 'PloneboardConversation'
    schema = schema
    _at_rename_after_creation = True

    security = ClassSecurityInfo()

    def _get_catalog(self):
        return api.portal.get_tool(name='portal_catalog')