Author: gttersen
Date: 2007-03-21 11:47:18 +0100 (Wed, 21 Mar 2007)
New Revision: 4596

Modified:
   trunk/query-transform-spi/pom.xml
   
trunk/query-transform-spi/src/main/java/no/schibstedsok/searchportal/query/transform/QueryTransformer.java
Log:
Need access to the datamodel in the QueryTransformer. Looks like this is the 
way to do it.

Modified: trunk/query-transform-spi/pom.xml
===================================================================
--- trunk/query-transform-spi/pom.xml   2007-03-20 15:19:32 UTC (rev 4595)
+++ trunk/query-transform-spi/pom.xml   2007-03-21 10:47:18 UTC (rev 4596)
@@ -1,11 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd";>
+<project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd";>
     <modelVersion>4.0.0</modelVersion>
-      <parent>
-          <groupId>schibstedsok</groupId>
-          <artifactId>search-portal</artifactId>
-          <version>2.10-SNAPSHOT</version>
-      </parent>
+    <parent>
+        <groupId>schibstedsok</groupId>
+        <artifactId>search-portal</artifactId>
+        <version>2.10-SNAPSHOT</version>
+    </parent>
     <artifactId>search-portal-query-transform-spi</artifactId>
     <packaging>jar</packaging>
     <name>Sesam Search Engine Query Transform SPI</name>
@@ -16,24 +17,25 @@
     <scm>
         
<connection>scm:svn:https://dev.schibstedsok.no/svn/search-portal/trunk/query-transform-spi</connection>
         
<url>https://dev.schibstedsok.no/svn/search-portal/sesam.no/trunk/query-transform-spi</url>
-        
<developerConnection>scm:svn:https://dev.schibstedsok.no/svn/search-portal/trunk/query-transform-spi</developerConnection>
+        
<developerConnection>scm:svn:https://dev.schibstedsok.no/svn/search-portal/trunk/query-transform-spi
+        </developerConnection>
     </scm>
-    
+
     <build>
         <plugins>
             <plugin>
-               <groupId>org.apache.maven.plugins</groupId>
-               <artifactId>maven-jar-plugin</artifactId>
-               <executions>
-                 <execution>
-                   <goals>
-                     <goal>test-jar</goal>
-                   </goals>
-                 </execution>
-               </executions>
-             </plugin>
-         </plugins>
-    </build>     
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-jar-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>test-jar</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
 
     <dependencies>
         <dependency>
@@ -48,6 +50,11 @@
         </dependency>
         <dependency>
             <groupId>schibstedsok</groupId>
+            <artifactId>search-portal-data-model-api</artifactId>
+            <version>${version}</version>
+        </dependency>
+        <dependency>
+            <groupId>schibstedsok</groupId>
             <artifactId>commons-ioc</artifactId>
         </dependency>
         <dependency>
@@ -60,6 +67,13 @@
             <scope>test</scope>
             <classifier>jdk15</classifier>
         </dependency>
+
+        <dependency>
+            <groupId>schibstedsok.newsadmin</groupId>
+            <artifactId>ha-services</artifactId>
+            <version>1.0-SNAPSHOT</version>
+        </dependency>
+
         <!-- Testing -->
         <dependency>
             <groupId>schibstedsok</groupId>

Modified: 
trunk/query-transform-spi/src/main/java/no/schibstedsok/searchportal/query/transform/QueryTransformer.java
===================================================================
--- 
trunk/query-transform-spi/src/main/java/no/schibstedsok/searchportal/query/transform/QueryTransformer.java
  2007-03-20 15:19:32 UTC (rev 4595)
+++ 
trunk/query-transform-spi/src/main/java/no/schibstedsok/searchportal/query/transform/QueryTransformer.java
  2007-03-21 10:47:18 UTC (rev 4596)
@@ -2,18 +2,20 @@
 package no.schibstedsok.searchportal.query.transform;
 
 
