Back to index

plone3  3.1.7
ironicwiki.py
Go to the documentation of this file.
00001 ##########################################################
00002 #
00003 # Licensed under the terms of the GNU Public License
00004 # (see docs/LICENSE.GPL)
00005 #
00006 # Copyright (c) 2005:
00007 #   - The Open Planning Project (http://www.openplans.org/)
00008 #   - Whit Morriss <whit@kalistra.com>
00009 #   - and contributors
00010 #
00011 ##########################################################
00012 
00013 """
00014 IronicWiki
00015 ~~~~~~~~~~
00016 
00017 a demonstration of wicked's capabilities confined to the content type
00018 wicked aspires to make obsolete
00019 
00020 """
00021 from AccessControl import ClassSecurityInfo
00022 from Products.Archetypes import public as atapi
00023 from Products.CMFCore import permissions as CMFCorePermissions
00024 from Products.CMFCore.utils import getToolByName
00025 from wicked.at.field import WikiField
00026 from wicked.atcontent import zope2
00027 from wicked.interfaces import IAmWicked
00028 from zope.annotation.interfaces import IAttributeAnnotatable 
00029 from zope.interface import implements
00030 
00031 
00032 class IronicWiki(atapi.BaseContent):
00033     """ Ironic wiki Portal Content """
00034     implements(IAmWicked, IAttributeAnnotatable)
00035     archetype_name = portal_type = meta_type = 'IronicWiki'
00036     schema = atapi.BaseSchema.copy() + atapi.Schema((
00037         WikiField( "body",
00038                    primary=True,
00039                    filters=('Wicked Filter',),
00040                    default_content_type='text/structured',
00041                    default_output_type='text/html',
00042                    allowable_content_types = ('text/structured',
00043                                               'text/restructured',
00044                                               'text/html',
00045                                               'text/plain',
00046                                               'text/plain-pre'),
00047                
00048                    widget=atapi.RichWidget( description = "The body text of the document.",
00049                                             description_msgid = "help_body_text",
00050                                             label = "Body text",
00051                                             label_msgid = "label_body_text",
00052                                             rows = 25,
00053                                             i18n_domain = "plone")),
00054         ))
00055 
00056 
00057 atapi.registerType(IronicWiki, zope2.PROJECTNAME)