EduploneExam ExamFolder.py,1.29,1.30 __init__.py,1.3,1.4 version.txt,1.21,1.22

Nils Haagen <[email protected]> Fri, 08 Apr 2005 09:18:11 +0000
Newsgroups gmane.comp.web.zope.eduplone.cvs
Message-ID <[email protected]>
Update of /cvsroot/eduplone/EduploneExam
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3973

Modified Files:
	ExamFolder.py __init__.py version.txt 
Log Message:
generated with ArchGen_1.4, +fillgap

Index: version.txt
===================================================================
RCS file: /cvsroot/eduplone/EduploneExam/version.txt,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -d -r1.21 -r1.22
*** version.txt	2 Apr 2005 15:07:27 -0000	1.21
--- version.txt	8 Apr 2005 09:18:09 -0000	1.22
***************
*** 1 ****
! 1.0-alpha build 41
--- 1 ----
! 1.0-alpha build 43

Index: __init__.py
===================================================================
RCS file: /cvsroot/eduplone/EduploneExam/__init__.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** __init__.py	14 Dec 2004 19:45:30 -0000	1.3
--- __init__.py	8 Apr 2005 09:18:09 -0000	1.4
***************
*** 1,4 ****
! print 'Product EduploneExam installed'
  
  
  try:
--- 1,18 ----
! #
! # Initialise the product's module. There are three ways to inject custom code
! # here:
! #
! #   - To set global configuration variables, create a file AppConfig.py. This
! #       will be imported in config.py, which in turn is imported in each
! #       generated class and in this file.
! #   - To perform custom initialisation after types have been registered, use
! #       the protected code section at the bottom of initialize().
! #   - To register a customisation policy, create a file CustomizationPolicy.py
! #       with a method register(context) to register the policy
! #
  
+ from zLOG import LOG, INFO
+ 
+ print LOG('EduploneExam',INFO, 'Installing Product')
  
  try:
***************
*** 9,12 ****
--- 23,27 ----
  from Globals import package_home
  from Products.CMFCore import utils, CMFCorePermissions, DirectoryView
+ from Products.CMFPlone.PloneUtilities import ToolInit
  from Products.Archetypes.public import *
  from Products.Archetypes import listTypes
***************
*** 15,30 ****
  import os, os.path
  
! 
! ADD_CONTENT_PERMISSION = '''Add EduploneExam content'''
! PROJECTNAME = "EduploneExam"
! 
! product_globals=globals()
  
  DirectoryView.registerDirectory('skins', product_globals)
! DirectoryView.registerDirectory('skins/EduploneExam', product_globals)
  
  
  def initialize(context):
!     ##Import Types here to register them
      import interfaces
      import questions
--- 30,49 ----
  import os, os.path
  
! from Products.EduploneExam.config import *
  
  DirectoryView.registerDirectory('skins', product_globals)
! DirectoryView.registerDirectory('skins/EduploneExam',
!                                     product_globals)
! 
! ##code-section custom-init-head #fill in your manual code here
! ##/code-section custom-init-head
  
  
  def initialize(context):
!     
!     ##code-section custom-init-top #fill in your manual code here
!     ##/code-section custom-init-top
! 
!     # imports packages and types for registration
      import interfaces
      import questions
***************
*** 34,54 ****
      import ExamFolder
  
      content_types, constructors, ftis = process_types(
          listTypes(PROJECTNAME),
          PROJECTNAME)
  
-     
- 
      utils.ContentInit(
          PROJECTNAME + ' Content',
          content_types      = content_types,
!         permission         = ADD_CONTENT_PERMISSION,
          extra_constructors = constructors,
          fti                = ftis,
          ).initialize(context)
  
!     
! 
!     if CustomizationPolicy and hasattr(CustomizationPolicy,'register'):
          CustomizationPolicy.register(context)
!         print 'Customizationpolicy for EduploneExam installed'
--- 53,75 ----
      import ExamFolder
  
+     # initialize portal content
      content_types, constructors, ftis = process_types(
          listTypes(PROJECTNAME),
          PROJECTNAME)
  
      utils.ContentInit(
          PROJECTNAME + ' Content',
          content_types      = content_types,
!         permission         = DEFAULT_ADD_CONTENT_PERMISSION,
          extra_constructors = constructors,
          fti                = ftis,
          ).initialize(context)
  
