Author: sshafroi
Date: 2008-08-19 12:37:23 +0200 (Tue, 19 Aug 2008)
New Revision: 6766

Modified:
   
trunk/generic.sesam/search-command-config/src/main/java/no/sesat/search/mode/config/EspFastCommandConfig.java
   
trunk/generic.sesam/search-command-config/src/main/java/no/sesat/search/mode/config/FastCommandConfig.java
   
trunk/generic.sesam/search-command-config/src/main/java/no/sesat/search/mode/config/NewsEspCommandConfig.java
   
trunk/generic.sesam/search-command-config/src/main/java/no/sesat/search/mode/config/YahooWebCommandConfig.java
   
trunk/search-command-config-spi/src/main/java/no/sesat/search/mode/config/AbstractSearchConfiguration.java
   
trunk/search-command-config-spi/src/main/java/no/sesat/search/mode/config/CommandConfig.java
Log:
Issue SKER4404:  (Automatically assign config settings in 
readSearchConfiguration where there is a setter)

Remove before and after methods. Code that used to be in before or after is now 
around call to super.readSearchConfiguration

See point c, in issue.



Modified: 
trunk/generic.sesam/search-command-config/src/main/java/no/sesat/search/mode/config/EspFastCommandConfig.java
===================================================================
--- 
trunk/generic.sesam/search-command-config/src/main/java/no/sesat/search/mode/config/EspFastCommandConfig.java
       2008-08-18 14:05:58 UTC (rev 6765)
+++ 
trunk/generic.sesam/search-command-config/src/main/java/no/sesat/search/mode/config/EspFastCommandConfig.java
       2008-08-19 10:37:23 UTC (rev 6766)
@@ -290,10 +290,10 @@
         return this;
     }
 
