[zopeorg-checkins] CVS: Products/ZopeOrg-NV - Installer.py:1.1 __init__.py:1.22

Sidnei da Silva sidnei at x3ng.com.br
Tue Apr 1 15:10:58 EST 2003


Update of /cvs-zopeorg/Products/ZopeOrg-NV
In directory cvs.zope.org:/tmp/cvs-serv12569

Modified Files:
	__init__.py 
Added Files:
	Installer.py 
Log Message:
Adding Plone Customization Policy in place of setupZopeOrg External Method.

=== Added File Products/ZopeOrg-NV/Installer.py === (590/690 lines abridged)
import os, string
from StringIO import StringIO

from Products.CMFPlone.Portal import addPolicy
from Products.CMFPlone.CustomizationPolicy import DefaultCustomizationPolicy
from Products.CMFPlone.interfaces.CustomizationPolicy import ICustomizationPolicy

from Products.CMFCore.utils import getToolByName
from Products.CMFCore.DirectoryView import addDirectoryViews
from Products.CMFCore.TypesTool import FactoryTypeInformation

from Products.ZopeOrg import zopeorg_globals
from Products.ZopeOrg.ZopeOrgTypes import ftis

from Products.ZCTextIndex import ZCTextIndex
from Products.PluginIndexes.DateIndex.DateIndex import DateIndex
from Products.PluginIndexes.DateRangeIndex.DateRangeIndex import DateRangeIndex
from Products.CMFDateIndexes.RSCatalogTool import RSCatalogTool

from Products.ExternalMethod.ExternalMethod import ExternalMethod

def register(context, app_state):
    addPolicy('Zope.org Policy', ZopeOrgPolicy())

INVISIBLE_TYPES = ( 'Wiki Page'
                  , 'Software Release File'
                  , 'BackTalk Document'
                  )

NEEDED_PRODUCTS = ( 'CMFDefault'
                  , 'CMFCore'
                  , 'CMFCalendar'
                  , 'CMFDateIndexes'
                  , 'CMFCollector'
                  , 'ZWiki'
                  , 'CMFPackage'
                  , 'BackTalk'
                  , 'CMFBackTalk'
                  , 'DCWorkflow'
                  , 'ZopeOrg'
                  , 'PageTemplates'
                  , 'Rewriter'
                  , 'BTreeFolder2'
                  , 'CMFPlone'
                  , 'Formulator'
                  , 'ExternalEditor'
                  )

SKINPATHS = ( 'Basic',
              'NZO', 

[-=- -=- -=- 590 lines omitted -=- -=- -=-]

                                                  , 'Monitoring'
                                                  , 'Object Model'
                                                  , 'Performance'
                                                  , 'Permissions'
                                                  , 'Properties'
                                                  , 'Programs'
                                                  , 'Proxy'
                                                  , 'Roles'
                                                  , 'Sessions'
                                                  , 'Structured Text'
                                                  , 'Tutorials'
                                                  , 'Upgrading'
                                                  , 'User Folders'
                                                  , 'Versions'
                                                  , 'Virtual Hosting'
                                                  , 'WAP'
                                                  , 'WebDAV'
                                                  , 'Workflow'
                                                  , 'XML'
                                                  , 'ZCatalog'
                                                  , 'ZClasses'
                                                  , 'ZClient'
                                                  , 'ZODB'
                                                  , 'ZServer'
                                                  , 'Zope Core'
                                                  )
                                       , REQUEST=None
                                       ,)

        self.log('  - MetaData Policies Setup')

    def setupExtMethods(self, portal):
        """ Set up all other external methods that are needed """

        for ext_dict in EXT_METHODS:
            eg = ext_dict.get
            id = eg( 'id' )

            if id in portal.objectIds():
                portal._delObject( id )

            ext_obj = ExternalMethod( id=id
                                    , title=eg( 'title' )
                                    , module=eg( 'module' )
                                    , function=eg( 'function' )
                                    )

            portal._setObject( id, ext_obj )

            self.log(' - Set up external method %s' % id)


=== Products/ZopeOrg-NV/__init__.py 1.21 => 1.22 ===
 import ZopeOrgTypes
 import ZPublisher.Publish
 from string import rfind
-#import SoftwareProduct
-#import ZopeOrgMemberDataTool
-#import ZopeOrgMembershipTool
 
 #Hackish workaround to allow accesing the broken ZODB on ZopeOrg
 class ImplicitAcquirerWrapper:
@@ -26,8 +23,6 @@
 # Make the skins available as DirectoryViews
 registerDirectory('skins', zopeorg_globals)
 
-#ftis = SoftwareProduct.factory_type_information
-
 ftis = ( CaseStudy.factory_type_information + \
          ZopeServiceProvider.factory_type_information )
 
@@ -37,6 +32,8 @@
 
 def initialize( context ):
     """ Initialize the ZopeOrg components """
+    import Installer
+    Installer.register(context, zopeorg_globals)
 
     context.registerClass( ContentList.ContentList
                          , constructors=CL_CTORS
@@ -54,24 +51,3 @@
                             ),
        fti = ftis ,
        ).initialize(context)
-
-    #ToolInit(
-    #    'Zope.Org Tools',
-    #    tools = ( ZopeOrgMemberDataTool.ZopeOrgMemberDataTool
-    #            , ZopeOrgMembershipTool.ZopeOrgMembershipTool
-    #            ),
-    #    product_name='ZopeOrg',
-    #    icon='tool.gif' ).initialize( context )
-
-    #ContentInit(
-    #    'Zope.org Content',
-    #    content_types = ( SoftwareProduct.SoftwareProduct
-    #                    , SoftwareProduct.SoftwareRelease
-    #                    ),
-    #    permission = AddPortalContent,
-    #    extra_constructors = ( SoftwareProduct.addSoftwareProduct
-    #                         , SoftwareProduct.addSoftwareRelease
-    #                         , SoftwareProduct.addSoftwareReleaseFile
-    #                         ),
-    #    fti = ftis ,
-    #    ).initialize(context)





More information about the zopeorg-checkins mailing list