!     # apply customization-policy, if theres any
!     if CustomizationPolicy and hasattr(CustomizationPolicy, 'register'):
          CustomizationPolicy.register(context)
!         print 'Customization policy for EduploneExam installed'
! 
!     ##code-section custom-init-bottom #fill in your manual code here
!     ##/code-section custom-init-bottom
! 

Index: ExamFolder.py
===================================================================
RCS file: /cvsroot/eduplone/EduploneExam/ExamFolder.py,v
retrieving revision 1.29
retrieving revision 1.30
diff -C2 -d -r1.29 -r1.30
*** ExamFolder.py	2 Apr 2005 15:07:27 -0000	1.29
--- ExamFolder.py	8 Apr 2005 09:18:09 -0000	1.30
***************
*** 3,13 ****
  unknown
  
- RCS-ID $Id$
  """
  # Copyright (c) 2005 by eduplone Open Source Business Network EEIG, contributed
  # by FH-Aargau, Switzerland
  #
! # Generated: Wed Mar 30 22:50:23 2005
! # Generator: ArchGenXML Version 1.2 devel 3 http://sf.net/projects/archetypes/
  #
  # GNU General Public Licence (GPL)
--- 3,11 ----
  unknown
  
  """
  # Copyright (c) 2005 by eduplone Open Source Business Network EEIG, contributed
  # by FH-Aargau, Switzerland
  #
! # Generator: ArchGenXML Version 1.4 devel 1 http://sf.net/projects/archetypes/
  #
  # GNU General Public Licence (GPL)
***************
*** 25,29 ****
  # Place, Suite 330, Boston, MA  02111-1307  USA
  #
! __author__  = 'Nils Haagen, Jens Klein <[email protected]>, <[email protected]>'
  __docformat__ = 'plaintext'
  
--- 23,27 ----
  # Place, Suite 330, Boston, MA  02111-1307  USA
  #
! __author__  = '''Nils Haagen <[email protected]>, Jens Klein <[email protected]>'''
  __docformat__ = 'plaintext'
  
***************
*** 31,35 ****
  from Products.Archetypes.public import *
  
! from interfaces.IExamContext import IExamContext
  
  ##code-section module-header #fill in your manual code here
--- 29,37 ----
  from Products.Archetypes.public import *
  
! 
! from Products.EduploneExam.interfaces.IExamContext import IExamContext
! 
! 
! from Products.EduploneExam.config import *
  
  ##code-section module-header #fill in your manual code here
***************
*** 39,93 ****
  ##/code-section module-header
  
  
  class ExamFolder(OrderedBaseFolder):
      security = ClassSecurityInfo()
!     portal_type = meta_type = 'ExamFolder' 
!     archetype_name = 'ExamFolder'   #this name appears in the 'add' box 
!     allowed_content_types = [] 
  
-     __implements__ = getattr(OrderedBaseFolder,'__implements__',()) + (IExamContext,)
  
!     ##code-section class-header #fill in your manual code here
!     ##/code-section class-header
  
!     schema=BaseSchema + Schema((
!         BooleanField('param_ShowScore',
!             default='''True''',
!             schemata='''settings''',
!             widget=BooleanWidget(description='Enter a value for param_ShowScore.',
!                 description_msgid='EduploneExam_help_param_ShowScore',
!                 i18n_domain='EduploneExam',
!                 label='Param_showscore',
!                 label_msgid='EduploneExam_label_param_ShowScore',
!             ),
!         ),
!         
!         IntegerField('param_BatchSize',
!             default='''1''',
!             schemata='''settings''',
!             widget=IntegerWidget(description='Enter a value for param_BatchSize.',
!                 description_msgid='EduploneExam_help_param_BatchSize',
!                 i18n_domain='EduploneExam',
!                 label='Param_batchsize',
!                 label_msgid='EduploneExam_label_param_BatchSize',
!             ),
!         ),
!         
!         StringField('param_FinalPage',
!             default='''exam_finished''',
!             schemata='''settings''',
!             widget=StringWidget(description='Enter a value for param_FinalPage.',
!                 description_msgid='EduploneExam_help_param_FinalPage',
!                 i18n_domain='EduploneExam',
!                 label='Param_finalpage',
!                 label_msgid='EduploneExam_label_param_FinalPage',
!             ),
!         ),
          
!     ),
      )
  
      #Methods
  
      def allowedContentTypes(self):
          """ use own registry to recognize allowed tpyes """
