Skip to content

Commit

Permalink
Get node capabilities from MN if standalone repo
Browse files Browse the repository at this point in the history
Issue #1817
  • Loading branch information
gothub committed Oct 19, 2021
1 parent 8bcd6ef commit bce99c6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/js/models/AppModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,13 @@ define(['jquery', 'underscore', 'backbone'],
*/
nodeServiceUrl: null,
/**
* The URL for the DataONE listNodes() API. This URL is contructed dynamically when the
* AppModel is initialized. Only override this if you are an advanced user and have a reason to!
* (see https://releases.dataone.org/online/api-documentation-v2.0/apis/CN_APIs.html#CNCore.listNodes)
* @type {string}
*/
getCapabilitiesServiceUrl: null,
/**
* The URL for the DataONE View API. This URL is contructed dynamically when the
* AppModel is initialized. Only override this if you are an advanced user and have a reason to!
* (see https://releases.dataone.org/online/api-documentation-v2.0/apis/MN_APIs.html#module-MNView)
Expand Down Expand Up @@ -1950,6 +1957,7 @@ define(['jquery', 'underscore', 'backbone'],
urls.queryServiceUrl = baseUrl + '/query/solr/?';
urls.metaServiceUrl = baseUrl + '/meta/';
urls.packageServiceUrl = baseUrl + '/packages/application%2Fbagit-097/';
urls.getCapabilitiesServiceUrl = baseUrl + '/';

if( d1Service.indexOf("mn") > 0 ){
urls.objectServiceUrl = baseUrl + '/object/';
Expand Down
7 changes: 6 additions & 1 deletion src/js/models/NodeModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ define(['jquery', 'underscore', 'backbone'],
if(MetacatUI.appModel.get('nodeServiceUrl')){
//Get the node information from the CN
this.getNodeInfo();
}
} else if(MetacatUI.appModeel.get('getCapabilitiesServiceUrl')) {

This comment has been minimized.

Copy link
@laurenwalker

laurenwalker Oct 19, 2021

Member

FYI there is a typo here

// If the CN node service URL is not defined, see if we can get getCapabilities
// information from the node directly
this.getCapabilities();
}
},

getMember: function(memberInfo){
Expand Down Expand Up @@ -77,6 +81,7 @@ define(['jquery', 'underscore', 'backbone'],
dataType: "text",
success: function(data, textStatus, xhr) {

/
var xmlResponse = $.parseXML(data) || null;
if(!xmlResponse) return;

Expand Down

0 comments on commit bce99c6

Please sign in to comment.