Changeset 1428
- Timestamp:
- 11/20/08 09:04:01
- Files:
-
- qPloneGoogleSitemaps/branches/contenttype/__init__.py (modified) (1 diff)
- qPloneGoogleSitemaps/branches/contenttype/browser (added)
- qPloneGoogleSitemaps/branches/contenttype/browser/__init__.py (added)
- qPloneGoogleSitemaps/branches/contenttype/browser/configure.zcml (added)
- qPloneGoogleSitemaps/branches/contenttype/config.py (modified) (1 diff)
- qPloneGoogleSitemaps/branches/contenttype/configure.zcml (added)
- qPloneGoogleSitemaps/branches/contenttype/content (added)
- qPloneGoogleSitemaps/branches/contenttype/content/__init__.py (added)
- qPloneGoogleSitemaps/branches/contenttype/content/configure.zcml (added)
- qPloneGoogleSitemaps/branches/contenttype/content/sitemap.py (added)
- qPloneGoogleSitemaps/branches/contenttype/content/sitemap.py~ (added)
- qPloneGoogleSitemaps/branches/contenttype/interfaces.py (added)
- qPloneGoogleSitemaps/branches/contenttype/profiles (added)
- qPloneGoogleSitemaps/branches/contenttype/profiles/default (added)
- qPloneGoogleSitemaps/branches/contenttype/profiles/default/factorytool.xml (added)
- qPloneGoogleSitemaps/branches/contenttype/profiles/default/metadata.xml (added)
- qPloneGoogleSitemaps/branches/contenttype/profiles/default/propertiestool.xml (added)
- qPloneGoogleSitemaps/branches/contenttype/profiles/default/rolemap.xml (added)
- qPloneGoogleSitemaps/branches/contenttype/profiles/default/skins.xml (added)
- qPloneGoogleSitemaps/branches/contenttype/profiles/default/types (added)
- qPloneGoogleSitemaps/branches/contenttype/profiles/default/types.xml (added)
- qPloneGoogleSitemaps/branches/contenttype/profiles/default/types/Sitemap.xml (added)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
qPloneGoogleSitemaps/branches/contenttype/__init__.py
r1089 r1428 9 9 allow_module('Products.qPloneGoogleSitemaps.utils.py') 10 10 allow_module('Products.qPloneGoogleSitemaps.config.py') 11 12 from zope.i18nmessageid import MessageFactory 13 from Products.qPloneGoogleSitemaps import config 14 15 from Products.Archetypes import atapi 16 from Products.CMFCore import utils 17 from Products.CMFCore.permissions import setDefaultRoles 18 19 # Define a message factory for when this product is internationalised. 20 # This will be imported with the special name "_" in most modules. Strings 21 # like _(u"message") will then be extracted by i18n tools for translation. 22 23 qPloneGoogleSitemapsMessageFactory = MessageFactory('qPloneGoogleSitemaps') 24 25 def initialize(context): 26 """Initializer called when used as a Zope 2 product. 27 28 This is referenced from configure.zcml. Regstrations as a "Zope 2 product" 29 is necessary for GenericSetup profiles to work, for example. 30 31 Here, we call the Archetypes machinery to register our content types 32 with Zope and the CMF. 33 """ 34 35 # Retrieve the content types that have been registered with Archetypes 36 # This happens when the content type is imported and the registerType() 37 # call in the content type's module is invoked. Actually, this happens 38 # during ZCML processing, but we do it here again to be explicit. Of 39 # course, even if we import the module several times, it is only run 40 # once. 41 42 content_types, constructors, ftis = atapi.process_types( 43 atapi.listTypes(config.PROJECTNAME), 44 config.PROJECTNAME) 45 46 # Now initialize all these content types. The initialization process takes 47 # care of registering low-level Zope 2 factories, including the relevant 48 # add-permission. These are listed in config.py. We use different 49 # permissions for each content type to allow maximum flexibility of who 50 # can add which content types, where. The roles are set up in rolemap.xml 51 # in the GenericSetup profile. 52 53 for atype, constructor in zip(content_types, constructors): 54 utils.ContentInit('%s: %s' % (config.PROJECTNAME, atype.portal_type), 55 content_types = (atype,), 56 permission = config.ADD_PERMISSIONS[atype.portal_type], 57 extra_constructors = (constructor,), 58 ).initialize(context) qPloneGoogleSitemaps/branches/contenttype/config.py
r8 r1428 1 """Common configuration constants 2 """ 3 4 PROJECTNAME = 'qPloneGoogleSitemaps' 5 6 ADD_PERMISSIONS = { 7 # -*- extra stuff goes here -*- 8 'Sitemap': 'qPloneGoogleSitemaps: Add Sitemap', 9 } 10 1 11 ping_googlesitemap = 'ping_googlesitemap'
