Stripes framework and jQuery: AJAX forms and HTTP Session Validation

October 23rd, 2008 by Samuel Santos 1 comment »

This example was greatly inspired by the Stripes and jQuery AJAX Forms article from Freddy Daoud, but with some nice improvements

Last week I was working on a new Stripes/AJAX example. It involves having a table listing entities, being the last row of the table a form for adding new ones.
The form gets submitted via AJAX, using jQuery, and the response is validated in order to check if the HTTP session is still valid.

If everything is OK, the list is refreshed and a success message appears. On the other hand, if validation errors occur, the list is refreshed and an error message appears.
Also, if the user’s session has expired on the server, an alert is shown to inform the user that his session is invalid, and the page is reloaded so the user can login once more.
» Read more: Stripes framework and jQuery: AJAX forms and HTTP Session Validation

The Semantic Web and RDFa

August 29th, 2008 by Samuel Santos 3 comments »

There is a lot of momentum around Semantic Web and RDFa.
This may be caused by the big milestone reached for RDFa, a Candidate Recommendation of RDFa in XHTML: Syntax and Processing.

Recently, several discussion threads have been started on the WHATWG mailing list around the effort of integrating RDFa into the HTML5 specification as XHTML1.1 and XHTML2 that will have it integrated.

While I was pretty aware of the Microformats activity, I can’t say the same about RDFa. But Manu Sporny makes it a lot easier. In fact, this is by far the most comprehensive explanation of RDFa that I have ever seen.
» Read more: The Semantic Web and RDFa

samaxesJS JavaScript Controls

July 23rd, 2008 by Samuel Santos No comments »

samaxesJS is a set of utilities and controls, written in JavaScript, for building rich interactive web applications.

The first extension is a dynamic Table of Contents script.

The TOC control dynamically builds a table of contents from the headings in a document and prepends legal-style section numbers to each of the headings:

  • adds numeration in front of all headings,
  • generates an HTML table of contents,
  • degrades gracefully if JavaScript is not available/enabled.

More information available in the project home page at Google Code Hosting.

BIRT/Stripes framework example

June 23rd, 2008 by Samuel Santos 6 comments »

A long time has passed since my previous BIRT examples Deploying BIRT Report Engine API with Jakarta Struts and Deploying BIRT Report Engine API with Stripes.
Although they have received a lot of attention and downloads, the examples were really basic and are now outdated.

Since I had to use BIRT in my last projects I decided to update my BIRT/Stripes example.
This example doesn’t depend on the Tribix project anymore since BIRT supports HTML/Paginated HTML, PDF, Excel, Word, PowerPoint, and PostScript outputs (images/charts are not embedded in Excel output).

BIRT WebReport Example

I’ve tried to follow some good practices that I think are important to use in a production application:

  • There is a significant cost associated with creating an engine instance, due primarily to the cost of loading extensions. Therefore, each application should create just one ReportEngine instance and use it to run multiple reports. In this example the engine is started in the context listener and the same instance is always used.
  • All texts in the report should be loaded from the resources so the application can be fully localizable and fully internationalized.
  • You should use a JDBC data set to preview your report with BIRT designer but you must swap the data set in runtime to use data from your business logic.
  • You should use predefined styles instead of custom styles as much as you can.
  • Not a good practice but often a requirement, hide the master page when generating a HTML report, and change the visibility of elements so they are visible only to specified outputs.

For this example BIRT Runtime Engine 2.2.2 2.3.1, and Stripes Framework 1.5 were used.
» Read more: BIRT/Stripes framework example

HTML 5 @media 2008

June 16th, 2008 by Samuel Santos No comments »

Now that almost everyone has heard about HTML 5, maybe not all of you know what’s new for us developers.

Lachlan Hunt and James Graham have presented on 2008-05-29 at @media 2008 in London Getting Your Hands Dirty with HTML5.
I really find it a great presentation and a good start if you want to check what’s new with the new HTML/XHTML version.

Lachlan Hunt is also the editor of The Web Developer’s Guide to HTML 5. Any suggestions can be added to the wiki.
We are all welcome to contribute, so let’s get our hands dirty!

.htaccess – gzip and cache your site for faster loading and bandwidth saving

April 20th, 2008 by Samuel Santos 90 comments »

Update: Please read Improving web performance with Apache and htaccess for an updated version of this article.

Last week I changed my hosting provider from Site5 to NearlyFreeSpeech.NET.
Despite the fact that the first one is faster than the second, NFSN is a lot more cheaper (I only pay for what I really use).

So in order to speed up my site and save bandwidth (the more I use the more I pay) I use .htaccess file to gzip my text based files and optimize cache HTTP headers.
Although this site is powered by WordPress which has some really great plugins to optimize PHP output I wanted a more generic solution which can be applied to all PHP web applications.

I also try to follow as much as I can the rules for high performance web sites so don’t be surprised if some Expires header seems too long (far future Expires header rule requires at least 172801 seconds).
» Read more: .htaccess – gzip and cache your site for faster loading and bandwidth saving

Alfresco and Web Content Management – Part II

March 26th, 2008 by Samuel Santos No comments »

I’ve had a lot of feedback with my article Exactly what is Alfresco?. A recurrent question I’ve received was where to find more info about WCM with Alfresco.

You can Download Alfresco Web Content Management 2.1 under Download Alfresco Community Network. There you can find Alfresco 2.1 Web Content Management Product Evaluation Guide which is a very complete guide about the WCM module.

Hope this helps.

Internet Explorer 8 Application Compatibility VPC Image

March 6th, 2008 by Samuel Santos No comments »

Alongside with the IE6/IE7 Application Compatibility VPC Images (VPC Hard Disk Image for testing websites on IE on Windows XP SP2), Microsoft now provides an IE8 version.

This is a great way to test your web applications since the IE8 Beta1 installation overwrites the previous IEs present in your system.

Web Standards Support in IE8

March 5th, 2008 by Samuel Santos 1 comment »

I’m really impressed about Microsoft responding to their customers and to the community.

Microsoft Expands Support for Web Standards
Company outlines new approach to make standards-based rendering the default mode in Internet Explorer 8, will work with Web designers and content developers to help with standards behavior transition.

Microsoft’s Interoperability Principles and IE8
We’ve decided that IE8 will, by default, interpret web content in the most standards compliant way it can. This decision is a change from what we’ve posted previously.
Microsoft recently published a set of Interoperability Principles. Thinking about IE8′s behavior with these principles in mind, interpreting web content in the most standards compliant way possible is a better thing to do.

That’s awesome. An unified industry can move forward.

Code Gallery – new Microsoft sharing place

February 7th, 2008 by Samuel Santos No comments »

Microsoft has created Code Gallery.

Code Gallery is a place for projects sharing, created to demonstrate .NET key features with a primary focus on C#.