EduploneWebdidactics/Extensions Install.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/Extensions
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13243/Extensions

Modified Files:
	Install.py 
Log Message:
now with default vocabs


Index: Install.py
===================================================================
RCS file: /cvsroot/eduplone/EduploneWebdidactics/Extensions/Install.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** Install.py	20 Jun 2004 11:14:40 -0000	1.3
--- Install.py	16 Sep 2004 14:38:31 -0000	1.4
***************
*** 10,13 ****
--- 10,16 ----
  from Products.EduploneWebdidactics import product_globals
  
+ from Products.CMFCore.utils import getToolByName
+ from Products.ATVocabularyManager.config import TOOL_NAME as ATVOCABULARYTOOL
+ 
  def install(self):
      out=StringIO()
***************
*** 15,18 ****
--- 18,81 ----
      install_subskin(self, out, product_globals)
      
+     install_vocabularies(self, out)
+     
      out.write('EduploneWebdidactics skins installation completed.\n')
      return out.getvalue()
+ 
+ def install_vocabularies(self, out):
+     atvm=getToolByName(self,ATVOCABULARYTOOL)
+     for vkey in eduplone_vocabularies.keys():
+         # create vocabulary if it doesnt exist:
+         vocabname= "wd_%s" % vkey
+         if not hasattr(atvm, vocabname):
+             print >>out, "adding vocabulary %s" % vocabname
+             atvm.invokeFactory('SimpleVocabulary',vocabname)
+         vocab = atvm[vocabname]
+         for (ikey, value) in eduplone_vocabularies[vkey]:
+             vocab.invokeFactory('SimpleVocabularyItem', ikey)
+             vocab[ikey].setTitle(value)
+                     
+                     
+     
+     
+ eduplone_vocabularies = {}
+ 
+ # CLASSIFICATION
+ eduplone_vocabularies['classification'] = (
+     ('orientation', u'Orientierung'),
+     ('summary', u'Zusammenfassung'),
+     ('overview', u'Ueberblick'),
+     ('explanation', u'Erklaerung'),
+     ('example', u'Beispiel'),
+     ('action', u'Handlung'),
+     ('rule', u'Regel'),
+     ('procedure', u'Prozedur'),
+     ('checklist', u'Checkliste'),
+     ('source', u'Quelle'),
+     ('assignment', u'Aufgabe'),
+     ('question', u'Frage'),
+ )
+ 
+ # LEVEL
+ eduplone_vocabularies['level'] = (
+     ('level_easy', u'Leicht'),
+     ('level_medium', u'Mittel'),
+     ('level_expert', u'Schwer'),
+ )
+ 
+ eduplone_vocabularies['mediatype'] = (
+     ('pres_text', u'Praesentation - Text'),
+     ('pres_table', u'Praesentation - Tabelle'),
+     ('pres_graphic', u'Praesentation - Grafik'),
+     ('pres_animatedgraphic', u'Praesentation - animierte Grafik'),
+     ('pres_image', u'Praesentation - Bild'),
+     ('pres_video', u'Praesentation - Film/Video'),
+     ('pres_sound', u'Praesentation - Sound'),
+     ('interact_simulation', u'Interaktion - Simulation'),
+     ('interact_voting', u'Interaktion - Abstimmung'),
+     ('interact_rating', u'Interaktion - Bewertung'),
+     ('communication_chat', u'Kommunikation - Chat'),
+     ('communication_email', u'Kommunikation - E-Mail'),
+     ('communication_directmail', u'Kommunikation - interne Nachricht'),
+     ('communication_board', u'Kommunikation - Forum')
+ )



-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
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.