Author: mickw
Date: 2006-05-04 15:46:03 +0200 (Thu, 04 May 2006)
New Revision: 2855

Removed:
   
trunk/src/java/no/schibstedsok/front/searchportal/executor/SearchTaskExecutorService.java
   
trunk/src/java/no/schibstedsok/front/searchportal/executor/ThreadPoolInspector.java
Modified:
   
trunk/src/java/no/schibstedsok/front/searchportal/executor/ParallelSearchCommandExecutor.java
   trunk/src/java/no/schibstedsok/front/searchportal/executor/SearchTask.java
   trunk/src/java/no/schibstedsok/front/searchportal/query/run/RunningQuery.java
   
trunk/src/java/no/schibstedsok/front/searchportal/query/run/RunningQueryImpl.java
   trunk/src/java/no/schibstedsok/front/searchportal/result/Enrichment.java
   
trunk/src/java/no/schibstedsok/front/searchportal/result/handler/ContentSourceCollector.java
   
trunk/src/java/no/schibstedsok/front/searchportal/result/handler/SumFastModifiers.java
   trunk/src/webapp/WEB-INF/jsp/decorators/mainDecorator.jsp
Log:
SEARCH-263 norsk-magic & internasjonal-magic
ParallelSearchCommandExecutor uses Executors.newCachedPool
Enrichments now keep and sort on a float analysis score value.


Modified: 
trunk/src/java/no/schibstedsok/front/searchportal/executor/ParallelSearchCommandExecutor.java
===================================================================
--- 
trunk/src/java/no/schibstedsok/front/searchportal/executor/ParallelSearchCommandExecutor.java
       2006-05-04 13:13:27 UTC (rev 2854)
+++ 
trunk/src/java/no/schibstedsok/front/searchportal/executor/ParallelSearchCommandExecutor.java
       2006-05-04 13:46:03 UTC (rev 2855)
@@ -2,6 +2,7 @@
 package no.schibstedsok.front.searchportal.executor;
 
 import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
 
 /**
  * A [EMAIL PROTECTED] 
no.schibstedsok.front.searchportal.executor.SearchCommandExecutor} executing a 
list of callables in parallel.
@@ -11,10 +12,11 @@
  */
 public final class ParallelSearchCommandExecutor extends 
