More Website Templates @ TemplateMonster.com - June 16, 2014!

List and Reporting

of

Light Weight Java Utilities & Services

Formerly known as canned list, LWJUS-List is a java component that provides data feed for list/report web pages with dynamic filtering, sorting, and pagination capabilities. A web app template is also included in the package, with which you can build your reporting and list pages like below in minutes by just changing the menus, list names, REST URL, etc.

The template is based on Smart-Table, AngularJS, and Bootstrap. See details in demo page.

At server side, no coding is required for typical use cases, you only need setup list details like SQL template, attributes, filters, order-bys in the configuration file. If you need to manipulate request or response, e.g. adding security filter to request, masking sensitive date in response, you can plug in your code by configuring interceptors. Below is the configuration for the list page in above image:


#configuration for list "employee"
ListRDBMSImpl.[list].employee.sql=select {attributes} from employees e, current_dept_emp de, departments d where {empId} and {lastName} and {firstName} and {gender} and {department} and {active} and de.emp_no = e.emp_no and d.dept_no = de.dept_no order by {orderBy} {pageOffsetLimit}
…
#attributes
ListRDBMSImpl.[list].employee.[attribute].empId.sql=e.emp_no
ListRDBMSImpl.[list].employee.[attribute].empId.type=Integer
ListRDBMSImpl.[list].employee.[attribute].empId.display=Employee ID

ListRDBMSImpl.[list].employee.[attribute].firstName.sql=e.first_name
ListRDBMSImpl.[list].employee.[attribute].firstName.type=String
ListRDBMSImpl.[list].employee.[attribute].firstName.display=First Name
…
#filters
ListRDBMSImpl.[list].employee.[filter].empId.sql=e.emp_no = ?
ListRDBMSImpl.[list].employee.[filter].empId.types=Integer
ListRDBMSImpl.[list].employee.[filter].empId.display=Employee Number equals
ListRDBMSImpl.[list].employee.[filter].empId.placeholder=E.g. 10001

ListRDBMSImpl.[list].employee.[filter].department.sql=de.dept_no = ?
ListRDBMSImpl.[list].employee.[filter].department.types=String
ListRDBMSImpl.[list].employee.[filter].department.display=Department is
#if optionName exists, UI create a select (instead of text input) and use optionName values build options.
ListRDBMSImpl.[list].employee.[filter].department.optionName=deptOption
…
#below is SQL for mysql, this will be different for Oracle 12c, or early version of Oracle using rownum.
ListRDBMSImpl.[list].employee.[filter].pageOffsetLimit.sql=LIMIT ?,?
…
#order by
ListRDBMSImpl.[list].employee.[sort_by].lastName.sql=e.last_name,e.first_name
ListRDBMSImpl.[list].employee.[sort_by].lastName.display=Sort by Last Name

ListRDBMSImpl.[list].employee.[sort_by].lastNameDesc.sql=e.last_name desc,e.first_name desc
ListRDBMSImpl.[list].employee.[sort_by].lastNameDesc.display=Sort by Last Name Descending
…


The template app uses the filter and sort_by configuration to build the search panel (filer, sort by, label, placeholder, options of select etc.) dynamically; it gets the list configuration metadata from "getListDefinition(s)" API.

The SQLs, or LDAP search queries in case of LDAP data source, are generated dynamically based on the SQL template and parameters in request. In this employee list SQL template, the where clause/filters are all "AND" together, it doesn’t have to be like this, you can use "OR" as well, e.g.

select … where ({filter1} or {filter2} or {filter3} and {filter4}) and status='ACTIVE' and {filter5} …
If a filter doesn't appear in the request, it will be removed from template when generate the SQL.

LWJUS-List provides REST API for remote client; for Java application, you can also use Java API by including the jar on classpath.