Thursday, March 22, 2007

JSON

wiki en and wiki ru

JSON (JavaScript Object Notation) is a lightweight data-interchange format. It is easy for humans to read and write. It is easy for machines to parse and generate. It is based on a subset of the JavaScript Programming Language.

Sample JSON


{
"data": "The markup of fragment",
"portlets": [
{
"wid": "8759875984237598347",
"title": "заголовок",
"mode": "VIEW",
"state": "NORMAL",
"content": "The markup of portlet",
}
]
}


Sample JavaScript, where is req.responseText - is the JSON response.


var data_object = eval("(" + req.responseText + ")");
alert("data_object.data = " + data_object.data);
var frag = data_object.data;
var portlets = data_object.portlets;
var portletLength = portlets.length;
for (var i = 0; i < portletLength; i++) {
document.getElementById("p" + portlets[i].wid + "title").innerHTML = portlets[i].title;
document.getElementById("p" + portlets[i].wid + "content").innerHTML = portlets[i].content;
}


Links:

JSON official
JSON in JavaScript
JSON in Java
Generate JSON from XML to use with Ajax
Генерирование JSON из XML для использования с Ajax

Wednesday, March 21, 2007

The portlets

Introduction
This is the article about portlets. It is the first steps to portlets and portal. I am talking about portlets, portals, aggregating portlets to portals, portlet API (JSR168), main portlet’s sides and showing simple portlet code. Prerequisites include understanding of of XML, HTML, Servlets and JavaServer Pages.

How does it work?


Portals
Portals are respected by a number of characteristics. The two most often observed by users are:
  • Aggregation
  • Personalization.
These characteristics have a major impact on the programming model, and how it differs from a non-portal web site.

Aggregation
Aggregation refers to taking content from multiple, independent, delivery channels, and providing a unified user experience. A Portal page will often contain multiple
portlets, each rendering content from a separate source. Aggregation is outside of the scope of JSR-168. Many Portal engines manage pages and aggregation differently.

Personalization
Personalization refers to allowing each user to customize their portal experience. Different portal engines will provide for differing levels of personalization. JSR-168 includes a notion of Portlet Preferences, which a developer can use to allow a user to customize how the portlet
will perform for that specific user.

Portlets
Portlet is a new type of Web Component, cousin to the Servlet, provides the interface to content.

What Is JSR-168?
The numeric designation for the JCP’s first local Portlet Specification.
Remote portlet technology is defined by the WSRP specification.
Extends Servlet Specification 2.3 with new Portlet concepts.
Defines the standard contract between the Portlet container and Portlet components.
JSR-168 does not define Portal behaviors, such as how pages are laid out, how aggregation works, how administration is performed, etc.

Why JSR-168?
Prior to JSR-168, we had many different Portlet APIs. The lack of standards fragmented the solution space, creating issues for customers and ISVs.

Portlets and servlets
Portlet-based Applications vs Servlet-based Applications Installing a Portlet Application provides capability, not content. Portlets from multiple applications can be
aggregated on the same page. More administration with Portlets and Portals than with traditional web applications.

Portlets Differ from Servlets
  • Two phase request processing
  • Persistent render parameters
  • Portlet render as markup fragments
  • Special URLs to access a Portlet
  • Portlet Modes
  • Portlet Window States
  • Portlet Preferences

Some of the Portal Servers That Support.. JSR-168
Open Source:
Commercial:

MVC and Portlets
Portlets in MVC terms:
  • Portlet class – Controller
  • Portlet’s JSP – View
Model/View/Controller Pattern
  • Model
Abstract interface
No user interaction
No presentation
  • View
Acquires Model data and renders it
Can be replaced, independent of the Model
  • Controller
Receives input events
Provides the means to effect change on the Model
Orchestrates interaction between Model and View
MVC and Portlets
The Portlet's primary role is as the Controller. Receives events from the container
  • Process actions
  • Render content

Portlets typically dispatch to the View (usually a JSP page).
As the Controller, Portlets orchestrate interaction with the Model and moving content to the View. The Model can be anything: POJO, EJB, Web Service, etc. A Portal is intended to provide an aggregated UI to models, not to necessarily contain those models.

Links

Friday, March 9, 2007

Portals

Yahoo polls:
Are you using Open Source Portal Server?
vote


Open Source

  • eXo Platform
Home page
eXo Portal 1.1.4
eXo Portal 2.0 alpha
Documentation
  • Apache Pluto
Apache Software Foundation
Apache Pluto

  • JBoss Portal
JBoss
JBoss Portal
Home page:
Documentation:
Community:

  • Jetspeed 2
Home page:
Documentation:
Community:
  • Liferay Portal
Home page
Documentation
Devzone forums
  • uPortal
Home page:
Documentation:
Community:
  • Gridsphere
Home page:
Documentation:
Community:

Yahoo polls:
In your opinion which is the best open source portal server?
vote


Commercial

  • Sun Java System Portal Server
Home page: http://www.sun.com/software/products/portal_srvr/home_portal6.xml
Documentation: http://docs.sun.com/app/docs/coll/PortalServer_05q1
Community: http://swforum.sun.com/jive/forum.jspa?forumID=80

  • WebSphere Portal
IBM http://www.ibm.com/
IBM WebSphere Portal Version 6.0 http://www-306.ibm.com/software/info1/websphere/index.jsp?tab=landings/portalbuzz
Home page: http://www-306.ibm.com/software/genservers/portal/
Documentation: http://www-106.ibm.com/developerworks/websphere/zones/portal/proddoc.html
Community: http://www-106.ibm.com/developerworks/forums/dw_forum.jsp?forum=168&cat=9

  • BEA WebLogic Portal
BEA http://www.bea.com
BEA WebLogic Portal 9.2 http://dev2dev.bea.com/wlportal/
Home page: http://www.beasys.com/framework.jsp?CNT=index.htm&FP=/content/products/portal
Documentation: http://e-docs.bea.com/wlp/docs81/index.html
Community: http://forums.bea.com/bea/forum.jspa?forumID=2044

  • Oracle Portal
Home page: http://www.oracle.com/technology/products/ias/portal/index.html
Documentation: http://www.oracle.com/technology/products/ias/portal/documentation.html
Community: http://www.oracle.com/technology/products/ias/portal/discussion_forums.html

  • Vignette Portal
Home page: http://www.vignette.com
Documentation: http://www.vignette.com
Community: http://www.vignette.com

Yahoo polls:
Which commercial portal meets most of your portal requirements?
vote

Does portal (portlet) create revolution in web application development in future?
results



Links:

Web portal
Portal
JSR 168 FAQ
Open Source CMS
Yahoo polls
Open Source Portals in Java
Open Source Portal Comparison (pdf)

Don't forget delete cookie in your browser when you faced with strange behave of your application while test it on other AS !!!