Retrieve the set of used columns in a contour app - palantir-foundry

I have a contour application with an input data-set of which I would like to know which columns are being used by the application. Is there a 'defined' way to achieve this? Either trough the application it self, or for example using the REST API.
Tried looking trough the documentation for contour, and the REST API for foundry with no luck so far.

Related

Listing model files in BIM360 through data management API

I have a need to display models stored in BIM360 in the Forge Viewer. For this reason I'd like to list all models that are contained in a project.
I was looking at fetching them using the search API. Is this a reasonable way to do it? I guess the only way to identify model files is to use attributes.fileType in the filter? And then look at the relationships.derivatives data. Or is there some other way to search for models?
Unfortunately, your request is not supported by the Search API currently. With my experience, extracting relationships.derivatives out is the only way manually from the API responses that contain this attribute e.g.
GET projects/:project_id/folders/:folder_id/contents
GET projects/:project_id/items/:item_id/tip
GET projects/:project_id/items/:item_id/versions

A360 viewer: Fetching object properties for web application integration

I am trying to integrate the autodesk a360 viewer into my web application. However, we'll like to extract the object properties of the selected object to fetch additional information from within our database. For example, when user clicks on a door, we wan to extract the tag id of this door from the object properties and perform some sql query with this tag id.
I've seen autodesk forge, but it i m not too sure if it is an overkill or its to direction to go.
Yes, what you want to achieve is absolutely possible within Forge. Actually, there are 2 ways to get the properties for an object. Either from server side(Model Derivate API) or client side(Forge Viewer API), I listed both of them here in case you are interested. But for your case, I think the 2nd way to use Forge Viewer API is more suitable.
1st solution, with Model Derivative API, it provides the following 3 APIs, the 1st API is used to get a list of model view Ids for a design model. Then, you can use the 2nd API to get a hierarchical list of objects for the model view. With the last API, you can get all the properties for the specified object that is represented by guid.
Please check the Model Derivative API for the details about following 3 APIs.
GET :urn/metadata
GET :urn/metadata/:guid
GET :urn/metadata/:guid/properties
2nd Solution is using Forge Viewer API, first, you need to register an event of SELECTION_CHANGED_EVENT, within that event, it’s easy to get dbId of the selected object, and use the API getProperties as follow to fetch all the properties you want, then perform some sql query with this property as you want. The code snippet is as follow, and I have a small sample code to demonstrate the solution if you are interested.
currentModel.getProperties(dbId, function(result) {
console.log("List properties of DbId:" + dbId);
if (result.properties) {
result.properties.forEach(function(prop) {
// call API to perform sql query with the property you are interested
console.log(prop);
});
};
});
Hope it helps.

Is it possible to customize fusion table( should point my database ) to use fusionTableLayer?

I would like to create a Map by the excel sheet values (.csv files too).
By using FusionTableLayer API, I think it is possible. At first step we could upload the excel values to the database. Then we create a map by the database annotated value. It is very good idea. This is what I wanted. But One thing is problem to me with FusionTableLayer API is google's Drive has been pointed for the fusion table. It means that all my business data will be shared with google. I don't want to be like that.
Instead of Google's drive My database has to be pointed out. From my database I would like to create a map with FusionTableLayer API. I have been searching through internet, I dont find this is possible. But I believe that it is possible. Please guile me to specify the way to trigger it out ?
Regards,
ArunRaj.
If you want to use your own database, then you cannot use the Fusion Table API as it's meant for the Google Infrastructure. You will have to find another API to take care of this.
One workaround I can suggest to you is to parse points you have as drawing objects for your map. So for each point, create new google.maps.Marker with the respective coordinates. Each region can be denoted with google.maps.Polygon, and lines with google.maps.Polyline. There's plenty more you can do, but it's just a bit more work, and possibly less secure depending on your implementation. Furthermore, you can also add info windows to each of those areas using the Google Maps API by attaching respective listeners to those objects created.
Hope this helps!

Is there any alternative to GViz on Google Apps Script?

