Author: ssanjamt
Date: 2007-06-19 09:57:47 +0200 (Tue, 19 Jun 2007)
New Revision: 5353

Modified:
   trunk/
   
trunk/core-api/src/main/java/no/schibstedsok/searchportal/mode/SearchModeFactory.java
   
trunk/core-api/src/main/java/no/schibstedsok/searchportal/view/velocity/QuickResourceManagerImpl.java
   
trunk/core-api/src/main/java/no/schibstedsok/searchportal/view/velocity/TopDomainDirective.java
   trunk/query-api/src/main/javacc/QueryParserImpl.jj
   
trunk/search-command-config-spi/src/main/java/no/schibstedsok/searchportal/mode/config/BlendingNewsCommandConfig.java
   
trunk/war/src/main/java/no/schibstedsok/searchportal/http/filters/SiteLocatorFilter.java
   trunk/war/src/webapp/index.jsp
Log:
Merged revisions 5291-5350 via svnmerge from 
https://dev.schibstedsok.no/svn/search-portal/branches/2.13

........
  r5292 | ssmiweve | 2007-06-08 10:52:26 +0200 (Fri, 08 Jun 2007) | 1 line
  
  SEARCH-2711 - Lang soekestreng gir veeeldig mange treff i katalog (hyphon 
variations)
........
  r5293 | ssmiweve | 2007-06-08 13:38:22 +0200 (Fri, 08 Jun 2007) | 1 line
  
  NPE :$
........
  r5294 | ssmiweve | 2007-06-08 15:40:03 +0200 (Fri, 08 Jun 2007) | 1 line
  
  SEARCH-2463 - Malformed URL on vg.sesam.no
........
  r5308 | ssanthor | 2007-06-12 11:17:16 +0200 (Tue, 12 Jun 2007) | 1 line
  
  addeddebugg information for SEARCH-2805
........
  r5309 | ssanthor | 2007-06-12 12:40:06 +0200 (Tue, 12 Jun 2007) | 1 line
  
  addeddebugg information for SEARCH-2805
........
  r5310 | ssanthor | 2007-06-12 12:57:20 +0200 (Tue, 12 Jun 2007) | 1 line
  
  addeddebugg information for SEARCH-2805
........
  r5311 | ssmaeklu | 2007-06-12 15:50:08 +0200 (Tue, 12 Jun 2007) | 1 line
  
  Fixed failing test due to incorrent inheritance w.r.t. modes.xml
........
  r5324 | ssmaeklu | 2007-06-14 09:25:30 +0200 (Thu, 14 Jun 2007) | 1 line
  
  Improved to keep updates of a resource from pilingup
........
  r5325 | ssmaeklu | 2007-06-14 10:01:57 +0200 (Thu, 14 Jun 2007) | 1 line
  
  Avoid IndexOutOfBoundsException.
........
  r5326 | ssanjamt | 2007-06-14 10:46:11 +0200 (Thu, 14 Jun 2007) | 1 line
  
  kart.sesam.no
........
  r5336 | ssanjamt | 2007-06-15 15:04:46 +0200 (Fri, 15 Jun 2007) | 1 line
  
  linkpulse for kart.sesam.no
........
  r5337 | ssanthor | 2007-06-15 15:30:39 +0200 (Fri, 15 Jun 2007) | 1 line
  
  rooled back SEARCH-2805
........
  r5340 | ssmiweve | 2007-06-16 20:57:01 +0200 (Sat, 16 Jun 2007) | 1 line
  
  SEARCH-2862 - High thread count (>1000) since release 2.13
........



Property changes on: trunk
___________________________________________________________________
Name: svnmerge-integrated
   - /branches/2.10:1-4690,4692-4745 /branches/2.11:1-4933 
/branches/2.12:1-5051,5053-5106 /branches/2.13:1-5290 /branches/2.6:1-3877 
/branches/2.7:1-4160 /branches/2.8:1-4446 /branches/2.9:1-4626 
/branches/MAP_SEARCHv2:1-4544
   + /branches/2.10:1-4690,4692-4745 /branches/2.11:1-4933 
/branches/2.12:1-5051,5053-5106 /branches/2.13:1-5350 /branches/2.6:1-3877 
/branches/2.7:1-4160 /branches/2.8:1-4446 /branches/2.9:1-4626 
/branches/MAP_SEARCHv2:1-4544