AbstractSearchCommandExecutor {
 
-    private static final int INSPECTOR_PERIOD = 300000;
+//    private static final int INSPECTOR_PERIOD = 300000;
 
-    private transient static final SearchTaskExecutorService EXECUTOR = new 
SearchTaskExecutorService();
-    private transient static final ThreadPoolInspector INSPECTOR = new 
ThreadPoolInspector(EXECUTOR, INSPECTOR_PERIOD);
+    //private transient static final SearchTaskExecutorService EXECUTOR = new 
SearchTaskExecutorService();
+    private static final ExecutorService EXECUTOR = 
Executors.newCachedThreadPool();
+    //private static final ThreadPoolInspector INSPECTOR = new 
ThreadPoolInspector(EXECUTOR, INSPECTOR_PERIOD);
 
     /**
      * Creates a new parallel EXECUTOR.
@@ -22,12 +24,12 @@
     public ParallelSearchCommandExecutor() {
     }
 
-    public void stop() {
-        LOG.info("Shutting down thread pool inspector");
-        INSPECTOR.cancel();
-        LOG.warn(EXECUTOR.getTaskCount() + " processed");
-        super.stop();
-    }
+//    public void stop() {
+//        //LOG.info("Shutting down ExecutorService");
+//        //INSPECTOR.cancel();
+//        //LOG.warn(EXECUTOR.getTaskCount() + " processed");
+//        super.stop();
+//    }
 
     protected ExecutorService getExecutorService(){
         return EXECUTOR;

Modified: 
trunk/src/java/no/schibstedsok/front/searchportal/executor/SearchTask.java
===================================================================
--- trunk/src/java/no/schibstedsok/front/searchportal/executor/SearchTask.java  
2006-05-04 13:13:27 UTC (rev 2854)
+++ trunk/src/java/no/schibstedsok/front/searchportal/executor/SearchTask.java  
2006-05-04 13:46:03 UTC (rev 2855)
@@ -15,7 +15,7 @@
  */
 public class SearchTask extends FutureTask<SearchResult> {
 
-    private static final Logger LOG = 
Logger.getLogger(SearchTaskExecutorService.class);
+    private static final Logger LOG = Logger.getLogger(SearchTask.class);
 
     private SearchCommand command;
 

Deleted: 
trunk/src/java/no/schibstedsok/front/searchportal/executor/SearchTaskExecutorService.java
===================================================================
--- 
trunk/src/java/no/schibstedsok/front/searchportal/executor/SearchTaskExecutorService.java
   2006-05-04 13:13:27 UTC (rev 2854)
+++ 
trunk/src/java/no/schibstedsok/front/searchportal/executor/SearchTaskExecutorService.java
   2006-05-04 13:46:03 UTC (rev 2855)
@@ -1,36 +0,0 @@
-// Copyright (2006) Schibsted Søk AS
-package no.schibstedsok.front.searchportal.executor;
-
-
-import java.util.concurrent.Callable;
-import java.util.concurrent.SynchronousQueue;
-import java.util.concurrent.ThreadPoolExecutor;
-import java.util.concurrent.TimeUnit;
-import no.schibstedsok.front.searchportal.command.SearchCommand;
-import no.schibstedsok.front.searchportal.result.SearchResult;
-import org.apache.log4j.Logger;
-
-/**
- * @author <a href="mailto:[EMAIL PROTECTED]">Magnus Eklund</a>
- * @version <tt>$Revision$</tt>
- */
-final class SearchTaskExecutorService extends ThreadPoolExecutor {
-
-    private static final Logger LOG = 
Logger.getLogger(SearchTaskExecutorService.class);
-
-    public SearchTaskExecutorService() {
-        super(20, Integer.MAX_VALUE, 60L, TimeUnit.SECONDS, new 
SynchronousQueue());
-    }
-
-    protected SearchTask newTaskFor(final Callable<SearchResult> callable) {
-
-        final SearchCommand command = (SearchCommand) callable;
-
-        if (LOG.isDebugEnabled()) {
-            LOG.debug("Creating new search task " + 
command.getSearchConfiguration().getName());
-        }
-
-        return new SearchTask(command);
-    }
-
-}

Deleted: 
trunk/src/java/no/schibstedsok/front/searchportal/executor/ThreadPoolInspector.java
===================================================================
--- 
trunk/src/java/no/schibstedsok/front/searchportal/executor/ThreadPoolInspector.java
 2006-05-04 13:13:27 UTC (rev 2854)
+++ 
trunk/src/java/no/schibstedsok/front/searchportal/executor/ThreadPoolInspector.java
 2006-05-04 13:46:03 UTC (rev 2855)
@@ -1,35 +0,0 @@
-// Copyright (2006) Schibsted Søk AS
-package no.schibstedsok.front.searchportal.executor;
-
-import java.util.concurrent.ThreadPoolExecutor;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import java.util.Timer;
-import java.util.TimerTask;
-
-/**
- * @author <a href="mailto:[EMAIL PROTECTED]">Magnus Eklund</a>
- * @version <tt>$Revision$</tt>
- */
-public final class ThreadPoolInspector extends TimerTask {
-
-    private ThreadPoolExecutor threadPool;
-
-    public ThreadPoolInspector(final ThreadPoolExecutor threadPool, final int 
msPeriod) {
-        this.threadPool = threadPool;
-        final Timer t = new Timer();
-        LOG.info("Scheduling to run every " + msPeriod + "ms");
-        t.schedule(this, 0, msPeriod);
-    }
-
-    private static final Log LOG = 
LogFactory.getLog(ThreadPoolInspector.class);
-
-    public void run() {
-        LOG.info("Thread pool size: " + threadPool.getPoolSize()
-                + "; Largest size: " + threadPool.getLargestPoolSize());
-        LOG.info("Active threads: " + threadPool.getActiveCount());
-        LOG.info("Approx. task count: " + threadPool.getTaskCount()
-                + "; Completed count: " + threadPool.getCompletedTaskCount());
-    }
-}

Modified: 
trunk/src/java/no/schibstedsok/front/searchportal/query/run/RunningQuery.java
===================================================================
--- 
trunk/src/java/no/schibstedsok/front/searchportal/query/run/RunningQuery.java   
    2006-05-04 13:13:27 UTC (rev 2854)
+++ 
trunk/src/java/no/schibstedsok/front/searchportal/query/run/RunningQuery.java   
    2006-05-04 13:46:03 UTC (rev 2855)
@@ -65,7 +65,7 @@
 
     String getSourceParameters(final String source);
 
-    List getSources();
+    List<Modifier> getSources();
 
     TokenEvaluatorFactory getTokenEvaluatorFactory();
 

Modified: 
trunk/src/java/no/schibstedsok/front/searchportal/query/run/RunningQueryImpl.java
===================================================================
--- 
trunk/src/java/no/schibstedsok/front/searchportal/query/run/RunningQueryImpl.java
   2006-05-04 13:13:27 UTC (rev 2854)
+++ 
trunk/src/java/no/schibstedsok/front/searchportal/query/run/RunningQueryImpl.java
   2006-05-04 13:46:03 UTC (rev 2855)
@@ -269,8 +269,8 @@
                         final SearchConfiguration config = 
searchResult.getSearchCommand().getSearchConfiguration();
                         final String name = config.getName();
                         final SearchTab.EnrichmentHint eHint = 
context.getSearchTab().getEnrichmentByCommand(name);
-                        final int score = scores.get(name) != null
-                                ? (int)(scores.get(name) * eHint.getWeight())
+                        final float score = scores.get(name) != null
+                                ? scores.get(name) * eHint.getWeight()
                                 : 0;
 
                         // update hit status

Modified: 
trunk/src/java/no/schibstedsok/front/searchportal/result/Enrichment.java
===================================================================
--- trunk/src/java/no/schibstedsok/front/searchportal/result/Enrichment.java    
2006-05-04 13:13:27 UTC (rev 2854)
+++ trunk/src/java/no/schibstedsok/front/searchportal/result/Enrichment.java    
2006-05-04 13:46:03 UTC (rev 2855)
@@ -5,28 +5,25 @@
  * @author <a href="mailto:[EMAIL PROTECTED]">Magnus Eklund</a>
  * @version <tt>$Revision$</tt>
  */
-public class Enrichment implements Comparable {
+public class Enrichment implements Comparable<Enrichment> {
 
-    private int analysisResult;
+    private float analysisResult;
     private String name;
 
-    public Enrichment(final int analysisResult, final String name) {
+    public Enrichment(final float analysisResult, final String name) {
         this.analysisResult = analysisResult;
         this.name = name;
     }
 
     public int getAnalysisResult() {
-        return analysisResult;
+        return (int)analysisResult;
     }
 
     public String getName() {
         return name;
     }
 
-    public int compareTo(final Object o) {
-        final Enrichment e = (Enrichment) o;
-        final Integer otherScore = Integer.valueOf(e.getAnalysisResult());
-        final Integer thisScore = Integer.valueOf(analysisResult);
-        return otherScore.compareTo(thisScore);
+    public int compareTo(final Enrichment e) {
+        return (int)(analysisResult - e.analysisResult);
     }
 }

Modified: 
trunk/src/java/no/schibstedsok/front/searchportal/result/handler/ContentSourceCollector.java
===================================================================
--- 
trunk/src/java/no/schibstedsok/front/searchportal/result/handler/ContentSourceCollector.java
        2006-05-04 13:13:27 UTC (rev 2854)
+++ 
trunk/src/java/no/schibstedsok/front/searchportal/result/handler/ContentSourceCollector.java
        2006-05-04 13:46:03 UTC (rev 2855)
@@ -2,6 +2,7 @@
 package no.schibstedsok.front.searchportal.result.handler;
 
 import java.util.Iterator;
+import java.util.List;
 import java.util.Map;
 import no.schibstedsok.front.searchportal.result.FastSearchResult;
 import no.schibstedsok.front.searchportal.result.Modifier;
@@ -11,7 +12,7 @@
  * @author <a href="mailto:[EMAIL PROTECTED]">Magnus Eklund</a>
  * @version <tt>$Revision$</tt>
  */
-public class ContentSourceCollector implements ResultHandler {
+public final class ContentSourceCollector implements ResultHandler {
 
     public void handleResult(final Context cxt, final Map parameters) {
 
@@ -20,8 +21,7 @@
             final FastSearchResult fastResult = (FastSearchResult) 
cxt.getSearchResult();
 
             if (fastResult.getModifiers("sources") != null) {
-                for (Iterator iterator = 
fastResult.getModifiers("sources").iterator(); iterator.hasNext();) {
-                    final Modifier modifier = (Modifier) iterator.next();
+                for (Modifier modifier : 
(List<Modifier>)fastResult.getModifiers("sources")) {
                     cxt.addSource(modifier);
                 }
             }

Modified: 
trunk/src/java/no/schibstedsok/front/searchportal/result/handler/SumFastModifiers.java
===================================================================
--- 
trunk/src/java/no/schibstedsok/front/searchportal/result/handler/SumFastModifiers.java
      2006-05-04 13:13:27 UTC (rev 2854)
+++ 
trunk/src/java/no/schibstedsok/front/searchportal/result/handler/SumFastModifiers.java
      2006-05-04 13:46:03 UTC (rev 2855)
@@ -16,11 +16,11 @@
  * @author <a href="mailto:[EMAIL PROTECTED]">Magnus Eklund</a>
  * @version <tt>$Revision$</tt>
  */
-public class SumFastModifiers implements ResultHandler {
+public final class SumFastModifiers implements ResultHandler {
 
     private String targetModifier;
     private String navigatorName;
-    private Collection modifierNames = new ArrayList();
+    private final Collection modifierNames = new ArrayList();
 
     public SumFastModifiers(){}
 

Modified: trunk/src/webapp/WEB-INF/jsp/decorators/mainDecorator.jsp
===================================================================
--- trunk/src/webapp/WEB-INF/jsp/decorators/mainDecorator.jsp   2006-05-04 
13:13:27 UTC (rev 2854)
+++ trunk/src/webapp/WEB-INF/jsp/decorators/mainDecorator.jsp   2006-05-04 
13:46:03 UTC (rev 2855)
@@ -25,7 +25,6 @@
 
     String currentC = "d";    //default collection
     currentC = (String) request.getAttribute("c");
-    final String searchType = request.getParameter("s");
     String q = (String) request.getAttribute("q");
     final String contentsource = (String) 
request.getParameter("contentsource");
     final String qURLEncoded = URLEncoder.encode(q, "utf-8");
@@ -41,7 +40,7 @@
     final String ss = request.getParameter("ss");
     final String ssr = request.getParameter("ssr");
 
-    final List enrichments = (List) request.getAttribute("enrichments");
+    final List<Enrichment> enrichments = (List<Enrichment>) 
request.getAttribute("enrichments");
     final int enrichmentSize = enrichments.size();
     pageContext.setAttribute("enrichmentSize", enrichmentSize);
 
@@ -49,7 +48,7 @@
     pageContext.setAttribute("siteMeshPage", siteMeshPage);
 
     final RunningQuery query = (RunningQuery) request.getAttribute("query");
-    final List sources = query.getSources();
+    final List<Modifier> sources = query.getSources();
     final Integer hits = (Integer) query.getNumberOfHits("defaultSearch");
 
     int no_hits = 0;
@@ -87,10 +86,9 @@
         // it *is* new-school n we doda-dance
         final VelocityContext context = 
VelocityResultHandler.newContextInstance(engine);
 
-        for (Iterator iter = sources.iterator(); iter.hasNext();) {
-            Modifier mod = (Modifier) iter.next();
+        for (Modifier mod : sources) {
             if ( mod.getName().equals("sesam_hits")) {
-                context.put("sesam_hits", text.getMessage("numberFormat", new 
Integer(mod.getCount())));
+                context.put("sesam_hits", text.getMessage("numberFormat", 
mod.getCount()));
             }
         }
         // populate context with sitemesh stuff
@@ -113,17 +111,18 @@
         // merge it into the JspWriter
         template.merge(context, out);%>
     <%-- old-school sitesearch --%>
-    <% } else if (currentC.equals("d") && "ds".equals(ss) ||
-            currentC.equals("d") && "di".equals(ss) ||
-            currentC.equals("d") && "pr".equals(ss) ||
-            currentC.equals("d") && "im".equals(ss) ||
-            currentC.equals("d") && "nrk".equals(ss) ||
-            currentC.equals("d") && "af".equals(ss) ||
-            currentC.equals("d") && "fv".equals(ss) ||
-            currentC.equals("d") && "aa".equals(ss) ||
-            currentC.equals("d") && "bt".equals(ss) ||
-            currentC.equals("d") && "sa".equals(ss) ||
-            currentC.equals("d") && "it".equals(ss)) { %>
+    <% } else if (currentC.equals("d") && (
+             "ds".equals(ss) ||
+             "di".equals(ss) ||
+             "pr".equals(ss) ||
+             "im".equals(ss) ||
+             "nrk".equals(ss) ||
+             "af".equals(ss) ||
+             "fv".equals(ss) ||
+             "aa".equals(ss) ||
+             "bt".equals(ss) ||
+             "sa".equals(ss) ||
+             "it".equals(ss))) { %>
 
 
         <div id="frame">
@@ -338,27 +337,23 @@
     <tr>
        <%if (q.trim().equals("") && !currentC.equals("m")) {%>
 
-       <%}else if (currentC.equals("m") || currentC.equals("d") || 
!q.trim().equals("")) {%>
+       <%}else if (currentC.equals("m") || currentC.equals("d")|| 
currentC.equals("g") || !q.trim().equals("")) {%>
         <td class="cell_one" valign="top">
 
             <%if (currentC.equals("y") || currentC.equals("yip") || 
currentC.equals("yipticker")) {%>
                 <table border="0" cellspacing="0" cellpadding="0" 
class="leftbar_table">
                            <% int i=0; %>
-                    <% for (Iterator iterator = sources.iterator(); 
iterator.hasNext();) {
-                        Modifier e = (Modifier) iterator.next();
+                    <% for (Modifier e : sources) {
                         ++i;
-                    %>
-                    <% if(i!=1) {%>
-                            <tr>
-                                <td colspan="2" class="nopad"><img 
src="../images/pix.gif" width="100%" height="1" alt="" /></td>
-                            </tr>
+                    if(i!=1) {%>
+                            <tr><td colspan="2" class="nopad"><img 
src="../images/pix.gif" width="100%" height="1" alt="" /></td></tr>
                     <% } %>
                         <tr onmouseover="this.style.background='#E3DEE4';" 
onmouseout="this.style.background='#F3F3F3';" 
onclick='strepRollover("?q=<%=qURLEncoded%>&amp;<%=query.getSourceParameters(e.getName())%>");'>
                             <td class="nav_pad_icon">
                                 <img <% if (e.getName().startsWith("Persons")) 
{ %> src="../images/menu/person.gif" <% } else if 
(e.getName().startsWith("Netts")) { %> src="../images/menu/nettsok.gif" <% } %> 
class="nav_icon" align="left" alt="" />
                                 <a 
href="?q=<%=qURLEncoded%>&amp;<%=query.getSourceParameters(e.getName())%>" 
onclick="return strep(this);"><%= e.getName() %></a>
                             </td>
-                            <td class="nav_pad" 
align="right"><%=text.getMessage("numberFormat", new Integer(e.getCount())) 
%></td>
+                            <td class="nav_pad" 
align="right"><%=text.getMessage("numberFormat", e.getCount()) %></td>
                         </tr>
                     <%}%>
                 </table>
@@ -366,21 +361,17 @@
             <%}else if (currentC.equals("w") || currentC.equals("wip")) {%>
                 <table border="0" cellspacing="0" cellpadding="0" 
class="leftbar_table">
                            <% int i=0; %>
-                    <% for (Iterator iterator = sources.iterator(); 
iterator.hasNext();) {
-                        Modifier e = (Modifier) iterator.next();
+                    <% for (Modifier e : sources) {
                                ++i;
-                    %>
-                    <% if(i!=1) {%>
-                            <tr>
-                                <td colspan="2" class="nopad"><img 
src="../images/pix.gif" width="100%" height="1" alt="" /></td>
-                            </tr>
+                    if(i!=1) {%>
+                            <tr><td colspan="2" class="nopad"><img 
src="../images/pix.gif" width="100%" height="1" alt="" /></td></tr>
                     <% } %>
                     <tr onmouseover="this.style.background='#E3DEE4';" 
onmouseout="this.style.background='#F3F3F3';" 
onclick='strepRollover("?q=<%=qURLEncoded%>&amp;<%=query.getSourceParameters(e.getName())%>");'>
                         <td class="nav_pad_icon">
                             <img <% if (e.getName().startsWith("Bedriftss")) { 
%> src="../images/menu/bedrift.gif" <% } else if 
(e.getName().startsWith("Netts")) { %> src="../images/menu/nettsok.gif" <% } %> 
class="nav_icon" align="left" alt="" />
                             <a 
href="?q=<%=qURLEncoded%>&amp;<%=query.getSourceParameters(e.getName())%>" 
onclick="return strep(this);"><%= e.getName() %></a>
                         </td>
-                        <td class="nav_pad" 
align="right"><%=text.getMessage("numberFormat", new Integer(e.getCount())) 
%></td>
+                        <td class="nav_pad" 
align="right"><%=text.getMessage("numberFormat", e.getCount()) %></td>
                     </tr>
                     <%}%>
                 </table>
@@ -393,21 +384,17 @@
             <%}else if (currentC.equals("m")) {%>
                 <table border="0" cellspacing="0" cellpadding="0" 
class="leftbar_table">
                            <% int i=0; %>
-                    <% for (Iterator iterator = sources.iterator(); 
iterator.hasNext();) {
-                        Modifier e = (Modifier) iterator.next();
+                    <% for (Modifier e : sources) {
                         ++i;
-                                %>
-                        <% if(i!=1) {%>
-                                <tr>
-                                    <td colspan="2" class="nopad"><img 
src="../images/pix.gif" width="100%" height="1" alt="" /></td>
-                                </tr>
+                        if(i!=1) {%>
+                                <tr><td colspan="2" class="nopad"><img 
src="../images/pix.gif" width="100%" height="1" alt="" /></td></tr>
                         <% } %>
                         <tr onmouseover="this.style.background='#E3DEE4';" 
onmouseout="this.style.background='#F3F3F3';" 
onclick='strepRollover("?q=<%=qURLEncoded%>&amp;<%=query.getSourceParameters(e.getName())%>");'>
                             <td class="nav_pad_icon">
                                 <img src="../images/menu/nettsok.gif" 
class="nav_icon" align="left" alt="" />
                                 <a 
href="?q=<%=qURLEncoded%>&amp;<%=query.getSourceParameters(e.getName())%>" 
onclick="return strep(this);"><%= e.getName() %></a>
                             </td>
-                            <td class="nav_pad" 
align="right"><%=text.getMessage("numberFormat", new Integer(e.getCount())) 
%></td>
+                            <td class="nav_pad" 
align="right"><%=text.getMessage("numberFormat", e.getCount()) %></td>
                         </tr>
                     <%}%>
                 </table>
@@ -417,23 +404,19 @@
 
                 <table border="0" cellspacing="0" cellpadding="0" 
class="leftbar_table">
                            <% int i = 0; %>
-                    <% for (Iterator iterator = sources.iterator(); 
iterator.hasNext();) {
-                        Modifier e = (Modifier) iterator.next();
-                        if ( (currentC.equals("d") && 
!e.getName().equals("Nettsøk")) || (currentC.equals("d") && searchType != null 
&& searchType.equals("g")) || currentC.equals("p") || currentC.equals("b")) {
+                    <% for (Modifier e : sources) {
+                        if ( (currentC.equals("d") && 
!e.getName().equals("Nettsøk"))
+                                || currentC.equals("g") || 
currentC.equals("p") || currentC.equals("b")) {
                             ++i;
-                    %>
-
-                            <% if(i!=1) {%>
-                                <tr>
-                                    <td colspan="2" class="nopad"><img 
src="../images/pix.gif" width="100%" height="1" alt="" /></td>
-                                </tr>
+                            if(i!=1) {%>
+                                <tr><td colspan="2" class="nopad"><img 
src="../images/pix.gif" width="100%" height="1" alt="" /></td></tr>
                             <% } %>
                             <tr onmouseover="this.style.background='#E3DEE4';" 
onmouseout="this.style.background='#F3F3F3';" 
onclick='strepRollover("?q=<%=qURLEncoded%>&amp;<%=query.getSourceParameters(e.getName())%>");'>
                                 <td class="nav_pad_icon">
                                     <img <% if 
(e.getName().startsWith("Bedrifts")) { %> src="../images/menu/bedrift.gif" <% } 
else if (e.getName().startsWith("Persons")) { %> 
src="../images/menu/person.gif" <% } else if (e.getName().startsWith("Bildes")) 
{ %> src="../images/menu/bilde.gif" <% } else if (e.getName().equals("Verden")) 
{ %> src="../images/menu/nettsok.gif"  <% } else if 
(e.getName().startsWith("Nyhetss")) { %> src="../images/menu/nyheter.gif" <% } 
else if (e.getName().startsWith("Netts")) { %> src="../images/menu/nettsok.gif" 
<% } %> class="nav_icon" align="left" alt="" />
                                     <a 
href="?q=<%=qURLEncoded%>&amp;<%=query.getSourceParameters(e.getName())%>" 
onclick="return strep(this);"><%= e.getName() %></a>
                                 </td>
-                                <td class="nav_pad" 
align="right"><%=text.getMessage("numberFormat", new Integer(e.getCount())) 
%></td>
+                                <td class="nav_pad" 
align="right"><%=text.getMessage("numberFormat", e.getCount()) %></td>
                             </tr>
                         <%}%>
                     <%}%>
@@ -464,7 +447,7 @@
         <%}%>
                 <%--<decorator:getProperty property="page.search-bar"/>--%>
                 <!-- Magic -->
-                <%if (currentC.equals("d")) {%>
+                <%if (currentC.equals("d") || "g".equals(currentC)) {%>
 
 
                         <%--  Header  --%>
@@ -498,15 +481,6 @@
                        <tr>
                         <decorator:getProperty property="page.spellcheck"/>
                          <td id="result_container">
-                             <% if ("n".equals(searchType)) { %>
-                                    <% if (no_hits > 0) { %>
-                                        <decorator:getProperty 
property="page.fast-results"/>
-                                    <%  } else if(!q.trim().equals("")){ %>
-                                        <decorator:getProperty 
property="page.noHits"/>
-                                    <% } %>
-                             <% } else if ("g".equals(searchType)) { %>
-                                    <decorator:getProperty 
property="page.global-results"/>
-                             <%  } else { %>
 
                                 <decorator:getProperty 
property="page.main_ads"/>
 
@@ -531,27 +505,31 @@
                                            </c:if>
                                        </c:forEach>
 
-                                       <%--  Shows the 3 first hits if more 
than 1 enrichment  --%>
-                                       <decorator:getProperty 
property="page.fast-results-norwegian_part1"/>
+                                        <% if ("d".equals(currentC)) { %>
+                                           <%--  Shows the 3 first hits if 
more than 1 enrichment  --%>
+                                           <decorator:getProperty 
property="page.fast-results-norwegian_part1"/>
 
-                                       <%-- Show tab's proceeding enrichments 
--%>
-                                       <c:forEach var="ee" 
items="${enrichments}" varStatus="i">
-                                           <c:if test="${(i.index >= 
tab.enrichmentOnTop || ee.analysisResult < tab.enrichmentOnTopScore) && i.index 
< tab.enrichmentLimit}">
-                                               <c:set var="pageName" 
value="page.${ee.name}"/>
-                                               <c:out 
value="${siteMeshPage.properties[pageName]}" escapeXml="false"/>
-                                           </c:if>
-                                       </c:forEach>
+                                           <%-- Show tab's proceeding 
enrichments --%>
+                                           <c:forEach var="ee" 
items="${enrichments}" varStatus="i">
+                                               <c:if test="${(i.index >= 
tab.enrichmentOnTop || ee.analysisResult < tab.enrichmentOnTopScore) && i.index 
< tab.enrichmentLimit}">
+                                                   <c:set var="pageName" 
value="page.${ee.name}"/>
+                                                   <c:out 
value="${siteMeshPage.properties[pageName]}" escapeXml="false"/>
+                                               </c:if>
+                                           </c:forEach>
 
-                                       <%--  Shows the 7 next hits after the 
second/third enrichments  --%>
-                                       <decorator:getProperty 
property="page.fast-results-norwegian_part2"/>
-                               
+                                           <%--  Shows the 7 next hits after 
the second/third enrichments  --%>
+                                           <decorator:getProperty 
property="page.fast-results-norwegian_part2"/>
+                                           
+                                       <% } else if ("g".equals(currentC)) { %>
+                                       
+                                            <decorator:getProperty 
property="page.global-results"/>
+                                       <% } %>
                                  </c:when>
                                  <c:otherwise>
                                      <decorator:getProperty 
property="page.noHits" />
                                  </c:otherwise>
                              </c:choose>
 
-                            <% } %>
                         </td>
                        </tr>
                        </table>
@@ -632,7 +610,7 @@
 <!--
 var tmsec = new Array(2);
 tmsec[0]="tmsec=sesam";
-<% if (currentC.equals("d") && "g".equals(searchType)) { %> 
tmsec[1]="tmsec=sesamsok_verden";
+<% if (currentC.equals("g")) { %> tmsec[1]="tmsec=sesamsok_verden";
 <% } else if (currentC.equals("d")) { %> tmsec[1]="tmsec=sesamsok";
 <% } else if (currentC.equals("m") && "Norske nyheter".equals(contentsource)) 
{ %> tmsec[1]="tmsec=nyhetssok_norske";
 <% } else if (currentC.equals("m") && "Internasjonale 
nyheter".equals(contentsource)) { %> tmsec[1]="tmsec=nyhetssok_internasjonale";
@@ -649,7 +627,7 @@
 getTMqs('','', 'sesam_no', 'no', 'iso-8859-15', tmsec);
 //-->
 </script>
-<% if (currentC.equals("d") && "g".equals(searchType)) { %> <noscript><img 
src="http://statistik-gallup.net/v11***sesam_no/no/iso-8859-15/tmsec=sesam&amp;tmsec=sesamsok_verden";
 alt="" /></noscript>
+<% if (currentC.equals("g") ) { %> <noscript><img 
src="http://statistik-gallup.net/v11***sesam_no/no/iso-8859-15/tmsec=sesam&amp;tmsec=sesamsok_verden";
 alt="" /></noscript>
 <% } else if (currentC.equals("d")) { %> <noscript><img 
src="http://statistik-gallup.net/v11***sesam_no/no/iso-8859-15/tmsec=sesam&amp;tmsec=sesamsok";
 alt="" /></noscript>
 <% } else if (currentC.equals("m") && "Norske nyheter".equals(contentsource)) 
{ %> <noscript><img 
src="http://statistik-gallup.net/v11***sesam_no/no/iso-8859-15/tmsec=sesam&amp;tmsec=nyhetssok_norske";
 alt="" /></noscript>
 <% } else if (currentC.equals("m") && "Internasjonale 
nyheter".equals(contentsource)) { %> <noscript><img 
src="http://statistik-gallup.net/v11***sesam_no/no/iso-8859-15/tmsec=sesam&amp;tmsec=nyhetssok_internasjonale";
 alt="" /></noscript>

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

Reply via email to