Changeset 665

Show
Ignore:
Timestamp:
03/02/07 17:26:02 (2 years ago)
Author:
thomase
Message:

PlacefulAssociation?.placeType now uses ATVocabularyManager to set up its vocabulary and populate its selection widget. This introduces a dependency on ATVM (DEPENDENCIES.txt has been updated accordingly).

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • PleiadesEntity/trunk/DEPENDENCIES.txt

    r602 r665  
    88http://codespeak.net/lxml/index.html 
    99 
     10- AT Vocabulary Manager: 
     11http://plone.org/products/atvocabularymanager 
     12tested with ATVM svn trunk r7582 
     13 
  • PleiadesEntity/trunk/Extensions/Install.py

    r647 r665  
    7272    install_subskin(self, out, GLOBALS) 
    7373 
     74 
     75    # Create vocabularies in vocabulary lib 
     76    from Products.ATVocabularyManager.config import TOOL_NAME as ATVOCABULARYTOOL 
     77    atvm = getToolByName(self, ATVOCABULARYTOOL) 
     78    vocabmap = {'AWMCPlaceTypes.xml': ('SimpleVocabulary', 'SimpleVocabularyTerm'), 
     79        } 
     80    for vocabname in vocabmap.keys(): 
     81        if not vocabname in atvm.contentIds(): 
     82            atvm.invokeFactory(vocabmap[vocabname][0], vocabname) 
     83 
     84        if len(atvm[vocabname].contentIds()) < 1: 
     85            if vocabmap[vocabname][0] == "VdexVocabulary": 
     86                vdexpath = os.path.join( 
     87                    package_home(GLOBALS), 'data', '%s.vdex' % vocabname) 
     88                if not (os.path.exists(vdexpath) and os.path.isfile(vdexpath)): 
     89                    print >>out, 'No VDEX import file provided at %s.' % vdexpath 
     90                    continue 
     91                try: 
     92                    #read data 
     93                    f = open(vdexpath, 'r') 
     94                    data = f.read() 
     95                    f.close() 
     96                except: 
     97                    print >>out, 'Problems while reading VDEX import file provided at %s.' % vdexpath 
     98                    continue 
     99                atvm[vocabname].importXMLBinding(data) 
     100            else: 
     101                pass 
    74102 
    75103    # try to call a workflow install method 
  • PleiadesEntity/trunk/content/PlacefulAssociation.py

    r649 r665  
    3131from AccessControl import ClassSecurityInfo 
    3232from Products.Archetypes.atapi import * 
     33from Products.ATVocabularyManager.namedvocabulary import NamedVocabulary 
    3334from Products.PleiadesEntity.config import * 
    3435 
     
    4041    StringField( 
    4142        name='placeType', 
    42         default="unknown", 
    4343        index="KeywordIndex", 
    4444        widget=SelectionWidget( 
     
    4747            i18n_domain='PleiadesEntity', 
    4848        ), 
    49         enforceVocabulary=1, 
    50         vocabulary=['aqueduct', 'bath', 'bay', 'bridge', 'canal', 'cape', 'cave', 'cemetery', 'centuriation', 'church', 'coast', 'dam', 'estate', 'estuary', 'findspot', 'forest', 'fort', 'hill', 'island', 'lighthouse', 'mine', 'mountain', 'oasis', 'pass', 'people', 'plain', 'port', 'production', 'region', 'reservoir', 'ridge', 'river', 'road', 'salt-marsh', 'settlement', 'settlement-modern', 'spring', 'station', 'temple', 'tumulus', 'undefined', 'unknown', 'unlocated', 'valley', 'wall', 'water-inland', 'water-open', 'well', 'wheel', 'whirlpool'] 
     49        vocabulary=NamedVocabulary("""AWMCPlaceTypes.xml"""), 
     50        default="unknown", 
     51        enforceVocabulary=1 
    5152    ), 
    5253 
  • PleiadesEntity/trunk/i18n/generated.pot

    r581 r665  
    8282msgstr "" 
    8383 
     84#. Default: "Certainty of association between locations and names" 
     85#: content\PlacefulAssociation.py 
     86msgid "PleiadesEntity_help_certainty" 
     87msgstr "" 
     88 
    8489#. Default: "A unique identifier for this name, assigned by the Pleiades editorial board." 
    8590#: content\GeographicName.py 
     
    175180#. Default: "Certainty" 
    176181#: content\TemporalAttestation.py 
     182#: content\PlacefulAssociation.py 
    177183msgid "PleiadesEntity_label_certainty" 
    178184msgstr "" 
     
    206212#. Default: "Locations" 
    207213#: content\Place.py 
     214#: content\PlacefulAssociation.py 
    208215msgid "PleiadesEntity_label_locations" 
    209216msgstr "" 
     
    270277#. Default: "Names" 
    271278#: content\Place.py 
     279#: content\PlacefulAssociation.py 
    272280msgid "PleiadesEntity_label_names" 
    273281msgstr "" 
     
    275283#. Default: "Place Type" 
    276284#: content\Place.py 
     285#: content\PlacefulAssociation.py 
    277286msgid "PleiadesEntity_label_placeType" 
    278287msgstr "" 
  • PleiadesEntity/trunk/version.txt

    r650 r665  
    1 0.1 build 237 
     10.1 build 240