The problems:
I need to get data in a kind of "relational" way.
GViz (Google Visualization API) is not available for GAS (Google Apps Script) HTML Service (see here: Can we use Google Chart Tools with Google Script HtmlService).
Getting all the functinality GViz delivers is a dream right now, so, instead, I'd be satisfied with DataTable and DataView objects and google.visualization.data.join(). I dont need charts right now.
All of this, as long as I cannot get full GViz on the client side, could be server side.
Being more explicit, I need to join some queries and not mess up with the normalized data.
Keep in mind that I'm using a Spreadsheet as a data container (the tables are composed of static and dynamic data).
Getting all the functionality from GViz is everyone's dream right now, but some of it is available through Charts Services in UiApps. I have no experience with HTML Service, so I can't speak for that.
https://developers.google.com/apps-script/service_charts
If you're manipulating a lot of data, have you looked at ScriptDB?
https://developers.google.com/apps-script/service_scriptdb
I currently use a set of spreadsheets and Charts Services for a dashboard and it works pretty well. I really wish I could make combo charts, though.
It looks like sometime between mid-March and now, GViz mostly works with HTML Service.
I'm very new to Google Apps Script myself, but I have managed to get TaffyDB working server side. I loaded it up as a library in case I want to use it across multiple projects.
I did have to add this line to make it work server side:
function setTimeout() {}
Not sure if the is necessarily sufficient, but it worked as a starting point.

When using the Google Places API, what is the difference between "using the JavaScript library" and "calling the API directly"?

I have seen the two forms of reference to the Google Places Library/Service, using JavaScript vs calling the API directly, a number of times, but I don't understand the difference. The Google Docs don't describe anything about two methods of accessing the API.
For example, this question talks about 2 ways of accessing the API: OVER_QUERY_LIMIT in a loop
And it appears that there is some type of direct web access taking place in this question: Querying Google Places API using jQuery
Is this something where there was an old way that involved formatting URL parameters and the new way is by utilizing the JavaScript library calls?
FINAL SUMMARY EDIT: There are two distinct ways of requesting data from Google, as described in #Dan Nissenbaum's answer below. And since my original question, the QUERY_LIMIT question referenced above has been edited to also include more information about the two options.
Perhaps you are referring to the distinction between the Google Places API that is intended for use on the SERVER (i.e., utilizing PHP to call the Google Places API directly), and using the completely different approach of the Google Places Javascript Library in which the BROWSER executes Javascript using the Javascript library provided by Google (that internally wraps calls to the Google Places API, so that you, as a Javascript programmer, only need to understand the Javascript library provided by Google, and use that)?
Here are the two scenarios.
Scenario #1: Use the API directly. For this method, you must refer to Google's API documentation for the Google Places API: https://developers.google.com/maps/documentation/places/.
Using this API works as follows (giving a simple example only). Say you want to retrieve places within 1000 meters of latitude=-27.2531166, longitude=138.8655664. You need to hit a URL as described by the API documentation: https://developers.google.com/maps/documentation/places/#PlaceSearchRequests.
In this example, the URL looks like this (it's long):
https://maps.googleapis.com/maps/api/place/search/json?location=-27.2531166,138.8655664&radius=1000&sensor=false&key=AddYourOwnKeyHere
You need a key for your personal use, which I assume you have. There are other options you can specify, such as limiting the results to restaurants, etc.
When you hit this URL, the data will be returned in either JSON, or XML format, as specified by the text json in the URL above (use the text xml for xml). This data is returned exactly like data is returned from any URL call when you hit a URL in your browser.
You can test this by simply typing the URL directly in your browser, and see the results.
To use the API directly from code, you will need to use code that hits the external URL above within code and retrieves the results within code (for example, using the PHP CURL library, or using AJAX in Javascript).
Scenario #2: You use the Javascript library that Google provides that wraps the API, so you don't need to deal with it. I'll update the answer with more details about this, if you don't know what this is.
The docs do discuss the two different approaches. The Places Library utilizes the Google Places services from within the JavaScript Google Maps API. If you are using the Google Maps API in a browser, this is probably the approach for you:
https://developers.google.com/maps/documentation/javascript/places
There is also a web service, which allows you to query directly from your application. You query it using direct http calls to Google services. If you need access to the data on your server or a mobile device, this is the approach you want to take:
https://developers.google.com/maps/documentation/places