use OpenILS::Application::AppUtils;
use LWP::UserAgent;
+use Data::Dumper;
+
+$Data::Dumper::Indent = 0;
+
my $U = 'OpenILS::Application::AppUtils';
return => {
desc => q/stream of numbers: first number of search results, then
numbers of extracted URLs for each record, grouped into arrays
- of 10/,
+ of 100/,
type => "number"
}
}
$client->respond($pos); # first response: the number of items created
# (number of search results)
- $pos = 0;
- my @url_counts;
-
# For each contain item, extract URLs. Report counts of URLs extracted
- # from each record in batches at every ten records.
+ # from each record in batches at every hundred records. XXX Arbitrary.
+ my @url_counts;
foreach my $item_id (@item_ids) {
my $res = $e->json_query({
from => ["url_verify.extract_urls", $ses_id, $item_id]
}) or return $e->die_event;
- push @url_counts, $res->[0]{extract_urls};
+ push @url_counts, $res->[0]{"url_verify.extract_urls"};
- if (++$pos % 10 == 0) {
- $client->respond(\@url_counts);
+ if (scalar(@url_counts) % 100 == 0) {
+ $client->respond([ @url_counts ]);
@url_counts = ();
}
}
- $client->respond(\@url_counts) if @url_counts;
+ $client->respond([ @url_counts ]) if @url_counts;
$e->disconnect;
return;
/* Reacting to the interface's "Begin" button, this function triggers the
* first of three server-side processes necessary to create a session:
+ *
* 1) create the session itself (API call), */
create_session.begin = function() {
var name = uv_session_name.attr("value");
scope
);
+ if (!create_session.tag_and_subfields.any()) {
+ alert(localeStrings.NEED_UVUS);
+ return;
+ }
+
progress_dialog.attr("title", localeStrings.CREATING);
progress_dialog.show(true);
fieldmapper.standardRequest(
r = openils.Util.readResponse(r);
if (!search_result_count) {
search_result_count = Number(r);
- console.log("search_result_count: " + r);
progress_dialog.show(); /* sic */
progress_dialog.attr(
{"maximum": search_result_count, "progress": 0}
);
} else {
- console.log("r.length: " + r.length);
progress_dialog.update({"progress": r.length})
}
},
"oncomplete": function() {
- progress_dialog.attr("title", "");
- progress_dialog.hide();
- console.warn("XXX TODO redirect to next interface");
+ progress_dialog.attr("title", localeStrings.REDIRECTING);
+ progress_dialog.show(true);
+
+ if (no_url_selection.checked) {
+ location.href = oilsBasePath +
+ "/url_verify/validation_review?" +
+ "session_id=" + create_session.session_id +
+ "&validate=1";
+ } else {
+ location.href = oilsBasePath +
+ "/url_verify/select_urls?session_id=" +
+ create_session.session_id;
+ }
}
}
);
};
/* At least in Dojo 1.3.3 (I know, I know), dijit.form.MultiSelect does
- * not behave like FilteringSelect, like you might thing, and work from a
+ * not behave like FilteringSelect, like you might expect, or work from a
* data store. So we'll use a native <select> control, which will have
- * fewer moving parts to go haywire anyway.
+ * fewer moving parts that can go haywire anyway.
*/
create_session.populate_saved_searches = function(node) {
var list = (new openils.PermaCrud()).retrieveAll(
this.counter++;
};
+ /* return a boolean indicating whether or not we have any rows */
+ this.any = function() {
+ return Boolean(
+ dojo.query(
+ '[id^="t-and-s-row-"]', dojo.byId(this.container_id)
+ ).length
+ );
+ };
+
+ /* Return one uvus object for each unique tag we have a row for,
+ * and use the given session_id for the uvus.session field. */
this.generate_uvus = function(session_id) {
var uniquely_grouped = {};
dojo.query(