Fork me on GitHub

java-presentation-manager by jpaoletti

A CRUD java tool

Java Presentation Manager is a CRUD system with extended tools to fast build an administrative and monitoring web site based in xml definition files, with data source and interface independece so you can define your model in xml terms and choose the data sources and visualization that you like most.

Install

This is a maven based project with several modules. A main core module contain the main functionality and definition tools. The other modules are implementations of some of the core aspect, normally the view or the data access. The default visual implementation is based on Struts 1. This is going to change soon to a pure jsp implementation with a custom MVC system.

To use it you need to git clone or download the project, install at your local repo with maven and use the following maven plugin in your web project:

  ...
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-war-plugin</artifactId>
        <version>2.1.1</version>
        <configuration>
          ...
        </configuration>
      </plugin>
    </plugins>
  </build>
  ...

  ...
  <dependencies>
    <dependency>
      <groupId>jpaoletti.jpm</groupId>
      <artifactId>jpm-struts1</artifactId>
      <version>1.0-SNAPSHOT</version>
      <type>war</type>
      <scope>runtime</scope>
    </dependency>
    ...
  </dependencies>
  ...
  
For further reference check http://maven.apache.org/plugins/maven-war-plugin/overlays.html

Screenshots

Those are some screenshots with default template, in english.






Configuration

How you get jPM configured? Its just a matter of some xml files. Detailed information can be found at our wiki page

Sample Configuration File

<?xml version="1.0" encoding="UTF-8"?>
<presentation-manager>
    <property name="debug" value="true"/>
    <property name="appversion" value="1.0.0"/>
    <property name="ignore-db" value="true"/>
    <property name="template" value="default"/>
    <property name="copyright" value="Jeronimo Paoletti"/>
    
    <property name="default-converter" 
              value="jpaoletti.jpm.struts.converter.DefaultStrutsConverter"/>
    
    <property name="security-connector" 
              value="jpaoletti.jpm.security.core.PMVoidSecurityConnector"/>

    <!-- External Converters -->
    <property name="external-converters" value="jpm-econverters.xml"/>

    <!-- Busissnes Entities -->

    <property name="entity" value="entities/simpleclass.xml"/>
    <property name="entity" value="entities/complexclass1.xml"/>
    <property name="entity" value="entities/complexclass2.xml"/>
    <property name="entity" value="entities/weakclass.xml"/>
    <property name="entity" value="entities/parentclass.xml"/>

    <!-- Monitors -->
</presentation-manager>

Sample Entity File

<?xml version='1.0'?>
<entity id="complexclass1" 
        clazz="jpaoletti.jpm.struts.test.model.ComplexClass1" 
        extendz="simpleclass">
    <dataAccess class="jpaoletti.jpm.struts.test.ui.DataAccessComplexClass1" />
    <order>id description amount date datetime active key </order>
    <operations>
        <operation id="list" enabled="true" scope="item">
            <properties>
                <property name="operation-column-width" value="1px" />
                <property name="show-row-number" value="true" />
            </properties>
        </operation>
        <operation id="show" scope="item" display="edit list" />
        <operation id="add" scope="general" display="all" />
        <operation id="edit" scope="item" display="edit show list" />
        <operation id="delete" scope="item" display="edit show list" confirm="true"/>
    </operations>

    <field id="amount" width="100" display="all" align="right">
        <converters>
            <econverter id="show-cash" />
            <converter class="jpaoletti.jpm.struts.converter.EditDecimalConverter" 
                       operations="add edit" />
        </converters>
    </field>
    <field id="date" width="70" display="all">
        <converters>
            <econverter id="edit-date" operations="add edit" />
            <econverter id="show-date" operations="list show" />
        </converters>
    </field>
    <field id="datetime" width="130" display="all" >
        <converters>
            <econverter id="show-datetime" />
        </converters>
    </field>
    <field id="active" width="30" display="all" align="center">
        <converters>
            <converter class="jpaoletti.jpm.struts.converter.ShowBooleanConverter" 
                       operations="list show" />
            <converter class="jpaoletti.jpm.struts.converter.EditBooleanConverter" 
                       operations="add edit" />
        </converters>
    </field>
    <field id="key" width="150" >
        <converters>
            <converter class="jpaoletti....ShowLocalizedStringConverter" 
                       operations="show list" />
            <econverter id="edit-50-string" operations="add edit" />
        </converters>
    </field>
    <field id="size" width="75" >
        <converters>
            <econverter id="show-cm" operations="show list" />
            <econverter id="edit-long" operations="add edit" />
        </converters>
    </field>
</entity>

License

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with this program.  If not, see http://www.gnu.org/licenses/.

Download

You can download this project in either zip or tar formats.

You can also clone the project with Git by running:

$ git clone git://github.com/jpaoletti/java-presentation-manager