r252689 - in tecnoteca.googlemap/trunk/googlemap/src/tecnoteca.googlemap: . docs tecnoteca.googlemap.egg-info tecnoteca/googlemap/browser

"Marco Celotti" <svn-changes-z4DKO/[email protected]> Mon, 11 Nov 2013 09:09:53 +0000 (UTC)
Newsgroups gmane.comp.web.zope.plone.collective.cvs
Message-ID <[email protected]>
Author: mcelotti
Date: Mon Nov 11 09:09:53 2013
New Revision: 252689

Modified:
   tecnoteca.googlemap/trunk/googlemap/src/tecnoteca.googlemap/docs/HISTORY.txt
   tecnoteca.googlemap/trunk/googlemap/src/tecnoteca.googlemap/setup.py
   tecnoteca.googlemap/trunk/googlemap/src/tecnoteca.googlemap/tecnoteca.googlemap.egg-info/PKG-INFO
   tecnoteca.googlemap/trunk/googlemap/src/tecnoteca.googlemap/tecnoteca.googlemap.egg-info/SOURCES.txt
   tecnoteca.googlemap/trunk/googlemap/src/tecnoteca.googlemap/tecnoteca.googlemap.egg-info/requires.txt
   tecnoteca.googlemap/trunk/googlemap/src/tecnoteca.googlemap/tecnoteca/googlemap/browser/views.py
Log:
getRelatedItems bug fix

Modified: tecnoteca.googlemap/trunk/googlemap/src/tecnoteca.googlemap/docs/HISTORY.txt
==============================================================================
--- tecnoteca.googlemap/trunk/googlemap/src/tecnoteca.googlemap/docs/HISTORY.txt	(original)
+++ tecnoteca.googlemap/trunk/googlemap/src/tecnoteca.googlemap/docs/HISTORY.txt	Mon Nov 11 09:09:53 2013
@@ -1,6 +1,9 @@
 Changelog
 =========
 
+Tecnoteca Google Map 1.2 - November 11, 2013
+	- getRelatedItems bug fix
+
 Tecnoteca Google Map 1.1 - October 8, 2013
     - GoogleMaps API v3
     - Georeference custom ContentTypes

Modified: tecnoteca.googlemap/trunk/googlemap/src/tecnoteca.googlemap/setup.py
==============================================================================
--- tecnoteca.googlemap/trunk/googlemap/src/tecnoteca.googlemap/setup.py	(original)
+++ tecnoteca.googlemap/trunk/googlemap/src/tecnoteca.googlemap/setup.py	Mon Nov 11 09:09:53 2013
@@ -9,7 +9,7 @@
 def read(*rnames):
     return open(os.path.join(os.path.dirname(__file__), *rnames)).read()
 
