Posts filed under 'web'

west drags web 2.0

Times of recession and it’s about business  survival. Stories of cost cutting, layoffs, no funding for research, frozen development etc…, are closely related to corporates and governance. Ok enough of those boring lines of corporate lecture. Do we see web 2.0 getting affected by these uncertainties of the business world. As a close observer of the web, i could see some sort of dizziness in the world of web development.

I don’t want to talk big players like Google and Micorosoft as they already established some sort of revenue model out of web, but i am worried about the startups. Since most of them being funded by west, aspiring startups might go for a halt for some time. I should say post 2006, the world of web saw many new ideas like Flikr, Facebook , Youtube etc.., Do they evolve as a model ?

So, how long do we wait. Wheres are those budding mobile VAS providers. Can this ecosystem sustain the tides of economic crisis ?

Another important question is: will web 2.0 take a turn someway or take a temporary halt ?

Add comment May 9, 2009

A simple displaytag grid demo

Display tags are pretty good option when it comes to creating a enterprise class data grid.
The sample code given below is quite a head start for building up a bulky grid.

// Create class that returns a list
package org.ixfree.Displayags;
import java.util.*;
public class GridList {

private List aList;

public List getAList() {
return aList;
}
public void setAList(List list) {
aList = list;
}
public GridList(int i)
{
this.aList = new LinkedList<DataBean>();
}
}

// POJO bean that goes into the list. DataBean in our case.
package org.ixfree.Displayags;
public class DataBean {

private String name;
private String age;

public String getName()
{
return this.name;
}

public String getAge()
{
return this.age;
}

public String setName(String name)
{
this.name = name;
}

public String setAge(String age)
{
this.age = age;
}
}

// Get the libraries reffered
// Sql needed if you wanna get the data out of the table. Ofcourse there are much better ways to do it.
<%@ taglib uri=”http://displaytag.sf.net” prefix=”display”%>
<%@ page import=”java.util.*” %>
<%@ page import=”org.ixfree.Displayags.*” %>
<%@ page import=”java.sql.*” %>

<%
// Make a list of data for populating grid
List<DataBean> list = new GridList(6).getAList();

// .. Get the data into the bean and add it to the list.
// .. Every bean here refers to a row in the grid. Yeppiiie….

// Put the list in the request
request.setAttribute( “storedList”,list);
%>

// Make it as a XHTML (good for the browser)
<head>
<!– All script and style/references goes here –>

<link href=”ixfreeDemoDisplayTags.css” rel=”stylesheet” type=”text/css”>
</head>
<body>
<!– If you dont want the grid to introduce scroll bar for the window, but ok for the grid –>
<div id=”My_DisplayTag_Grid” style=”width: 800px; height: 360px; overflow: auto” >
<!–
The pageSize is pretty useful when you wanna have pagination
class is just our regular css stuff
headerClass applies to the TH’s

name attribute of the display:table tag does the magic of reading our list.

–>
<display:table name=”storedList” class=”myDisplayTagStyle” id=”displayTable” pagesize=”10″ requestURI=”theCurrentJspPage.jsp”>
<display:column  sortable=”true” property=”name” title=”Name”  class=”myDisplayTagStyle” headerClass=”myDisplayTagStyle”/>
<display:column  sortable=”true” property=”age” title=”Age” class=”myDisplayTagStyle” headerClass=”myDisplayTagStyle” />
</display:table>
</div>
</body>

### ixfreeDemoDisplayTags.css goes this way ###
html
{
scrollbar-base-color: #dddddd;

}

table.myDisplayTagStyle
{
background-color: #dddddd;
}

td.myDisplayTagStyle
{
border-color: black;
border-width: 1px 1px 1px 1px;
border-style: solid;
margin: 0;
font-family:Arial Verdana;
font-size:10pt;
overflow: auto;
white-space:nowrap;
padding-top: 6px;
padding-right: 6px;
padding-left: 6px;
padding-bottom: 6px;
}

