Wednesday, December 19, 2007

OpenID 2.0 final released

OpenID

check these

The Sound of Crickets Chirping » Blog Archive » OpenID != SSO

The Sound of Crickets Chirping » Blog Archive » OpenID != SSO: "OpenID != SSO"

Well, I understood what the author wants to say, but from an user point of view, they are the same.

Friday, October 26, 2007

Dev Thoughts » Blog Archive » JMX meets Log4J

Dev Thoughts » Blog Archive » JMX meets Log4J

Today, after repeating this routine a few times, for the first time I told myself “There must be a better way…”. It didn’t take me long to feature out that spring’s jmx support and jdk 5 practically hand me the solution to this problem on a silver plate - Just create a simple management bean that controls the log levels for categories, export this bean as an MBean using spring superb JMX’s support, and use jdk5 jconsole application to manage the logging levels. Here’s a quick recipe:

1. Create the management bean:

public class Log4jMBean {

public void activateInfo(String category) {
LogManager.getLogger(category).setLevel(Level.INFO);
}

public void activateDebug(String category) {
LogManager.getLogger(category).setLevel(Level.DEBUG);
}

public void activateWarn(String category) {
LogManager.getLogger(category).setLevel(Level.WARN);
}

public void activateError(String category) {
LogManager.getLogger(category).setLevel(Level.ERROR);
}

public void activateFatal(String category) {
LogManager.getLogger(category).setLevel(Level.FATAL);
}
}

2. Export the bean in the application context.

3. Run your application with the following system property -Dcom.sun.management.jmxremote

4. Run jconsole tool (found at JAVA_HOME/bin)

5. Look for the exported MBean (”logging” in our case)

6. Change the log level of categories just by invoking the management methods.

Done!

After googling a bit, I found out that loads of people already thought about this solution (hell… there’s even an MBean class in the jdk that does the same for jdk’s logging mechanism). Unfortunately, I only gave it a thought today - if I had done so long time ago it would have probably saved me quite a lot of time… So if it’s new to you aswell, stop wasting your time and add it to your project today.

Note: This can be quite useful at production phase as well, but keep in mind that a more secured schema should be applied - possibly using jdk’s jmx security support (for more information, see the resources below).

Some resources:
Monitoring and Management Using JMX
Spring JMX support

Sunday, October 14, 2007

SEO Title Tag: A WordPress Plugin for SEO (Search Engine Optimization)

SEO Title Tag: A WordPress Plugin for SEO (Search Engine Optimization)