Modified: 
trunk/core-api/src/main/java/no/schibstedsok/searchportal/mode/SearchModeFactory.java
===================================================================
--- 
trunk/core-api/src/main/java/no/schibstedsok/searchportal/mode/SearchModeFactory.java
       2007-06-19 07:47:55 UTC (rev 5352)
+++ 
trunk/core-api/src/main/java/no/schibstedsok/searchportal/mode/SearchModeFactory.java
       2007-06-19 07:57:47 UTC (rev 5353)
@@ -82,7 +82,7 @@
     // Static --------------------------------------------------------
 
     /**
-     * TODO comment me. *
+     *
      * @param cxt
      * @return
      */
@@ -155,7 +155,7 @@
     // Public --------------------------------------------------------
 
     /**
-     * TODO comment me. *
+     *
      * @param id
      * @return
      */
@@ -418,7 +418,14 @@
                 final SearchConfiguration inherit,
                 final Context context) {
 
-            return construct(element, 
context).readSearchConfiguration(element, inherit);
+            final SearchConfiguration sc = construct(element, context);
+            
+            assert null == inherit || 
inherit.getClass().isAssignableFrom(sc.getClass()) 
+                    : "Can only inherit from same or superclass configuration. 
" 
+                    + element.getAttribute("id") + '(' + 
sc.getClass().getSimpleName() + ')'
+                    + " trying to inherit from " + inherit.getName() + '(' + 
inherit.getClass().getSimpleName() + ')';
+            
+            return sc.readSearchConfiguration(element, inherit);
         }
 
         @SuppressWarnings("unchecked")

Modified: 
trunk/core-api/src/main/java/no/schibstedsok/searchportal/view/velocity/QuickResourceManagerImpl.java
===================================================================
--- 
trunk/core-api/src/main/java/no/schibstedsok/searchportal/view/velocity/QuickResourceManagerImpl.java
       2007-06-19 07:47:55 UTC (rev 5352)
+++ 
trunk/core-api/src/main/java/no/schibstedsok/searchportal/view/velocity/QuickResourceManagerImpl.java
       2007-06-19 07:57:47 UTC (rev 5353)
@@ -14,6 +14,7 @@
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 import java.text.MessageFormat;
+import java.util.concurrent.ThreadPoolExecutor;
 
 /**
  * A quicker replacement for [EMAIL PROTECTED] 
org.apache.velocity.runtime.resource.ResourceManagerImpl} that avoids
@@ -24,6 +25,7 @@
  * loaded several times during startup or reload.
  *
  * @author Magnus Eklund
+ * @version $Id$
  */
 public final class QuickResourceManagerImpl extends ResourceManagerImpl {
 
@@ -36,6 +38,7 @@
     private static final String CHECKED_MODIFICATION = "Checked modification 
of velocity resource {0} in {1}";
 
     private static final Logger LOG = 
Logger.getLogger(QuickResourceManagerImpl.class);
+    private static final String DEBUG_POOL_COUNT = "Pool size: ";
 
     /**
      * [EMAIL PROTECTED]
@@ -45,14 +48,21 @@
         final Resource resource = globalCache.get(type + name);
 
         if (resource != null) {
+
             // Use cached resource for this invocation but also start a thread 
to update cache with a brand new
             // resource instance.
             if (resource.requiresChecking()) {
+                
+                // Touch the resource so that a closely following caller won't 
trigger an update thread.
+                // Keeps updates of the same resource from piling up when 
traffic is high.
+                resource.touch();
                 EXECUTOR.submit(new Loader(resource, name, type, encoding));
             }
 
             return resource;
+            
         } else {
+            
             return new Loader(resource, name, type, encoding).load();
         }
     }
@@ -86,6 +96,11 @@
             this.enc = enc;
 
             key = type + name;
+            
+            if(LOG.isDebugEnabled() && EXECUTOR instanceof ThreadPoolExecutor){
+                final ThreadPoolExecutor tpe = (ThreadPoolExecutor)EXECUTOR;
+                LOG.debug(DEBUG_POOL_COUNT + tpe.getActiveCount() + '/' + 
tpe.getPoolSize());
+            }
         }
 
         /**
@@ -130,10 +145,10 @@
 
                 stopWatch.stop();
 
-                if (oldResource != null) {
+                if (oldResource != null && LOG.isInfoEnabled()) {
                     LOG.info(MessageFormat.format(CHECKED_MODIFICATION, key, 
stopWatch.toSplitString()));
                 }
-                if (modified) {
+                if (modified && LOG.isDebugEnabled()) {
                     LOG.debug(MessageFormat.format(LOADED_VELOCITY_RESOURCE, 
key, stopWatch.toString()));
                 }
             }
@@ -143,8 +158,10 @@
          * Loads resource if it has been modified since it was last loaded.
          */
         public void run() {
+            
             try {
                 load();
+                
             }  catch (ResourceNotFoundException rnfe) {
                 log.error(MessageFormat.format(RESOURCE_NOT_FOUND, name));
             } catch (ParseErrorException pee) {


Property changes on: 
trunk/core-api/src/main/java/no/schibstedsok/searchportal/view/velocity/QuickResourceManagerImpl.java
___________________________________________________________________
Name: svn:keywords
   + Id

Modified: 
trunk/core-api/src/main/java/no/schibstedsok/searchportal/view/velocity/TopDomainDirective.java
===================================================================
--- 
trunk/core-api/src/main/java/no/schibstedsok/searchportal/view/velocity/TopDomainDirective.java
     2007-06-19 07:47:55 UTC (rev 5352)
+++ 
trunk/core-api/src/main/java/no/schibstedsok/searchportal/view/velocity/TopDomainDirective.java
     2007-06-19 07:57:47 UTC (rev 5353)
@@ -58,7 +58,6 @@
         }
 
         final String input = node.jjtGetChild(0).value(context).toString();
-        String topDomain = "";
         String string = "";
 
         if (input.indexOf("http://";) > -1) 
@@ -69,9 +68,10 @@
             string = input;
         }
 
-        int i = string.indexOf("/");
-        topDomain = string.substring(0, i);
+        final int i = string.indexOf("/");
 
+        final String topDomain = i > 0 ? string.substring(0, i) : string;
+
         writer.write(topDomain);
 
         final Token lastToken = node.getLastToken();

Modified: trunk/query-api/src/main/javacc/QueryParserImpl.jj
===================================================================
--- trunk/query-api/src/main/javacc/QueryParserImpl.jj  2007-06-19 07:47:55 UTC 
(rev 5352)
+++ trunk/query-api/src/main/javacc/QueryParserImpl.jj  2007-06-19 07:57:47 UTC 
(rev 5353)
@@ -61,6 +61,7 @@
     | < [ "\u007b"-"\u00bf" ] >
     | < [ "\u00d7" ] >
     | < [ "\u00f7" ] >
+    | < [ "\u2010"-"\u2015" ] >
 }
 
 /* These are the the above skip characters */
