Handling Requests to Return XML, JSON, Rendered CSS, etc

Discussion for Jaxer newbies about how to get Jaxer up and running.

Moderator: Aptana Staff

Handling Requests to Return XML, JSON, Rendered CSS, etc

Postby p1ilmaker » Wed Apr 09, 2008 7:01 pm

Is it currently possible to serve data other that a host html page and via callbacks? I think Aptana may be working on other cases such as the ability to respond to other types of requests such returning XML or JSON documents/data. So I just want to verify. Is it currently possible to serve data other that a host html page and via callbacks?

Thanks,
Phil
p1ilmaker
 
Posts: 54
Joined: Fri Jan 25, 2008 6:42 am
Location: Austin, Texas

Postby davey » Wed Apr 09, 2008 10:44 pm

You can change the content type of callbacks, but not regular html pages at the moment. This feature is high on the dev aganda.

Could you give me a use case? and i'll let you know if there is a workable way to do what you want.
User avatar
davey
 
Posts: 710
Joined: Mon Jul 23, 2007 9:25 pm

Postby p1ilmaker » Thu Apr 10, 2008 12:32 am

Use case is loading JSON data into a JSONStore for a grid in ExtJS. ExtJS has the means to load the JSON directly from a URL. I know I can likely request the JSON data via a callback, plug it into the store, and that's my plan for now. Maybe that's the best plan. But just wondering about being able to return responses other than HTML from Jaxer and I think we are waiting on that. I do really like Jaxer and understand its intended use but I like flexibility.

Also, it would be nice to make a request to a CSS file and be able to compose that CSS response using Javascript somehow. Like: http://ajaxian.com/archives/new-css-javascript-library
p1ilmaker
 
Posts: 54
Joined: Fri Jan 25, 2008 6:42 am
Location: Austin, Texas

Postby p1ilmaker » Thu Apr 10, 2008 12:38 am

Regarding the flexibility I just mentioned: I like the way Jaxer works - I like the callbacks. One comment I made before in an email to you guys previously is that I also am interested in having the opportunity to use Jaxer additionally for server-centric development even if there is no AJAX in play and for client-centric development using Jaxer as a tool similar to CouchDB or Persevere. This is in addition to callbacks. But that's sort of offtopic. Would be nice to have the flexibility to return JSON/XML via REST just in case.
p1ilmaker
 
Posts: 54
Joined: Fri Jan 25, 2008 6:42 am
Location: Austin, Texas

Postby davey » Thu Apr 10, 2008 12:54 am

Phil,

That's basically the plan. but today you'd have to use the callback route, and set the response type on the callback, but that means you have to be serving the original page through Jaxer.

The restful access will be available in the next couple of weeks, as it is a high priority item.
User avatar
davey
 
Posts: 710
Joined: Mon Jul 23, 2007 9:25 pm

Postby zmila » Thu Jun 26, 2008 1:44 pm

davey wrote:Could you give me a use case?


Hi.
A sample use case.

I'd like to provide server-side functionality accessible as REST services. I say to my students: here is a server, which supports operations:
http://myhost/aptana/ajax/add
http://myhost/aptana/ajax/delete
http://myhost/aptana/ajax/list
The operations accept parameters in JSON format and return data in JSON.
And then I give exercises: write simple client application using plain AJAX, js and XHR (or different technologies like flex, .NET).

Your Jaxer server has all I need: good programming language, DB support. The only missing is comunication with client via json but not html.
Can I get the described scenario?
zmila
 
Posts: 3
Joined: Thu Jun 26, 2008 1:13 pm

Postby davey » Thu Jun 26, 2008 5:59 pm

Zmila,

We have new API support for returning different content type in our forthcoming release. We've just updated the backend to the same codebase as mozilla FF3.0, so we are in final testing of that, and a release is likely in the next few weeks.

That will allow you return an arbitrary document type and content.
User avatar
davey
 
Posts: 710
Joined: Mon Jul 23, 2007 9:25 pm

Postby zmila » Fri Jun 27, 2008 7:28 am

davey wrote:We have new API support for returning different content type in our forthcoming release.
...
That will allow you return an arbitrary document type and content.


Sanks, davey!
I put your blog into my rss reader and will wait for updates.

good luck!
zmila
 
Posts: 3
Joined: Thu Jun 26, 2008 1:13 pm

Postby p1ilmaker » Wed Jul 02, 2008 10:35 pm

Zmila, regarding data access for the client, here is a project I have been composing to run within Jaxer. At the moment is is using callbacks and not REST but that will be a easy modification. I made a post earlier but it's tucked away in the Persistence forum section: http://forums.aptana.com/viewtopic.php?t=5990
p1ilmaker
 
Posts: 54
Joined: Fri Jan 25, 2008 6:42 am
Location: Austin, Texas

Postby i2finite » Tue Sep 30, 2008 1:05 am

davey wrote:We have new API support for returning different content type in our forthcoming release.


Any updates on outputting XML?
User avatar
i2finite
 
Posts: 12
Joined: Fri Sep 26, 2008 5:50 am
Location: Seattle, WA


Return to Installing and Configuring Jaxer