Author: sshafroi
Date: 2008-10-29 16:26:25 +0100 (Wed, 29 Oct 2008)
New Revision: 6899
Modified:
trunk/search-command-config-spi/src/main/java/no/sesat/search/mode/SearchModeFactory.java
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/SearchConfiguration.java
Log:
Issue SKER4404: (Automatically assign config settings in
readSearchConfiguration where there is a setter)
Remove old implementation
Modified:
trunk/search-command-config-spi/src/main/java/no/sesat/search/mode/SearchModeFactory.java
===================================================================
---
trunk/search-command-config-spi/src/main/java/no/sesat/search/mode/SearchModeFactory.java
2008-10-29 15:22:45 UTC (rev 6898)
+++
trunk/search-command-config-spi/src/main/java/no/sesat/search/mode/SearchModeFactory.java
2008-10-29 15:26:25 UTC (rev 6899)
@@ -542,12 +542,8 @@
+ element.getAttribute("id") + '(' +
sc.getClass().getSimpleName() + ')'
+ " trying to inherit from " + inherit.getId() + '(' +
inherit.getClass().getSimpleName() + ')';
- if ("old".equals(System.getenv("SearchModeFactory"))) {
- sc = sc.readSearchConfiguration(element, inherit, context);
- }
- else {
- sc.readSearchConfiguration(element, inherit);
- }
+ sc.readSearchConfiguration(element, inherit, context);
+
LOG.info("ParsedSearchConfiguration: " + sc);
return sc;
}
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-10-29 15:22:45 UTC (rev 6898)
+++
trunk/search-command-config-spi/src/main/java/no/sesat/search/mode/config/CommandConfig.java
2008-10-29 15:26:25 UTC (rev 6899)
@@ -300,7 +300,7 @@
fieldFilters.clear();
}
- public SearchConfiguration readSearchConfiguration(final Element element,
final SearchConfiguration inherit) {
+ public SearchConfiguration readSearchConfiguration(final Element element,
final SearchConfiguration inherit, Context context) {
if(null!=inherit){
fieldFilters.putAll(inherit.getFieldFilterMap());
}
@@ -319,50 +319,6 @@
return this;
}
- /** [EMAIL PROTECTED]
- */
- public CommandConfig readSearchConfiguration(
- final Element element,
- final SearchConfiguration inherit,
- final Context context){
-
- setId(element.getAttribute("id"));
-
- AbstractDocumentFactory.fillBeanProperty(this, inherit, "alwaysRun",
ParseType.Boolean, element, "true");
- AbstractDocumentFactory.fillBeanProperty(this, inherit, "runBlank",
ParseType.Boolean, element, "false");
- AbstractDocumentFactory.fillBeanProperty(this, inherit,
"asynchronous", ParseType.Boolean, element, "false");
-
- // field-filters
- if(null!=inherit){
- fieldFilters.putAll(inherit.getFieldFilterMap());
- }
- if (element.hasAttribute("field-filters")) {
- if (element.getAttribute("field-filters").length() > 0) {
-
setFieldFilters(element.getAttribute("field-filters").split(","));
-
- } else {
- // If attribute is present and empty, clear the field filters.
This creates an option
- // for child commands to not inherit field filters.
- clearFieldFilters();
- }
- }
-
- AbstractDocumentFactory.fillBeanProperty(this, inherit,
"queryParameter", ParseType.String, element, "");
-
- // result-fields
- if(null!=inherit){
- resultFields.putAll(inherit.getResultFieldMap());
- }
- if (element.getAttribute("result-fields").length() > 0) {
- addResultFields(element.getAttribute("result-fields").split(","));
- }
-
- AbstractDocumentFactory.fillBeanProperty(this, inherit,
"resultsToReturn", ParseType.Int, element, "-1");
- AbstractDocumentFactory.fillBeanProperty(this, inherit,
"statisticalName", ParseType.String, element, "");
-
- return this;
- }
-
/** Currently only used by the fast subclasses but hopefully open to all
one day. **/
protected final Collection<Navigator> parseNavigators(final Element navsE)
{
Modified:
trunk/search-command-config-spi/src/main/java/no/sesat/search/mode/config/SearchConfiguration.java
===================================================================
---
trunk/search-command-config-spi/src/main/java/no/sesat/search/mode/config/SearchConfiguration.java
2008-10-29 15:22:45 UTC (rev 6898)
+++
trunk/search-command-config-spi/src/main/java/no/sesat/search/mode/config/SearchConfiguration.java
2008-10-29 15:26:25 UTC (rev 6899)
@@ -150,6 +150,7 @@
*
*/
public interface ModesW3cDomDeserialiser extends SearchConfiguration{
+
/**
* Apply the attributes found in element to 'this'. If some attributes
are not found
* in element then try to fetch them from inherit and set them on
'this'.
@@ -159,11 +160,8 @@
*
* @return The newly read configuration (Done to keep the chaining
pattern)
*/
- SearchConfiguration readSearchConfiguration(Element element,
SearchConfiguration inherit);
+ SearchConfiguration readSearchConfiguration(Element element,
SearchConfiguration inherit, Context context);
}
-
- // TODO: remove
- SearchConfiguration readSearchConfiguration(Element element,
SearchConfiguration inherit, Context context);
}
_______________________________________________
Kernel-commits mailing list
[email protected]
http://sesat.no/mailman/listinfo/kernel-commits