@@ -69,6 +70,7 @@
 /* . / */
 /* ; < = > ? @ */
 /* [ \ ] ^ _ ` */
+/* ‐ ‑ ‒ – — ― */
 
 
<DEFAULT,EMAIL_DISABLED,PHONE_NUMBER_DISABLED,NUMBER_GROUP_DISABLED,QUOTED_WORD_DISABLED>
 TOKEN : { <URL: "http://";<WORD>("/"<WORD>)*> }
@@ -101,25 +103,34 @@
     | <#PHONE_MIDDLE: ((" ")*<PHONE_SYMBOL>(" ")*)|(" ")+>
     | <#PHONE_SYMBOL: (".")|("-")|("/")>
     | <#WORD_SYMBOL_PREFIX: (".")|("<")|("=")|(">")>
-    | <#WORD_SYMBOL_MIDDLE: (".")|("-")|("_")|("+")>
+    | <#WORD_SYMBOL_MIDDLE: (".")|<HYPON>|("_")|("+")>
     | <#WORD_SEPARATOR: [ // just a copy of the SKIP declaration.
             " ", "!", 
             "\u0023"-"\u0040",
             "\u005b"-"\u0060",
             "\u007b"-"\u00bf",
             "\u00d7",
-            "\u00f7"
+            "\u00f7",
+            "\u2010"-"\u2015"
         ]>
+    | <#HYPON: // Different types of hypons, 
http://www.cs.tut.fi/~jkorpela/dashes.html
+        [
+            "-",
+            "\u2010"-"\u2015",
+            "\u207b",
+            "\u208b",
+            "\u2212"
+        ]>
     | <#LETTER:
-    /** UNICODE Characters **/
         [
             "\u0041"-"\u005a",
             "\u0061"-"\u007a",
             "\u00c0"-"\u00d6",
             "\u00d8"-"\u00f6",
-            "\u00f8"-"\uffff"
+            "\u00f8"-"\u200f",
+            "\u2016"-"\uffff"
         ]>