Features include:

  • Allows you to override a page’s or a post’s title tag with a custom one.
  • New for v2.0 A Title Tag input box in the Edit Post and Write Post forms. (Previously in version 1.0 you had to use the Custom Field box.)
  • New for v2.0 Mass editing of title tags for all posts, static pages, category pages, tag pages, tag conjunction pages, archive by month pages, — indeed, any URL — all in one go.
  • Define a custom title tag for your home page (or, more accurately, your Posts page, if you have chosen a static Front Page set under Options -> Reading), through the Options -> SEO Title Tag page in the WordPress admin.
  • New for v2.0 Define the title tag of 404 error pages, also through Options -> SEO Title Tag.
  • New for v2.0 Handles internal search result pages too.
  • For users of the UltimateTagWarrior plugin (which should be everybody!), incorporates the tag name into the title tag on “tag pages” (sorry for the confusing use of “tag” in two contexts here — as in tagging and HTML title tags).
  • New for v2.0 (When used with Ultimate Tag Warrior) Customize the title tags on tag pages, and on tag conjunction pages too (e.g. http://www.netconcepts.com/tag/seo+articles). The latter is done through Manage -> Title Tags -> URLs; see this screenshot for an example.
  • New for v2.0 Title tags of category pages can optionally be set to the category description. If you use a Meta Tag plugin like Add Meta Tags, then you should not use this feature and instead let the Meta Tag plugin use the category description for the meta description on category pages.
  • If you choose to keep the blog name in your title tags (not recommended!), the order of the blog name and the title are automatically reversed, giving more keyword prominence to the title instead of the blog name. Note there is also an option to replace your blog name with a shorter blog nickname.

And best of all, the plugin is FREE!

Suitably convinced? Then Download the plugin!

Friday, October 12, 2007

Enterprise Java Community: Introduction to the Spring Framework

Enterprise Java Community: Introduction to the Spring Framework

This is a basic introduction of Spring Framework.

The author thinks the Spring Framework is unique as:
Spring is unique, for several reasons:
  • It addresses important areas that many other popular frameworks don't.
  • Spring is both comprehensive and modular.
  • Spring is designed from the ground up to help you write code that's easy to test.
  • Spring is an increasingly important integration technology
I fully agree with it. The loose couple and tight couple inside way makes Spring eases to be used in any kind of applications.

Architectural benefits of Spring

Before we get down to specifics, let's look at some of the benefits Spring can bring to a project:

  • Spring can effectively organize your middle tier objects, whether or not you choose to use EJB. Spring takes care of plumbing that would be left up to you if you use only Struts or other frameworks geared to particular J2EE APIs. And while it is perhaps most valuable in the middle tier, Spring's configuration management services can be used in any architectural layer, in whatever runtime environment.
  • Spring can eliminate the proliferation of Singletons seen on many projects.
  • Spring can eliminate the need to use a variety of custom properties file formats, by handling configuration in a consistent way throughout applications and projects. Ever wondered what magic property keys or system properties a particular class looks for, and had to read the Javadoc or even source code? With Spring you simply look at the class's JavaBean properties or constructor arguments. The use of Inversion of Control and Dependency Injection (discussed below) helps achieve this simplification.
  • Spring can facilitate good programming practice by reducing the cost of programming to interfaces, rather than classes, almost to zero.
  • Spring is designed so that applications built with it depend on as few of its APIs as possible. Most business objects in Spring applications have no dependency on Spring.
  • Applications built using Spring are very easy to unit test.
  • Spring can make the use of EJB an implementation choice, rather than the determinant of application architecture. You can choose to implement business interfaces as POJOs or local EJBs without affecting calling code.
  • Spring helps you solve many problems without using EJB. Spring can provide an alternative to EJB that's appropriate for many applications. For example, Spring can use AOP to deliver declarative transaction management without using an EJB container; even without a JTA implementation, if you only need to work with a single database.
  • Spring provides a consistent framework for data access, whether using JDBC or an O/R mapping product such as TopLink, Hibernate or a JDO implementation.
  • Spring provides a consistent, simple programming model in many areas, making it an ideal architectural "glue." You can see this consistency in the Spring approach to JDBC, JMS, JavaMail, JNDI and many other important APIs.

Spring is essentially a technology dedicated to enabling you to build applications using POJOs. This desirable goal requires a sophisticated framework, which conceals much complexity from the developer.


What does Spring do?

Mission statement
POJO-based programming model
Spring is portable between application servers.
Inversion of control container
The core of Spring is the org.springframework.beans package, designed for working with JavaBeans.
The most commonly used BeanFactory definitions are:
  • XmlBeanFactory. This parses a simple, intuitive XML structure defining the classes and properties of named objects. We provide a DTD to make authoring easier.
  • DefaultListableBeanFactory: This provides the ability to parse bean definitions in properties files, and create BeanFactories programmatically.
The concept behind Inversion of Control is often expressed in the Hollywood Principle: "Don't call me, I'll call you." IoC moves the responsibility for making things happen into the framework, and away from application code. Whereas your code calls a traditional class library, an IoC framework calls your code. Lifecycle callbacks in many APIs, such as the setSessionContext() method for session EJBs, demonstrate this approach.

Spring provides sophisticated support for both Setter Injection (injection via JavaBean setters); and Constructor Injection (injection via constructor arguments), and even allows you to mix the two when configuring the one object.

JDBC abstraction and data access exception hierarchy

Spring addresses these problems in two ways:

  • By providing APIs that move tedious and error-prone exception handling out of application code into the framework. The framework takes care of all exception handling; application code can concentrate on issuing the appropriate SQL and extracting results.
  • By providing a meaningful exception hierarchy for your application code to work with in place of SQLException.
This is really cute feature that I like. It frees most of 3 tiers application developers paint.



Spring JDBC can help you in several ways:

  • You'll never need to write a finally block again to use JDBC
  • Connection leaks will be a thing of the past
  • You'll need to write less code overall, and that code will be clearly focused on the necessary SQL
  • You'll never need to dig through your RDBMS documentation to work out what obscure error code it returns for a bad column name. Your application won't be dependent on RDBMS-specific error handling code.
  • Whatever persistence technology use, you'll find it easy to implement the DAO pattern without business logic depending on any particular data access API.
  • You'll benefit from improved portability (compared to raw JDBC) in advanced areas such as BLOB handling and invoking stored procedures that return result sets.
O/R mapping integration

Of course often you want to use O/R mapping, rather than use relational data access. Your overall application framework must support this also. Thus Spring integrates out of the box with Hibernate (versions 2 and 3), JDO (versions 1 and 2), TopLink and other ORM products. Its data access architecture allows it to integrate with any underlying data access technology. Spring and Hibernate are a particularly popular combination.

Why would you use an ORM product plus Spring, instead of the ORM product directly? Spring adds significant value in the following areas:

  • Session management.
  • Resource management.
  • Integrated transaction management.
  • Exception wrapping, as described above.
  • To avoid vendor lock-in.
  • Ease of testing.

Above all, Spring facilitates a mix-and-match approach to data access. Spring enables a consistent architecture, and transaction strategy, even if you mix and match persistence approaches, even without using JTA.

AOP

The first goal of Spring's AOP support is to provide J2EE services to POJOs. Spring AOP is portable between application servers, so there's no risk of vendor lock in.

Spring AOP supports method interception. Key AOP concepts supported include:

  • Interception: Custom behaviour can be inserted before or after method invocations against any interface or class. This is similar to "around advice" in AspectJ terminology.
  • Introduction: Specifying that an advice should cause an object to implement additional interfaces. This can amount to mixin inheritance.
  • Static and dynamic pointcuts: Specifying the points in program execution at which interception should take place. Static pointcuts concern method signatures; dynamic pointcuts may also consider method arguments at the point where they are evaluated. Pointcuts are defined separately from interceptors, enabling a standard interceptor to be applied in different applications and code contexts.

Spring supports both stateful (one instance per advised object) and stateless interceptors (one instance for all advice).

Spring does not support field interception.

Spring integrates with AspectJ, providing the ability to seamlessly include AspectJ aspects into Spring applications

MVC web framework
  • Spring provides a very clean division between controllers, JavaBean models, and views.
  • Spring's MVC is very flexible. Unlike Struts, which forces your Action and Form objects into concrete inheritance (thus taking away your single shot at concrete inheritance in Java), Spring MVC is entirely based on interfaces. Furthermore, just about every part of the Spring MVC framework is configurable via plugging in your own interface. Of course we also provide convenience classes as an implementation option.
  • Spring, like WebWork, provides interceptors as well as controllers, making it easy to factor out behavior common to the handling of many requests.
  • Spring MVC is truly view-agnostic. You don't get pushed to use JSP if you don't want to; you can use Velocity, XLST or other view technologies. If you want to use a custom view mechanism - for example, your own templating language - you can easily implement the Spring View interface to integrate it.
  • Spring Controllers are configured via IoC like any other objects. This makes them easy to test, and beautifully integrated with other objects managed by Spring.
  • Spring MVC web tiers are typically easier to test than Struts web tiers, due to the avoidance of forced concrete inheritance and explicit dependence of controllers on the dispatcher servlet.
  • The web tier becomes a thin layer on top of a business object layer. This encourages good practice. Struts and other dedicated web frameworks leave you on your own in implementing your business objects; Spring provides an integrated framework for all tiers of your application.
Implementing EJBs
Using EJBs
Testing


Most of the key point of spring framework already mentioned here, but there are lots of part we haven't covered, or didn't touch the details: e.g. Spring Web Flow, Spring AOP, Available modules.

Thursday, October 11, 2007

Who's using ZK?

Who's using ZK?
Barclays Global Investors (BGI) is the leader in creating investment solutions and also one of the largest asset managers in the world. BGI manages more than $1.8 trillion in assets (December 2006) for institutional and individual investors across the globe. The development teams in Sydney and San Francisco are developing the new Web application with ZK.

Sun Microsystems, Inc. provides network computing infrastructure solutions that include computer systems, software, storage, and services. Its core brands include the Java technology platform, the Solaris operating system, StorageTek and the UltraSPARC processor. For the third year in a row, Sun is among the top 10 Fortune 500 companies that lead the country by providing outstanding commuter benefits to a significant portion of its U.S. Sun has chosen ZK as the frontend to refine a Web application serving Sun's customers in the world.

Swiss Re is the world’s leading and most diversified global reinsurer, offers financial services products that enable risk taking essential to enterprise and progress. Founded in Zurich, Switzerland, in 1863, Swiss Re operates in more than 25 countries and provides its expertise and services to clients throughout the world. Swiss Re chooses ZK to build a system for customer use.

Alcatel-Lucent provides solutions that enable service providers, enterprises and governments worldwide, to deliver voice, data and video communication services to end-users. Alcatel-Lucent today is one of the largest innovation powerhouses in the communications industry. Alcatel-Lucent is using ZK to rewrite Web applications.

Immediate Response Team, Germany, provides ZK-bench, an eclipse-plugin for work with ZK. It's an IDE with features which make the plugin a Next-Generation IDE so that database-based Web-development becomes now easy like a breeze. IR-Team is true for speedy, qualified and fair dealing. She does consulting as well as development for database-based web applications and the development process itself.

Banco Comercial e de Investimentos (BCI Fomento), is one of the largest private financial group in Mozambique. It is contributing for the development of the financial system and the Mozambican economy. ZK is used in the presentation layer of a web application for foreign operations (Payment of Orders, etc.), because the advantage of rich user interface for web applications with little programming.

Govern de les Illes Balears is the local government of les Illes Balearschose area in Spain. ZK is used as the Web front end for both citizen users and government's internal use. RFID is one of the official websites with ZK available for public access now.

Kazeon Systems, Inc. is a leading provider of enterprise information access solutions that revolutionize the way companies search, classify and act on information. The Kazeon Information Server IS1200 was awarded the storage management "Product of the Year" by TechTarget's Storage magazine and SearchStorage.com. The colorful management Web interface for the storage devices is done with ZK.

Taiwan Futures Exchange (TaiFEX) provides investors with more efficient and quality services allowing buyers and sellers to arrive at the best prices for a given futures or options on futures contract. In 2006, TaiFEX's global ranking is 6th on stock index options trading volume. The volume of index futures and options traded at TaiFEX is 114.6 million contracts(2006). TaiFEX is migrating her Futures Management System from client/server to Web-based system with ZK.

MapInfo Corporation is a worldwide leading provider of location intelligence solutions. MapInfo is named to Forbes' 200 Best Small Companies List in 2006. With ZK, MapInfo created a fabulous real-time web map Evention, which supports drag & drop, zoom, traffic analysis and lots of cool functions. "Credit must go to the amazing ZK team. Our tricked user interface is mostly done using their API. We like what they have built."

Odorfer Eisenhof GmbH, Austria, is a 200 years old company providing over forty-thousand products ranging from tools, machines, building and garden necessities to screws, pins, wires and wire goods. Odorfer Online Katalog-System, an online catalog and shopping system, is developed with ZK.

Agriculture, Forestry and Fisheries Research Council (AFFRC) is established under the Ministry of Agriculture, Forestry & Fisheries, Japan. The information center handles and develops the retrieval systems for supply of information concerning research and experiments related to agriculture, forestry and fisheries, both domestic and overseas. AAFRC develops a RiceMet System with ZK to display and compare various types of rice-related data including yield, quality, etc. all over Japan.

China Southern Power Grid Co., Ltd. (CSG), China, is a Fortune Global 500 company. CSG provides power to 230,000,000 people and covers five provinces in China with a west-to-east distance of about 2000 km. Some of CSG's web pages, such as the recruiting pages, have been migrated to modern faces with ZK.

The Ministry of Justice, New Zealand, delivers a wide variety of services from court services and fines collection to policy advice, negotiation of Treaty of Waitangi claims and running the parliamentary elections. The Ministry administers legislation and provides services to contribute to safer communities and a fairer, more credible and more effective justice system. The Ministry adopts ZK to enrich the interface of her Web applications.

Database, Lda, Mozambique, offers customized Apache OFBiz installations for small and medium enterprises. After a six-month evaluation, Database chooses ZK among plenty of Ajax solutions, such as GWT, OpenLaszlo, DOJO. Database is switching all of web-based products (currently 3) to ZK framework.

Sobedi informationsmangement gmbh, Germany, is specialized in professionalizing business project management, knowledge management and procurement. RISK-MAP is Sobedi's risk management solution which provides a web based platform for enterprise wide, international risk management and documentation. Using ZK framework and the proprietary development "Generic Object Framework" (GOF) as the JAVA oriented application development environment, sobedi presents this solution now to international customers.

Noaris Consulting S.L., Spain, is an IT/software company focused on innovational technologies as well as software. Noaris provides a revolutionary view to the software development in order to lead the competitive edge. In the accomplishment of projects, it's crucial important in the phase of selection of technologies. In Noaris, we work with latest technologies in software development. We are expert in consolidated technologies like Java/JavaEE and those emergent ones like Ruby on Rails as well as in frameworks of development based on ZK.

Beijing Institute of Graphic Communication (BIGC), China, is a general polytechnic university of technology, humanities, arts, and management. BIGC is among the first batch of higher learning institutions which were granted the right to confer bachelor’s degrees in China. At present, BIGC has 7,200 full-time students and more than 330 teachers. Teaching Management System, developed with ZK, is a web-based management system for teachers at BIGC.


ADempiere
is a smart professional open source business solution that delivers ERP, CRM, POS, shop floor, supply chain management functionality. Now, ZK has been chosen to Ajaxify ADempiere Posterita, a full web-based highly enhanced Point Of Sale System.
Posterita, Mauritius, is the world pioneer in designing, developing and marketing business for web applications based on ADempiere.

OpenCms is a professional, easy to use website content management solution. As one of the most popular open source CMS, OpenCms helps worldwide content managers to create and maintain beautiful websites fast and efficiently. OpenCms 7 is lanuched in July 2007 after 18 months of development. QuinScape GmbH and Alkacon Software GmbH supported the development of the new version. In order to realize Web inteface up-to-date without complex programming, Quinscape integrate prominent ZK in OpenCms.

The Apache Open For Business Project (OFBiz) is an open source enterprise automation software project. By open source enterprise automation we mean: Open Source ERP, Open Source CRM, Open Source E-Business / E-Commerce, Open Source SCM, Open Source MRP, Open Source CMMS/EAM, and so on. OFBiz uses a "rich client" web UI via ZK framework. That is, a ZK frontend but an OFBiz backend.

LibX is a Firefox extension that provides direct access to your library's resources. LibX is an open source framework from which editions for specific libraries can be built. Currently, 61 academic and public libraries (Harvard, MIT, New York State Library, etc.) are offering LibX editions to their users, and additional 86 libraries are testing editions. LibX Edition Builder uses ZK as the rich user interface to build and manage LibX editions. LibX is created by Annette Bailey and Godmar Back. LibX Edition Builder is written by Tilottama Gaat and Godmar Back.

999FANG.COM is a leading real estate searching engine in China. It is established by a group of professors and technical experts who aims to provide the most friendly real estate searching service to local people. Currently, 999FANG.COM covers 10 major cities in China including Peking, Shanghai and Nanking. ZK plays an important role in 999FANG.COM's searching engine by providing the functional searching user interface.

WebAppCabaret is a leading Java EE Web Hosting and Outsourcing Service Provider in California, offering the latest standards based JAVA EE Servlet containers, EJB servers, and JVMs. WebAppCabaret's portal interface, providing various service options such as e-Commerce, EJB 2.x, the latest PHP, Perl and CGI scripting, is constructed with ZK.

Zero Kelvin Desktop


Web-based desktop environment built by using the ZK AJAX toolkit. It includes advanced, easy-to-use CRUD tools for customized data management.

ROZK - Ruby on ZK

Building CRUD forms with jRuby and ZK with minimal codes.

REM - A NetBeans Module for ZK

REM is a NetBeans module for ZK application development. It can be used to create ZK web Applications, ZUL and ZS documents.

ZK Plugin for NetBeans

A plugin for Netbeans to support developing ZK framework applications.

ZK based application generating engine

Zforms generates web interface for CRUD operations introspecting model beans.

ZiNO

ZiNO, standing for "Zino is Naked Objects", consists of a framework that provides naked objects development to ZK.

Yomari WebDB

A web-based database access tool made with ZK framework.

ZK Knowledge Tree

ZK Knowledge Tree is a web based Document Management System based on ZK fr