Author: magnuse
Date: 2006-04-28 14:25:33 +0200 (Fri, 28 Apr 2006)
New Revision: 2824

Modified:
   trunk/pom.xml
   
trunk/src/java/no/schibstedsok/front/searchportal/command/MobileSearchCommand.java
   
trunk/src/java/no/schibstedsok/front/searchportal/configuration/MobileSearchConfiguration.java
   
trunk/src/java/no/schibstedsok/front/searchportal/configuration/SearchModeFactory.java
   trunk/src/java/no/schibstedsok/front/searchportal/servlet/SearchServlet.java
   trunk/src/main/conf/msearch-client-context.xml
Log:
Fixed spring stuff.


Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml       2006-04-28 06:29:38 UTC (rev 2823)
+++ trunk/pom.xml       2006-04-28 12:25:33 UTC (rev 2824)
@@ -182,6 +182,7 @@
         
<queryServerURL.3>http://cobraprod.bos3.fasstsearch.net:15100</queryServerURL.3>
         <queryServerURL.2>http://localhost:15200</queryServerURL.2>
         <queryServerURL.1>http://localhost:15100</queryServerURL.1>
+       
<msearch.configuration.url>http://mobile:8080/mobile/conf/msearch-client.properties</msearch.configuration.url>
         <mail.smtp.host>ssmail.schibstedsok.no</mail.smtp.host>
         <linkpulse.sesam>http://localhost:8080/search/</linkpulse.sesam>
         <linkpulse.url>http://go.sesam.no/</linkpulse.url>
@@ -206,7 +207,8 @@
         
<tradedoubler.context.url>http://www.sesam.no</tradedoubler.context.url>
         <queryServerURL.2>http://10.16.195.249:15300</queryServerURL.2>
         <queryServerURL.1>http://10.16.195.250:15100</queryServerURL.1>
-        <mail.smtp.host>ssmail.schibstedsok.no</mail.smtp.host>
+       
<msearch.configuration.url>http://mobil.bleedingsearch.schibstedsok.no/mobil.bleedingsearch.schibstedsok.no/conf/msearch-client.properties</msearch.configuration.url>
 
+       <mail.smtp.host>ssmail.schibstedsok.no</mail.smtp.host>
         
<linkpulse.sesam>http://bleedingsearch.schibstedsok.no/search/</linkpulse.sesam>
         <linkpulse.url>http://go.sesam.no/</linkpulse.url>
         <log.file>sesam</log.file>
@@ -237,6 +239,7 @@
         
<tradedoubler.context.url>http://www.sesam.no</tradedoubler.context.url>
         <queryServerURL.2>http://10.16.195.249:15300</queryServerURL.2>
         <queryServerURL.1>http://10.16.195.250:15100</queryServerURL.1>
+       
<msearch.configuration.url>http://mobil.sesam.no/mobil.sesam.no/conf/msearch-client.properties</msearch.configuration.url>
 
         <mail.smtp.host>ssmail.schibstedsok.no</mail.smtp.host>
         <linkpulse.sesam>http://sesam.no/search/</linkpulse.sesam>
         <linkpulse.url>http://go.sesam.no/</linkpulse.url>
@@ -466,4 +469,4 @@
       
<url>scp://localhost/www/schibstedsok/data/httpd/dev.schibstedsok.no_443/htdocs/maven/sites/search-front-html</url>
     </site>
   </distributionManagement>
-</project>
\ No newline at end of file
+</project>

Modified: 
trunk/src/java/no/schibstedsok/front/searchportal/command/MobileSearchCommand.java
===================================================================
--- 
trunk/src/java/no/schibstedsok/front/searchportal/command/MobileSearchCommand.java
  2006-04-28 06:29:38 UTC (rev 2823)
+++ 
trunk/src/java/no/schibstedsok/front/searchportal/command/MobileSearchCommand.java
  2006-04-28 12:25:33 UTC (rev 2824)
@@ -6,6 +6,7 @@
  */
 package no.schibstedsok.front.searchportal.command;
 
+import java.util.Properties;
 import no.fast.ds.common.FastException;
 import no.fast.ds.search.BaseParameter;
 import no.fast.ds.search.IDocumentSummary;
@@ -31,6 +32,7 @@
 
 import no.schibstedsok.front.searchportal.InfrastructureException;
 import 
no.schibstedsok.front.searchportal.configuration.MobileSearchConfiguration;
+import 
no.schibstedsok.front.searchportal.configuration.loader.PropertiesLoader;
 import no.schibstedsok.front.searchportal.result.BasicSearchResult;
 import no.schibstedsok.front.searchportal.result.BasicSearchResultItem;
 import no.schibstedsok.front.searchportal.result.SearchResult;
@@ -54,6 +56,7 @@
     
     private static final String PERSONALIZATION_GROUP = "aspiro-sesam1";
     private static final String USER_AGENT_PARAMETER="ua";
+    private static final String MSEARCH_CLIENT_PROPS = 
"msearch-client.properties";
     
     private final MobileSearchConfiguration cfg;
     
