Hi,
i have a big problem. I must create with dojo static websites.
Explanation:
I have generated a dynamic web application with dojo. But now i got a request to optimize the page for a search engine. I can't use jaxer on the server, so i can't render it on server side.
Question:
Is it possible to generate static files for a search engine during the dojo build process with rino?
I hoooooooooooope somebody can help me.
Cheers

This is a great application
Generating a static HTML document from an Ajax page for search engine optimization is a great application of Jaxer. Jaxer can run your javascript and ajax scripts server-side and generate the needed static HTML page. Jaxer can likely do this better than Rhino since only Jaxer has a server-side DOM model. Jaxer's core engine is the same engine that's in the Mozilla browser. Jaxer is an Ajax server with a browser engine inside it so that you have a parity of client and server environments). Jaxer runs on many server operating systems and it's free to use under its open source license.
You can even use Jaxer in a post-processing model to do this. For example... use the Jaxer server as a client to consume the Ajax page (literally browse your Ajax page as if it were a browser since it has a browser in its server core), then use Jaxer's APIs to convert that into a static form and even auto-generate metadata for the search engines. In this model, you need not change the original app. The original app could be written in PHP, Ruby on Rails, Python, Java, whatever... That's the beauty. (Of course Jaxer can be used as the primary app engine too, if you do not like the post-processing model.)
Why is it that you can't use Jaxer on the server-side?
My Problem is that i deliver
My Problem is that i deliver the page to a customer, who has only a php server. i can't install the jaxer on the system because i have no administrator account and the customer wont install it. So i need a solution to build static pages during the dojo build process or later, to deliver two versions (dynamic/static) of the page.
Can you explain me the post-process, so that i can generate the pages automatically at another server.
Thanks, this would be a great help.
Cheers
Ah! Yes you can use jaxer on
Ah!
Yes you can use jaxer on another server like this:
Let's assume the "source" app is at: php.myapp.com and that you have jaxer at jaxer.anotherplace.com (or even jaxer.myapp.com).
The idea is that you use the jaxer server as both a client and a server: a client to the php app and a server to the search bots.
Since Jaxer embeds the mozilla browser on the server side you first request a page from php.myapp.com using Jaxer's Jaxer.Web.Get method. Jaxer gets that page and generates a full DOM of that page server-side for you. Perhaps think of this as "DOM Scraping" as opposed to "Screen Scaping". With DOM Scraping you get a live DOM to work with and process. With Screen Scraping you get a long sting that happens to have < > demarcations in it ... making processing of that string much more difficult.
So with a live DOM in hand on the server, the next step is to process that DOM into a SEO friendly form. Since Jaxer uses JavaScript server-side you can use the full breadth of the DOM APIs available in mozilla to do that. Jaxer also has assistive APIs for aspects of this. You can use Jaxer to execute any client-side JavaScript in your page, server-side to flush out that conents into HTML, then generate the full "flattened" html of the page from the DOM. Most likely you'd save the result as a static HTML page that perhaps referred back to its dynamic source in some way such that the search engines get the full "flatland" view of the page, while the user gets linked to the user experience you want them to have.
re: DOM scraping with
re: DOM scraping with Jaxer:
Here's a short piece that might help you get started...
http://www.aptana.com/blog/paul/dom_scraping_with_jaxer
We're now completing work on
We're now completing work on Jaxer functionality that'll really give you great "screen scraping"/"DOM scraping" abilities. You'll be able to create a new server-side "window" that behaves just like a regular browser window, with no Jaxer in it (nor any access to the Jaxer object or server-side objects) for security, and a regular onload and so on; and this window is then accessible by you as you normally would access any other window if you were in a browser, but you have full privileges. So you can easily load a page (using GET or even POST with data), synchronously or asynchronously, know when it's loaded, and do whatever you need to it or get whatever you need from it.
Should be available real soon now... let us know if you'd like to get a preview of a build with that.
That will be great when i
That will be great when i can get a preview of the build.
Cheers
Jaxer 1.0 RC b is now
Jaxer 1.0 RC b is now available for download.
Uri Sarid has also added a part II to the DOM Scraping concepts showing how Jaxer 1.0 can do an even more efficient job of this using Jaxer.
Here's the post: http://www.aptana.com/blog/uri/dom_scraping_with_jaxer_part_2
Download Aptana Jaxer 1.0 RC b @ http://www.aptana.com/jaxer/download