Index: other-projects/hathitrust/wcsa/extracted-features-solr/trunk/web-portal/INSTALL.sh
===================================================================
--- other-projects/hathitrust/wcsa/extracted-features-solr/trunk/web-portal/INSTALL.sh	(revision 31383)
+++ other-projects/hathitrust/wcsa/extracted-features-solr/trunk/web-portal/INSTALL.sh	(revision 31384)
@@ -2,6 +2,4 @@
 
 /bin/cp *.html *.js *.css ../solr-server-head/solr-webapp/webapp/.
-/bin/cp etc/jetty.xml etc/realm.properties ../solr-server-head/etc/.
 
-/bin/cp WEB-INF/*.xml ../solr-server-head/solr-webapp/webapp/WEB-INF/.
 
Index: other-projects/hathitrust/wcsa/extracted-features-solr/trunk/web-portal/UPDATE-SERVLET.sh
===================================================================
--- other-projects/hathitrust/wcsa/extracted-features-solr/trunk/web-portal/UPDATE-SERVLET.sh	(revision 31384)
+++ other-projects/hathitrust/wcsa/extracted-features-solr/trunk/web-portal/UPDATE-SERVLET.sh	(revision 31384)
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+
+/bin/cp etc/jetty.xml etc/realm.properties ../solr-server-head/etc/.
+
+/bin/cp WEB-INF/*.xml ../solr-server-head/solr-webapp/webapp/WEB-INF/.
+
Index: other-projects/hathitrust/wcsa/extracted-features-solr/trunk/web-portal/index.html
===================================================================
--- other-projects/hathitrust/wcsa/extracted-features-solr/trunk/web-portal/index.html	(revision 31383)
+++ other-projects/hathitrust/wcsa/extracted-features-solr/trunk/web-portal/index.html	(revision 31384)
@@ -2,12 +2,10 @@
 <html><head>
 <meta http-equiv="content-type" content="text/html; charset=windows-1252">
-    <!-- base href="https://analytics.hathitrust.org/" -->    
+
         <title>HTRC Extracted Feature Solr Search</title>
         <link rel="shortcut icon" href="https://analytics.hathitrust.org/assets/images/favicon.ico">
         <meta name="viewport" content="width=device-width, initial-scale=1.0">
-	<!--
-        <meta http-equiv="refresh" content="600">
--->
-            <!-- Bootstrap -->
+
+        <!-- Bootstrap -->
         <link href="HTRC_Mashup--Home_files/bootstrap.css" rel="stylesheet" media="screen">
         <link href="HTRC_Mashup--Home_files/main.css" rel="stylesheet" media="screen">
@@ -15,7 +13,4 @@
         <link href="HTRC_Mashup--Home_files/font-awesome.css" rel="stylesheet">
         <link href="HTRC_Mashup--Home_files/tomorrow.css" rel="stylesheet">
-<!--        
-        <link rel="stylesheet" href="HTRC_Mashup--Home_files/theme.css">
-	-->
 
         <link href="index.css" rel="stylesheet">
@@ -167,14 +162,17 @@
             <div class="col-md-12">
 
-
-
-	      <h2>Prototype Search</h2>
+	      <h2>Paged-based Extracted Feature Search (Prototype)</h2>
 	      <form action="htrc-full-ef/select" id="search-form">
 		<input type="hidden" id="indent" name="indent" value="on"/>
 		<input type="hidden" id="wt" name="wt" value="json"/>
+		<input type="hidden" id="start" name="start" value="0"/>
+		<input type="hidden" id="rows" name="rows" value="25"/>
 		<input type="text"   id="q" name="q" style="width: 600px;"/>
 		<input type="submit" id="search-submit" />
 
-
+		<div id="pos-fieldsets">
+		</div>
+		
+<!--
 		<fieldset>
 		  <legend style="margin-bottom: 5px; padding-top: 15px;">
@@ -265,5 +263,5 @@
 		  </div>
 		</fieldset>
-
+-->
 
 		<fieldset>
@@ -288,4 +286,14 @@
 
 
+            
+    <div class="container">
+      <h4>Admin Resources</h4>
+      <ul>
+	<li><a href="admin.html">HTRC-EF Solr Admin UI (log in)</a></li>
+	<li><a href="luke_lang_mappings.html">Dynamically Generated Language Map (Part-of-Speech, and Other)</a></li>
+	<li><a href="/solr/htrc-full-ef_shard6_replica1/admin/luke">Luke XML on shard</a></li>
+      </ul>
+    </div>
+
 	
         <div class="container">
@@ -296,14 +304,4 @@
         
         <div id="push"></div>
-        
-        
-        
-        
-        
-        <div>
-	  <a href="solr1.ischool.illinois.edu/solr/htrc-full-ef_shard6_replica1/admin/luke">Luke XML on shard</a>
-	</div>
-        
-        
         
         
Index: other-projects/hathitrust/wcsa/extracted-features-solr/trunk/web-portal/index.js
===================================================================
--- other-projects/hathitrust/wcsa/extracted-features-solr/trunk/web-portal/index.js	(revision 31383)
+++ other-projects/hathitrust/wcsa/extracted-features-solr/trunk/web-portal/index.js	(revision 31384)
@@ -1,4 +1,5 @@
 
-var langs_with_pos =["da","de","en","nl","pt"];
+//var langs_with_pos =["da","de","en","nl","pt"];
+var langs_with_pos =["en","de","pt","da","nl"];
 var langs_without_pos =["af","ar","bg","bn","cs","el","es","et","fa","fi","fr","he","hi","hr","hu","id","it","ja","kn","ko","lt","lv","mk","ml","mr","ne","no","pa","pl","ro","ru","sk","sl","so","sq","sv","sw","ta","te","th","tl","tr","uk","ur","vi","zh-cn","zh-tw"];
 
@@ -93,13 +94,164 @@
 }
 
-$(function() {
-    $('#en-enabled').click(lang_pos_toggle);
-    $('#de-enabled').click(lang_pos_toggle);
-    $('#de-pos-choice *').prop('disabled',true);
-
+function submit_action(event)
+{
+    event.preventDefault();
+
+    var action = $('#search-form').attr("action");
+    
+    var arg_indent = $('#indent').attr('value');
+    var arg_wt     = $('#wt').attr('value');
+    var arg_start  = $('#start').attr('value');
+    var arg_rows   = $('#rows').attr('value');
+    var q_text     = $('#q').val();
+    
+    if (q_text === "") {
+	alert("No query term entered");
+	return;
+    }
+    
+    var fields = [];
+    //var langs_with_pos = [ "da", "de", "en", "nl", "pt", "se" ];
+    var universal_pos_tags = [ "VERB", "NOUN", "ADJ", "ADV", "ADP", "CONJ", "DET", "NUM", "PRT", "X" ];
+    
+    for (var li=0; li<langs_with_pos.length; li++) {
+	var lang = langs_with_pos[li];
+	var lang_enabled_id = lang + "-enabled";
+	var $lang_enabled_cb = $('#'+lang_enabled_id);
+	if ($lang_enabled_cb.is(':checked')) {
+	    console.log("Extracting POS tags for: " + lang);
+	    
+	    for (var ti=0; ti<universal_pos_tags.length; ti++) {
+		var tag = universal_pos_tags[ti];
+		var lang_tag_id = lang+"-"+tag+"-htrctoken-cb";
+		var $lang_tag_cb = $('#'+lang_tag_id);
+		if ($lang_tag_cb.is(':checked')) {
+		    var lang_tag_field = "xxxx"+lang+"_"+tag+"_htrctoken";
+		    fields.push(lang_tag_field+":"+q_text);
+		}
+	    }
+	}
+    }
+
+    for (var li=0; li<langs_without_pos.length; li++) {
+	var lang = langs_without_pos[li];
+	var lang_enabled_id = lang + "-enabled";
+	var $lang_enabled_cb = $('#'+lang_enabled_id);
+
+	if ($lang_enabled_cb.is(':checked')) {
+	    console.log("Adding in non-POS field for: " + lang);
+	    var lang_tag_field = "xxxx"+lang+"_htrctoken";
+	    fields.push(lang_tag_field+":"+q_text);	    
+	}
+    }
+
+    if (fields.length == 0) {
+	alert("No languages selected");
+	return;
+    }
+    
+    var arg_q = fields.join(" OR ");
+    
+    
+    // Example search on one of the htrc-full-ef fields is: 
+    //  q=xxxxen_NOUN_htrctoken:farming
+    
+    var args = { q: arg_q, indent: arg_indent, wt: arg_wt, start: arg_start, rows: arg_rows };
+    
+    $.ajax({
+	type: 'GET',
+	url: action,
+	data: args,
+	dataType: 'json',
+	success: show_results,
+	error: ajax_error
+    });
+
+}
+
+function generate_pos_langs()
+{
+    var pos_checkbox = [
+	{ pos:"VERB", label:"Verbs",       tooltip:"Verbs (all tenses and modes)" },
+	{ pos:"NOUN", label:"Nouns",       tooltip:"Nouns (common and proper)" },
+	{ pos:"ADJ",  label:"Adjectives",  tooltip: null }, 
+	{ pos:"ADV",  label:"Adverbs",     tooltip: null },
+	{ pos:"ADP",  label:"Adpositions", tooltip:"Adpositions (prepositions and postpositions)" },
+	{ pos:"CONJ", label:"Conjunctions",tooltip: null },
+	{ pos:"DET",  label:"Determiners", tooltip: null },
+	{ pos:"NUM",  label:"Numbers",     tooltip:"Cardinal numbers" },
+	{ pos:"PRT",  label:"Particles",   tooltip:"Particles or other function words" },
+	{ pos:"X",    label:"Other",       tooltip:"Other words, such as foreign words, typos, abbreviations"}
+    ];
+
+    var $pos_fieldsets = $('#pos-fieldsets');
+    
+    for (var li=0; li<langs_with_pos.length; li++) {
+
+	var l = langs_with_pos[li];
+	var lang_full = isoLangs[l].name;
+	var lang_native_full = isoLangs[l].nativeName;
+	var opt_title = (lang_full !== lang_native_full) ? 'title="'+lang_native_full+'"' : "";
+
+	var opt_enabled = (l == "en") ? 'checked="checked"' : "";
+	
+	var legend = "";
+	legend += '    <legend style="margin-bottom: 5px; padding-top: 15px;">\n';
+	legend += '      <input type="checkbox" name="'+l+'-enabled" id="'+l+'-enabled" ' + opt_enabled +'/>\n';
+	legend += '      <span ' + opt_title + '>'+lang_full+':</span>\n';
+	legend += '    </legend>\n';
+	
+
+	var check_box_list = [];
+	    
+	for (var pi=0; pi<pos_checkbox.length; pi++) {
+	    var pos_info = pos_checkbox[pi];
+	    var pos = pos_info.pos;
+	    var label = pos_info.label;
+	    var tooltip = pos_info.tooltip;
+	    var opt_tooltip = (tooltip != null) ? 'title="'+tooltip+'"' : "";
+	    
+	    var check_box = "";
+	    check_box += '    <input type="checkbox" name="'+l+'-'+pos+'-htrctoken-cb" id="'+l+'-'+pos+'-htrctoken-cb" checked="checked" />\n';
+	    check_box += '    <label for="'+l+'-'+pos+'-htrctoken-cb" '+opt_tooltip+'>'+label+'</label>\n';
+
+	    check_box_list.push(check_box);
+	}
+	
+	var fieldset = "";
+	fieldset += '<fieldset>\n';
+	fieldset += legend;
+	fieldset += '  <div id="'+l+'-pos-choice">\n';
+
+	var check_box_join = check_box_list.join('&nbsp;');
+	fieldset += check_box_join;
+	
+	fieldset += '  </div>\n';
+	fieldset += '</fieldset>\n';
+	
+	$pos_fieldsets.append(fieldset);
+	$('#'+l+'-enabled').click(lang_pos_toggle);
+
+	if (l == "en") {
+	    $('#en-pos-choice *').prop('disabled',false);
+	}
+	else {
+	    $('#'+l+'-pos-choice *').prop('disabled',true);
+	}
+    }
+
+
+    //$('#en-enabled').click(lang_pos_toggle);
+    //$('#de-enabled').click(lang_pos_toggle);
+    //$('#de-pos-choice *').prop('disabled',true);
+}
+
+function generate_other_langs()
+{
     // setup other languages
     // for each 'langs_without_pos' generate HTML of the form:
     //    <input type="checkbox" name="fr-enabled" id="fr-enabled" />French
     var $other_langs = $('#other-langs');
+
     for (var i=0; i<langs_without_pos.length; i++) {
 	var lang = langs_without_pos[i];
@@ -122,51 +274,12 @@
 	
     }
-	
-
-    
-    $('#search-submit').click(function(event) {
-	event.preventDefault();
-
-	var action = $('#search-form').attr("action");
-
-	var arg_indent = $('#indent').attr('value');
-	var arg_wt = $('#wt').attr('value');
-	var q_text = $('#q').val();
-
-	var fields = [];
-	var langs_with_pos = [ "da", "de", "en", "nl", "pt", "se" ];
-	var universal_pos_tags = [ "VERB", "NOUN", "ADJ", "ADV", "ADP", "CONJ", "DET", "NUM", "PRT", "X" ];
-
-	for (var l=0; l<langs_with_pos.length; l++) {
-	    var lang = langs_with_pos[l];
-	    for (var t=0; t<universal_pos_tags.length; t++) {
-		var tag = universal_pos_tags[t];
-		var lang_tag_id = lang+"-"+tag+"-htrctoken-cb";
-		var $lang_tag_cb = $('#'+lang_tag_id);
-		if ($lang_tag_cb.is(':checked')) {
-		    var lang_tag_field = "xxxx"+lang+"_"+tag+"_htrctoken";
-		fields.push(lang_tag_field+":"+q_text);
-		}
-	    }
-	}
-	
-	var arg_q = fields.join(" OR ");
-
-
-	// Example search on one of the htrc-full-ef fields is: 
-	//  q=xxxxen_NOUN_htrctoken:farming
-
-	var args = { q: arg_q, indent: arg_indent, wt: arg_wt };
-
-	$.ajax({
-	    type: 'GET',
-	    url: action,
-	    data: args,
-	    dataType: 'json',
-	    success: show_results,
-	    error: ajax_error
-	});
-
-    });
+}
+
+$(function() {
+    generate_pos_langs();
+
+    generate_other_langs();
+    
+    $('#search-submit').click(submit_action);
 
 });
