The web layer of the generated JSF CRUD application will contain the following components, which will be generated for each of the entities in the data model. These components are view pars and sub-parts which can be included in custom views, as well as JSF managed beans and abstract managed beans which can be used and derived by other components.
The templates
They define a simple layout for the CRUD forms and include a standard menu linking the CRUD pages together.
The views
Include the re-usable sub-parts generated for each entity. Display the command buttons for CRUD and mapping operations.
The tables
These sub-parts define PrimeFaces data tables which list the records of a given entity.
The edit forms
These sub-parts define PrimeFaces dialogs which include forms for editing a given record for a given entity. They include validation.
The mapping forms
These sub-parts apply to entities which are referenced by other entities. For example, enity "City" is referenced by entities "ZIP Code". In this case, on the view of the "City" entity there will be a button labeled "ZIP Codes". Clicking on this button will open the mapping dialog (which is the included re-usable sub-part) which allows users to add or remove ZIP Codes from the currently selected City.
The search forms
These sub-parts are dialogs which provide access to the search functionality in the entity-related backing bean. The search can be made either by example or by searching for a string in any of the text fields of the entity.
Registry entity beans
These are backing beans for the CRUD views. Since these views are releted to registry entities, their initialization loads all available records for the entity, as well as lists of values for the dependencies of the registry entity. The generated registry entity beans also contain functionality for searching and mapping, as well as CRUD functionality, which is their primary purpose.
Abstract entity beans
These beans are designed for bulk entities. They contain all of the functionality of the registry entity beans, but with abstract initialization methods, making it possible for the implementations of these beans to define custom initialization as required.
Below is an example implementation of a custom entity backing bean.
package com.evilcorp.blackops.worlddomination.web; ... @Configurable @ViewScoped @ManagedBean public class StoreRelatedStocksBean extends StocksBean { private Store store; /* Custom initialization - load only the stocks of the selected store */ @Override protected void loadCollection() { collection = worlddomination.findAllStocksByStore(store); } /* Also load the entity dependency lists, as they ar needed for the search form */ @Override protected boolean ignoreDependencyLists() { return false; } public void setStore(Store store) { this.store = store; } public Store getStore() { return store; } }