Author: rwesten
Date: Tue Jan 18 13:46:48 2011
New Revision: 1060372

URL: http://svn.apache.org/viewvc?rev=1060372&view=rev
Log:
STANBOL-22

Three corrections:
 - Corrected Parameter definition for the maximum number of results from 
"maxRow" to "maxRows"
 - The configured value for the maximum number of added enhancements was not 
used to set the maxRows parameter
 - Removed the forked geonames.org java client also from the bundle list of the 
light and the full launcher.

Modified:
    
incubator/stanbol/trunk/fise/engines/geonames/src/main/java/eu/iksproject/fise/engines/geonames/impl/GeonamesAPIWrapper.java
    
incubator/stanbol/trunk/fise/engines/geonames/src/main/java/eu/iksproject/fise/engines/geonames/impl/LocationEnhancementEngine.java
    incubator/stanbol/trunk/fise/launchers/full/src/main/bundles/list.xml
    incubator/stanbol/trunk/fise/launchers/lite/src/main/bundles/list.xml

Modified: 
incubator/stanbol/trunk/fise/engines/geonames/src/main/java/eu/iksproject/fise/engines/geonames/impl/GeonamesAPIWrapper.java
URL: 
http://svn.apache.org/viewvc/incubator/stanbol/trunk/fise/engines/geonames/src/main/java/eu/iksproject/fise/engines/geonames/impl/GeonamesAPIWrapper.java?rev=1060372&r1=1060371&r2=1060372&view=diff
==============================================================================
--- 
incubator/stanbol/trunk/fise/engines/geonames/src/main/java/eu/iksproject/fise/engines/geonames/impl/GeonamesAPIWrapper.java
 (original)
+++ 
incubator/stanbol/trunk/fise/engines/geonames/src/main/java/eu/iksproject/fise/engines/geonames/impl/GeonamesAPIWrapper.java
 Tue Jan 18 13:46:48 2011
@@ -82,7 +82,7 @@ public class GeonamesAPIWrapper {
         /**
          * the maximum number of results (must be < 1000). Default is set to 5
          */
-        maxRow("5"),
+        maxRows("5"),
         /**
          * the index of the first result returned
          */

Modified: 
incubator/stanbol/trunk/fise/engines/geonames/src/main/java/eu/iksproject/fise/engines/geonames/impl/LocationEnhancementEngine.java
URL: 
http://svn.apache.org/viewvc/incubator/stanbol/trunk/fise/engines/geonames/src/main/java/eu/iksproject/fise/engines/geonames/impl/LocationEnhancementEngine.java?rev=1060372&r1=1060371&r2=1060372&view=diff
==============================================================================
--- 
incubator/stanbol/trunk/fise/engines/geonames/src/main/java/eu/iksproject/fise/engines/geonames/impl/LocationEnhancementEngine.java
 (original)
+++ 
incubator/stanbol/trunk/fise/engines/geonames/src/main/java/eu/iksproject/fise/engines/geonames/impl/LocationEnhancementEngine.java
 Tue Jan 18 13:46:48 2011
@@ -27,6 +27,7 @@ import org.osgi.service.component.Compon
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import 
eu.iksproject.fise.engines.geonames.impl.GeonamesAPIWrapper.SearchRequestPropertyEnum;
 import eu.iksproject.fise.servicesapi.ContentItem;
 import eu.iksproject.fise.servicesapi.EngineException;
 import eu.iksproject.fise.servicesapi.EnhancementEngine;
@@ -264,10 +265,15 @@ public class LocationEnhancementEngine i
             }
         }
         //Now we do have all the names we need to lookup
