Changeset 534
- Timestamp:
- 09/22/06 10:08:48
- Files:
-
- qPloneGoogleMaps/trunk/DEPENDENCY.txt (added)
- qPloneGoogleMaps/trunk/HISTORY.txt (modified) (1 diff)
- qPloneGoogleMaps/trunk/README.txt (modified) (1 diff)
- qPloneGoogleMaps/trunk/TODO.txt (modified) (1 diff)
- qPloneGoogleMaps/trunk/__init__.py (modified) (1 diff)
- qPloneGoogleMaps/trunk/browser/map_view.pt (deleted)
- qPloneGoogleMaps/trunk/browser/markersview.py (modified) (2 diffs)
- qPloneGoogleMaps/trunk/config.py (modified) (2 diffs)
- qPloneGoogleMaps/trunk/configure.zcml (modified) (1 diff)
- qPloneGoogleMaps/trunk/content/Map.py (modified) (2 diffs)
- qPloneGoogleMaps/trunk/content/Marker.py (modified) (1 diff)
- qPloneGoogleMaps/trunk/content/Overlay.py (modified) (3 diffs)
- qPloneGoogleMaps/trunk/interfaces/markers.py (modified) (2 diffs)
- qPloneGoogleMaps/trunk/skins/qPloneGoogleMaps/maps_markers.py (modified) (1 diff)
- qPloneGoogleMaps/trunk/skins/qPloneGoogleMaps/maps_view.pt (modified) (1 diff)
- qPloneGoogleMaps/trunk/skins/qPloneGoogleMaps/topic_maps_view.pt (modified) (1 diff)
- qPloneGoogleMaps/trunk/tests (added)
- qPloneGoogleMaps/trunk/tests/MapFieldTest.py (added)
- qPloneGoogleMaps/trunk/tests/__init__.py (added)
- qPloneGoogleMaps/trunk/tests/commonTestingStuff.py (added)
- qPloneGoogleMaps/trunk/tests/framework.py (added)
- qPloneGoogleMaps/trunk/tests/runalltests.py (added)
- qPloneGoogleMaps/trunk/tests/runtests.sh (added)
- qPloneGoogleMaps/trunk/tests/testAdapters.py (added)
- qPloneGoogleMaps/trunk/tests/testField.py (added)
- qPloneGoogleMaps/trunk/tests/testFunctional.py (added)
- qPloneGoogleMaps/trunk/tests/testInstallation.py (added)
- qPloneGoogleMaps/trunk/tests/testMap.py (added)
- qPloneGoogleMaps/trunk/tests/testMarker.py (added)
- qPloneGoogleMaps/trunk/tests/testOverlay.py (added)
- qPloneGoogleMaps/trunk/tests/testUtility.py (added)
- qPloneGoogleMaps/trunk/tests/testValidator.py (added)
- qPloneGoogleMaps/trunk/utility.py (added)
- qPloneGoogleMaps/trunk/utils.py (deleted)
- qPloneGoogleMaps/trunk/version.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
qPloneGoogleMaps/trunk/HISTORY.txt
r533 r534 1 0.1.0 1 2 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 1 Plone 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 7 Plone 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 25 Plone 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 31 How 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 2 76 3 77 Authors 4 78 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 19 19 20 20 * adding markers via map layer 21 22 # * tests tests tests 23 24 * javascript tests qPloneGoogleMaps/trunk/__init__.py
r533 r534 15 15 16 16 allow_module('Products.qPloneGoogleMaps.config') 17 allow_module('Products.qPloneGoogleMaps.util s')17 allow_module('Products.qPloneGoogleMaps.utility') 18 18 19 19 registerDirectory(SKINS_DIR, GLOBALS) qPloneGoogleMaps/trunk/browser/markersview.py
r533 r534 7 7 # Product imports 8 8 from Products.qPloneGoogleMaps.interfaces.markers import IMarkersView 9 from Products.qPloneGoogleMaps.adapters.markers import IMarkersListing 9 10 10 11 class MarkersView(BrowserView): … … 21 22 else: 22 23 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 1 try: 2 from Products.CMFCore.permissions import setDefaultRoles 3 except ImportError: 4 from Products.CMFCore.CMFCorePermissions import setDefaultRoles 2 5 3 6 PROJECTNAME = 'qPloneGoogleMaps' … … 8 11 9 12 NEW_PORTAL_TYPES = ['Map', 'Marker', 'Overlay'] 10 MAP_API_KEYS = ["http:// gewgaw.office.quintagroup.com:8888/map|ABQIAAAAPKXXAksH6LF9wD3-iB3Z9hR-_Derz1M-sZYUdeXG3J1uZOMrKxT98efydo7fhYu6kuaFv5ESjlw4mw", ]13 MAP_API_KEYS = ["http://localhost.com:8888/map|ABQIAAAAPKXXAksH6LF9wD3-iB3Z9hR-_Derz1M-sZYUdeXG3J1uZOMrKxT98efydo7fhYu6kuaFv5ESjlw4mw", ] 11 14 12 15 MAP_PORTLETS = ['here/portlet_maps/macros/portlet', 'here/portlet_overlays/macros/portlet',] qPloneGoogleMaps/trunk/configure.zcml
r533 r534 25 25 /> 26 26 27 <browser:page28 for="*"29 name="map_view"30 template="browser/map_view.pt"31 permission="zope2.View"32 />33 34 27 </configure> qPloneGoogleMaps/trunk/content/Map.py
r533 r534 1 1 from AccessControl import ClassSecurityInfo 2 from Products.CMFCore.permissions import ModifyPortalContent, View 2 try: 3 from Products.CMFCore.permissions import ModifyPortalContent, View 4 except ImportError: 5 from Products.CMFCore.CMFCorePermissions import ModifyPortalContent, View 3 6 from Products.CMFCore.utils import getToolByName 4 7 … … 153 156 def geoLocation(self): 154 157 """ Return geolocation tuple """ 155 return self. location158 return self.getLocation() 156 159 157 160 security.declareProtected(View, 'getOverlayMarkers') qPloneGoogleMaps/trunk/content/Marker.py
r533 r534 1 1 from AccessControl import ClassSecurityInfo 2 from Products.CMFCore.permissions import ModifyPortalContent, View 3 2 try: 3 from Products.CMFCore.permissions import ModifyPortalContent, View 4 except ImportError: 5 from Products.CMFCore.CMFCorePermissions import ModifyPortalContent, View 4 6 try: 5 7 from Products.LinguaPlone.public import * qPloneGoogleMaps/trunk/content/Overlay.py
r533 r534 1 1 from AccessControl import ClassSecurityInfo 2 from Products.CMFCore.permissions import ModifyPortalContent, View 2 try: 3 from Products.CMFCore.permissions import ModifyPortalContent, View 4 except ImportError: 5 from Products.CMFCore.CMFCorePermissions import ModifyPortalContent, View 3 6 4 7 try: … … 13 16 14 17 OverlaySchema = BaseSchema.copy() + Schema(( 15 ReferenceField(' Markers Source',18 ReferenceField('markerssource', 16 19 accessor = 'getSource', 17 20 required = True, … … 19 22 allowed_types=('Folder', 'Topic', 'Large Plone Folder'), 20 23 relationship='markers', 21 widget=ReferenceBrowserWidget(allow_search=1, 24 widget=ReferenceBrowserWidget(label='Markers Source', 25 label_msgid='label_markers_source', 26 allow_search=1, 22 27 allow_browse=1, 23 28 startup_directory='/', qPloneGoogleMaps/trunk/interfaces/markers.py
r533 r534 5 5 """ 6 6 7 def listMarkers( self):7 def listMarkers(): 8 8 """ return markers listing """ 9 9 … … 11 11 """ Markers view support interface 12 12 """ 13 14 def listMarkers(): 15 """ return contained markers """ qPloneGoogleMaps/trunk/skins/qPloneGoogleMaps/maps_markers.py
r533 r534 9 9 ## 10 10 11 from Products.qPloneGoogleMaps.util simport processDesc11 from Products.qPloneGoogleMaps.utility import processDesc 12 12 13 13 lon = [] qPloneGoogleMaps/trunk/skins/qPloneGoogleMaps/maps_view.pt
r533 r534 10 10 <span tal:define="brain python:here.portal_catalog(path='/'.join(here.getPhysicalPath())); 11 11 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:" /> 13 14 </metal:block> 14 15 </head> qPloneGoogleMaps/trunk/skins/qPloneGoogleMaps/topic_maps_view.pt
r533 r534 8 8 tal:attributes="src string:http://maps.google.com/maps?file=api&v=2&key=${here/getMapKey}"> 9 9 </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 []" 13 12 tal:replace="structure python:here.maps_markers(longlat, node='mapView', events=True, controls='large', typeControls=True, overviewControls=True)" /> 14 13 </metal:block> qPloneGoogleMaps/trunk/version.txt
r533 r534 1 0.1 1 0.1.0