-import java.util.Map;
-import no.schibstedsok.searchportal.site.config.ResourceContext;
+import no.schibstedsok.searchportal.datamodel.DataModelContext;
 import no.schibstedsok.searchportal.query.Clause;
+import no.schibstedsok.searchportal.query.LeafClause;
 import no.schibstedsok.searchportal.query.QueryContext;
 import no.schibstedsok.searchportal.query.Visitor;
 import no.schibstedsok.searchportal.query.XorClause;
-import no.schibstedsok.searchportal.query.LeafClause;
 import no.schibstedsok.searchportal.query.token.TokenEvaluationEngine;
 import no.schibstedsok.searchportal.site.SiteContext;
+import no.schibstedsok.searchportal.site.config.ResourceContext;
 import org.w3c.dom.Element;
 
+import java.util.Map;
 
+
 /**
  * Query query can be applied to queries before sending them away to
  * indices or other sources for further processing.
@@ -21,48 +23,56 @@
  * @author <a href="mailto:[EMAIL PROTECTED]">Magnus Eklund</a>
  * @version <tt>$Revision: 3829 $</tt>
  */
-public interface QueryTransformer extends Visitor, Cloneable{
+public interface QueryTransformer extends Visitor, Cloneable {
 
-    public interface Context extends QueryContext, ResourceContext, 
SiteContext {
+    public interface Context extends QueryContext, ResourceContext, 
SiteContext, DataModelContext {
 
         /**
          * @deprecated use getTransformedTerms() instead
-         **/
+         */
         String getTransformedQuery();
-        /** Get the terms with their current transformed representations.
-         *
-         **/
-        Map<Clause,String> getTransformedTerms();
 
-        /** For evaluation acitions on individual (or the whole query) terms.
-         **/
+        /**
+         * Get the terms with their current transformed representations.
+         */
+        Map<Clause, String> getTransformedTerms();
+
+        /**
+         * For evaluation acitions on individual (or the whole query) terms.
+         */
         TokenEvaluationEngine getTokenEvaluationEngine();
-        
-        /** QueryTransformers must follow the same XorClause hints as the 
search command. **/
+
+        /**
+         * QueryTransformers must follow the same XorClause hints as the 
search command. *
+         */
         void visitXorClause(Visitor visitor, XorClause clause);
 
-        /** QueryTransformers needs information about supported field filters. 
**/
+        /**
+         * QueryTransformers needs information about supported field filters. *
+         */
         String getFieldFilter(LeafClause clause);
     }
 
-    /** TODO comment me. **/
+    /**
+     * TODO comment me. *
+     */
     void setContext(final Context cxt);
 
     /**
      * Add keywords to query to get better searchresults
      *
-     * @deprecated use the visitor pattern instead via visit(Object)
      * @param originalQuery
      * @return
+     * @deprecated use the visitor pattern instead via visit(Object)
      */
     String getTransformedQuery();
 
     /**
      * Set filter for this query. By analizing the query we can
      * set dynamic filter. For example a special sort order or specify 
contentsource
-     *
+     * <p/>
      * Example to add docdatetime argument
-     *
+     * <p/>
      * +docdatetime:>2005-10-28
      *
      * @return filterstring
@@ -72,17 +82,19 @@
     /**
      * Set filter for this query. By analizing the query we can
      * set dynamic filter. For example a special sort order or specify 
contentsource
-     *
+     * <p/>
      * Example to add docdatetime argument
-     *
+     * <p/>
      * +docdatetime:>2005-10-28
      *
      * @return filterstring
      */
     String getFilter();
 
-    /** Force public implementation of Clonable. **/
-    Object clone() throws CloneNotSupportedException ;
-    
+    /**
+     * Force public implementation of Clonable. *
+     */
+    Object clone() throws CloneNotSupportedException;
+
     QueryTransformer readQueryTransformer(final Element element);
 }

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

Reply via email to