Changeset 238

Show
Ignore:
Timestamp:
09/08/06 12:46:38 (2 years ago)
Author:
thomase
Message:

Adding and committing not fully tested code which we may want to repurpose elsewhere.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • PleiadesThesauri/trunk/PleiadesThesauri/Extensions/AppInstall.py

    r168 r238  
    11from Products.PleiadesThesauri.config import PROJECTNAME 
    22from Products.PleiadesThesauri.AppConfig import VOCABLISTFILE 
     3from Products.PleiadesThesauri.Extensions.UtilCreation import setupContentItem 
     4from Products.CMFCore.utils import getToolByName 
    35import os, logging 
    46from xml.dom.minidom import parse 
     
    3234    """ 
    3335    logger = logging.getLogger(PROJECTNAME + '.AppInstall.installThesaurus') 
     36     
    3437    th_dom = getXMLDOM(th_file_path) 
    3538    thesaurus = th_dom.getElementsByTagName("vdex") 
     
    6568 
    6669    # create a new thesaurus in portal_thesauri 
     70    portal_thesauri = getToolByName(self, 'portal_thesauri') 
     71     
    6772    # set new thesaurus title = vocabName 
    6873    # set new thesaurus identifier = vocabIdentifier 
    6974    # leave new thesaurus description empty (there's nothing in vdex to correspond) 
     75     
     76    c_thesaurus_title = getText(thesaurus[0].getElementsByTagName("vocabName")[0].childNodes) 
     77    c_thesaurus_id = getText(thesaurus[0].getElementsByTagName("vocabIdentifier")[0].childNodes) 
     78     
     79    setupContentItem(portal_thesauri, 'Thesaurus', c_thesaurus_id, c_thesaurus_title, 'blah blah blah')  
     80 
    7081    # for each term in the thesaurus 
    7182    #     create a new term in this thesaurus