Skip to content

Commit

Permalink
Proper logging support #109
Browse files Browse the repository at this point in the history
  • Loading branch information
DevanshiDesai committed Jun 8, 2021
1 parent b381cb4 commit 58b8e61
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 14 deletions.
16 changes: 9 additions & 7 deletions boolean-search/booleansearch.app.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,23 +78,25 @@ var setSourceForFilter;
})
.value('headerInfo', {
pid: "",
cid: ""
cid: "",
wid: ""
})
.factory('filterOptions', ['$http', '$window', 'ERMrest', 'headInjector', 'MathUtils', 'UriUtils', 'headerInfo', function ($http, $window, ERMrest, headInjector, MathUtils, UriUtils, headerInfo) {
.factory('filterOptions', ['$http', '$window', 'ERMrest', 'headInjector', 'MathUtils', 'UriUtils', 'headerInfo','ConfigUtils', function ($http, $window, ERMrest, headInjector, MathUtils, UriUtils, headerInfo,ConfigUtils) {
var baseUrl = $window.location.origin;
var specExprUrl = baseUrl + "/ermrest/catalog/2/attributegroup/Gene_Expression:Specimen_Expression";
var devStageUrl = baseUrl + "/ermrest/catalog/2/attribute/Vocabulary:Developmental_Stage";
var sourceUrl = baseUrl + "/ermrest/catalog/2/entity/Vocabulary:Anatomy";

// Configuring ERMrestjs service object and http module
var contextHeaderParams = { "cid": "boolean-search" };
console.log(ConfigUtils.getContextHeaderParams())
var contextHeaderParams = ConfigUtils.getContextHeaderParams();
var server = ERMrest.ermrestFactory.getServer(baseUrl + "/ermrest", contextHeaderParams);
headerInfo.pid = MathUtils.uuid();
headerInfo.cid = "boolean-search";
headInjector.setWindowName();
headerInfo.pid = contextHeaderParams.pid;
headerInfo.cid = contextHeaderParams.cid;
headerInfo.wid = contextHeaderParams.wid;
var getHeader = function () {
return {
wid: $window.name,
wid: headerInfo.wid,
cid: headerInfo.cid,
pid: headerInfo.pid,
action: "facet"
Expand Down
2 changes: 2 additions & 0 deletions heatmap/heatmap.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ heatmapApp.controller('HeatmapController', function HeatmapController($scope, $h
}]
};
var url = window.origin + "/chaise/recordset/" + ERMrest.createPath("2", "Gene_Expression", "Array_Data", facet);
console.log(url)
console.log(url + "?pcid=" + headerInfo.cid + "&ppid=" + headerInfo.pid)
window.location = url + "?pcid=" + headerInfo.cid + "&ppid=" + headerInfo.pid;
}
});
Expand Down
3 changes: 2 additions & 1 deletion lineplot/lineplot.app.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
}])
.factory('LineplotUtils', ['AlertsService', 'ConfigUtils', 'dataFormats', 'Session', 'UriUtils', '$rootScope', function (AlertsService, ConfigUtils, dataFormats, Session, UriUtils, $rootScope) {
var ermrestServiceUrl = ConfigUtils.getConfigJSON().ermrestLocation;
var contextHeaderParams = {"cid": "line-plot"};
console.log(ConfigUtils.getContextHeaderParams())
var contextHeaderParams = ConfigUtils.getContextHeaderParams();
var server = ERMrest.ermrestFactory.getServer(ermrestServiceUrl, contextHeaderParams);

return {
Expand Down
5 changes: 2 additions & 3 deletions plot/plot.app.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,8 @@
})
.factory('PlotUtils', ['AlertsService', 'ConfigUtils', 'dataFormats', 'dataParams', 'Errors', 'ErrorService', 'Session', 'UriUtils', '$q', '$rootScope', '$window', function (AlertsService, ConfigUtils, dataFormats, dataParams, Errors, ErrorService, Session, UriUtils, $q, $rootScope, $window) {
var ermrestServiceUrl = ConfigUtils.getConfigJSON().ermrestLocation;
var contextHeaderParams = {"cid": "2d-plot"};
var server = ERMrest.ermrestFactory.getServer(ermrestServiceUrl, contextHeaderParams);

console.log(ConfigUtils.getContextHeaderParams())
var server = ERMrest.ermrestFactory.getServer(ermrestServiceUrl, ConfigUtils.getContextHeaderParams());
function getType(type) {
switch (type) {
case "line":
Expand Down
11 changes: 8 additions & 3 deletions treeview/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
}
return s4() + s4() + s4() + s4() + s4() + s4();
}

function getHeader(action, schemaTable, params) {
return ERMrest._certifyContextHeader({
wid: window.name,
Expand Down Expand Up @@ -558,6 +557,8 @@
function getTreeData(queryConfig) {
var treeHeaders = {};
treeHeaders[ERMrest.contextHeaderName] = getHeader("main", queryConfig.tree_schema_table);
console.log(urlParamNames)
console.log(treeHeaders[ERMrest.contextHeaderName])
$.ajax({
headers: treeHeaders,
dataType: "json",
Expand Down Expand Up @@ -918,10 +919,14 @@
// assuming Parent_App is booleanSearch
s["onClick"] = nodeClickCallback(node);
} else {
var context=JSON.parse(getHeader())
// TODO: this function should be exposed as public in ermrestJS
console.log(ERMrest._fixedEncodeURIComponent(node.dbxref))
templateParams.$node_id = ERMrest._fixedEncodeURIComponent(node.dbxref);
var l = "'" + ERMrest._renderHandlebarsTemplate(treeviewConfig.tree.click_event_callback, templateParams) + "','_blank'";
s["onClick"] = "window.open(" + l + ");";
var l = "'" + ERMrest._renderHandlebarsTemplate(treeviewConfig.tree.click_event_callback, templateParams);
url=l+"?pcid=" + context.cid + "&ppid=" + context.pid+ "','_blank'";
console.log(url)
s["onClick"] = "window.open(" + url + ");";
}
// properties stored under "original" property on jstree_node object
var newNode = {
Expand Down

0 comments on commit 58b8e61

Please sign in to comment.