mardi févr. 27, 2007

Mashing it up with jMaki lab



As a follow-up to my previous post on using jMaki to display Roller-generated JSON content, I would recommend reading this lab presentation.

It has explanations on how to configure the XMLHttpProxy (using the /resources/xhp.json file) and configure web.xml for proxies to bypass the limitations in my post. Also, it doesn't use Roller-generated JSON but rather an elegant XSL tranformation to move from RSS to JSON. Note Yahoo pipes can generate JSON. Try with Arun's GlassFish aggregation pipe.

More jMaki presentations from the jMaki day are available here. Check out also this value proposition link (sounds new to me).


lundi janv. 15, 2007

Taking Roller's JSON and jMakifying it - short video



Building on Dave Johnson's Roller/JSON post I wrote a simple application consuming Roller-generated data using the jMaki framework and NetBeans 5.5. jMaki, as any framework in the AJAX space, consumes JSON data and provides a wrapper technology around existing AJAX components.

I slightly changed Dave's formating of the Roller template:

#set($pager = $model.getWeblogEntriesPager())
#set(  $map = $pager.getEntries())
  {
     columns: {'pubTime' : 'Publish Time',
                 'title' : 'Title',
                    'Id' : 'Identifier',
          'commentCount' : '# comments' },
     rows: [
           #foreach($day in $map.keySet())
           #set($entries = $map.get($day))  
              #foreach($entry in $entries)
                ['$entry.pubTime',
                 '$entry.title',
                 '$entry.anchor',
                 '$entry.commentCount'],
              #end
           #end
  ]}

The page generating live JSON data is available at http://blogs.sun.com/alexismp/page/jsontest.

From NetBeans 5.5 with the jMaki plugin installed (get it from the Update Center), I simply created a Web Application with jMaki as the framework, dropped a DOJO table and changed it's service attribute to the URL generating to JSON data (actually I had to copy/paste the data so that it was available from the same domain) and run the application.

Pretty simple and I didn't see a line of JavaScript.
Here's the simple jMaki tag from the JSP source :

<a:ajax name="dojo.table"
       service="http://blogs.sun.com/alexismp/page/jsontest">


All of this is shown in this short screencast :



Update: the JSON content should really be using double quotes and ideally not end with a trailing comma (and your blog post titles shouldn't use double quotes :)
Update 2: the answer to my initial questions (different domains requiring me to copy paste JSON content in the video to workaround security constraints, quite ugly) are all described here. Sorry I didn't update the screencast.
About

This blog has moved

Alexis Moussine-Pouchkine's Weblog

GlassFish - Stay Connected

Search

Archives
« avril 2014
lun.mar.mer.jeu.ven.sam.dim.
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
    
       
Today
Blogroll

No bookmarks in folder

News

No bookmarks in folder