@@ -61,6 +64,7 @@
         super(cxt, parameters);
         cfg = (MobileSearchConfiguration) cxt.getSearchConfiguration();
     }
+
     
     public SearchResult execute() {
         try {

Modified: 
trunk/src/java/no/schibstedsok/front/searchportal/configuration/MobileSearchConfiguration.java
===================================================================
--- 
trunk/src/java/no/schibstedsok/front/searchportal/configuration/MobileSearchConfiguration.java
      2006-04-28 06:29:38 UTC (rev 2823)
+++ 
trunk/src/java/no/schibstedsok/front/searchportal/configuration/MobileSearchConfiguration.java
      2006-04-28 12:25:33 UTC (rev 2824)
@@ -45,8 +45,16 @@
     public String getPersonalizationGroup() {
         return personalizationGroup;
     }
+    
+    public void setPersonalizationGroup(final String group) {
+        this.personalizationGroup = group;
+    }
 
     public String getSortBy() {
         return sortBy;
     }
+
+    public void setSortBy(final String sortBy) {
+        this.sortBy = sortBy;
+    }
 }

Modified: 
trunk/src/java/no/schibstedsok/front/searchportal/configuration/SearchModeFactory.java
===================================================================
--- 
trunk/src/java/no/schibstedsok/front/searchportal/configuration/SearchModeFactory.java
      2006-04-28 06:29:38 UTC (rev 2823)
+++ 
trunk/src/java/no/schibstedsok/front/searchportal/configuration/SearchModeFactory.java
      2006-04-28 12:25:33 UTC (rev 2824)
@@ -262,8 +262,9 @@
         STOCK_COMMAND(StockSearchConfiguration.class),
         WEB_COMMAND(WebSearchConfiguration.class),
         WHITEPAGES_COMMAND(WhiteSearchConfiguration.class),
-        YELLOWPAGES_COMMAND(YellowSearchConfiguration.class);
-
+        YELLOWPAGES_COMMAND(YellowSearchConfiguration.class),
+        MOBILE_COMMAND(MobileSearchConfiguration.class);
+        
         private final Class<? extends SearchConfiguration> clazz;
         private final String xmlName;
 
@@ -408,7 +409,14 @@
                 if( sc instanceof YellowSearchConfiguration ){
                     final YellowSearchConfiguration ysc = 
(YellowSearchConfiguration) sc;
                 }
+                if (sc instanceof MobileSearchConfiguration) {
+                    final MobileSearchConfiguration msc = 
(MobileSearchConfiguration) sc;
 
+                    
msc.setPersonalizationGroup(commandE.getAttribute("personalization-group"));
+                    msc.setSortBy(commandE.getAttribute("sort-by"));
+                    msc.setSource(commandE.getAttribute("source"));
+                }
+
                 // query transformers
                 final NodeList qtNodeList = 
commandE.getElementsByTagName("query-transformers");
                 final Element qtRootElement = (Element) qtNodeList.item(0);

Modified: 
trunk/src/java/no/schibstedsok/front/searchportal/servlet/SearchServlet.java
===================================================================
--- 
trunk/src/java/no/schibstedsok/front/searchportal/servlet/SearchServlet.java    
    2006-04-28 06:29:38 UTC (rev 2823)
+++ 
trunk/src/java/no/schibstedsok/front/searchportal/servlet/SearchServlet.java    
    2006-04-28 12:25:33 UTC (rev 2824)
@@ -95,15 +95,17 @@
         }
         //final SearchTabs tabs = 
SiteConfiguration.valueOf(site).getSearchTabs();
 
-        final String xmlParam = httpServletRequest.getParameter("xml");
 
-        if (xmlParam != null && xmlParam.equals("yes")) {
+        // TODO. Any better way to do this. Sitemesh? 
+        if (site.getName().startsWith("mobile")) {
             httpServletResponse.setContentType("text/xml; charset=utf-8");
         } else {
             httpServletResponse.setContentType("text/html; charset=utf-8");
         }
+        
         httpServletResponse.setCharacterEncoding("UTF-8"); // correct encoding
 
+        
         String searchTabKey = httpServletRequest.getParameter("c");
 
         if (searchTabKey == null) {

Modified: trunk/src/main/conf/msearch-client-context.xml
===================================================================
--- trunk/src/main/conf/msearch-client-context.xml      2006-04-28 06:29:38 UTC 
(rev 2823)
+++ trunk/src/main/conf/msearch-client-context.xml      2006-04-28 12:25:33 UTC 
(rev 2824)
@@ -5,7 +5,7 @@
 <beans>
 
        <bean id="placeholderConfig" 
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer" >
-               <property name="location" 
value="classpath:msearch-client.properties" />
+               <property name="location" value="@msearch.configuration.url@" />
        </bean>
        
        <!--

_______________________________________________
Kernel-commits mailing list
[email protected]
http://sesat.no/mailman/listinfo/kernel-commits

Reply via email to