3. Seam Sample Project Installation

 Documentation Summary
 Page Summary

What It Does

The Seam sample application shows a basic address book with a list of persons in the left panel and, for each selected person, a list of contacts in the right panel. You may search existing persons by first or last name, and create, edit, and delete persons or contacts, based on the login you choose. Note that admins have the right to modify or delete elements, users only have the right to modify elements they created.

This sample demonstrates most features of the Tide for Seam integration:

  • Managed Entities. EJB 3 entity beans are externalized with the HibernateExternalizer class. The ActionScript3 entities are generated by Gas3 with the specific Tide template. The entities are cached on the client, and subsequent calls on the server to get the state of a particular entity will all work on the same instance on the Flex side.
  • Integration with a Seam EntityQuery Component. The left list of persons is a paginated Tide PagedQuery component which communicates with a server-side Seam EntityQuery. The list is also remotely sorted when the user clicks on a column header and the search text box is mapped to the example person entity used by the restrictions on the EntityQuery.

    Code Sample: PagedQuery is defined in SearchCtl.as and injected in Persons.mxml as a data provider for the DataGrid persons.

  • Integration with a Seam EntityHome Component. Updates on the persons/contacts are made through a Seam EntityHome declared in components.xml.

    Code Sample: Use of personHome remote proxy in AddressBookCtl.as to perform updates on persons/contacts.

  • Lazy Loading of Collections. The right side list of contacts is retrieved lazily when the user selects a person in the left list. Note that entities and collections are cached on the client, and when you click a second time on a loaded entity, the collection is not retrieved again.

    Code Sample: Use in Persons.mxml of the injected variable person.contacts as a data provider for the DataGrid contacts.

  • JMS Integration. The client component DataObserverCtl subscribes to a server JMS topic and merges data updates dispatched by the topic on the client context. On the server-side, an entity listener intercepts data updates and dispatches them on the JMS topic. If you open two browsers on the application, you will see that updates made from a client are automatically propagated to the others.

    Code Sample: Use of Consumer and context.meta_mergeExternal in DataObserverCtl.as.

  • Security. The login/logout is made by the Identity component. Also, buttons are made visible depending on Seam 2.1 permissions retrieved from the server.

    Code Sample: Use of identity.login in Login.mxml, identity.logout in Persons.mxml on the Logout button and binding on identity.logged to select the correct view in the main viewstack (login page or application). Use of identity.hasRole and identity.hasPermission in Persons.mxml.

  • Client Framework. This example requires Flex 3. It shows the use of client components such as AddressBookCtl.as and SearchCtl.as, injections with the In annotation, and Observer methods.
  • Note 1: There are some functionalities in the sample application that are not part of the Tide framework, such as the EntityForm component.
  • Note 2: There is no particular example of a simple usage of the Seam integration without Tide. It is very similar to EJB or Spring and just involves configuring the proper ServiceFactory and defining the destinations in services-config.xml.

Requirements, Installation & Deployment

Follow general requirements here and point your browser to http://localhost:8080/graniteds-ejb3/.

Note: you must have setup the security accordingly to instructions in the graniteds/examples/README.txt file.

You should now see the EJB 3 sample application running.


Browse Space

- Pages
- Blog
- Labels
- Attachments
- Bookmarks
- Mail
- Advanced

Explore Confluence

- Popular Labels
- Notation Guide

Your Account

Log In

Other Features

Add Content

- Add Comment


SourceForge.net Logo
Copyright © 2007-2010 Adequate Systems. All Rights Reserved.