-    protected void readSearchConfigurationAfter(Element element, 
SearchConfiguration inherit) {
-        super.readSearchConfigurationAfter(element, inherit);
-        final EspFastCommandConfig efscInherit = inherit instanceof 
EspFastCommandConfig
-                ? (EspFastCommandConfig) inherit
+    @Override
+    public void readSearchConfiguration(final Element element, final 
SearchConfiguration inherit) {
+        super.readSearchConfiguration(element, inherit);
+        final EspFastCommandConfig efscInherit = inherit instanceof 
EspFastCommandConfig ? (EspFastCommandConfig) inherit
                 : null;
 
         if (efscInherit != null && efscInherit.getNavigators() != null) {

Modified: 
trunk/generic.sesam/search-command-config/src/main/java/no/sesat/search/mode/config/FastCommandConfig.java
===================================================================
--- 
trunk/generic.sesam/search-command-config/src/main/java/no/sesat/search/mode/config/FastCommandConfig.java
  2008-08-18 14:05:58 UTC (rev 6765)
+++ 
trunk/generic.sesam/search-command-config/src/main/java/no/sesat/search/mode/config/FastCommandConfig.java
  2008-08-19 10:37:23 UTC (rev 6766)
@@ -594,11 +594,11 @@
         return this;
     }
 
-    protected void readSearchConfigurationAfter(Element element, 
SearchConfiguration inherit) {
-        super.readSearchConfigurationAfter(element, inherit);
-        final FastCommandConfig fscInherit = inherit instanceof 
FastCommandConfig
-                ? (FastCommandConfig) inherit
-                : null;
+    @Override
+    public void readSearchConfiguration(final Element element, final 
SearchConfiguration inherit) {
+        super.readSearchConfiguration(element, inherit);
+
+        final FastCommandConfig fscInherit = inherit instanceof 
FastCommandConfig ? (FastCommandConfig) inherit : null;
         if (getQueryServerUrl() == null || "".equals(getQueryServerUrl())) {
             LOG.debug("queryServerURL is empty for " + getId());
         }

Modified: 
trunk/generic.sesam/search-command-config/src/main/java/no/sesat/search/mode/config/NewsEspCommandConfig.java
===================================================================
--- 
trunk/generic.sesam/search-command-config/src/main/java/no/sesat/search/mode/config/NewsEspCommandConfig.java
       2008-08-18 14:05:58 UTC (rev 6765)
+++ 
trunk/generic.sesam/search-command-config/src/main/java/no/sesat/search/mode/config/NewsEspCommandConfig.java
       2008-08-19 10:37:23 UTC (rev 6766)
@@ -312,13 +312,13 @@
         return this;
     }
 
-    protected void readSearchConfigurationAfter(Element element, 
SearchConfiguration inherit) {
+    @Override
+    public void readSearchConfiguration(final Element element, final 
SearchConfiguration inherit) {
+        super.readSearchConfiguration(element, inherit);
         // maxAge is of the format 10h (for 10 hours).
         if (maxAge != null) {
             ageSymbol = maxAge.charAt(maxAge.length() - 1);
             maxAgeAmount = Integer.parseInt(maxAge.substring(0, 
maxAge.length() - 1));
         }
-
-        super.readSearchConfigurationAfter(element, inherit);    //To change 
body of overridden methods use File | Settings | File Templates.
     }
 }

Modified: 
trunk/generic.sesam/search-command-config/src/main/java/no/sesat/search/mode/config/YahooWebCommandConfig.java
===================================================================
--- 
trunk/generic.sesam/search-command-config/src/main/java/no/sesat/search/mode/config/YahooWebCommandConfig.java
      2008-08-18 14:05:58 UTC (rev 6765)
+++ 
trunk/generic.sesam/search-command-config/src/main/java/no/sesat/search/mode/config/YahooWebCommandConfig.java
      2008-08-19 10:37:23 UTC (rev 6766)
@@ -201,9 +201,8 @@
     }
 
     @Override
-    protected void readSearchConfigurationAfter(final Element element, final 
SearchConfiguration inherit) {
-        super.readSearchConfigurationAfter(element, inherit);
+    public void readSearchConfiguration(final Element element, final 
SearchConfiguration inherit) {
+        super.readSearchConfiguration(element, inherit);
         setPartnerId(getAppid());
     }
-
 }

Modified: 
trunk/search-command-config-spi/src/main/java/no/sesat/search/mode/config/AbstractSearchConfiguration.java
===================================================================
--- 
trunk/search-command-config-spi/src/main/java/no/sesat/search/mode/config/AbstractSearchConfiguration.java
  2008-08-18 14:05:58 UTC (rev 6765)
+++ 
trunk/search-command-config-spi/src/main/java/no/sesat/search/mode/config/AbstractSearchConfiguration.java
  2008-08-19 10:37:23 UTC (rev 6766)
@@ -36,32 +36,6 @@
     private static final String[] setters = {"set", "add"};
 
     /**
-     * This method will be called before settings from the modes.xml files will
-     * be applied. Default implementation is empty.
-     *
-     * @param element
-     *            The xml element where the attribues are found.
-     * @param inherit
-     *            The configuration that we inherit from.
-     */
-    protected void readSearchConfigurationBefore(final Element element, final 
SearchConfiguration inherit) {
-
-    }
-
-    /**
-     * This method will be called after settings from the modes.xml files will
-     * be applied. Default implementation is empty.
-     *
-     * @param element
-     *            The xml element where the attribues are found.
-     * @param inherit
-     *            The configuration that we inherit from.
-     */
-    protected void readSearchConfigurationAfter(final Element element, final 
SearchConfiguration inherit) {
-
-    }
-
-    /**
      * This method will apply the attributes found in element.
      *
      * @param element
@@ -69,8 +43,7 @@
      * @param inherit
      *            The configuration that we inherit from.
      */
-    public final void readSearchConfiguration(final Element element, final 
SearchConfiguration inherit) {
-        readSearchConfigurationBefore(element, inherit);
+    public void readSearchConfiguration(final Element element, final 
SearchConfiguration inherit) {
         Set<String> methods = getMethodNames(setters);
 
         NamedNodeMap attribs = element.getAttributes();
@@ -102,7 +75,6 @@
                 }
             }
         }
-        readSearchConfigurationAfter(element, inherit);
     }
 
     private static boolean startsWith(String string, String[] prefixes) {

Modified: 
trunk/search-command-config-spi/src/main/java/no/sesat/search/mode/config/CommandConfig.java
===================================================================
--- 
trunk/search-command-config-spi/src/main/java/no/sesat/search/mode/config/CommandConfig.java
        2008-08-18 14:05:58 UTC (rev 6765)
+++ 
trunk/search-command-config-spi/src/main/java/no/sesat/search/mode/config/CommandConfig.java
        2008-08-19 10:37:23 UTC (rev 6766)
@@ -301,23 +301,22 @@
         fieldFilters.clear();
     }
 
-    protected void readSearchConfigurationBefore(Element element, 
SearchConfiguration inherit) {
+    @Override
+    public void readSearchConfiguration(final Element element, final 
SearchConfiguration inherit) {
         if(null!=inherit){
             fieldFilters.putAll(inherit.getFieldFilterMap());
         }
         if(null!=inherit){
             resultFields.putAll(inherit.getResultFieldMap());
         }
-        super.readSearchConfigurationBefore(element, inherit);
-    }
 
-    protected void readSearchConfigurationAfter(Element element, 
SearchConfiguration inherit) {
+        super.readSearchConfiguration(element, inherit);
+
         if (element.hasAttribute("field-filters")) {
             if (element.getAttribute("field-filters").length() == 0) {
                clearFieldFilters();
             }
         }
-        super.readSearchConfigurationAfter(element, inherit);
     }
 
     /** [EMAIL PROTECTED]

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

Reply via email to