EduploneWebdidactics DMLRelationVocabulary.py,NONE,1.1 CustomizationPolicy.py,1.10,1.11 __init__.py,1.1.1.1,1.2 config.py,1.2,1.3

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-serv14740

Modified Files:
	CustomizationPolicy.py __init__.py config.py 
Added Files:
	DMLRelationVocabulary.py 
Log Message:
added vocabulary for DML


Index: config.py
===================================================================
RCS file: /cvsroot/eduplone/EduploneWebdidactics/config.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** config.py	1 Nov 2004 12:48:56 -0000	1.2
--- config.py	2 Nov 2004 22:13:02 -0000	1.3
***************
*** 8,11 ****
--- 8,12 ----
      'ATContentTypes',
      'ATVocabularyManager',
+     'ATReferenceBrowserWidget',
      'Annotations',
      'CMFMetadata',

--- NEW FILE: DMLRelationVocabulary.py ---
"""\
Vocabulary for Webdidactic Relations.

RCS-ID $Id: DMLRelationVocabulary.py,v 1.1 2004/11/02 22:13:02 yenzenz Exp $
"""
# Copyright (c) 2004, Eduplone Open Source Business Network EEIG, Europe/Austria
#
# GNU General Public Licence (GPL)
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
# details.
# You should have received a copy of the GNU General Public License along with
# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
# Place, Suite 330, Boston, MA  02111-1307  USA
#
__author__  = 'Jens Klein <[email protected]>'
__docformat__ = 'plaintext'

from AccessControl import ClassSecurityInfo
from Products.Archetypes.public import *

from Products.ATReferenceBrowserWidget.ATReferenceBrowserWidget import *

from Products.ATVocabularyManager.types.SimpleVocabularyItem import SimpleVocabularyItem
from Products.ATVocabularyManager.VocabularyTool import registerVocabularyItem


class DMLRelationVocabularyItem(SimpleVocabularyItem):
    security = ClassSecurityInfo()
    portal_type = meta_type = 'DMLRelationVocabularyItem'
    archetype_name = 'DML Entry'   #this name appears in the 'add' box
    allowed_content_types = []
    global_allow = 0

    schema= getattr(SimpleVocabularyItem,'schema',Schema(())) + Schema((
        ReferenceField(
            'inversevocabularyref',
            allowed_types=('DMLVocabularyItem',),
            required = 0,
            multiValued=0,
            relationship='dml_vocabulary_inverse',
            widget = ReferenceWidget(
                description = 'Choose an inverse DML entry to be referenced (if needed).',
                description_msgid = "help_inversevocab_ref",
                label = "Inverse DML Entry",
                label_msgid = "label_inversevocab_ref",
                i18n_domain="eduplonewebdidactic",),
        ),

        ReferenceField(
            'rulebookref',
            allowed_types=('ReferenceJig',),
            required = 1,
            multiValued=0,
            relationship='dml_vocabulary_inverse',
            widget = ReferenceBrowserWidget(
                description = 'Choose an Rulebook to be referenced.',
                description_msgid = "help_rulebook_ref",
                label = "Rulebook",
                label_msgid = "label_jig_ref",
                i18n_domain="eduplonewebdidactic",),
        ),

    ),
    )

registerType(DMLRelationVocabularyItem)
registerVocabularyItem(DMLRelationVocabularyItem, 'SimpleVocabulary')

Index: CustomizationPolicy.py
===================================================================
RCS file: /cvsroot/eduplone/EduploneWebdidactics/CustomizationPolicy.py,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** CustomizationPolicy.py	1 Nov 2004 17:07:56 -0000	1.10
--- CustomizationPolicy.py	2 Nov 2004 22:13:02 -0000	1.11
***************
*** 34,37 ****
--- 34,38 ----
      def customize_1_InstallProducts(self, portal):
          for p in DEPENDENCIES+[PROJECTNAME]:
+             print "Install Product %s" % p
              portal.portal_quickinstaller.installProduct(p)
  
***************
*** 59,62 ****
--- 60,68 ----
                  cat.addIndex(mditem,'FieldIndex')
  
+         # add access handler for references
+         # this is a bit tricky, cause the reference is not a CMF object.
+ 
+ 
+ 
      def customize_4_add_relation_tab(self, portal):
          portal.portal_actions.addAction('relations',
***************
*** 72,75 ****
--- 78,82 ----
  
  
+ 
  def register(context):
      addPolicy(DISPLAYNAME, WebdidacticsPolicy())

Index: __init__.py
===================================================================
RCS file: /cvsroot/eduplone/EduploneWebdidactics/__init__.py,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** __init__.py	20 Jun 2004 10:21:06 -0000	1.1.1.1
--- __init__.py	2 Nov 2004 22:13:02 -0000	1.2
***************
*** 5,10 ****
  
  from Globals import package_home
! from Products.CMFCore import DirectoryView
! 
  PROJECTNAME = "EduploneWebdidactics"
  
--- 5,10 ----
  
  from Globals import package_home
! from Products.CMFCore import utils, DirectoryView, CMFCorePermissions
! from Products.Archetypes.public import *
  PROJECTNAME = "EduploneWebdidactics"
  
***************
*** 16,19 ****
--- 16,34 ----
  
  def initialize(context):
+ 
+     from DMLRelationVocabulary import DMLRelationVocabularyItem
+ 
+     content_types, constructors, ftis = process_types(
+         listTypes(PROJECTNAME),
+         PROJECTNAME)
+ 
+     utils.ContentInit(
+         PROJECTNAME + ' Content',
+         content_types      = content_types,
+         permission         = CMFCorePermissions.ModifyPortalContent,
+         extra_constructors = constructors,
+         fti                = ftis,
+         ).initialize(context)
+ 
      if CustomizationPolicy and hasattr(CustomizationPolicy,'register'):
          CustomizationPolicy.register(context)



-------------------------------------------------------
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.