The JavaServer Faces (JSF) Classified Ads Web site is similar to
many Web-based classified advertisement sites. When you first open the site,
you are redirected to the home page. A tiles template has been applied to
all of the site pages so that the banner and navigation are available on all
pages.
The sample is composed of four tiles:
- Header tile - Displays the banner image and navigation links. This tile
is common to all of the site pages.
- Footer tile - Displays the copyright and limitations statements. This
tile is common to all of the site pages.
- Search/Login tile - Displays the search, login forms, and site statistics.
This tile is common to all of the site pages.
- Content tile - Displays the page specific content.
All the advertisement, news items, and related data are held in a database.
A Derby database containing the sample data is packaged with the sample. Plus,
an administrator account is provided to demonstrate administrative functions
on such a site. The login function is not a proper implementation of login
and does not provide correct authentication. Details of the administrator
tasks are described below.
About the Classified Ads Web site
The top of the
JSF page (header tile) contains the following navigation links:
- Home - The sample home page.
- Browse - Opens a page from which the site user
can browse any advertisement placed on the site.
- Place an Ad - Allows users to create and list an
advertisement.
- Search - Advanced search of the advertisements.
The left side of the JSF page (search/login tile) contains the
following form inputs and navigation links:
- Quick Search - Enables any user to search for advertisements
based on Title or the Location. Searches are case sensitive.
- Sign in - Enables registered users to log into
the site.
- Sign out - Logs out the current user. This navigation
link is visible only when user has already logged in.
- Register - Enables users to create a new user or
administrator account.
- Admin - This navigation link is only visible when
issuers are logged in as an administrator. For this sample you can log with
the username admin and the password admin, or register your own administrator
account. The Admin page allows users to manage the ad categories.
Pages in the Classified Ads Web site
- Home
- The Web site home page. It contains the following content:
- Latest Ads. A data table filtered to display the
latest 5 advertisements. When an ad is selected a details page opens with
more information about the ad item.
- News. An area where news items about the site are
displayed. The news content can be modified by the site administrator. When
a headline link is clicked, the news item page opens.
- Browse
- Opens a page that allows site users to browse the advertisements. The
page displays all of the categories and subcategories of the available ads.
The category and subcategories are used to filter the advertisement search.
When an ad is selected, the details for that ad are displayed.
- Search
- Provides advanced search capabilities for the advertisements in the site.
Searching without specifying search criteria will display all advertisements,
displayed in a paged data grid with 5 items per page by default. Search based
on the Title and Description criteria
are case sensitive. Users can select the categories to search within and also
a price range. Selecting an advertisement from the Search Results page will
display the advertisement details.
- Place an Ad
- Allows users to create an advertisement and post the advertisement to
the Web site. Users can specify the category and subcategory under which the
item should be placed. A file upload facility is available for users to include
an image. A rich text editor component is provided to allow users to create
a formatted ad description. Once the ad is completed and submitted the posting
is stored in the backend database. A confirmation of the posting detail is
displayed.
- Sign out
- Logs out the current user. When this option is selected the administrator
is logged out.
- Performing administrative tasks
- The Admin link is only visible when you are logged in as an administrator.
For this sample, you can log in with the username admin and
password admin, or you can register to create your
own administrator account. The link opens a page that allows users to manage
news items, available categories, and view the details of the classified ads
in edit mode. Administrative tasks for this site include the following:
- The modification and deletion of advertisements.
- The addition and modification of categories and subcategories - deletion
can be made to categories without ads.
- The creation, modification and deletion of news items.