I'm hoping to get your thoughts on the following topic. I'm using echarts on my application to display charts. All has been going good with it, but I have stumbled on the situation where I need to render a chart on the server-side.
Echarts have posted a few examples here: https://echarts.apache.org/en/tutorial.html#Server-side%20Rendering. The server I'm developing on doesn't have the likes of nodejs installed and I don't imagine it will be available.
Basically, I'm asking have you implemented rendering echarts on the server with lucee/coldfusion? Which headless tool have you used to do so?
Would something like CFSelenium achieve this? https://github.com/teamcfadvance/CFSelenium
Thanks for any stories or examples you can share!
I ended up installing NodeJs on my server and did the server side rendering that way. I called node with Shell script which was called with cfexecute.
Related
I am trying to create a web app that allows the user to browse a noSQL (Preferably MongoDB) database and perform some queries using a graphical interface. All the queries are written in the code and the user only needs to click links and/or enter strings (mostly to search for matches to be displayed in properly formatted tables). The app follows MVC model.
Up until now I used to write similar desktop apps using Java and JavaFX. I have no experience with other languages or frameworks (Aside from C and SDL), neither have I ever deployed anything on a server, and the assignment should be completed within 6 weeks (Three other students are working with me). And I have the three following questions:
Which language/framework is easiest to learn (considering I/we know Java/JavaFX)?
The answer to that would most probably be JavaScript*, which takes me to the next question:Is there any (practical) way that I would make it possible to write the app without having to learn HTML and CSS?
The third and last question, in case I write the View class in JS or Angular, can I write the Controller and Modal with Java (If we disregard complicated workarounds)? And do I deploy all three MVC classes/packages on the same server?
*I believe some would suggest we use GWT or Vaadin, and in this case I wonder if these frameworks have any quirks or limitations that would make it difficult for us as students to work with, be it when it comes to deployment (which is totally new for us) or the writing of the code itself.
Thanks a lot in advance.
Since nobody answered I am posting the best answer I could find so if anyone googles this subject could read it. At last we went with Java for backend running on Tomcat server and JS for front end. It turns out that HTML is very simple and JS is pretty similar to C/Java in syntax.
I'm aware that Famous framework does not care about data in the app, and something like AngularJS is the most ideal candidate for the job.
I just want to know how other folks out here are handling data in their apps, specifically POST requests from an external REST API. (since GET calls can be done with the Utility.loadURL() from famo.us itself)
Is AJAX calls the only way to do this right now? (besides Angular/Meteor and the like).
I'm just looking for a clean and simple solution which is easy on beginners like myself.
Appreciate your help.
This might be a better question for the Famo.us Group Mailing List. There are a lot of options that are not tied to just Famo.us also.
So, the answer to your question is there is not a recommended way to call an external API in the Famo.us framework as long as it does not manipulate the DOM directly which could have adverse affects on performance. This is addressed in the Famo.us Gotchas
I'm currently working on a school project where we need to display database info in a web UI.
I have a YUI3 Datatable with built in client side pagination. Now I would like to implement server side pagination due to the massive amount of data I will have to work with.
Are there any good solid tutorials on how to implement server side pagination in YUI3?
I've already gone through the API and the YUI2 tutorials I've come across have features no longer supported in YUI3..
No, not that I can find.
I've used this paginator with great success. But the documentation that did exist seems to have vanished both from the github repo and from http://blunderalong.com/yui/gallery/datatable-paginator/paginator_examples.html where it used to live. It may be worth pinging the author a message about it.
Like barnyr, I've used Todd Smith's paginator with great success. I agree that the closest you can get to a tutorial is by perusing Todd's comments in the code.
When I pinged Todd with a fix for a resizing problem, he responded that he had stopped working on it. I guess it's up to us to figure it out now. Also, he seemed to believe that YUI must have either picked up his code from the gallery or developed an equivalent solution; neither seems to be the case right now.
It is sad that blunderalong is gone -- it had lots of goodies -- but I have Todd's server-side pagination example fossilised in my repo:
https://github.com/selkovjr/bfs/blob/master/mojits/Samples/binders/index.js
And here is the server-side model that provides the data for it:
https://github.com/selkovjr/bfs/blob/master/mojits/Samples/models/samples.server.js
It is a bigger pile than you're asking for (the binder code also has row selection and inline cell editing), but at least it has the example you're looking for, almost unchanged.
We are still using YUI 2 which is really good large amounts of data.
Try http://yui.github.io/yui2/docs/yui_2.9.0_full/examples/datatable/dt_dynamicdata.html
and it might be good to do SQL sort for heavy loads which is cheaper.
You can try following examples
http://jafl.github.io/yui-modules/querybuilder/ for complete datatable implementation
or http://jafl.github.io/yui-modules/paginator/ for different pagination samples.
I have implemented paginator successfully using this example.
I have a project which is heavily JavaScript based (e.g. node.js, backbone.js, etc.). I'm using hashbang urls like /#!/about and have read the google ajax crawlable spec. I've done a wee bit of headless UI testing with zombie and can easily conceive of how this could be done by setting a slight delay and returning static content back to the google bot. But I don't really want to implement this from scratch and was hoping there was a pre-existing library that fits in with my stack. Know of one?
EDIT: At time of writing I don't think this exists. However, rendering using backbone (or similar) on server and client is a plausible approach (even if not a direct answer). So I'm going to mark that as answer although there may be better solutions in the future.
Just to chime in, I ran into this issue too (I have very ajax/js heavy site), and I found this which may be of interest:
crawlme
I have yet to try it but it sounds like it will make the whole process a piece of cake if it works as advertised! it's a piece of connect/express middleware that is simply inserted before any calls to pages, and apparently takes care of the rest.
Edit:
Having tried crawlme, I had some success, but the backend headless browser it uses (zombie.js) was failing with some of my javascript content, likely because it works by emulting the DOM and thus won't be perfect.
Sooo, instead I got hold of a full webkit based headless browser, phantomjs, and a set of node linkings for it, like this:
npm install phantomjs node-phantom
I then created my own script similar to crawlme, but using phantomjs instead of zombie.js. This approach seems to work perfectly, and will render every single one of my ajax based pages perfectly. the script I wrote to pull this off can be found here. to use it, simply:
var googlebot = require("./path-to-file");
and then before any other calls to your app (this is using express but should work with just connect too:
app.use(googlebot());
the source is realtively simple minus a couple of regexps, so have a gander :)
Result: AJAX heavy node.js/connect/express based website can be crawled by the googlebot.
There is one implementation using node.js and Backbone.js on the server and browser
https://github.com/Morriz/backbone-everywhere
crawleable nodejs module seems to fit this purpose: https://npmjs.org/package/crawlable and example of such SPA that can be rendered server-side in node https://github.com/trupin/crawlable-todos
Backbone looks interesting:
http://documentcloud.github.com/backbone/
http://lostechies.com/derickbailey/2011/09/26/seo-and-accessibility-with-html5-pushstate-part-1-introducing-pushstate/
I would like to write a web app that uses Dropbox for cloud storage.
If I understand correctly, I should use the Restful API to achieve that.
This documentation exists and is quite good but being a newcomer to Restful API I would love to see and play with a simple example that works with this API.
My questions are:
Am I right to assume that Rest API is the way to go?
Is there a quick and easy example (Maybe a live example) to get me going?
Thanks!
as you tagged your question with "ajax", i presume you want to do this entirely client-side (except for some proxy-code to be able to make requests accross domains)? I haven't tried it out myself, but there's dropbox-js on google code which will at least give you some ideas (and if the Dropbox API didn't change too much since June 2010 it might even work out of the box)?
Update: there's no "download", but you can browse the source code of trunk here.
Here's a lengthy article on the matter
Some love for Javascript Applications with code samples, a demo etc.