ambari-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Sposetti <j...@hortonworks.com>
Subject Re: Ambari Views Client-Server Interaction Preference
Date Tue, 17 Feb 2015 13:47:22 GMT
Hi,

Take a look at this example. In this case, it builds the path in the index.html page (doesn't
use dot-dots but uses absolute paths)

https://github.com/apache/ambari/blob/trunk/ambari-views/examples/simple-view/src/main/resources/ui/index.html

Best not to hardcode the instance name.

Jeff

From: "John.Bork" <John.Bork@target.com<mailto:John.Bork@target.com>>
Reply-To: "user@ambari.apache.org<mailto:user@ambari.apache.org>" <user@ambari.apache.org<mailto:user@ambari.apache.org>>
Date: Monday, February 16, 2015 at 5:13 PM
To: "user@ambari.apache.org<mailto:user@ambari.apache.org>" <user@ambari.apache.org<mailto:user@ambari.apache.org>>
Subject: Ambari Views Client-Server Interaction Preference

Hi I was wondering if is it preferred for an index.html of an Ambari View to make dynamic
calls to an Ambari View Instance via a hard coded relative path, or to generate the relative
path for the index? For example, an Ambari View I am working on loads a index.html for the
view and the user can instantiate AJAX calls to the Ambari View API from the index.html. Currently
the AJAX call uses a relative path that consists of "../<more dot dot slashes>/api/v1/rest/of/path"
embedded in the index.html. Would it be better to build this path from the Java class method
in the Ambari View Server instead of having it embedded in the index.html?


John Bork




Mime
View raw message