manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1558024 - /manifoldcf/branches/CONNECTORS-840-2/connectors/solr/connector/src/main/java/org/apache/manifoldcf/agents/output/solr/SolrConnector.java
Date Tue, 14 Jan 2014 13:00:48 GMT
Author: kwright
Date: Tue Jan 14 13:00:48 2014
New Revision: 1558024

URL: http://svn.apache.org/r1558024
Log:
Fix UI defaults for backwards compatibility

Modified:
    manifoldcf/branches/CONNECTORS-840-2/connectors/solr/connector/src/main/java/org/apache/manifoldcf/agents/output/solr/SolrConnector.java

Modified: manifoldcf/branches/CONNECTORS-840-2/connectors/solr/connector/src/main/java/org/apache/manifoldcf/agents/output/solr/SolrConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-840-2/connectors/solr/connector/src/main/java/org/apache/manifoldcf/agents/output/solr/SolrConnector.java?rev=1558024&r1=1558023&r2=1558024&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-840-2/connectors/solr/connector/src/main/java/org/apache/manifoldcf/agents/output/solr/SolrConnector.java
(original)
+++ manifoldcf/branches/CONNECTORS-840-2/connectors/solr/connector/src/main/java/org/apache/manifoldcf/agents/output/solr/SolrConnector.java
Tue Jan 14 13:00:48 2014
@@ -2330,7 +2330,7 @@ public class SolrConnector extends org.a
 
       int fieldCounter = 0;
       i = 0;
-      SpecificationNode keepMetadata = null;
+      boolean keepMetadata = true;
       while (i < os.getChildCount()) {
         SpecificationNode sn = os.getChild(i++);
         if (sn.getType().equals(SolrConfig.NODE_FIELDMAP)) {
@@ -2368,7 +2368,7 @@ public class SolrConnector extends org.a
           fieldCounter++;
         }
         else if(sn.getType().equals(SolrConfig.NODE_KEEPMETADATA)) {
-            keepMetadata = sn;
+          keepMetadata = Boolean.parseBoolean(sn.getAttributeValue(SolrConfig.ATTRIBUTE_VALUE));
         }
       }
       
@@ -2379,11 +2379,12 @@ public class SolrConnector extends org.a
         );
       }
       
-      String keepMetadataValue = "";
-      if(keepMetadata != null) {
-          keepMetadataValue = keepMetadata.getAttributeValue(SolrConfig.ATTRIBUTE_VALUE);
-          keepMetadataValue = !keepMetadataValue.isEmpty() && keepMetadataValue !=
null && keepMetadataValue.equals("true") ? "checked" : "";
-      }
+      String keepMetadataValue;
+      if (keepMetadata)
+        keepMetadataValue = "checked";
+      else
+        keepMetadataValue = "";
+
       out.print(
 "        <tr class=\"formrow\"><td class=\"formseparator\" colspan=\"3\"><hr/></td></tr>\n"+
 "        <tr class=\"formrow\">\n"+
@@ -2401,18 +2402,16 @@ public class SolrConnector extends org.a
 "            <nobr><input type=\"text\" size=\"15\" name=\"solr_fieldmapping_target\"
value=\"\"/></nobr>\n"+
 "          </td>\n"+
 "        </tr>\n"+
-"        <tr class=\"formrow\">\n"+
-"          <td class=\"formcolumncell\">\n"+
-"              <input type=\"checkbox\" "+keepMetadataValue+" name=\"solr_keepallmetadata\"
value=\"true\" />\n"+
-"          </td>\n"+
-"          <td class=\"formcolumncell\">\n"+
-              Messages.getAttributeString(locale,"SolrConnector.KeepAllMetadata")+
-"          </td>\n"+
-"          <td class=\"formcolumncell\">\n</td>\n"+
-"        </tr>\n"+
 "      </table>\n"+
 "    </td>\n"+
 "  </tr>\n"+
+"  <tr><td class=\"separator\" colspan=\"2\"><hr/></td></tr>\n"+
+"  <tr>\n"+
+"    <td class=\"description\">\n"+Messages.getBodyString(locale,"SolrConnector.KeepAllMetadata")+"</td>\n"+
+"    <td class=\"value\">\n"+
+"       <input type=\"checkbox\" "+keepMetadataValue+" name=\"solr_keepallmetadata\" value=\"true\"
/>\n"+
+"    </td>\n"+
+"  </tr>\n"+
 "</table>\n"
       );
     }



Mime
View raw message