+ // create a parameters array and pass it to the pz2's constructor
+ // then register the form submit event with the pz2.search function
+ // autoInit is set to true on default
+ that.makePz2 = function() {
+ that.debug("m_queues=" + $.toJSON(m_queues));
+ var params = {
+ "windowid": teamName,
+ "pazpar2path": mkws.pazpar2_url(),
+ "usesessions" : config.use_service_proxy ? false : true,
+ "showtime": 500, //each timer (show, stat, term, bytarget) can be specified this way
+ "termlist": config.facets.join(',')
+ };
+
+ params.oninit = onInit;
+ if (m_queues.targets) {
+ params.onbytarget = onBytarget;
+ that.info("setting bytarget callback");
+ }
+ if (m_queues.stat || m_queues.firstrecords || m_queues.complete) {
+ params.onstat = onStat;
+ that.info("setting stat callback");
+ }
+ if (m_queues.facets && config.facets.length) {
+ params.onterm = onTerm;
+ that.info("setting term callback");
+ }
+ if (m_queues.records) {
+ that.info("setting show callback");
+ params.onshow = onShow;
+ // Record callback is subscribed from records callback
+ that.info("setting record callback");
+ params.onrecord = onRecord;
+ }
+
+ m_paz = new pz2(params);
+ that.info("created main pz2 object");
+ }
+
+