A portlet application dedicated to the development and database portlet development including scrollable lists and data entry forms. The 1.1 release contains one portlet, the Database Browser Portlet:
<portlet-class>org.apache.portals.applications.dbBrowser.DatabaseBrowserPortlet</portlet-class>
The portlet is configured with several init parameters for the view. You can just use the supplied templates:
<init-param> <name>ViewPage</name> <value>/WEB-INF/view/database-view.vm</value> </init-param> <init-param> <name>EditPage</name> <value>/WEB-INF/view/database-edit.vm</value> </init-param> <init-param> <name>HelpPage</name> <value>/WEB-INF/view/database-help.vm</value> </init-param>
Portlet Preferences configure the database connection:
Name | Example Value | Description |
---|---|---|
DatasourceType | dbcp | jndi | The type of data source to connect to. Valid values are dbcp (a pooled database connection configured locally), or a jndi data source configured by the application server |
JndiDatasource | jdbc/jetspeed | The name of the JNDI data source. Only valid when DatasourceType is jndi |
JdbcDriver | org.apache.derby.jdbc.EmbeddedDriver | The JDBC Driver qualified Java package and class name. Only valid with DatasourceType = dbcp |
JdbcConnection | jdbc:derby:JETSPEED-DEMO | The JDBC connection string. Only valid with DatasourceType = dbcp |
JdbcUsername | The JDBC database user name. Only valid with DatasourceType = dbcp | |
JdbcPassword | The JDBC database password. Only valid with DatasourceType = dbcp | |
WindowSize | 15 | The size of the browser window page |
tableName | CITY | The name of database table to be viewed |
conditions | where POPULATION > 500000 | The WHERE clause condition when retrieving database rows |
columnNames | ID,NAME,COUNTRYCODE,DISTRICT,POPULATION | The columns to be selected and displayed in the list. If none specified, all columns are selected. |
columnTitles | ID,City,Country Code,District,Population | The titles to display for selected columns, count must match columnNames preference |
orderByColumns | COUNTRYCODE,DISTRICT | The columns to sort by |
Here is an example database browser from the Jetspeed 2.2 demo distribution: