Customization

General Guidelines

  • Generate with nearest match and then customize. For example, if you need a blob field, configure the field as String and generate the code. Add a @lob annotation at the field in the JPA bean class for the entity.
  • Generate Everything and then choose. There is no extra cost in generating extra code. So generate as many options as you like and choose what you really want.
  • Database Connection. After generating the application, update database connection string to match your database. If the your database is not MySql, you will have to add the JDBC driver jar of the your database to class path (typically to server library).
  • Database Scripts. Run the generated database scripts to initialize the security service and permission data. This is needed only if you use the security module that comes with the generated application.
  • Home Page. Since this is your landing page, most of the customization will go in here. There is not much of automation can be done for the home page. By default all the list and search page links are appear in the home page.
  • Email Customization. If you are using email feature of the application, you will have to provide the email server information in the property file of the application. The fields are populated with a sample gmail server information as a guide.

Adding New Services

Adding a new service involve the following steps. At each step you can look at an existing method and copy and modify for your needs. Once you familiarize with the system, it should not take much time to add or modify a service by changing the code in different layers

  1. Write new DAO method, if the service needs data access
  2. Write the new service method in the Service class
  3. Write a method in the Rest Resource class.

You should be able to use the service from the Angular JS. There are many existing working code that will guide you writing the new code.

Filters

By default most of REST service can be invoked only by a logged in user. The security filter checks the URL and checks if the user is logged in. However, all the REST URLs that have a /guest/ in the path as assumed to be public. So if you want to allow the unauthorized to access the REST service, either add /guest/ to the URL path or comment out the checking in the filter class.

Background Jobs

The generated application does not have any background processing code. However a placeholder class is created to help the customer add any back ground processing code they need.

Types of pages

Following are different types of pages generated. You can use/discard/modify these pages to suit your need. The generation uses a Search-List-Edit-Detail page paradigm for the user interface. Entities related by one to many relation can be edited from detail page. All the list items are paginated in the server for performance and usability reasons.

  • Home Page
  • Search Page
  • List Page
  • Edit Page
  • Parent-Child Edit Page
  • Detail Page

Home Page

This is the landing page of the application. The default generated page may not reflect the look and feel you want. This may be the page you would want to customize mainly for the look and feel of the application.

Search Page

All the fields for which you specified 'search' in attribute are included in the list fields. You can include or exclude a field by changing just the html (in src/main/webapp/partials/<entity name>_search.html)

List Page

All the fields for which you specified 'list' in attribute are included in the list fields. You can include or exclude a field by changing just the html (in src/main/webapp/partials/<entity name>_list.html)

Detail Page

All the fields which are not hidden or primary key or foreign key are displayed in the detail page. You can include or exclude a field by changing just the html (in src/main/webapp/partials/<entity name>.html)

Edit Page

All the fields that are not hidden or key are included in the list fields. You can include or exclude a field by changing just the html (in src/main/webapp/partials/<entity name>_edit.html)

Data Validations

Each of the JPA bean has a validate method, The generator puts some of the validations (mandatory fields, field size etc). You can add more validations in these methods. The data is persisted only if it passes the validation.

Security

If your planning to use the security module, you will have to run the sql files packaged in ?? in your database. This script will create required data for the security to work. It will also create two uses 'admin' (password: 'admin1') and 'user' (password: 'user1')

Themes

The generated application does not use any in-line styles. So it is easy to modify by overriding the CSS classes in the style file or using a completely different style file altogether.

The default application comes with Bootstrap style. But generated application has a CSS style file (_theme.css) in src/main/webapp/styles folder of the web application. You can modify this file to change the style, or use a different style in the index.html.

results matching ""

    No results matching ""