Author: ssmalamb
Date: 2007-06-26 15:53:17 +0200 (Tue, 26 Jun 2007)
New Revision: 5432

Modified:
   
branches/2.14/core-api/src/main/java/no/schibstedsok/searchportal/mode/command/VideoSearchCommand.java
   
branches/2.14/search-command-config-spi/src/main/java/no/schibstedsok/searchportal/mode/config/VideoCommandConfig.java
Log:
Added searchType for modes.xml

Modified: 
branches/2.14/core-api/src/main/java/no/schibstedsok/searchportal/mode/command/VideoSearchCommand.java
===================================================================
--- 
branches/2.14/core-api/src/main/java/no/schibstedsok/searchportal/mode/command/VideoSearchCommand.java
      2007-06-26 13:35:38 UTC (rev 5431)
+++ 
branches/2.14/core-api/src/main/java/no/schibstedsok/searchportal/mode/command/VideoSearchCommand.java
      2007-06-26 13:53:17 UTC (rev 5432)
@@ -13,11 +13,11 @@
 import java.io.UnsupportedEncodingException;
 import java.net.URLEncoder;
 import java.text.SimpleDateFormat;
-import java.text.Format;
 import java.util.Date;
 
+import no.schibstedsok.searchportal.mode.config.VideoCommandConfig;
+import no.schibstedsok.searchportal.result.BasicResultItem;
 import no.schibstedsok.searchportal.result.BasicResultList;
-import no.schibstedsok.searchportal.result.BasicResultItem;
 import no.schibstedsok.searchportal.result.ResultItem;
 import no.schibstedsok.searchportal.result.ResultList;
 
@@ -35,12 +35,14 @@
     private static final Logger LOG = 
Logger.getLogger(VideoSearchCommand.class);
     final SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
     final SimpleDateFormat timeFormatter = new SimpleDateFormat("m:ss");
+    private String searchType;
 
-    // http://usp1.blinkx.com/partnerapi/user/?uid=7d51d9&text=pixies
-
     public VideoSearchCommand(final Context cxt) {
         super(cxt);
+        final VideoCommandConfig vcConfig = (VideoCommandConfig) 
context.getSearchConfiguration();
 
+        searchType = vcConfig.getSearchType();
+
     }
 
     protected String createRequestURL() {
@@ -60,8 +62,7 @@
             Start   Prints results only from this position onwards.
             Text    The query text.
          */
-        LOG.info("zz124");
-//        return 
"http://usp1.blinkx.com/partnerapi/user/?uid=7d51d9&text=pixies";;
+        LOG.info("zz124: "+searchType);
         String query = getTransformedQuery();
         try {
             query = URLEncoder.encode(query, "utf-8");
@@ -73,7 +74,8 @@
         if (sortByString.equals("standard")) {
             biasDate = "100";
         }
-        return 
"/partnerapi/user/?uid=7d51d9&Anylanguage=true&Adultfilter=true&printfields=media_duration&BiasDate="+biasDate+"&Start="+getCurrentOffset(1)+"&text="+query;
+        // 
http://usp1.blinkx.com/partnerapi/sesam/?text=george+bush&channelhits=true
+        return 
"/partnerapi/sesam/?searchtype="+searchType+"Anylanguage=true&Adultfilter=true&printfields=media_duration&BiasDate="+biasDate+"&Start="+getCurrentOffset(1)+"&text="+query;
     }
 
     public ResultList<? extends ResultItem> execute() {

Modified: 
branches/2.14/search-command-config-spi/src/main/java/no/schibstedsok/searchportal/mode/config/VideoCommandConfig.java
===================================================================
--- 
branches/2.14/search-command-config-spi/src/main/java/no/schibstedsok/searchportal/mode/config/VideoCommandConfig.java
      2007-06-26 13:35:38 UTC (rev 5431)
+++ 
branches/2.14/search-command-config-spi/src/main/java/no/schibstedsok/searchportal/mode/config/VideoCommandConfig.java
      2007-06-26 13:53:17 UTC (rev 5432)
@@ -13,21 +13,42 @@
 
     private static final Logger LOG = 
Logger.getLogger(VideoCommandConfig.class);
     private String customerId;
-    /**
-     * Returns the customer id to use for picsearch queries associated with 
this configuration.
-     *
-     * @return The customer id.
-     */
-    public String getCustomerId() {
-        return customerId;
+    private String searchType;
+//    /**
+//     * Returns the customer id to use for picsearch queries associated with 
this configuration.
+//     *
+//     * @return The customer id.
+//     */
+//    public String getCustomerId() {
+//        return customerId;
+//    }
+//    /**
+//     * Sets property customerId
+//     *
+//     * @param customerId New value for customerId
+//     */
+//    public void setCustomerId(final String customerId) {
+//        this.customerId = customerId;
+//    }
+
+    public String getSearchType() {
+        return searchType;
     }
-    /**
-     * Sets property customerId
-     *
-     * @param customerId New value for customerId
-     */
-    public void setCustomerId(final String customerId) {
-        this.customerId = customerId;
+
+    public void setSearchType(String searchType) {
+        this.searchType = searchType;
     }
 
+    @Override
+    public AbstractXmlSearchConfiguration readSearchConfiguration(
+            final Element element,
+            final SearchConfiguration inherit) {
+
+        super.readSearchConfiguration(element, inherit);
+
+        AbstractDocumentFactory.fillBeanProperty(this, inherit, "searchType", 
ParseType.String, element, "notset");
+
+        return this;
+    }
+
 }

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

Reply via email to