Skip to content

Commit

Permalink
Ndvizsupport (#23)
Browse files Browse the repository at this point in the history
* added a point match call to get all point matches that involve a particular tile

* added ndviz support
  • Loading branch information
fcollman authored and trautmane committed Mar 15, 2017
1 parent 68b723e commit 2b69aae
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 6 deletions.
31 changes: 25 additions & 6 deletions render-ws/src/main/webapp/script/janelia-render.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,23 @@ var JaneliaScriptUtilities = function() {
failureCallbackFunction(self.getErrorMessage(data));
};

this.getServicesBaseUrl = function() {
this.getShortRenderHost = function() {
var href = window.location.href;
var hostIndex = href.indexOf(window.location.host);
var stopIndex = href.indexOf('/', hostIndex);

// for localhost debugging:
// return 'http://renderer-dev.int.janelia.org:8080/render-ws/v1';

return href.substring(7, stopIndex);
};

this.getServicesBaseUrl = function() {
var href = window.location.href;
var hostIndex = href.indexOf(window.location.host);
var stopIndex = href.indexOf('/', hostIndex);

// for localhost debugging:
// for localhost debugging:
// return 'http://renderer-dev.int.janelia.org:8080/render-ws/v1';

return href.substring(0, stopIndex) + '/render-ws/v1';
Expand Down Expand Up @@ -189,7 +199,7 @@ var JaneliaRenderServiceData = function(owner, project, stack) {

this.util = new JaneliaScriptUtilities();
this.baseUrl = this.util.getServicesBaseUrl();

this.shortbaseUrl = this.util.getShortRenderHost();
this.ownerList = [];
this.stackMetaDataList = [];
this.projectToStackCountMap = {};
Expand Down Expand Up @@ -362,10 +372,10 @@ var JaneliaMessageUI = function(messageId, summaryMessage) {
var JaneliaRenderServiceDataUI = function(queryParameters, ownerSelectId, projectSelectId, stackSelectId, messageId, urlToViewId) {

this.util = new JaneliaScriptUtilities();

this.shortbaseUrl = this.util.getShortRenderHost();
this.queryParameters = queryParameters;

this.catmaidHost = queryParameters.map['catmaidHost'];
this.ndvizHost = queryParameters.map['ndvizHost'];
this.dynamicRenderHost = queryParameters.map['dynamicRenderHost'];

this.renderServiceData = new JaneliaRenderServiceData(queryParameters.map[ownerSelectId],
Expand Down Expand Up @@ -453,6 +463,9 @@ JaneliaRenderServiceDataUI.prototype.getDynamicRenderBaseUrl = function() {
return baseRenderUrl;
};

JaneliaRenderServiceDataUI.prototype.isNdvizHostDefined = function() {
return typeof this.ndvizHost != 'undefined';
}
JaneliaRenderServiceDataUI.prototype.isCatmaidHostDefined = function() {
return typeof this.catmaidHost != 'undefined';
};
Expand All @@ -466,7 +479,8 @@ JaneliaRenderServiceDataUI.prototype.buildStackQueryParameters = function(owner,
['renderStackProject', project],
['renderStack', stack],
['dynamicRenderHost', this.dynamicRenderHost],
['catmaidHost', this.catmaidHost]
['catmaidHost', this.catmaidHost],
['ndvizHost', this.ndvizHost]
];

var key;
Expand Down Expand Up @@ -559,6 +573,11 @@ JaneliaRenderServiceDataUI.prototype.getStackSummaryHtml = function(ownerUrl, st
'&zp=' + zp + '&yp=' + yp + '&xp=' + xp;
linksHtml = linksHtml + ' <a target="_blank" href="' + CATMAIDUrl + '">CATMAID-alpha</a>';
}
if (this.isNdvizHostDefined()) {
var NDVIZUrl = 'http://' + this.ndvizHost + '/render/' + this.shortbaseUrl + '/' +
stackId.owner + '/' + stackId.project + '/' + stackId.stack + '/';
linksHtml = linksHtml + ' <a target="_blank" href="' + NDVIZUrl + '">NdViz</a>';
}

if (stackInfo.state == 'OFFLINE') {
linksHtml = '';
Expand Down
9 changes: 9 additions & 0 deletions render-ws/src/main/webapp/view/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,15 @@ <h3>Render Web Service Views</h3>
</td>
</tr>

<tr>
<td>
</td>
<td>
<span class="selectSpan">NdViz Host (e.g. 'renderer-ndviz:8000'):</span>
<input id="ndvizHost" title="ndvizHost" type="text" style="width:30em"
onchange="renderWebServiceViews.updateParameter('ndvizHost', this.value)">
</td>
</tr>
<tr style="line-height: 50px">
<td>
</td>
Expand Down

0 comments on commit 2b69aae

Please sign in to comment.