-    | < #DIGIT:                      // unicode digits
+    | <#DIGIT:
           [
            "\u0030"-"\u0039",
            "\u0660"-"\u0669",

Modified: 
trunk/search-command-config-spi/src/main/java/no/schibstedsok/searchportal/mode/config/BlendingNewsCommandConfig.java
===================================================================
--- 
trunk/search-command-config-spi/src/main/java/no/schibstedsok/searchportal/mode/config/BlendingNewsCommandConfig.java
       2007-06-19 07:47:55 UTC (rev 5352)
+++ 
trunk/search-command-config-spi/src/main/java/no/schibstedsok/searchportal/mode/config/BlendingNewsCommandConfig.java
       2007-06-19 07:57:47 UTC (rev 5353)
@@ -18,7 +18,7 @@
  * @version $Id$
  */
 @Controller("BlendingNewsSearchCommand")
-public final class BlendingNewsCommandConfig extends FastCommandConfig {
+public final class BlendingNewsCommandConfig extends  NewsCommandConfig {
 
     private List<String> filtersToBlend;
     private int documentsPerFilter;

Modified: 
trunk/war/src/main/java/no/schibstedsok/searchportal/http/filters/SiteLocatorFilter.java
===================================================================
--- 
trunk/war/src/main/java/no/schibstedsok/searchportal/http/filters/SiteLocatorFilter.java
    2007-06-19 07:47:55 UTC (rev 5352)
+++ 
trunk/war/src/main/java/no/schibstedsok/searchportal/http/filters/SiteLocatorFilter.java
    2007-06-19 07:57:47 UTC (rev 5353)
@@ -72,6 +72,7 @@
     
     private static final String UNKNOWN = "unknown";
 
+     
     /** Changes to this list must also change the ProxyPass|ProxyPassReverse 
configuration in httpd.conf **/
     private static final Collection<String> EXTERNAL_DIRS =
             Collections.unmodifiableCollection(Arrays.asList(new String[]{
@@ -463,6 +464,7 @@
             userAgent = req.getHeader("User-Agent");
             sesamId = getCookieValue(req, "SesamID");
             sesamUser = getCookieValue(req, "SesamUser");
+
             
         }else{
             

Modified: trunk/war/src/webapp/index.jsp
===================================================================
--- trunk/war/src/webapp/index.jsp      2007-06-19 07:47:55 UTC (rev 5352)
+++ trunk/war/src/webapp/index.jsp      2007-06-19 07:57:47 UTC (rev 5353)
@@ -96,7 +96,7 @@
                                     <td class="navbut" 
onclick='deleteCookie("sesam_menu", 
"/");document.getElementById("front_button_layer").style.visibility="hidden";menu_submit("sw","");'
 onmouseover='this.style.backgroundColor="#DADBDD"' 
onmouseout='this.style.backgroundColor="#FFF"'>V&#230;rs&#248;k</td>
                                 </tr>
                                 <tr>
-                                    <td class="navbut" 
onclick='deleteCookie("sesam_menu", 
"/");document.getElementById("front_button_layer").style.visibility="hidden";menu_submit("map","");'
 onmouseover='this.style.backgroundColor="#DADBDD"' 
onmouseout='this.style.backgroundColor="#FFF"'>Karts&#248;k</td>
+                                    <td class="navbut" 
onclick='deleteCookie("sesam_menu", 
"/");document.getElementById("front_button_layer").style.visibility="hidden";menu_submit("map","",
 "http://kart.sesam.no";);' onmouseover='this.style.backgroundColor="#DADBDD"' 
onmouseout='this.style.backgroundColor="#FFF"'>Karts&#248;k</td>
                                 </tr>
                                 <tr>
                                     <td 
onclick='document.getElementById("front_button_layer").style.visibility="hidden";'><img
 src="../images/index/skjul_meny.png" width="21" height="20" alt="" 
align="left" /><div class="navbutend">&nbsp;&nbsp;Lukk</div></td>
@@ -158,7 +158,7 @@
                 </div>
                 <div class="navRow">
                     <img src="images/menu/icons/kart.png" width="16" 
height="16" alt="" />
-                    <a href='<search:boomerang url="/search/?c=map" 
param="category:front_service"/>' onclick="return 
strep(this);">Karts&#248;k</a><span class="betaNavbar">beta</span>
+                    <a href='<search:boomerang 
url="http://kart.sesam.no/search/?c=map"; param="category:front_service"/>' 
onclick="return strep(this);">Karts&#248;k</a><span 
class="betaNavbar">beta</span>
                 </div>
             </div>
             <div id="navToggleHide">

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

Reply via email to