+        Map<SearchRequestPropertyEnum,Collection<String>> requestParams = new 
EnumMap<SearchRequestPropertyEnum,Collection<String>>(SearchRequestPropertyEnum.class);
+        if(getMaxLocationEnhancements() != null){   
+            requestParams.put(SearchRequestPropertyEnum.maxRows, 
Collections.singleton(getMaxLocationEnhancements().toString()));
+        }
         for (Map.Entry<String, Collection<NonLiteral>> entry : 
name2placeEnhancementMap.entrySet()) {
             List<Toponym> results;
             try {
-                results = geonamesService.searchToponyms(entry.getKey());
+                requestParams.put(SearchRequestPropertyEnum.name, 
Collections.singleton(entry.getKey()));
+                results = geonamesService.searchToponyms(requestParams);
             } catch (Exception e) {
                 /*
                      * TODO: Review if it makes sense to catch here for each 
name, or

Modified: incubator/stanbol/trunk/fise/launchers/full/src/main/bundles/list.xml
URL: 
http://svn.apache.org/viewvc/incubator/stanbol/trunk/fise/launchers/full/src/main/bundles/list.xml?rev=1060372&r1=1060371&r2=1060372&view=diff
==============================================================================
--- incubator/stanbol/trunk/fise/launchers/full/src/main/bundles/list.xml 
(original)
+++ incubator/stanbol/trunk/fise/launchers/full/src/main/bundles/list.xml Tue 
Jan 18 13:46:48 2011
@@ -318,21 +318,11 @@
                </bundle>
                <!--
                        The geonames.org LocationEnhancement Engines needs two 
additional
-                       bundles 1) com.springsource.org.jdom 2)
-                       eu.iksproject.fise.ext.org.geonames (Rupert 
Westenthaler 20100619)
+                       bundles 1) jettyjson 2) commons-io. Both of them are 
already
+                       present in the bundle list.
                -->
                <bundle>
                        <groupId>eu.iksproject</groupId>
-                       
<artifactId>eu.iksproject.fise.ext.org.geonames</artifactId>
-                       <version>0.9-SNAPSHOT</version>
-               </bundle>
-               <bundle>
-                       <groupId>org.jdom</groupId>
-                       <artifactId>com.springsource.org.jdom</artifactId>
-                       <version>1.1.0</version>
-               </bundle>
-               <bundle>
-                       <groupId>eu.iksproject</groupId>
                        
<artifactId>eu.iksproject.fise.engines.geonames</artifactId>
                        <version>0.9-SNAPSHOT</version>
                </bundle>

Modified: incubator/stanbol/trunk/fise/launchers/lite/src/main/bundles/list.xml
URL: 
http://svn.apache.org/viewvc/incubator/stanbol/trunk/fise/launchers/lite/src/main/bundles/list.xml?rev=1060372&r1=1060371&r2=1060372&view=diff
==============================================================================
--- incubator/stanbol/trunk/fise/launchers/lite/src/main/bundles/list.xml 
(original)
+++ incubator/stanbol/trunk/fise/launchers/lite/src/main/bundles/list.xml Tue 
Jan 18 13:46:48 2011
@@ -296,22 +296,11 @@
                        <version>0.9-SNAPSHOT</version>
                </bundle>
                <!--
-                       The geonames.org LocationEnhancement Engines needs two 
additional bundles
-                       1) com.springsource.org.jdom
-                       2) eu.iksproject.fise.ext.org.geonames (Rupert 
Westenthaler 20100619)
+                       The geonames.org LocationEnhancement Engines needs only 
jettyjson and
+                       commons-io as additional bundels. Both are already in 
this list.
                -->
                <bundle>
                        <groupId>eu.iksproject</groupId>
-                       
<artifactId>eu.iksproject.fise.ext.org.geonames</artifactId>
-                       <version>0.9-SNAPSHOT</version>
-               </bundle>
-               <bundle>
-                       <groupId>org.jdom</groupId>
-                       <artifactId>com.springsource.org.jdom</artifactId>
-                       <version>1.1.0</version>
-               </bundle>
-               <bundle>
-                       <groupId>eu.iksproject</groupId>
                        
<artifactId>eu.iksproject.fise.engines.geonames</artifactId>
                        <version>0.9-SNAPSHOT</version>
                </bundle>


Reply via email to