Changeset 1356

Show
Ignore:
Timestamp:
08/15/08 15:16:58 (4 months ago)
Author:
sgillies
Message:

Features are now referenced by Places

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • PleiadesEntity/trunk

    • Property svn:ignore set to
      *.pyc
  • PleiadesEntity/trunk/Extensions

    • Property svn:ignore set to
      *.pyc
  • PleiadesEntity/trunk/Extensions/Install.py

    r1244 r1356  
    134134        "SecondaryReference", 
    135135        "PrimaryReference", 
    136         "PlacefulAssociation", 
     136        "Feature", 
    137137        "LocationContainer", 
    138138        "PlaceContainer", 
  • PleiadesEntity/trunk/Extensions/loader.py

    r1354 r1356  
    198198    if srs is not None: 
    199199        bibls = srs.xpath('tei:bibl', namespaces={'tei': TEI}) 
    200         if not bibls: 
    201             raise EntityLoadError, "Encountered an empty secondaryReferences"  
    202         else: 
     200        #if not bibls: 
     201        #    return 
     202        #    #raise EntityLoadError, "Encountered an empty secondaryReferences" 
     203        if bibls is not None: 
    203204            for bibl in bibls: 
    204205                title_elem = bibl.xpath('tei:title', namespaces={'tei': TEI}) 
     
    311312            pass 
    312313 
    313         try: 
    314             vid = find_next_valid_name_id(names, id) 
    315             nid = names.invokeFactory("Name", 
    316                     id=vid, 
    317                     title = transliteration.encode('utf-8'), 
    318                     nameTransliterated=transliteration.encode('utf-8'), 
    319                     nameAttested=nameAttested.encode('utf-8'), 
    320                     nameLanguage=nameLanguage.encode('utf-8'), 
    321                     nameType=type, 
    322                     accuracy=accuracy, 
    323                     completeness=completeness, 
    324                     creators=creators, 
    325                     contributors=contributors, 
    326                     rights=rights, 
    327                     description=description 
    328                     ) 
    329             name = names[nid] 
    330         except: 
    331             nid = names.duplicates.invokeFactory("Name", 
    332                     id=id, 
    333                     title = transliteration.encode('utf-8'), 
    334                     nameTransliterated=transliteration.encode('utf-8'), 
    335                     nameAttested=nameAttested.encode('utf-8'), 
    336                     nameLanguage=nameLanguage.encode('utf-8'), 
    337                     nameType=type, 
    338                     accuracy=accuracy, 
    339                     completeness=completeness, 
    340                     creators=creators, 
    341                     contributors=contributors, 
    342                     rights=rights, 
    343                     description=description 
    344                     ) 
    345             name = names.duplicates[nid] 
     314        #vid = find_next_valid_name_id(names, id) 
     315        nid = names.invokeFactory("Name", 
     316                #id=vid, 
     317                title = transliteration.encode('utf-8'), 
     318                nameTransliterated=transliteration.encode('utf-8'), 
     319                nameAttested=nameAttested.encode('utf-8'), 
     320                nameLanguage=nameLanguage.encode('utf-8'), 
     321                nameType=type, 
     322                accuracy=accuracy, 
     323                completeness=completeness, 
     324                creators=creators, 
     325                contributors=contributors, 
     326                rights=rights, 
     327                description=description 
     328                ) 
     329        name = names[nid] 
    346330 
    347331        nids.append(nid) 
     
    383367 
    384368    places = site['places'] 
     369    features = site['features'] 
    385370    names = site['names'] 
    386371    locations = site['locations'] 
     
    435420         
    436421        pid = places.invokeFactory('Place', 
    437                     id=id, 
     422                    #id=id, 
    438423                    title=computedTitle, 
    439424                    modernLocation=modernLocation, 
     
    449434            # Handle the unnamed case 
    450435            if len(nids) == 0: 
    451                 aid = p.invokeFactory('PlacefulAssociation', 
    452                     id="unnamed-%s" % lid, 
    453                     placeType=placeType, 
     436                fid = features.invokeFactory('Feature', 
     437                    #id="unnamed,%s" % lid, 
     438                    featureType=placeType, 
    454439                    associationCertainty='certain', 
    455440                    ) 
    456                 a = p[aid] 
    457                 a.addReference(locations[lid], 'hasLocation') 
     441                f = features[fid] 
     442                f.addReference(locations[lid], 'hasLocation') 
    458443                # Secondary references for the place 
    459                 parse_secondary_references(root, a, ptool) #, wftool) 
    460  
     444                parse_secondary_references(root, f, ptool) #, wftool) 
     445                p.addReference(f, 'hasFeature') 
    461446            else: 
    462447                for i, nid in enumerate(nids): 
    463448                    # Get association certainty from XML 
    464449                    certainty = association_certainties[i] 
    465                  
    466                     aid = p.invokeFactory('PlacefulAssociation', 
    467                         id="%s-%s" % (nid,lid), 
    468                         placeType=placeType, 
     450                    fid = features.invokeFactory('Feature', 
     451                        #id="%s,%s" % (nid,lid), 
     452                        featureType=placeType, 
    469453                        associationCertainty=certainty, 
    470454                        ) 
    471                     a = p[aid] 
    472                     a.addReference(locations[lid], 'hasLocation') 
    473                     a.addReference(names[nid], 'hasName') 
     455                    f = features[fid] 
     456                    f.addReference(locations[lid], 'hasLocation') 
     457                    f.addReference(names[nid], 'hasName') 
    474458                    # Secondary references for the place 
    475                     parse_secondary_references(root, a, ptool) #, wftool) 
    476      
     459                    parse_secondary_references(root, f, ptool) #, wftool) 
     460                    p.addReference(f, 'hasFeature') 
     461                 
    477462        # If there are no locations, iterate over the names 
    478463        if len(lids) == 0: 
    479464            for nid in nids: 
    480                 aid = p.invokeFactory('PlacefulAssociation', 
    481                         id="%s-unlocated" % nid, 
    482                         placeType=placeType, 
     465                fid = features.invokeFactory('Feature', 
     466                        #id="%s,unlocated" % nid, 
     467                        featureType=placeType, 
    483468                        associationCertainty='certain', 
    484469                        ) 
    485                 a = p[aid] 
    486                 a.addReference(names[nid], 'hasName') 
     470                f = features[fid] 
     471                f.addReference(names[nid], 'hasName') 
    487472                # Secondary references for the place 
    488                 parse_secondary_references(root, a, ptool) #, wftool) 
     473                parse_secondary_references(root, f, ptool) #, wftool) 
     474                p.addReference(f, 'hasFeature') 
    489475 
    490476    except: 
  • PleiadesEntity/trunk/__init__.py

    r1244 r1356  
    55# Copyright (c) 2008 by Ancient World Mapping Center, University of North 
    66# Carolina at Chapel Hill, U.S.A. 
    7 # Generator: ArchGenXML Version 2.0 
     7# Generator: ArchGenXML Version 2.1 
    88#            http://plone.org/products/archgenxml 
    99# 
     
    7272 
    7373    # Initialize portal content 
    74     content_types, constructors, ftis = process_types( 
     74    all_content_types, all_constructors, all_ftis = process_types( 
    7575        listTypes(PROJECTNAME), 
    7676        PROJECTNAME) 
     
    7878    cmfutils.ContentInit( 
    7979        PROJECTNAME + ' Content', 
    80         content_types      = content_types, 
     80        content_types      = all_content_types, 
    8181        permission         = DEFAULT_ADD_CONTENT_PERMISSION, 
    82         extra_constructors = constructors, 
    83         fti                = ftis, 
     82        extra_constructors = all_constructors, 
     83        fti                = all_ftis, 
    8484        ).initialize(context) 
     85 
     86    # Give it some extra permissions to control them on a per class limit 
     87    for i in range(0,len(all_content_types)): 
     88        klassname=all_content_types[i].__name__ 
     89        if not klassname in ADD_CONTENT_PERMISSIONS: 
     90            continue 
     91 
     92        context.registerClass(meta_type   = all_ftis[i]['meta_type'], 
     93                              constructors= (all_constructors[i],), 
     94                              permission  = ADD_CONTENT_PERMISSIONS[klassname]) 
    8595 
    8696    ##code-section custom-init-bottom #fill in your manual code here 
  • PleiadesEntity/trunk/config.py

    r1244 r1356  
    55# Copyright (c) 2008 by Ancient World Mapping Center, University of North 
    66# Carolina at Chapel Hill, U.S.A. 
    7 # Generator: ArchGenXML Version 2.0 
     7# Generator: ArchGenXML Version 2.1 
    88#            http://plone.org/products/archgenxml 
    99# 
     
    3434DEFAULT_ADD_CONTENT_PERMISSION = "Add portal content" 
    3535setDefaultRoles(DEFAULT_ADD_CONTENT_PERMISSION, ('Manager', 'Owner')) 
     36ADD_CONTENT_PERMISSIONS = { 
     37    'Name': 'PleiadesEntity: Add Name', 
     38    'Location': 'PleiadesEntity: Add Location', 
     39    'TemporalAttestation': 'PleiadesEntity: Add TemporalAttestation', 
     40    'Reference': 'PleiadesEntity: Add Reference', 
     41    'SecondaryReference': 'PleiadesEntity: Add SecondaryReference', 
     42    'PrimaryReference': 'PleiadesEntity: Add PrimaryReference', 
     43    'Feature': 'PleiadesEntity: Add Feature', 
     44    'NameContainer': 'PleiadesEntity: Add NameContainer', 
     45    'LocationContainer': 'PleiadesEntity: Add LocationContainer', 
     46    'PlaceContainer': 'PleiadesEntity: Add PlaceContainer', 
     47    'Place': 'PleiadesEntity: Add Place', 
     48    'FeatureContainer': 'PleiadesEntity: Add FeatureContainer', 
     49} 
     50 
     51setDefaultRoles('PleiadesEntity: Add Name', ('Manager','Owner')) 
     52setDefaultRoles('PleiadesEntity: Add Location', ('Manager','Owner')) 
     53setDefaultRoles('PleiadesEntity: Add TemporalAttestation', ('Manager','Owner')) 
     54setDefaultRoles('PleiadesEntity: Add Reference', ('Manager','Owner')) 
     55setDefaultRoles('PleiadesEntity: Add SecondaryReference', ('Manager','Owner')) 
     56setDefaultRoles('PleiadesEntity: Add PrimaryReference', ('Manager','Owner')) 
     57setDefaultRoles('PleiadesEntity: Add Feature', ('Manager','Owner')) 
     58setDefaultRoles('PleiadesEntity: Add NameContainer', ('Manager','Owner')) 
     59setDefaultRoles('PleiadesEntity: Add LocationContainer', ('Manager','Owner')) 
     60setDefaultRoles('PleiadesEntity: Add PlaceContainer', ('Manager','Owner')) 
     61setDefaultRoles('PleiadesEntity: Add Place', ('Manager','Owner')) 
     62setDefaultRoles('PleiadesEntity: Add FeatureContainer', ('Manager','Owner')) 
    3663 
    3764product_globals = globals() 
  • PleiadesEntity/trunk/configure.zcml

    r1346 r1356  
    1 <configure xmlns="http://namespaces.zope.org/zope" 
    2            xmlns:browser="http://namespaces.zope.org/browser" 
    3            xmlns:five="http://namespaces.zope.org/five"> 
     1<configure xmlns="http://namespaces.zope.org/zope"  
     2           xmlns:browser="http://namespaces.zope.org/browser"  
     3           xmlns:five="http://namespaces.zope.org/five">  
    44   
    55  <include file="profiles.zcml" /> 
     6 
     7 
    68 
    79  <!-- ##code-section configure.zcml --> 
     
    1315 
    1416  <adapter 
    15     for="Products.PleiadesEntity.content.PlacefulAssociation.PlacefulAssociation
     17    for="Products.PleiadesEntity.content.Feature.Feature
    1618    provides="zgeo.geographer.interfaces.IGeoreferenced" 
    17     factory=".geo.PlacefulAssociationGeoItem" 
     19    factory=".geo.FeatureGeoItem" 
    1820    /> 
    1921   
  • PleiadesEntity/trunk/content

    • Property svn:ignore set to
      *.pyc
  • PleiadesEntity/trunk/content/Location.py

    r1346 r1356  
    55# Copyright (c) 2008 by Ancient World Mapping Center, University of North 
    66# Carolina at Chapel Hill, U.S.A. 
    7 # Generator: ArchGenXML Version 2.0 
     7# Generator: ArchGenXML Version 2.1 
    88#            http://plone.org/products/archgenxml 
    99# 
     
    5858        ), 
    5959    ), 
     60 
    6061), 
    6162) 
     
    7576    """ 
    7677    security = ClassSecurityInfo() 
     78 
    7779    implements(interfaces.ILocation) 
    7880 
  • PleiadesEntity/trunk/content/LocationContainer.py

    r1244 r1356  
    55# Copyright (c) 2008 by Ancient World Mapping Center, University of North 
    66# Carolina at Chapel Hill, U.S.A. 
    7 # Generator: ArchGenXML Version 2.0 
     7# Generator: ArchGenXML Version 2.1 
    88#            http://plone.org/products/archgenxml 
    99# 
     
    3131schema = Schema(( 
    3232 
     33 
    3334), 
    3435) 
     
    4849    """ 
    4950    security = ClassSecurityInfo() 
     51 
    5052    implements(interfaces.ILocationContainer) 
    5153 
  • PleiadesEntity/trunk/content/Name.py

    r1244 r1356  
    55# Copyright (c) 2008 by Ancient World Mapping Center, University of North 
    66# Carolina at Chapel Hill, U.S.A. 
    7 # Generator: ArchGenXML Version 2.0 
     7# Generator: ArchGenXML Version 2.1 
    88#            http://plone.org/products/archgenxml 
    99# 
     
    9696        enforceVocabulary=1, 
    9797    ), 
     98 
    9899), 
    99100) 
     
    112113    """ 
    113114    security = ClassSecurityInfo() 
     115 
    114116    implements(interfaces.IName) 
    115117 
  • PleiadesEntity/trunk/content/Place.py

    r1244 r1356  
    55# Copyright (c) 2008 by Ancient World Mapping Center, University of North 
    66# Carolina at Chapel Hill, U.S.A. 
    7 # Generator: ArchGenXML Version 2.0 
     7# Generator: ArchGenXML Version 2.1 
    88#            http://plone.org/products/archgenxml 
    99# 
     
    2121from Products.CMFDynamicViewFTI.browserdefault import BrowserDefaultMixin 
    2222 
     23from Products.ATReferenceBrowserWidget.ATReferenceBrowserWidget import \ 
     24    ReferenceBrowserWidget 
    2325from Products.PleiadesEntity.config import * 
    2426 
    2527##code-section module-header #fill in your manual code here 
     28from Products.CMFCore import permissions 
    2629##/code-section module-header 
    2730 
     
    3841        ), 
    3942    ), 
     43    TextField( 
     44        name='content', 
     45        widget=RichWidget( 
     46            label="Content", 
     47            description="About the place", 
     48            label_msgid='PleiadesEntity_label_content', 
     49            description_msgid='PleiadesEntity_help_content', 
     50            i18n_domain='PleiadesEntity', 
     51        ), 
     52    ), 
     53    ReferenceField( 
     54        name='features', 
     55        widget=ReferenceBrowserWidget( 
     56            label='Features', 
     57            label_msgid='PleiadesEntity_label_features', 
     58            i18n_domain='PleiadesEntity', 
     59        ), 
     60        allowed_types=('Feature',), 
     61        multiValued=1, 
     62        relationship='hasFeature', 
     63    ), 
     64 
    4065), 
    4166) 
     
    4469##/code-section after-local-schema 
    4570 
    46 Place_schema = BaseFolderSchema.copy() + \ 
     71Place_schema = BaseSchema.copy() + \ 
    4772    schema.copy() 
    4873 
     
    5075##/code-section after-schema 
    5176 
    52 class Place(BaseFolder, BrowserDefaultMixin): 
     77class Place(BaseContent, BrowserDefaultMixin): 
    5378    """ 
    5479    """ 
    5580    security = ClassSecurityInfo() 
     81 
    5682    implements(interfaces.IPlace) 
    5783 
     
    7096        """ 
    7197        """ 
    72         try: 
    73             associations = self.listFolderContents() 
    74             nametitles = [] 
    75             nametypes = [] 
    76             for a in associations: 
    77                 try: 
    78                     name = a.getRefs('hasName')[0]              # there can only be one name per association 
    79                     nametitles.append(name.Title()) 
    80                     nametypes.append(name.getNameType()) 
    81                 except: 
    82                     pass 
    83             title = '/'.join([title for i, title in enumerate(nametitles) if nametypes[i] == 'geographic' and not title.startswith('Unnamed')]) 
    84             if title == '': 
    85                 '/'.join([title for title in nametitles if not title.startswith('Unnamed')]) 
    86             return title 
    87         except AttributeError: 
     98        titles = [] 
     99        types = [] 
     100        for o in self.getFeatures(): 
     101            try: 
     102                name = o.getRefs('hasName')[0] 
     103                titles.append(name.Title()) 
     104                types.append(name.getNameType()) 
     105            except: 
     106                pass 
     107        if len(titles) == 0: 
    88108            return 'Unnamed Place' 
     109        else: 
     110            return '/'.join(titles) 
    89111 
    90112    security.declarePublic('getTimePeriods') 
     
    93115        """ 
    94116        result = [] 
    95         for a in self.listFolderContents(): 
    96             for p in a.getTimePeriods(): 
    97                 if p not in result: 
    98                     result.append(p
     117        for o in self.getFeatures(): 
     118            for t in o.getTimePeriods(): 
     119                if t not in result: 
     120                    result.append(t
    99121        return result 
    100122 
     
    104126        """ 
    105127        result = [] 
    106         for a in self.listFolderContents(): 
    107             if a.getPlaceType() not in result: 
    108                 result.append(a.getPlaceType()) 
     128        for o in self.getFeatures(): 
     129            t = o.getFeatureType() 
     130            if t not in result: 
     131                result.append(t) 
    109132        return result 
     133 
     134    # Manually created methods 
     135 
     136    security.declareProtected(permissions.View, 'getFeatures') 
     137    def getFeatures(self): 
     138         for o in self.getRefs('hasFeature'): 
     139            if interfaces.IFeature.providedBy(o): 
     140                yield o 
     141 
    110142 
    111143 
  • PleiadesEntity/trunk/content/PlaceContainer.py

    r1244 r1356  
    55# Copyright (c) 2008 by Ancient World Mapping Center, University of North 
    66# Carolina at Chapel Hill, U.S.A. 
    7 # Generator: ArchGenXML Version 2.0 
     7# Generator: ArchGenXML Version 2.1 
    88#            http://plone.org/products/archgenxml 
    99# 
     
    3131schema = Schema(( 
    3232 
     33 
    3334), 
    3435) 
     
    4748    """ 
    4849    security = ClassSecurityInfo() 
     50 
    4951    implements(interfaces.IPlaceContainer) 
    5052 
     
    7880 
    7981        # Places are handled differently 
    80         if id
     82        if id is not None
    8183            obid = str(id) 
    8284        else: 
    83             # prevent ids in the reserved range 
    84             obid = -1 
    85             while int(obid) <= BA_ID_MAX: 
    86                 obid = self.generateId(prefix='') 
     85            obid = self.generateId(prefix='') 
    8786        args = ('Place', self, obid, RESPONSE) 
    8887        new_id = pt.constructContent(*args, **kw) 
  • PleiadesEntity/trunk/content/PlacefulAssociation.py

    r1244 r1356  
    11# -*- coding: utf-8 -*- 
    22# 
    3 # File: PlacefulAssociation.py 
     3# File: Feature.py 
    44# 
    55# Copyright (c) 2008 by Ancient World Mapping Center, University of North 
     
    8282##/code-section after-local-schema 
    8383 
    84 PlacefulAssociation_schema = BaseFolderSchema.copy() + \ 
     84Feature_schema = BaseFolderSchema.copy() + \ 
    8585    schema.copy() 
    8686 
     
    8888##/code-section after-schema 
    8989 
    90 class PlacefulAssociation(BaseFolder, BrowserDefaultMixin): 
     90class Feature(BaseFolder, BrowserDefaultMixin): 
    9191    """Associates Names and Locations 
    9292    """ 
    9393    security = ClassSecurityInfo() 
    94     implements(interfaces.IPlacefulAssociation
     94    implements(interfaces.IFeature
    9595 
    96     meta_type = 'PlacefulAssociation
     96    meta_type = 'Feature
    9797    _at_rename_after_creation = False 
    9898 
    99     schema = PlacefulAssociation_schema 
     99    schema = Feature_schema 
    100100 
    101101    ##code-section class-header #fill in your manual code here 
     
    143143 
    144144 
    145 registerType(PlacefulAssociation, PROJECTNAME) 
    146 # end of class PlacefulAssociation 
     145registerType(Feature, PROJECTNAME) 
     146# end of class Feature 
    147147 
    148148##code-section module-footer #fill in your manual code here 
  • PleiadesEntity/trunk/content/PrimaryReference.py

    r1244 r1356  
    55# Copyright (c) 2008 by Ancient World Mapping Center, University of North 
    66# Carolina at Chapel Hill, U.S.A. 
    7 # Generator: ArchGenXML Version 2.0 
     7# Generator: ArchGenXML Version 2.1 
    88#            http://plone.org/products/archgenxml 
    99# 
     
    2828schema = Schema(( 
    2929 
     30 
    3031), 
    3132) 
     
    4546    """ 
    4647    security = ClassSecurityInfo() 
     48 
    4749    implements(interfaces.IPrimaryReference) 
    4850 
  • PleiadesEntity/trunk/content/Reference.py

    r1244 r1356  
    55# Copyright (c) 2008 by Ancient World Mapping Center, University of North 
    66# Carolina at Chapel Hill, U.S.A. 
    7 # Generator: ArchGenXML Version 2.0 
     7# Generator: ArchGenXML Version 2.1 
    88#            http://plone.org/products/archgenxml 
    99# 
     
    6363        ), 
    6464    ), 
     65 
    6566), 
    6667) 
     
    7980    """ 
    8081    security = ClassSecurityInfo() 
     82 
    8183    implements(interfaces.IReference) 
    8284 
  • PleiadesEntity/trunk/content/SecondaryReference.py

    r1244 r1356  
    55# Copyright (c) 2008 by Ancient World Mapping Center, University of North 
    66# Carolina at Chapel Hill, U.S.A. 
    7 # Generator: ArchGenXML Version 2.0 
     7# Generator: ArchGenXML Version 2.1 
    88#            http://plone.org/products/archgenxml 
    99# 
     
    2828schema = Schema(( 
    2929 
     30 
    3031), 
    3132) 
     
    4546    """ 
    4647    security = ClassSecurityInfo() 
     48 
    4749    implements(interfaces.ISecondaryReference) 
    4850 
  • PleiadesEntity/trunk/content/TemporalAttestation.py

    r1244 r1356  
    55# Copyright (c) 2008 by Ancient World Mapping Center, University of North 
    66# Carolina at Chapel Hill, U.S.A. 
    7 # Generator: ArchGenXML Version 2.0 
     7# Generator: ArchGenXML Version 2.1 
    88#            http://plone.org/products/archgenxml 
    99# 
     
    5252        required=1, 
    5353    ), 
     54 
    5455), 
    5556) 
     
    6869    """ 
    6970    security = ClassSecurityInfo() 
     71 
    7072    implements(interfaces.ITemporalAttestation) 
    7173 
  • PleiadesEntity/trunk/content/__init__.py

    r1244 r1356  
    55# Copyright (c) 2008 by Ancient World Mapping Center, University of North 
    66# Carolina at Chapel Hill, U.S.A. 
    7 # Generator: ArchGenXML Version 2.0 
     7# Generator: ArchGenXML Version 2.1 
    88#            http://plone.org/products/archgenxml 
    99# 
     
    4444import SecondaryReference 
    4545import PrimaryReference 
    46 import PlacefulAssociation 
     46import Feature 
     47import NameContainer 
    4748import LocationContainer 
    4849import PlaceContainer 
    4950import Place 
     51import FeatureContainer 
    5052 
    5153##code-section init-module-footer #fill in your manual code here 
  • PleiadesEntity/trunk/content/interfaces.py

    r1251 r1356  
    3030    """ 
    3131 
    32 class IPlacefulAssociation(Interface): 
    33     """Marker interface for .PlacefulAssociation.PlacefulAssociation 
     32class IFeature(Interface): 
     33    """Marker interface for .Feature.Feature 
     34    """ 
     35 
     36class INameContainer(Interface): 
     37    """Marker interface for .NameContainer.NameContainer 
    3438    """ 
    3539 
     
    4650    """ 
    4751 
     52class IFeatureContainer(Interface): 
     53    """Marker interface for .FeatureContainer.FeatureContainer 
     54    """ 
     55 
    4856##code-section FOOT 
    4957##/code-section FOOT 
  • PleiadesEntity/trunk/data

    • Property svn:ignore set to
      *.pyc
  • PleiadesEntity/trunk/geo.py

    r1325 r1356  
    3131from zgeo.geographer.interfaces import IGeoreferenced, IWriteGeoreferenced 
    3232import simplejson 
    33  
     33from Products.PleiadesEntity.content.interfaces import IPlace 
    3434import logging 
    3535log = logging.getLogger('PleiadesEntity.geo') 
     
    6464 
    6565 
    66 class PlacefulAssociationGeoItem(object): 
     66class FeatureGeoItem(object): 
    6767    implements(IGeoreferenced) 
    6868    
     
    109109        self.context = context 
    110110        self._adapter = None 
    111         for ob in self.context.values(): 
     111        for ob in self.context.getFeatures(): 
    112112            try: 
    113113                self._adapter = IGeoreferenced(ob) 
     
    137137def createGeoItem(context): 
    138138    """Factory for adapters.""" 
    139     if IPlacefulContainer.providedBy(context): 
     139    if IPlace.providedBy(context): 
    140140        return PlaceGeoItem(context) 
    141141    else: 
    142         return PlacefulAssociationGeoItem(context) 
     142        return FeatureGeoItem(context) 
  • PleiadesEntity/trunk/i18n

    • Property svn:ignore set to
      *.pyc
  • PleiadesEntity/trunk/interfaces

    • Property svn:ignore set to