javascript/web/Matrix.js
function TermInfoStage(term_accs){

    // Ready logging.
    var logger = new bbop.logger();
    logger.DEBUG = true;
    function ll(str){ logger.kvetch('JSM01: ' + str); }
    ll('TermInfoStage start...');

    // Prep the progress bar and hide the order selector until we're
    // done.
    jQuery("#progress-text").empty();
    jQuery("#progress-text").append('<b>Loading...</b>');
    //jQuery("#progress-bar").empty();
    jQuery("#progress-widget").show();
    jQuery("#order-selector").hide();

    // Now, cycle though all of the terms to collect info on.
    ll('Gathering batch functions for term info...');
    var run_funs = [];
    var term_user_order = {};
    us.each(term_accs, function(r, r_i){

	// Remember the incoming order.
	term_user_order[r] = r_i;

	// Create runner function.
	run_funs.push(function(){

	    // Manager settings.
	    var go = _new_manager();
	    go.set_personality('ontology');
	    
    	    // Set the next query and go.
    	    go.set_id(r);
    	    return go.search();
	});
    });

    var term_info = {};
    // Fetch the data and grab the number we want.
    var accumulator_fun = function(resp){

	// Who was this?
	var qval = resp.parameter('q');
	var two_part = bbop.first_split(':', qval);
	var acc = bbop.dequote(two_part[1]);
	ll(' Looking at info for: ' + acc);
	term_info[acc] = {
	    id : acc,
	    name: acc,
	    source : 'n/a',
	    index : term_user_order[acc]
	};

	// Dig out names and the like.
	var doc = resp.get_doc(0);
	if( doc ){
	    term_info[acc]['name'] = doc['annotation_class_label'];
	    term_info[acc]['source'] = doc['source'];
	}

    };

    // The final function is the data renderer.
    var final_fun = function(){
	ll('Starting final in TermInfoStage...');
	ll(' term_info: ' + bbop.dump(term_info));
	TermDataStage(term_info, term_accs);
	ll('Completed TermInfoStage!');
    };

    // Create and run coordinating manager.
    var manager = _new_manager();
    manager.run_promise_functions(
	run_funs,
	accumulator_fun,
	final_fun,
	function(err){
	    alert(err.toString());
	});
}
function TermInfoStage(term_accs){

    // Ready logging.
    var logger = new bbop.logger();
    logger.DEBUG = true;
    function ll(str){ logger.kvetch('JSM01: ' + str); }
    ll('TermInfoStage start...');

    // Prep the progress bar and hide the order selector until we're
    // done.
    jQuery("#progress-text").empty();
    jQuery("#progress-text").append('<b>Loading...</b>');
    //jQuery("#progress-bar").empty();
    jQuery("#progress-widget").show();
    jQuery("#order-selector").hide();

    // Now, cycle though all of the terms to collect info on.
    ll('Gathering batch functions for term info...');
    var run_funs = [];
    var term_user_order = {};
    us.each(term_accs, function(r, r_i){

	// Remember the incoming order.
	term_user_order[r] = r_i;

	// Create runner function.
	run_funs.push(function(){

	    // Manager settings.
	    var go = _new_manager();
	    go.set_personality('ontology');
	    
    	    // Set the next query and go.
    	    go.set_id(r);
    	    return go.search();
	});
    });

    var term_info = {};
    // Fetch the data and grab the number we want.
    var accumulator_fun = function(resp){

	// Who was this?
	var qval = resp.parameter('q');
	var two_part = bbop.first_split(':', qval);
	var acc = bbop.dequote(two_part[1]);
	ll(' Looking at info for: ' + acc);
	term_info[acc] = {
	    id : acc,
	    name: acc,
	    source : 'n/a',
	    index : term_user_order[acc]
	};

	// Dig out names and the like.
	var doc = resp.get_doc(0);
	if( doc ){
	    term_info[acc]['name'] = doc['annotation_class_label'];
	    term_info[acc]['source'] = doc['source'];
	}

    };

    // The final function is the data renderer.
    var final_fun = function(){
	ll('Starting final in TermInfoStage...');
	ll(' term_info: ' + bbop.dump(term_info));
	TermDataStage(term_info, term_accs);
	ll('Completed TermInfoStage!');
    };

    // Create and run coordinating manager.
    var manager = _new_manager();
    manager.run_promise_functions(
	run_funs,
	accumulator_fun,
	final_fun,
	function(err){
	    alert(err.toString());
	});
}
function TermInfoStage ( term_accs ) { // Ready logging. var logger = new bbop . logger ( ) ; logger . DEBUG = true ; function ll ( str ) { logger . kvetch ( 'JSM01: ' + str ) ; } ll ( 'TermInfoStage start...' ) ; // Prep the progress bar and hide the order selector until we're // done. jQuery ( "#progress-text" ) . empty ( ) ; jQuery ( "#progress-text" ) . append ( '<b>Loading...</b>' ) ; //jQuery("#progress-bar").empty(); jQuery ( "#progress-widget" ) . show ( ) ; jQuery ( "#order-selector" ) . hide ( ) ; // Now, cycle though all of the terms to collect info on. ll ( 'Gathering batch functions for term info...' ) ; var run_funs = [ ] ; var term_user_order = { } ; us . each ( term_accs , function ( r , r_i ) { // Remember the incoming order. term_user_order [ r ] = r_i ; // Create runner function. run_funs . push ( function ( ) { // Manager settings. var go = _new_manager ( ) ; go . set_personality ( 'ontology' ) ; // Set the next query and go. go . set_id ( r ) ; return go . search ( ) ; } ) ; } ) ; var term_info = { } ; // Fetch the data and grab the number we want. var accumulator_fun = function ( resp ) { // Who was this? var qval = resp . parameter ( 'q' ) ; var two_part = bbop . first_split ( ':' , qval ) ; var acc = bbop . dequote ( two_part [ 1 ] ) ; ll ( ' Looking at info for: ' + acc ) ; term_info [ acc ] = { id : acc , name : acc , source : 'n/a' , index : term_user_order [ acc ] } ; // Dig out names and the like. var doc = resp . get_doc ( 0 ) ; if ( doc ) { term_info [ acc ] [ 'name' ] = doc [ 'annotation_class_label' ] ; term_info [ acc ] [ 'source' ] = doc [ 'source' ] ; } } ; // The final function is the data renderer. var final_fun = function ( ) { ll ( 'Starting final in TermInfoStage...' ) ; ll ( ' term_info: ' + bbop . dump ( term_info ) ) ; TermDataStage ( term_info , term_accs ) ; ll ( 'Completed TermInfoStage!' ) ; } ; // Create and run coordinating manager. var manager = _new_manager ( ) ; manager . run_promise_functions ( run_funs , accumulator_fun , final_fun , function ( err ) { alert ( err . toString ( ) ) ; } ) ; }
Get the information for the incoming terms, launch stage 02.
Get the information for the incoming terms launch stage 02 .