diff --git a/boolean-search/booleansearch.app.js b/boolean-search/booleansearch.app.js index 9aa51b5b..4e3193fc 100644 --- a/boolean-search/booleansearch.app.js +++ b/boolean-search/booleansearch.app.js @@ -109,6 +109,12 @@ var setSourceForFilter; headers[ERMrest.contextHeaderName].column = "Strength"; headers[ERMrest.contextHeaderName].referrer = { schema_table: "Gene_Expression:Specimen" }; headers[ERMrest.contextHeaderName].source = [{ "inbound": ["Gene_Expression", "Specimen_Expression_Specimen_fkey"] }, "Strength"]; + var pcid= UriUtils.getQueryParams($window.location.href).pcid; + var ppid= UriUtils.getQueryParams($window.location.href).ppid; + if(pcid) + headers[ERMrest.contextHeaderName].pcid=pcid + if(ppid) + headers[ERMrest.contextHeaderName].ppid=ppid return server.http.get(specExprUrl + "/Strength", { headers: headers }).then(function success(response) { return response.data; }).catch(function (err) { diff --git a/heatmap/heatmap.js b/heatmap/heatmap.js index ad905b86..048a6a30 100644 --- a/heatmap/heatmap.js +++ b/heatmap/heatmap.js @@ -33,19 +33,22 @@ var heatmapApp = headInjector.setWindowName(); headerInfo.pid = MathUtils.uuid(); headerInfo.cid = "heatmap"; - $rootScope.pid var header = { wid: $window.name, cid: headerInfo.cid, pid: headerInfo.pid, - action: "main", - schema_table: "Gene_Expression:Array_Data_view" + action: "model/read", + schema_table: "Gene_Expression:Array_Data_view", + catalog: UriUtils.getCatalogId() }; - ERMrest.resolve(ermrestURI, {cid: headerInfo.cid, pid: headerInfo.pid, wid: $window.name, action: "model/read"}).then(function getReference(reference) { + ERMrest.resolve(ermrestURI, header).then(function getReference(reference) { verifyConfiguration(reference); if (!$rootScope.configErrorsPresent) { var sortBy = typeof heatmapConfig.data.sortBy !== "undefined" ? heatmapConfig.data.sortBy : []; var ref = reference.sort(sortBy); + header['action']="main"; + header["ppid"]=UriUtils.getQueryParams(location.href).ppid; + header["pcid"]=UriUtils.getQueryParams(location.href).pcid; ref.read(1000, header).then(function getPage(page) { readAll(page); }).catch(function (error) { diff --git a/lineplot/lineplot.app.js b/lineplot/lineplot.app.js index 28c1a71f..9c55f024 100644 --- a/lineplot/lineplot.app.js +++ b/lineplot/lineplot.app.js @@ -55,7 +55,12 @@ uriWithFilters += "&recorded_time::leq::" + UriUtils.fixedEncodeURIComponent(end_x); } var uri = uriWithFilters + "/" + trace.x_col + "," + trace.y_col + "@sort(recorded_time)?limit=" + $rootScope.limit; - server.http.get(uri).then(function(response) { + if($rootScope.params["pcid"]) + contextHeaderParams['pcid']=$rootScope.params["pcid"] + if($rootScope.params["ppid"]) + contextHeaderParams['ppid']=$rootScope.params["ppid"] + + server.http.get(uri, { headers: contextHeaderParams }).then(function(response) { // console.log(response, response.headers('content-type')); var layout = { title: lineplotConfig.plot_title, diff --git a/plot/plot.app.js b/plot/plot.app.js index cd1a1f16..e36400db 100644 --- a/plot/plot.app.js +++ b/plot/plot.app.js @@ -410,8 +410,14 @@ defer.resolve(plot_values);// TODO: figure out how to return an error to catch clause without breaking code return defer.promise; } - - server.http.get(uri).then(function(response) { + var headers = {}; + headers[ERMrest.contextHeaderName]=ConfigUtils.getContextHeaderParams(); + if(UriUtils.getQueryParams($window.location.href).pcid) + headers[ERMrest.contextHeaderName].pcid=UriUtils.getQueryParams($window.location.href).pcid; + if(UriUtils.getQueryParams($window.location.href).ppid) + headers[ERMrest.contextHeaderName].ppid=UriUtils.getQueryParams($window.location.href).ppid; + + server.http.get(uri,{ headers: headers}).then(function(response) { var data = response.data; // transform x data based on groupKey @@ -626,7 +632,14 @@ } else { plot.traces.forEach(function (trace) { var uri = trace.uri; - server.http.get(uri).then(function(response) { + var headers = {}; + headers[ERMrest.contextHeaderName]=ConfigUtils.getContextHeaderParams(); + if(UriUtils.getQueryParams($window.location.href).pcid) + headers[ERMrest.contextHeaderName].pcid=UriUtils.getQueryParams($window.location.href).pcid; + if(UriUtils.getQueryParams($window.location.href).ppid) + headers[ERMrest.contextHeaderName].ppid=UriUtils.getQueryParams($window.location.href).ppid; + + server.http.get(uri,{ headers: headers }).then(function(response) { try { var layout = getPlotlyLayout(plot); var data = response.data; diff --git a/treeview/js/main.js b/treeview/js/main.js index 45c62165..49d03b82 100644 --- a/treeview/js/main.js +++ b/treeview/js/main.js @@ -5,6 +5,8 @@ // console.log($); // console.log(ERMrest); // console.log(Q); + var urlParams=[]; + var urlParamNames=[]; function uuid() { // gets a string of a deterministic length of 4 @@ -14,14 +16,21 @@ return s4() + s4() + s4() + s4() + s4() + s4(); } function getHeader(action, schemaTable, params) { - return ERMrest._certifyContextHeader({ + var header={ wid: window.name, pid: uuid(), cid: "treeview", action: action, schema_table: schemaTable, - params: params - }); + params: params, + } + if(action==="main"){ + if(urlParams['pcid']) + header['pcid']=urlParams['pcid'] + if(urlParams['ppid']) + header['ppid']=urlParams['ppid'] + } + return ERMrest._certifyContextHeader(header); } if (!window.name) { @@ -34,8 +43,8 @@ var showAnnotation, id_parameter, filterUrl, filterValue, columnName, parentAppExists, selected_option; var annotated_term = ""; var annotated_terms = [], - urlParams = {}, // key/values from uri - urlParamNames = [], // keys defined in url + // urlParams = {}, // key/values from uri + // urlParamNames = [], // keys defined in url queryParams = {}, // key/values from uri and defaults in config queryParamNames = [], // keys defined in templating requiredParams = []; // params that are required and are used for identification purposes