--- 41,130 ----
  ##/code-section module-header
  
+ schema= Schema((
+     BooleanField('param_ShowScore',
+         default="True",
+         widget=BooleanWidget(
+             label='Param_showscore',
+             label_msgid='EduploneExam_label_param_ShowScore',
+             description='Enter a value for param_ShowScore.',
+             description_msgid='EduploneExam_help_param_ShowScore',
+             i18n_domain='EduploneExam',
+         ),
+         schemata="settings",
+     ),
+     
+     IntegerField('param_BatchSize',
+         default="1",
+         widget=IntegerWidget(
+             label='Param_batchsize',
+             label_msgid='EduploneExam_label_param_BatchSize',
+             description='Enter a value for param_BatchSize.',
+             description_msgid='EduploneExam_help_param_BatchSize',
+             i18n_domain='EduploneExam',
+         ),
+         schemata="settings",
+     ),
+     
+     StringField('param_FinalPage',
+         default="exam_finished",
+         widget=StringWidget(
+             label='Param_finalpage',
+             label_msgid='EduploneExam_label_param_FinalPage',
+             description='Enter a value for param_FinalPage.',
+             description_msgid='EduploneExam_help_param_FinalPage',
+             i18n_domain='EduploneExam',
+         ),
+         schemata="settings",
+     ),
+     
+ ),
+ )
+ 
+ ##code-section after-schema #fill in your manual code here
+ ##/code-section after-schema
  
  class ExamFolder(OrderedBaseFolder):
      security = ClassSecurityInfo()
!     __implements__ = (getattr(OrderedBaseFolder,'__implements__',()),) + (IExamContext,)
  
  
!     # This name appears in the 'add' box
!     archetype_name             = 'ExamFolder'
!     portal_type = meta_type    = 'ExamFolder' 
  
!     allowed_content_types      = [] 
!     filter_content_types       = 1
!     global_allow               = 1
!     allow_discussion           = 0
!     content_icon               = 'ExamFolder.gif'
!     immediate_view             = 'base_view'
!     default_view               = 'base_view'
!     typeDescription            = "ExamFolder"
!     typeDescMsgId              = 'description_edit_examfolder'
! 
!     actions =  (
! 
! 
!        {'action':      "string:$object_url/exam_view",
!         'category':    "object",
!         'id':          'view',
!         'name':        'exam_view',
!         'permissions': ("View",),
!         'condition'  : 'python:1'
!        },
          
! 
      )
  
+     schema = BaseSchema + \
+              schema
+ 
+     ##code-section class-header #fill in your manual code here
+     ##/code-section class-header
+ 
+ 
      #Methods
  
+     security.declarePublic('allowedContentTypes')
      def allowedContentTypes(self):
          """ use own registry to recognize allowed tpyes """
***************
*** 101,104 ****
--- 138,142 ----
  
  
+     security.declarePublic('invokeFactory')
      def invokeFactory( self, type_name, id, RESPONSE=None, *args, **kw):
          """ Invokes the portal_types tool """
***************
*** 111,114 ****
--- 149,153 ----
      #methods from Interface IExamContext
  
+     security.declarePublic('deliverResponse')
      def deliverResponse(self, question, create=False):
          '''
***************
*** 137,167 ****
  
  
! 
!     # uncomment lines below when you need
!     factory_type_information={
!         'allowed_content_types':allowed_content_types,
!         'allow_discussion': 0,
!         #'content_icon':'ExamFolder.gif',
!         'immediate_view':'base_view',
!         'global_allow':1,
!         'filter_content_types':1,
!         }
! 
!         
!     actions=  (
!         
! 
!        {'action':      '''string:$object_url/exam_view''',
!         'category':    '''object''',
!         'id':          'view',
!         'name':        'exam_view',
!         'permissions': ('''View''',),
!         'condition'  : 'python:1'},
!         
! 
!           )
!         
! 
! registerType(ExamFolder)
  # end of class ExamFolder
  
--- 176,180 ----
  
  
! registerType(ExamFolder,PROJECTNAME)
  # end of class ExamFolder
  
***************
*** 170,171 ****
--- 183,185 ----
  
  
+ 



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click