-version = '1.1'
+version = '1.2'
 
 long_description = (
     read('docs/README.txt')

Modified: tecnoteca.googlemap/trunk/googlemap/src/tecnoteca.googlemap/tecnoteca.googlemap.egg-info/PKG-INFO
==============================================================================
--- tecnoteca.googlemap/trunk/googlemap/src/tecnoteca.googlemap/tecnoteca.googlemap.egg-info/PKG-INFO	(original)
+++ tecnoteca.googlemap/trunk/googlemap/src/tecnoteca.googlemap/tecnoteca.googlemap.egg-info/PKG-INFO	Mon Nov 11 09:09:53 2013
@@ -1,16 +1,14 @@
-Metadata-Version: 1.0
+Metadata-Version: 1.1
 Name: tecnoteca.googlemap
-Version: 1.1
+Version: 1.2
 Summary: Tecnoteca GoogleMap Plone Product
 Home-page: http://svn.plone.org/svn/collective/
 Author: Tecnoteca srl
 Author-email: [email protected]
 License: GPL
-Description: Tecnoteca GoogleMap Module for Plone 3
-        
-        WARNING:
+Description: Tecnoteca GoogleMap Module for Plone 3 and Plone 4
+        ---------------------------------------------------------------------------
         
-        USE AT YOUR OWN RISK
         The Tecnoteca GoogleMap module and these instructions are distributed
         in the hope that they will be useful, but WITHOUT ANY WARRANTY;
         without even the implied warranty of MERCHANTABILITY
@@ -24,64 +22,114 @@
         
         **************************************************************************
         
-        CONTENTS
-        ---------------------------------------------------------------------------
-        1. Module functions
-        2. Module manufacturer
-        3. Installation
-        
-        
         
-        1. Module functions
+        Introduction
         ---------------------------------------------------------------------------
+        This product lets you include Google Maps v3 in a Plone 3 / Plone 4 environment.
+        The Tecnoteca GoogleMap module extends Plone with the capability to display different maps with macro-categories, categories, markers, paths and areas.
+        Thanks to the Plone relations feature it's possible to define georeference from/to map markers and other Plone objects.
+        You can also extend your custom content types (Archetypes) to add geolocalization attributes and then show your content types on the google map.
         
-        This product lets you include google map service in a Plone 3 environment.
-        The Tecnoteca GoogleMap module extends Plone 3 with the capability to display
-        different maps with macro-categories, categories, markers, paths and areas.
-        Thanks to the Plone relations feature it's possible to define georeference
-        from/to map markers and other Plone objects.
+        .. image:: http://www.tecnoteca.com/it/release/plone-google-map/immagini/TecnotecaGoogleMap.png/image_preview
         
-        Features
         
-        - Complete map definition (center,zoom,size,advanced controls,etc) for each map
+        Features
+        ---------------------------------------------------------------------------
+        - Plone 3 and Plone 4 compatibility
+        - Complete map definition (center,zoom,size,advanced controls,traffic,panoramio,weather,bicycle,street view, etc)
         - Custom categories with custom icons and unlimited markers per category
         - Location widget to define markers' position
+        - Georeference for custom content types (Archetypes), see section below
+        - Georeference for plone pages, events, news, images etc
         - Custom paths
         - Custom areas
-        - Georeference for plone pages, events, news, images etc
         - Portlet to show georeference relations
-        - Panoramio photos
-        - JQuery based interface
-        - Italian and English localizations
-        
-        Scenario
-        
-        You have a Plone site and you'd like to add several maps (culture, health,
-        transportation, etc) each one containing several categories (ie museums,
-        theaters, churches etc), and every category containing several markers
+        - Cache load option (@ram.cache)
+        - Italian, English and French localizations
+        
+        **Scenario**
+        
+        You have a Plone site and you'd like to add several maps (culture, health, 
+        transportation, etc) each one containing several categories (ie museums, 
+        theaters, churches etc), and every category containing several markers 
         (ie museum n.1, museum n.2, museum n.3 etc).
-        Moreover you'd like to link together the content page regarding the "museum n.1"
-        and the marker "museum n.1" you've defined in your map, so that a user reading
+        
+        Moreover you'd like to link together the content page regarding the "museum n.1" 
+        and the marker "museum n.1" you've defined in your map, so that a user reading 
         the content page could see where that specific museum is located.
-        Finally, you'd like to highlight some areas of your city / territory (ie highlight
+        
+        Also, you have your custom content types and you would like to extend them with 
+        georeference feature so that you can show them on a google map.
+        
+        Finally, you'd like to highlight some areas of your city / territory (ie highlight 
         residential area) and highlight some paths (ie highlight streets or tourist routes).
         
         
+        Usage
+        ---------------------------------------------------------------------------
+        Once you've installed and configured the product you can create a google map object.
+        Then, inside the google map object, you can create paths / areas / categories and, inside categories, markers.
+        Important: you must publish categories / markers / paths / areas to show them on the map!
+        
+        Example:
+        
+        1. Add new >> Google Map
+        2. (inside Google Map object) Add new >> Google Map Category
+        3. (inside Google Map Category) Add new >> Google Map Marker
+        4. **Publish your categories and markers in order to see them on the map**
+        
+        If you'd like to add the "related markers" portlet please use the Plone portlet manager ( http://path_to_your_installation/@@manage-portlets ).
         
-        2. Module manufacturer
+        
+        Extend your custom content types (Archetype)
         ---------------------------------------------------------------------------
+        1. Import:
         
-        Tecnoteca srl
-        via L'Aquila 1/B
-        33010 Tavagnacco UD
-        http://www.tecnoteca.com
+            **from tecnoteca.googlemap.content.ttgooglemapcoordinates import TTGoogleMapCoordinates,TTGoogleMapCoordinatesSchema**
+        
+        2. Extend schema:
+            schemata.ATContentTypeSchema.copy() + atapi.Schema((
+                ...
+        
+            )) + **TTGoogleMapCoordinatesSchema.copy()**
+        
+        3. Extend class:
+            class MyContentType(base.ATCTContent, **TTGoogleMapCoordinates**):
+        
+        4. Done! Now your content type has the required georeference fields and you can edit your items to set location
         
+        5. Add to your GoogleMap a new "Google Map Category Content Type" object to show your items on the map
         
         
-        3. Installation
+        Requirements
         ---------------------------------------------------------------------------
