Access to add and change pages is restricted. See: https://cwiki.apache.org/confluence/display/OFBIZ/Wiki+access

Add geolocation to data model.
commit 738452
I don't know for Yahoo and other, but I guess it's the same than for Google. You need a key to use their Map API. For Google this
key is related to the domain used and allow to use the API only on this domain. So we need to store this information somewhere. I
think about general.properties

Jacques

I'm trying to finally commit our GoePoint entities related modelling. For that, I need to introduce the Google Map API key concept (a key corresponding to an URL). I previsously suggested general.properties. But maybe an entity like the one below would be more convenient in case the user would have to deal with more than an handle of URLs

<entity entity-name="GoogleMapApiKey" package-name="org.ofbiz.common.geo" default-resource-name="CommonEntityLabels"
title="Google Map API key">
<field name="UrlId" type="id"></field>
<field name="ApiKey" type="long-varchar"></field><!-- As generated from UrlId at http://code.google.com/intl/fr/apis/maps/signup.html, note that it works for http://localhost !-->
<prim-key field="UrlId"/>
</entity>

What do you think ?

Thanks

Jacques

Quick answer : these keys are generated by Google Map and used when you want to render a map using Google Map something like

Google Map java Script
<script src=http://maps.google.com/maps?file=api&amp;v=2.73&amp;key=ABQIAAAA-O3c-Om9OcvXMOJXreXHAxSsTL4WIgxhMZ0ZK_kHjwHeQuOD4xSbZqVZW2U_OWOxMp3YPfzZl2GavQThese

keys are system oriented (or at least I guess so), that's why I 1st thought about general.properties. But maybe in some case an user would like to have this more handy and accessible from DB. I'm not sure though since now properties are cached and it's easy to set them on the fly. Of course putting them in a property file is easier.The key relates to GeoPoint but only in Google case. I introduced also these data in CommonTypeData.xml.

Add to CommonTypeData.xml
<DataSourceType dataSourceTypeId="GEOPOINT_SUPPLIER" description="Name of GeoPoints publisher"/>    


<DataSource dataSourceId="GEOPT_GOOGLE" dataSourceTypeId="GEOPOINT_SUPPLIER" description="Google as GeoPoint supplier"/>    
<DataSource dataSourceId="GEOPT_YAHOO" dataSourceTypeId="GEOPOINT_SUPPLIER" description="Yahoo as GeoPoint supplier"/>

I also created a PartyGeoPointData.xml where dataSourceId is used to know which map rendered (javascript) will be used, here an example with Google Map

PartyGeoPointData.xml

<entity-engine-xml>        
<GeoType comment="GeoPoint for DemoCustomer"             
geoPointId="9000" dataSourceId="GEOPT_GOOGLE"            
latitude="40.297264"            
longitude="111.696625"/> 
</entity-engine-xml>

Thanks

Jacques

  • No labels