Changeset 534

Show
Ignore:
Timestamp:
09/22/06 10:08:48
Author:
piv
Message:

added tests, used adapter and browser in maps_topic_view, DEPENDENCY.txt, version.txt, HISTORY.txt and README.txt,

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • qPloneGoogleMaps/trunk/HISTORY.txt

    r533 r534  
     10.1.0 
    12 
    2   * initial realize 
     3  * partial adapter  implementation 
     4 
     5  * added tests 
     6 
     7  * added overlay manipulation 
     8 
     9  * provided initial functionality 
  • qPloneGoogleMaps/trunk/README.txt

    r533 r534  
    1 qPloneGoogleMaps 
     1Plone Google Maps 
     2 
     3  Plone Google Maps (qPloneGoogleMaps) is a Google Maps view product 
     4  for the Plone content management system which enables integration 
     5  of Google Maps into Plone sites. 
     6 
     7Plone Google Maps Features 
     8 
     9   1. Due to qPloneGoogleMaps you can set up the latitude and longitude 
     10      of your site objects and have their maps exhibited on your site. 
     11   2. Any object with the latitude-longitude has an additional map 
     12      portlet displaying this object. This portlet, in turn, has a 
     13      template "Large screen". If you click on the large screen below 
     14      the portlet, you will be able to see the full-size map of the 
     15      page with its description. 
     16   3. The folders containing objects with the latitude-longitude 
     17      parameters have an additional display view - "maps view", 
     18      which gives an opportunity to see the full-size map with all 
     19      these objects. 
     20   4. There is a new content type "Map" which can have other content 
     21      types - "overlays". It enables the positioning of different 
     22      objects on one map showing them with the markers of different 
     23      colours. 
     24 
     25Plone Google Maps Installation 
     26 
     27    * Install qPloneGoogleMaps and geolocation as Zope products 
     28    * Install these two products in your Plone instance with Quick 
     29      Installer (Plone Control Panel ->Add/remove Products) 
     30 
     31How To Use qPloneGoogleMaps 
     32 
     33 Use Case 1 
     34 
     35    Let's assume you need to show two objects (Plone pages) situated in 
     36    one folder on one map. 
     37 
     38      * Suppose you have a folder "School" 
     39      * Create two pages for this folder ("School 1", "School 2") 
     40      * Go to the page "School 1" and click on the tab "geolocation" 
     41      * You will see a page with the latitude, longitude,zoom, type 
     42        fields and an empty Google map. Fill in the fields which determine 
     43        map displaying properties and then click on map for choosing 
     44        marker position and then click the "Save" button 
     45      * Do the same steps for the page "School 2" 
     46      * Go to the folder "School" 
     47      * Choose "maps view" from the "display" drop-down menu. You will 
     48        see the map with both of these objects ("School 1", "School 2") 
     49        marked with the markers. If you click on one of these markers 
     50        you will see its name and description appear beside it (after 
     51        the click on this name you will be taken to the page the marker 
     52        displays)  
     53 
     54 Use Case 2 
     55 
     56    Let's assume, you need to show many objects situated in different 
     57    folders on one map. 
     58 
     59      * Suppose, you have a folder "Nigeria". 
     60      * Go to this folder and add "map" item from the "add item" drop-down 
     61        menu. 
     62      * If you go to the "map" you've created, you will notice that it 
     63        can have an additional content type "overlay": 
     64      * Choose "overlay" from "add item" drop-down menu 
     65      * Enter Short Name and title of a new overlay 
     66      * Click "browse" button for the "Markers Source" pop-up window to appear 
     67      * Now choose the folder containing the object with the latitude- 
     68        longitude parameters you want your marker to be tied to and click 
     69        "insert" 
     70      * Return to the "Edit Overlay" page to select the marker's color 
     71        which will be shown on the map 
     72      * Click the "Save" button 
     73      * Complete the same steps for creating overlays for other objects of 
     74        the folder "Nigeria" 
     75      * Go to this folder and choose the map 
    276 
    377Authors 
    478 
    5   * Myroslav Opyr 
    6    
    7   * Vitaliy Podoba 
    8      
     79  * Myroslav Opyr,   quintagroup.com 
     80 
     81  * Vitaliy Podoba,  quintagroup.com 
  • qPloneGoogleMaps/trunk/TODO.txt

    r533 r534  
    1919 
    2020  * adding markers via map layer 
     21   
     22#  * tests tests tests 
     23 
     24   * javascript tests 
  • qPloneGoogleMaps/trunk/__init__.py

    r533 r534  
    1515 
    1616allow_module('Products.qPloneGoogleMaps.config') 
    17 allow_module('Products.qPloneGoogleMaps.utils') 
     17allow_module('Products.qPloneGoogleMaps.utility') 
    1818 
    1919registerDirectory(SKINS_DIR, GLOBALS) 
  • qPloneGoogleMaps/trunk/browser/markersview.py

    r533 r534  
    77# Product imports 
    88from Products.qPloneGoogleMaps.interfaces.markers import IMarkersView 
     9from Products.qPloneGoogleMaps.adapters.markers import IMarkersListing 
    910 
    1011class MarkersView(BrowserView): 
     
    2122        else: 
    2223            self.markers = None 
     24 
     25    def listMarkers(self): 
     26        """ return contained markers """ 
     27        return self.markers 
  • qPloneGoogleMaps/trunk/config.py

    r533 r534  
    1 from Products.CMFCore.CMFCorePermissions import setDefaultRoles 
     1try: 
     2    from Products.CMFCore.permissions import setDefaultRoles 
     3except ImportError: 
     4    from Products.CMFCore.CMFCorePermissions import setDefaultRoles 
    25 
    36PROJECTNAME = 'qPloneGoogleMaps' 
     
    811 
    912NEW_PORTAL_TYPES = ['Map', 'Marker', 'Overlay'] 
    10 MAP_API_KEYS = ["http://gewgaw.office.quintagroup.com:8888/map|ABQIAAAAPKXXAksH6LF9wD3-iB3Z9hR-_Derz1M-sZYUdeXG3J1uZOMrKxT98efydo7fhYu6kuaFv5ESjlw4mw", ] 
     13MAP_API_KEYS = ["http://localhost.com:8888/map|ABQIAAAAPKXXAksH6LF9wD3-iB3Z9hR-_Derz1M-sZYUdeXG3J1uZOMrKxT98efydo7fhYu6kuaFv5ESjlw4mw", ] 
    1114 
    1215MAP_PORTLETS = ['here/portlet_maps/macros/portlet', 'here/portlet_overlays/macros/portlet',] 
  • qPloneGoogleMaps/trunk/configure.zcml

    r533 r534  
    2525      />   
    2626 
    27   <browser:page 
    28       for="*" 
    29       name="map_view" 
    30       template="browser/map_view.pt" 
    31       permission="zope2.View" 
    32       />   
    33     
    3427</configure> 
  • qPloneGoogleMaps/trunk/content/Map.py

    r533 r534  
    11from AccessControl import ClassSecurityInfo 
    2 from Products.CMFCore.permissions import ModifyPortalContent, View 
     2try: 
     3    from Products.CMFCore.permissions import ModifyPortalContent, View 
     4except ImportError: 
     5    from Products.CMFCore.CMFCorePermissions import ModifyPortalContent, View 
    36from Products.CMFCore.utils import getToolByName 
    47 
     
    153156    def geoLocation(self): 
    154157        """ Return geolocation tuple """ 
    155         return self.location 
     158        return self.getLocation() 
    156159 
    157160    security.declareProtected(View, 'getOverlayMarkers') 
  • qPloneGoogleMaps/trunk/content/Marker.py

    r533 r534  
    11from AccessControl import ClassSecurityInfo 
    2 from Products.CMFCore.permissions import ModifyPortalContent, View 
    3  
     2try: 
     3    from Products.CMFCore.permissions import ModifyPortalContent, View 
     4except ImportError: 
     5    from Products.CMFCore.CMFCorePermissions import ModifyPortalContent, View 
    46try: 
    57  from Products.LinguaPlone.public import * 
  • qPloneGoogleMaps/trunk/content/Overlay.py

    r533 r534  
    11from AccessControl import ClassSecurityInfo 
    2 from Products.CMFCore.permissions import ModifyPortalContent, View 
     2try: 
     3    from Products.CMFCore.permissions import ModifyPortalContent, View 
     4except ImportError: 
     5    from Products.CMFCore.CMFCorePermissions import ModifyPortalContent, View 
    36 
    47try: 
     
    1316 
    1417OverlaySchema = BaseSchema.copy() + Schema(( 
    15     ReferenceField('Markers Source', 
     18    ReferenceField('markerssource', 
    1619                   accessor = 'getSource', 
    1720                   required = True, 
     
    1922                   allowed_types=('Folder', 'Topic', 'Large Plone Folder'), 
    2023                   relationship='markers', 
    21                    widget=ReferenceBrowserWidget(allow_search=1, 
     24                   widget=ReferenceBrowserWidget(label='Markers Source', 
     25                                                 label_msgid='label_markers_source', 
     26                                                 allow_search=1, 
    2227                                                 allow_browse=1, 
    2328                                                 startup_directory='/', 
  • qPloneGoogleMaps/trunk/interfaces/markers.py

    r533 r534  
    55    """ 
    66    
    7     def listMarkers(self): 
     7    def listMarkers(): 
    88        """ return markers listing """ 
    99 
     
    1111    """  Markers view support interface 
    1212    """ 
     13     
     14    def listMarkers(): 
     15        """ return contained markers """ 
  • qPloneGoogleMaps/trunk/skins/qPloneGoogleMaps/maps_markers.py

    r533 r534  
    99## 
    1010 
    11 from Products.qPloneGoogleMaps.utils import processDesc 
     11from Products.qPloneGoogleMaps.utility import processDesc 
    1212 
    1313lon = [] 
  • qPloneGoogleMaps/trunk/skins/qPloneGoogleMaps/maps_view.pt

    r533 r534  
    1010    <span tal:define="brain python:here.portal_catalog(path='/'.join(here.getPhysicalPath())); 
    1111                      longlat python:test(len(brain)==1 and brain[0].portal_type != 'Map' and brain[0].geoLocation, brain, [])" 
    12           tal:replace="structure python:here.maps_markers(longlat, node='mapView', events=True, controls='large', typeControls=True, overviewControls=True, zoom=6, loc=longlat[0].geoLocation, auto=None)" /> 
     12          tal:replace="structure python:here.maps_markers(longlat, node='mapView', events=True, controls='large', typeControls=True, overviewControls=True, zoom=6, loc=longlat[0].geoLocation, auto=None)" 
     13          tal:on-error="string:" /> 
    1314  </metal:block> 
    1415</head> 
  • qPloneGoogleMaps/trunk/skins/qPloneGoogleMaps/topic_maps_view.pt

    r533 r534  
    88            tal:attributes="src string:http://maps.google.com/maps?file=api&amp;v=2&amp;key=${here/getMapKey}"> 
    99    </script> 
    10     <span tal:define="contentsMethod python:test(here.portal_type=='Topic', here.queryCatalog, here.getFolderContents); 
    11                       content folderContents|python:contentsMethod(); 
    12                       longlat python:[el for el in content if el.geoLocation]" 
     10    <span tal:define="markersview context/@@MarkersView; 
     11                      longlat python:markersview and markersview.listMarkers() or []" 
    1312          tal:replace="structure python:here.maps_markers(longlat, node='mapView', events=True, controls='large', typeControls=True, overviewControls=True)" /> 
    1413  </metal:block> 
  • qPloneGoogleMaps/trunk/version.txt

    r533 r534  
    1 0.1 
     10.1.0