+        - Plone 3 / 4
+        - SmartColorWidget
+        
+        
+        Configuration
+        ---------------------------------------------------------------------------
+        Before creating a GoogleMap object please configure product parameters in plone control panel (http://path_to_your_installation/plone_control_panel).
+        
+        The google map api key can be generated here: http://code.google.com/apis/maps/signup.html
+        
         
-        See docs/INSTALL.txt
+        Installation
+        ---------------------------------------------------------------------------
+        Standard buildout installation, see docs/INSTALL.txt
+        
+        
+        Support and issues
+        ---------------------------------------------------------------------------
+        http://www.tecnoteca.com/en/contact
+        
+        
+        Author
+        ---------------------------------------------------------------------------
+        Tecnoteca srl
+        Via l'Aquila, 1/B
+        33010 Tavagnacco UD
+        http://www.tecnoteca.com
 Keywords: tecnoteca googlemap
 Platform: UNKNOWN
 Classifier: Framework :: Plone

Modified: tecnoteca.googlemap/trunk/googlemap/src/tecnoteca.googlemap/tecnoteca.googlemap.egg-info/SOURCES.txt
==============================================================================
--- tecnoteca.googlemap/trunk/googlemap/src/tecnoteca.googlemap/tecnoteca.googlemap.egg-info/SOURCES.txt	(original)
+++ tecnoteca.googlemap/trunk/googlemap/src/tecnoteca.googlemap/tecnoteca.googlemap.egg-info/SOURCES.txt	Mon Nov 11 09:09:53 2013
@@ -30,6 +30,9 @@
 tecnoteca/googlemap/browser/configure.zcml
 tecnoteca/googlemap/browser/controlpanel.py
 tecnoteca/googlemap/browser/logger.py
+tecnoteca/googlemap/browser/viewlet_ct_link.pt
+tecnoteca/googlemap/browser/viewlets.py
+tecnoteca/googlemap/browser/views.py
 tecnoteca/googlemap/content/__init__.py
 tecnoteca/googlemap/content/configure.zcml
 tecnoteca/googlemap/content/ttgooglemap.py
@@ -50,9 +53,12 @@
 tecnoteca/googlemap/interfaces/ttgooglemapmarker.py
 tecnoteca/googlemap/interfaces/ttgooglemappolygon.py
 tecnoteca/googlemap/interfaces/ttgooglemappolyline.py
+tecnoteca/googlemap/interfaces/views.py
 tecnoteca/googlemap/locales/tecnoteca.googlemap.pot
 tecnoteca/googlemap/locales/en/LC_MESSAGES/tecnoteca.googlemap.mo
 tecnoteca/googlemap/locales/en/LC_MESSAGES/tecnoteca.googlemap.po
+tecnoteca/googlemap/locales/fr/LC_MESSAGES/tecnoteca.googlemap.mo
+tecnoteca/googlemap/locales/fr/LC_MESSAGES/tecnoteca.googlemap.po
 tecnoteca/googlemap/locales/it/LC_MESSAGES/tecnoteca.googlemap.mo
 tecnoteca/googlemap/locales/it/LC_MESSAGES/tecnoteca.googlemap.po
 tecnoteca/googlemap/portlets/TTGeoReference.pt
@@ -68,7 +74,9 @@
 tecnoteca/googlemap/profiles/default/rolemap.xml
 tecnoteca/googlemap/profiles/default/skins.xml
 tecnoteca/googlemap/profiles/default/tecnoteca.googlemap_various.txt
+tecnoteca/googlemap/profiles/default/tinymce.xml
 tecnoteca/googlemap/profiles/default/types.xml
+tecnoteca/googlemap/profiles/default/viewlets.xml
 tecnoteca/googlemap/profiles/default/types/TTGoogleMap.xml
 tecnoteca/googlemap/profiles/default/types/TTGoogleMapCategory.xml
 tecnoteca/googlemap/profiles/default/types/TTGoogleMapCategoryCT.xml
@@ -196,12 +204,10 @@
 tecnoteca/googlemap/skins/TTGoogleMapImages/ttgooglemap_map.png
 tecnoteca/googlemap/skins/TTGoogleMapImages/ttgooglemap_marker.png
 tecnoteca/googlemap/skins/TTGoogleMapImages/ttgooglemap_path.png
-tecnoteca/googlemap/skins/TTGoogleMapJS/egeoxml.js
 tecnoteca/googlemap/skins/TTGoogleMapJS/googlemap_functions.js
+tecnoteca/googlemap/skins/TTGoogleMapJS/googlemap_widget_functions.js
 tecnoteca/googlemap/skins/TTGoogleMapJS/markerclusterer.js
 tecnoteca/googlemap/skins/TTGoogleMapJS/markermanager.js
-tecnoteca/googlemap/skins/TTGoogleMapJS/pano_layer.js
-tecnoteca/googlemap/skins/TTGoogleMapJS/pano_maptypecontrol.js
 tecnoteca/googlemap/skins/TTGoogleMapScripts/TTGoogleMapCatContainers.py
 tecnoteca/googlemap/skins/TTGoogleMapScripts/TTGoogleMapCatIcons.py
 tecnoteca/googlemap/skins/TTGoogleMapScripts/TTGoogleMapCatSH.py

Modified: tecnoteca.googlemap/trunk/googlemap/src/tecnoteca.googlemap/tecnoteca.googlemap.egg-info/requires.txt
==============================================================================
--- tecnoteca.googlemap/trunk/googlemap/src/tecnoteca.googlemap/tecnoteca.googlemap.egg-info/requires.txt	(original)
+++ tecnoteca.googlemap/trunk/googlemap/src/tecnoteca.googlemap/tecnoteca.googlemap.egg-info/requires.txt	Mon Nov 11 09:09:53 2013
@@ -1,5 +1,5 @@
 setuptools
-Products.SmartColorWidget
+Products.SmartColorWidget>=1.1.5
 
 [tests]
 zope.testing
\ No newline at end of file

Modified: tecnoteca.googlemap/trunk/googlemap/src/tecnoteca.googlemap/tecnoteca/googlemap/browser/views.py
==============================================================================
--- tecnoteca.googlemap/trunk/googlemap/src/tecnoteca.googlemap/tecnoteca/googlemap/browser/views.py	(original)
+++ tecnoteca.googlemap/trunk/googlemap/src/tecnoteca.googlemap/tecnoteca/googlemap/browser/views.py	Mon Nov 11 09:09:53 2013
@@ -4,6 +4,8 @@
 from zope.interface import implements
 from tecnoteca.googlemap.interfaces.views import IHelpersView
 from DateTime import DateTime
+from Products.CMFCore.utils import getToolByName
+from plone.memoize.view import memoize
 
 class HelpersView(BrowserView):
     """ Utility class """
@@ -52,19 +54,33 @@
     
     security.declareProtected(View,'getRelatedItemsHTML')
     def getRelatedItemsHTML(self, object):
-        output = ""        
-        if object.getRelatedItems() or object.getBRefs():
+        ctool = getToolByName(self.context, 'portal_catalog')
+        # backref items
+        query_br = self.query().copy()
+        query_br['getRawRelatedItems'] = object.UID()
+        items = ctool(query_br)
+        # related items
+        if object.getRawRelatedItems():
+            query_r = self.query().copy()
+            query_r['UID'] = object.getRawRelatedItems()
+            items += ctool(query_r)
+        output = ""
+        if items:
             output += "<ul>"
-            for relation in object.getRelatedItems(): # A>B relation
-                if relation and (not hasattr(relation, 'getLanguage') or relation.getLanguage()==context.REQUEST.get("Language","it")) and relation.expires() > DateTime():
-                    output += "<li>"
-                    output += "<a href='"+relation.absolute_url()+"' title='"+self.customEscape(relation.Title())+"'>"+self.customEscape(relation.Title())+"</a>"
-                    output += "</li>"
-            for relation in object.getBRefs(): # B>A relation
-                if relation and relation.expires() > DateTime():
-                    output += "<li>"
-                    output += "<a href='"+relation.absolute_url()+"' title='"+self.customEscape(relation.pretty_title_or_id())+"'>"+self.customEscape(relation.pretty_title_or_id())+"</a>"
-                    output += "</li>"
+            for item in items:
+                output += "<li>"
+                output += "<a href='%(url)s' title='%(title)s'>%(title)s</a>" % {'url': item.getURL(), 
+                                                                                 'title': item.pretty_title_or_id()}
+                output += "</li>"
             output += "</ul>"
         return output
-            
\ No newline at end of file
+    
+    @memoize
+    def query(self):
+        ptool = getToolByName(self.context, "portal_properties")
+        navtree = getattr(ptool, "navtree_properties")
+        query = dict(sort_on = 'sortable_title',
+                     expired = {'query': DateTime(), 'range': 'min'})
+        if navtree.getProperty('enable_wf_state_filtering', False):
+            query['review_state'] = navtree.getProperty('wf_states_to_show', ())
+        return query
\ No newline at end of file

------------------------------------------------------------------------------
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most 
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk