Changeset 1216

Show
Ignore:
Timestamp:
10/30/07 23:30:13 (1 year ago)
Author:
sgillies
Message:

Use IItem and ICollection as markers for things to adapt to IGeoItemSimple and IGeoCollectionSimple, add missing methods and attribute to IGeoItemSimple

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • PleiadesGeocoder/trunk/CHANGES.txt

    r630 r1216  
    33 
    44All ticket numbers are relative to http://icon.stoa.org/trac/pleiades/tickets. 
     5 
     61.0a1 
     7----- 
     8- Added a content georeferencing event. 
     9- New content georeferencing form, with event notification. 
     10- GML geometry serialization used in GeoRSS view. 
     11- Added support for LineString and Polygon geometry types. 
    512 
    6130.6.2 - 20 February, 2007 
  • PleiadesGeocoder/trunk/configure.zcml

    r1166 r1216  
    77 
    88  <adapter 
    9     for=".interfaces.IGeoreferenceable
     9    for=".interfaces.IItem
    1010    provides=".interfaces.IGeoItemSimple" 
    1111    factory=".geo.GeoItemSimple" 
     
    1313 
    1414  <adapter 
    15     for=".interfaces.IGeoserializable
     15    for=".interfaces.ICollection
    1616    provides=".interfaces.IGeoCollectionSimple" 
    1717    factory=".geo.GeoCollectionSimple" 
    1818    /> 
    1919 
     20  <five:implements 
     21    class="Products.ATContentTypes.content.base.BaseContent" 
     22    interface=".interfaces.IItem" 
     23    /> 
     24 
     25  <five:implements 
     26    class="Products.ATContentTypes.content.base.BaseContent" 
     27    interface=".interfaces.ICollection" 
     28    /> 
    2029 
    2130  <five:implements 
     
    3140  <five:implements 
    3241    class="Products.ATContentTypes.content.folder.ATFolder" 
     42    interface=".interfaces.ICollection" 
     43    /> 
     44 
     45  <five:implements 
     46    class="Products.ATContentTypes.content.folder.ATFolder" 
    3347    interface=".interfaces.IGeoserializable" 
     48    /> 
     49 
     50  <five:implements 
     51    class="Products.ATContentTypes.content.topic.ATTopic" 
     52    interface=".interfaces.ICollection" 
    3453    /> 
    3554 
  • PleiadesGeocoder/trunk/interfaces/__init__.py

    r1188 r1216  
    3434from zope.interface import Interface, Attribute 
    3535 
     36 
     37class IItem(Interface): 
     38    """Marker for items.""" 
     39 
     40 
     41class ICollection(Interface): 
     42    """Marker for collections.""" 
     43 
     44 
    3645class IGeoreferencedEvent(Interface): 
    3746    """An event fired when georeferenced. 
     
    4049    context = Attribute("The content object that was saved.") 
    4150 
     51 
  • PleiadesGeocoder/trunk/interfaces/simple.py

    r372 r1216  
    2828# =========================================================================== 
    2929 
    30 from zope.interface import Interface 
     30from zope.interface import Interface, Attribute 
    3131from zope.app.annotation.interfaces import IAttributeAnnotatable 
    3232 
     
    109109    def setGeometry(type, coordinates): 
    110110        """Set spatial coordinates, input is a tuple of (X, Y, Z) floats."""  
    111          
     111 
     112    def setGeoInterface(type, coordinates): 
     113        """Set type and coordinates, following the geo interface spec.""" 
     114 
    112115    def getInfo(dims): 
    113116        """Returns a dict suitable for serialization to GeoRSS or KML. 
     
    119122        has an SRS, geometry type, and coordinates.""" 
    120123 
     124    def hasPoint(): 
     125        """Returns True if the item has a point geometry.""" 
     126 
     127    def hasLineString(): 
     128        """Returns True if the item has a linestring geometry.""" 
     129 
     130    def hasPolygon(): 
     131        """Returns True if the item has a polygon geometry.""" 
     132 
     133    __geo_interface__ = Attribute("Provides Python geo interface") 
    121134 
    122135class IGeoCollectionSimple(Interface): 
  • PleiadesGeocoder/trunk/tests/test_simple.py

    r459 r1216  
    1111from Products.PleiadesGeocoder.interfaces \ 
    1212    import IGeoreferenceable, IGeoserializable \ 
    13         , IGeoItemSimple, IGeoCollectionSimple 
     13        , IGeoItemSimple, IGeoCollectionSimple \ 
     14        , IItem, ICollection 
    1415from Products.PleiadesGeocoder.geo import GeoItemSimple, GeoCollectionSimple 
    1516from Products.PleiadesGeocoder.utils import addSpatialMemberData 
     
    2728 
    2829    def testImplements(self): 
    29         self.failUnless(IGeoreferenceable.implementedBy(BaseContent)) 
    30         self.failUnless(IGeoreferenceable.implementedBy(ATDocument)) 
     30        self.failUnless(IItem.implementedBy(BaseContent)) 
     31        self.failUnless(IItem.implementedBy(ATDocument)) 
    3132         
    3233class DocumentTest(PloneTestCase.PloneTestCase): 
     
    4142 
    4243    def testInterfaces(self): 
    43         self.failUnless(IGeoreferenceable.providedBy(self.document)) 
     44        self.failUnless(IItem.providedBy(self.document)) 
     45        self.failUnless(ICollection.providedBy(self.document)) 
    4446 
    4547    def testGeoreferenced(self): 
  • PleiadesGeocoder/trunk/version.txt

    r630 r1216  
    1 0.6.2 
    2  
     11.0a1