Google Fusion Table Javascript UPDATE Query? - javascript

I have looked everywhere for a way to update a Google Fusion table using an UPDATE query from a javascript. All I need to do is update one column with an array that is generated from the code itself, after the fusion table information is read and processed. I do not need the user to update the table.
Is there a way to do this using Javascript alone? Or do I really need a combination of OAuth 2.0 and php? Is there a working example of this? All I find is extremely vague or fragmentary.
Thank you.

Yes you need OAuth 2.0 and some kind of server-side code (like PHP). If you don't need the user to update the table, I guess that you are using Fusion Tables as some kind of central database for your application.
For this purpose (i.e. without the user being involved), Google provides so called Service Accounts. If you use such a service account, you can simply give access to your table to this account and then you are able to update the table via server-side code. The PHP OAuth library from Google supports service accounts and is quite easy to use.
If you want to use as much JavaScript code as possible you could provide an interface to the PHP OAuth library to your JavaScript code (see my answer to a similar question for more details). Otherwise just defer the UPDATE statement to the PHP code and you're fine.

Related

Store data accessible to and editable for all users in JavaScript

Is this possible to do:
Create a (web) database where you can add data from a website either by writing to a file or another method.
Allow another user on the website to access this by reading from a file or another method.
If it is, I would like some information or code.
I Do not want to create an independent database because:
a) I just started learning html5 and javascript
b) I do not know how, or have the resources to (I think, I'm just a user on a shared system without sudo access)
OR
Would I have to use something like firebase: (https://www.firebase.com/docs/web/quickstart.html)?
If you have a Database , why would you need to write to a "file"?
What you really want is to create an application with a database. So search for tutorials, because there are hundreds available from google, in all web oriented languages you can imagine.
Or maybe you are looking for something like this?
IndexedDB API
IndexedDB is a transactional database system, like an SQL-based RDBMS. However, unlike SQL-based RDBMSes, which use fixed-column tables, IndexedDB is a JavaScript-based object-oriented database.

How do you make a single-page-application (SPA) searchable from SharePoint?

We are working on a single-page-application (SPA) developed in ASP.NET MVC using knouckout and a wealth of other libraries. Routing will be done in front-end, maybe we will use crossroads.js. A lot of information is presented in virtual grids using slickgrid.js. All data is fetched from backend using AJAX.
Now, if you want to crawl and index such a site from SharePoint, how would you go about that? If you just load the main page with no javascript, it is almost empty.
Update
After more investigation into this issue, I have concluded that there are at least two possible solutions to this kind of problem.
Possible solution 1: Render HTML
This approach would involve detecting that a SP crawler is crawling your site, and then return static HTML pages for the crawler. PhantomJS could possibly be used for this. There are however several uncertain aspects to this solution, and I suspect that it would involve a lot of work.
Possible solution 2: Import data into SharePoint
As so clearly described by Josh below, you could import the data that you want crawlable into SharePoint. Then SharePoint can be configured to crawl the data, and the data is not Javascript dependant anymore as it is inside SharePoint. I think this is the best and easiest solution and will mark Josh answer as the accepted answer.
While I see that this question is getting a lot of close requests, I did run across this very question on a previous project. Sharepoint won't be able to index the page that data is manipulated on via your SPA, but inside SP, you can connect external data sources into the search service, thus exposing the data inside the SPA. You would then write custom search results tied to the content type of the data exposed in order to make the results a bit more friendly than just a data row. You might create an entry point in your SPA that can take in a URL with a parameter so you can send the user from the search results to the SPA in one shot.
There are a lot of interconnected concepts to this solution, so I'd suggest looking into connecting external data sources and adding them to the crawled index of SP. Then, create a content type out of the exposed objects. And finally, add a custom search result template for the content type. MSDN will be your friend on this and so will your SP administrator.

Summarizing data using an MVC application

I am looking for either an existing framework or software that would allow us to summarize our large MySQL database and allow us to present the information in the form of charts or tables.
I have looked online and found a few that are standalone web services, however for our purposes we would need it to be embedded without our existing web app and able to run either on the front end or on our server.
we would also be able to make use of any existing framework(c#) for data aggregation as we could implement them in c# on our server and display the information using JavaScript. We are trying to avoid implementing our own version due to time constraints so any pre-made method would be preferable.
I know this is a fairly vague question but we are just looking for some suggestions as the topic of web based data analysis doesn't seem to return many useful options for us.

Dynamic handling of mongodb data

My requirement is to generate charts using fusion charts.
I'm supposed to provide data to fusion charts from MongoDB which is a no SQL database.
MongoDB stores data into collections which is in the json format.and fusion charts accepts the data either in json format or in Xml format.
how should i provide the data to the fusion charts?
Currently I have written a java class to read the collection and put it into the .json file and I am passing this json file to the fusion charts(ie. a program written in html embedded with javascript)separately.I am stuck with the issue that how to call a java function from javascript?
Hence is there any other better alternative for this ??
Well, it isn't an easy task. You must make a Java Web Application with a Servlet, REST service or whatever you want. Then you must deploy the application in an application server like Tomcat or JBoss, so your HTML+Javascript application is able to do request to your Java service.
You can't call a standalone Java class from an HTML+Javascript page.
I think you're trying to do something that you don't know anything about... and must read a lot about the subject.
how should i provide the data to the fusion charts?
FusionCharts has specific data formats for different charts. So if you have got the data from your MongoDB you need to parse and create FusionCharts compatible JSON data. So any JSON data wont work.
I hope I am wrong in assuming that, you have already done so. Otherwise you really need to learn a lot about simple things about reading the basics of any library, you intend to work.

Is it possible to retrieve data from parse.com using objective-c and show it in website?

I have an iOS app in which I use parse.com as backend service. Now, I hired someone to do a website interface using HTML and CSS. I want to share the same data between iOS app and website, I know parse.com offers me a few ways to do this, including creating a javaScriptapplication. The problem is, my programmer doesn't have any experience in JavaScript, nor do I.
My question is: Is it possible to use what I have (objective-c, xcode) as far as retrieving data from parse.com and showing on website? Even if I need to code something new, is it possible to use objective-c together with HTML and CSS?
Thanks.
Parse has several APIs, one of which is REST. Your web developer should use the REST API to get data from Parse
https://www.parse.com/docs/rest
If there is will there is way, but you'll be making something really specific to your use and will be non standard and will be immediately hard to maintain, I recommend that you hire another developer and do things properly using the technologies given to you by parse !. if the cost will be high now I can promise you it'll be much higher if you went the path you're going to now.
So my answer is:
Yes, everything is possible and no, don't do it ! :)
Edit: Added an example to a possible way to do it to actually answer OP's question.
Example case:
1-Create a simple Mac Application in Xcode that fetches data exactly like you do it on iOS, and store the needed data into a database of your choice on your server
2-You now have access to the data you needed from parse, but on a local mirror. you will need some tool to fetch that data though, I recommend a simple PHP script.
Note that this will require an OSX server to always be running to fetch that data, you'll also need of find a way to fetch data on demand when a user needs it Vs. polling at specified intervals, this will hardly scale and will be costly as I said.

Categories

Resources