EduploneWebdidactics config.py,NONE,1.1 CustomizationPolicy.py,1.3,1.4

Jens Klein <[email protected]>
Newsgroups gmane.comp.web.zope.eduplone.cvs
Message-ID <[email protected]>
Update of /cvsroot/eduplone/EduploneWebdidactics
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5321

Modified Files:
	CustomizationPolicy.py 
Added Files:
	config.py 
Log Message:
new style customization-policy


--- NEW FILE: config.py ---
# settings for this product

PROJECTNAME = "EduploneWebdidactics"
DISPLAYNAME = "Eduplone Webdidactics"

DEPENDENCIES= [
    'Archetypes',
    'ATContentTypes',
    'ATVocabularyManager',
    'Annotations',
    'CMFMetadata',
]

USE_CUSTOMIZATION_POLICY = 1

# do not change below here
GLOBALS=globals()

Index: CustomizationPolicy.py
===================================================================
RCS file: /cvsroot/eduplone/EduploneWebdidactics/CustomizationPolicy.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** CustomizationPolicy.py	17 Sep 2004 09:14:45 -0000	1.3
--- CustomizationPolicy.py	1 Nov 2004 12:12:08 -0000	1.4
***************
*** 2,5 ****
--- 2,6 ----
  from Products.CMFPlone.Portal import addPolicy
  from os import path
+ from config import *
  module_path = path.abspath(path.dirname(__file__))
  
***************
*** 8,37 ****
  
      def customize(self, portal):
!     	# If the customization Policy id called inside an already existing
! 	# portal, calling the DefaultCustomizationPolicy.customize is a 
! 	# problem
! 	# ugly try catch arround works, but should somewhere in future be
! 	# replaced by a test from which location we are calling.
          try:
              DefaultCustomizationPolicy.customize(self, portal)
! 	except:
! 	    pass
! 	
! 	# install products needed
!         portal.portal_quickinstaller.installProduct("Annotations")
!         portal.portal_quickinstaller.installProduct("CMFMetadata")
!         portal.portal_quickinstaller.installProduct("Archetypes")
!         portal.portal_quickinstaller.installProduct("ATVocabularyManager")
!         portal.portal_quickinstaller.installProduct("EduploneWebdidactics")
  
! 	# populate portalmetadata with combined dc/webdidactic metadataset
! 	portal.portal_metadata.collection.importSet( \
! 	    path.join(module_path,'data/dublincore_webdidactics.xml')
! 	)
! 	portal.portal_metadata.collection.dc_wd.title = 'Dublin Core and Webdidactic DML Metadata'
! 	# and set this set as default
          portal.portal_metadata.ct_mapping.setDefaultChain('dcwd')
  
  
  def register(context):
!     addPolicy('Eduplone Webdidactics', WebdidacticsPolicy())
--- 9,48 ----
  
      def customize(self, portal):
!         """ custom customize method
!         """
!         # If the customization Policy id called inside an already existing
!         # portal, calling the DefaultCustomizationPolicy.customize is a
!         # problem
!         # ugly try catch arround works, but should somewhere in future be
!         # replaced by a test from which location we are calling.
          try:
              DefaultCustomizationPolicy.customize(self, portal)
!         except:
!             pass
  
!         # call all methods starting with 'customize'
!         LOG(DISPLAYNAME, INFO, "Customization Policy applied:")
!         for method in dir(self):
!             if method.startswith('customize') and method!='customize':
!                 print "Processing customization '%s' ..." % method
!                 eval('self.%s(portal)' % method)
! 
!     def customize_1_InstallProducts(self, portal):
!         for p in DEPENDENCIES+[PROJECTNAME]:
!             portal.portal_quickinstaller.installProduct(p)
! 
!     def customize_2_add_metadata_definiton(self, portal):
!         # populate portalmetadata with combined dc/webdidactic metadataset
!         portal.portal_metadata.collection.importSet( \
!             path.join(module_path,'data/dublincore_webdidactics.xml')
!         )
!         portal.portal_metadata.collection.dc_wd.title = 'Dublin Core and Webdidactic DML Metadata'
!         # and set this set as default
          portal.portal_metadata.ct_mapping.setDefaultChain('dcwd')
  
+     def customize_3_add_relation_tab(self, portal):
+         pass
+ 
  
  def register(context):
!     addPolicy(DISPLAYNAME, WebdidacticsPolicy())



-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.