Posts filed under 'OSS'
Simple Dojo Datagrid + JSON Store
Sample Dojo Grid with JSON access below
Works for Dojo 1.2, and not with earlier versions.
And one fabulous improvement with the new grid (dojox.grid.DataGrid) is that when we try to load the data from json, it shows a Loading symbol which i feel is pretty cool compared to the earlier dojox.Grid. And the layout definition is fairly simplified. What i would love to see in future is a framework with which people can work with less scripting knowledge.
<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN” “http://www.w3.org/TR/html4/loose.dtd”>
<html>
<head>
<title>Layout Markup Basic</title>
<style type=”text/css”>
@import “dijit/themes/soria/soria.css”;
@import “dijit/themes/tundra/tundra.css”;
@import “dojox/grid/resources/Grid.css”;
@import “dojox/grid/resources/tundraGrid.css”;
@import “general.css”;
</style>
<script type=”text/javascript” src=”dojo/dojo.js” djConfig=”isDebug:false, parseOnLoad: true”></script>
<script type=”text/javascript”>
dojo.require(“dojo.data.ItemFileReadStore”);
dojo.require(“dojox.grid.DataGrid”);
dojo.require(“dojo.parser”);
dojo.require(“dijit.form.Button”);
dojo.require(“dijit.form.TextBox”);
dojo.require(“dijit.form.DateTextBox”);
dojo.require(“dijit.form.ComboBox”);
dojo.require(“dijit.layout.ContentPane”);
dojo.require(“dijit.layout.TabContainer”);
var jsonStore = new dojo.data.ItemFileReadStore({ url: “MyJson.jsp” });
</script>
</head>
<body class=”soria”>
<table id=”gridNode” jsId=”grid” dojoType=”dojox.grid.DataGrid” autowidth=”true”
query=”{ customer_name: ‘*’ }” store=”jsonStore” class=”tundra” style=”height:300px;width:400px”>
<thead>
<tr>
<th field=”customer_name”>Customer Name</th>
<th field=”customer_address” width=”100px”>Customer Address</th>
</tr>
</thead>
</table>
</body>
</html>
MyJson.jsp Sample goes below:
<%@ taglib prefix=”json” uri=”http://www.atg.com/taglibs/json” %>
<json:object>
<json:array name=”items” var=”item” items=”2″>
<json:object>
<json:property name=”customer_name” value=”nancy”/>
<json:property name=”customer_address” value=”LA”/>
</json:object>
<json:object>
<json:property name=”customer_name” value=”ken”/>
<json:property name=”customer_address” value=”CA”/>
</json:object>
</json:array>
</json:object>
If we need a json to be dynamically associated to the grid on any event, simple 3 steps will do:
- dojo.require(“dojo.data.ItemFileReadStore”);
- jsonStore = new dojo.data.ItemFileReadStore({ url: “<url for json rendering>”})
- var grid = dijit.byId(“gridNode”); // our grid div
- grid.setStore(jsonStore); // no need for a separate refresh call
If you have any comments or corrections, then please leave a comment.
Add comment October 7, 2008
Good bye Gates doesnt mean ….. but
Bye Bye gates doesn’t mean end to proprietary software but his walls remain very solid and closed !! An article on BBC by Richard M Stallman Founder, Free Software Foundation.
Since i grew using GNU/Linux system(from my college days when i first started using computers), i did not have much attachment to the Microsoft windowing system neither Mr.Gates.
But there are lot of other restrictions that the company brought in for the user accessing the PC installed Microsoft Windows. If you are in USA then it’s pretty serious and you can never get away unless you switch to. The evils of patents and proprietary document are there still a battle to be fought. So it’s pretty unfair to just put the blame on Gates alone.
The empire of proprietary software is there to live long and so does the open architectures and tools supporting open standards. Can we call it as “coexist in totally isolated world”.
It’s really funny to see the company making their own way of doing things centered around the banner. Openxml is one such thing. But thankfully it’s not accepted as a standard because of it’s complex documentation detailing the standards and other peculiarities. ODT has a good community backup. But this war is there to continue for a long time though. And there are many similar bed time stories like this.
One day i wish to use operating system just as a minimal platform to run applications. And this would be very much possible when the world of web gains more potential and improvements. Then i would definitely say bye bye to Mr.Gates. I guess players like google can bring in such environments for users to concentrate only on their business and not worry about the operating system much. GoS is one such attempt.
In future you could have your documents online and forget about bulky hard disks. The world of web browsers have lot to offer to the user. It’s good that now people are very comfortable trading the documents in web.
Eek, i tend to move away from the topic i write. But honestly there is nothing to talk about Mr.Gates bye bye scene because we have a bigger wall to manage.
I am really interested to read about him and the charity works he does tough.
1 comment July 8, 2008
software, lawsuit, and patentable
Software patents have always been a controversy and much worse they are not understood by most of the people. Even the lawyers are paid to decode them. The most obvious reason is the way in which they are developed, maintained and shipped unlike the other products like refrigerators, motors etc..
Any standard or protection law need not go to the extent of encouraging innovation. But atleast it should not curtail it. The nature of software being such a fluid idea, lacks clarity even to the person who developed it, the idea is nothing but asking for trouble. And as Stallman says, it;s just a pure math and that math could be formulated in many ways resulting in similar ideas. So, taking the ownership for the way of math doesn’t make much sense.
And the idea of cross licensing is another matter of concern. It behaves simply as a trade tool and nothing else. Obviously makes the world of software a pure business that doesn’t give room for innovation or new ideas. More seriously, It affects the small companies entering the market. If i have to publish a software idea, there is most likely a similar math already patented. If i am a big corporation then i am likely to be noticed by the cunning patent holder but even in that case i can fight it out with my lawyers. It becomes a story of lawyers and lawsuit.
Registered patents under US Patent could be read online. Just a Google search will take you there. It’s fun to read them and definitely the inverse when we understand that we are troubled by the same.
1 comment June 18, 2008
To Make, Ant and MSBuild
I am not sure if we can assume Ant as the replacement for Makefiles. But i feel they are good in their own ways. Makefiles are extensively used in opensource projects where in one can utilize the power of shell commands and rich set of options.
But the downside of Makefile is the availability of developers to write the build files and maintain. Even in my own experience i have seen many stumbling to resolve build issues. Esp. people who are not much into Unix. But still there are millions of code being compiled using Makefiles and it is definitely there to live long.
On Contrary there is a need for scripts which are easier to maintain/understand/cross-platform. And as always it is, xml is the answer. And build tools like Ant and MSBuild have acquired some reasonably good space share.
There are even cases where Ant to execute a MSBuild (after all just a native OS call considering the .NET framework installed) and MSBuild executing an Ant script.
All said, both the styles are there to remain long until we see a total drift in the way the projects and dependencies are handled. One best benchmark i would say for Makefile is the GNOME project. I guess it would have crossed 110 modules by the time now.
A must read article on Automake in FSM suggested by Ranga.
Add comment June 5, 2008
Complete Linux desktop
As a developer/Desktop User, i use Linux . But dual boot option still remains intact. Since there is only one PC at home and people have different likings, dual boot becomes unavoidable.
I always tried to convince desktop users to use Linux for their document works and web bowsing. But had a very little success. Even though i know the workaround to overcome some discomforts using Linux for Desktop work, i could never put them on words in my blog. I wanted to leave it to experts in Linux desktop usage.
Recently i found a comprehensible article in web about how Ubuntu can be used in place of windows. The author has highlighted the practical and useful points about how to switch to only Linux PC (provided you do not share your PC with a windows lover).
Some tit-bits:
“imagine upgrading Windows and having all your third party applications upgraded at the same time, everything from utilities and browsers to games and office applications. That’s what the upgrade system does here, checking all packages not just those originally installed, and grabbing the latest versions. Literally, fantastic, as I don’t need to hunt around for these myself. I even got a new version of my Sound Juicer.”
Click here to read the complete work
Add comment October 6, 2007