Skip to content

Commit

Permalink
Display a more detailed error msg when the metadata view fails
Browse files Browse the repository at this point in the history
  • Loading branch information
laurenwalker committed Sep 11, 2014
1 parent 6690c5b commit a35ccd0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
7 changes: 6 additions & 1 deletion metacatui/src/main/webapp/js/views/MetadataIndexView.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,12 @@ define(['jquery',
$.get(appModel.get('queryServiceUrl') + query, function(data, textStatus, xhr){

if(data.response.numFound == 0){
var msg = "<h4>That ID does not exist.</h4>";
var msg = "<h4>Nothing was found for one of the following reasons:</h4>" +
"<ul class='indent'>" +
"<li>The content was removed because it was invalid or inappropriate.</li>" +
"<li>You do not have permission to view this content.</li>" +
"<li>The ID '" + view.pid + "' does not exist.</li>" +
"</ul>";
view.$el.html(view.alertTemplate({msg: msg, classes: "alert-danger"}));
}
else{
Expand Down
8 changes: 3 additions & 5 deletions metacatui/src/main/webapp/js/views/MetadataView.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ define(['jquery',
// get the pid to render
var pid = appModel.get('pid');

//URL encode the pid
// URL encode the pid
this.encodedPid = encodeURIComponent(pid);

//Check for a view service in this appModel
// Check for a view service in this appModel
if((appModel.get('viewServiceUrl') !== undefined) && (appModel.get('viewServiceUrl'))) var endpoint = appModel.get('viewServiceUrl') + pid + ' #Metadata';

if(endpoint && (endpoint !== undefined)){
Expand All @@ -93,9 +93,7 @@ define(['jquery',

viewRef.insertResourceMapContents(appModel.get('pid'));
if(gmaps) viewRef.insertSpatialCoverageMap();

}

}
});
}
else this.renderMetadataFromIndex();
Expand Down

0 comments on commit a35ccd0

Please sign in to comment.