tr.odd
{
border-color: black;
border-width: 1px 1px 1px 1px;
border-style: solid;
margin: 0;
padding: 4px;
background-color: #ffffff;
white-space:nowrap;
}

tr.even
{
border-color: black;
border-width: 1px 1px 1px 1px;
border-style: solid;
margin: 0;
padding: 4px;
background-color: #dddddd;
white-space:nowrap;
}

th.myDisplayTagStyle
{
background-color: #dddddd;
border-color: black;
border-width: 1px 1px 1px 1px;
border-style: solid;
font-size: 9pt;
white-space: nowrap;
padding-top: 10px;
padding-right: 10px;
padding-left: 10px;
padding-bottom: 10px;
}

Add comment December 11, 2008

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

Simple Dojo Grid

Hi Friends. I was working on a simple data grid using Dojo. Thanks to SitePen’s blogs. It was quite useful except for the fact that i messed up with the css and took some time to make over.

Dojo makes an intensive use of JSON and it’s really a brilliant idea which is evolving quite firmly. We are there to use JSON more in the future.

Try to deploy in any web server and make sure the Dojo, Digit and Dojox are in the path of this file which we deploy.

<html><head>
<script type=”text/javascript” src=”dojo/dojo.js” djconfig=”parseOnLoad: true, isDebug: false”>  </script>
<script type=”text/javascript” src=”dojox/grid/Grid.js”></script>
<style type=”text/css”>
@import “dojox/grid/_grid/tundraGrid.css”;
</style>

<script type=”text/javascript”>
var data =    [
[ '4001', 'SB', '19/10/1983', '19/10/1920' ],
[ '4002', 'SB', '20/10/1983', '20/10/1920' ],
[ '4003', 'FD', '21/10/1983', '21/10/1920' ],
[ '4004', 'FD', '22/10/1983', '22/10/1920' ]
];

var cell = { name: ‘Cell Name’ };
var subrow = [ cell ];
var view = { rows: subrow };
var structure = [ view ];

var subrow = [
{ name: 'Account Number' },
{ name: 'Account Type' },
{ name: 'Start Date' },
{ name: 'Expiry Date' }
];
var view = {
rows: [ subrow ]
};
var structure = [
view
];
var model = new dojox.grid.data.Table(null, data);
</script>

</head><body class=”tundra”>
<div id=”grid1″ dojotype=”dojox.Grid” autowidth=”true” model=”model” structure=”structure” class=”grid”/>
</body></html>

PS:- Try the latest Dojo version to avoid any mishaps.

Oho… This is not the way to go. Try dojo toolkit version 1.2 grid like given here

One problem regarding working on DOJO is the lack of documentation and heavy depencendy on search engines. This has been felt/discussed in many places. When i had to find the list of dijit widgets i could not get proper answers. Finally found this link: http://redesign.dojotoolkit.org/jsdoc/dijit/HEAD/dijit.form.

And do write in your comments when you try to populate grid using JSON or any other technique.

2 comments September 30, 2008

What does web 2.0 means to the users ?

This is one question which raises in my mind frequently these days. Every day there is a new startup and everyday the garage filled up with a new idea or a betterment sort. There is a truck load of information we can find across all the street corners of the web.

Has any one took hold of the market or does it need more time to evolve? Are we designing anything which centers society and social welfare? Do we really have time to explore new applications or are we wasting our valuable time before the PC.

One thing i could see is that there are lot of blogs made about many yet another web 2.0. How much the IT majors fund/invest on these startups? Does it open new IT oppurtunities? Does technology and application ideas flow parallel to complement each other?

How much time can we effectively(recommended) spend on a web 2.0 in an average? This question is irrelevant to the geeks or the developers. But it’s most relevant to the average consumer of the services of web 2.0.

There are more serious question waiting to be posted on these web 2.0 companies and service providers.

Add comment September 26, 2008

Previous Posts


Blogroll

Category Cloud

ajax books Education free software linux Market opensource open standards OSS programming search servers services Uncategorized web

Archives