AJAX In Action [207]
We are all accustomed to classic portals—we’ve been using them for years—and a lot of company intranets are using them to improve company performance by having everything in one place. The classic portal is one that allows a user to log into the system and have the content personalized to her tastes. For example, a Licensed to jonathan zheng The evolving portal 425 company portal can have one setup for a salesperson and another setup for a computer programmer. Both of these employees may need to have a window to the company calendar, but they both may not need to see the sales figures or the bug report for the applications. By limiting what they can see, we increase company security and improve the employees’ performance since they do not have to search for information all over the company intranet. Another example of a classic portal is Yahoo!. When we log into Yahoo!, we can check mail, change the weather to fit our current location, change the look, and so much more. As you can see in figure 11.1, Yahoo!’s portal is customized to the needs of the user. Yahoo! accomplishes this by sending us to maintenance screens to alter the information. One example of the maintenance page allows us to select the city that we live in so that the weather forecast is for our area. In figure 11.1, you can Figure 11.1 Yahoo!’s portal shows customized information. Licensed to jonathan zheng 426 CHAPTER 11 The enhanced Ajax web portal see that the weather is customized to Laurel, Maryland. While it is great that we can customize the information we want to see, we can enhance the user experience even more by incorporating Ajax into the portal in the same way that Amazon did with the A9.com portal. 11.1.2 The rich user interface portal With an Ajax portal, the rich user interface is more dynamic than a classic portal while positively impacting the user’s experience. We can add new content and change the way the content is displayed in a seamless manner. A great example of this seamless interaction is in Amazon’s A9.com search portal. Let’s look at how that works. In figure 11.2, a search has been performed for Eric Pascarello with only the Web checkbox selected. Now let’s narrow the search results. We know that we are looking for a book that Pascarello has written, so we click the Books checkbox. The Book Results pane is inserted into the right-hand side of the page. The search results for Eric Pascarello’s books are displayed without posting the entire page back to the server to obtain them, as shown in figure 11.3. Another example of using Ajax to enhance the portal experience is in the configuration of the portal. Ajax allows the user interface to become part of the Figure 11.2 A9.com’s portal with the web results for Eric Pascarello Licensed to jonathan zheng The Ajax portal architecture using Java 427 Figure 11.3 A9.com’s portal showing the search results with the Book Results column configuration-management tools by having the user click on objects in the window instead of going to another web page to configure the setup. The user can dynamically resize and position the elements on the screen, thus customizing his portal to fit his needs exactly. Now that we’ve seen some of the advantages of an Ajax portal, let’s look at the architecture of the portal we will be building. 11.2 The Ajax portal architecture using Java To provide a highly customizable Ajax portal for multiple users, we need clientside code, server-side code, and a database. The client side handles the users’ interactions with the windows, such as dragging, dropping, and sending data back to the server with Ajax. The server, in return, handles our users