enterprise-app
Common functionality for Vaadin enterprise applications (CRUDs, reports, import/export data, scheduled jobs, audit logs)
**NOTICE: I'm no longer supporting this add-on. I've developed individual add-ons to replace it. See: Crud UI Add-on Report UI Add-on **
Enterprise App allows you to easily build CRUD-based Vaadin applications in minutes.
Easily integrate Hibernate, JasperReports and Quartz technologies in Vaadin applications.
Features:
Easy creation of CRUD (create, read, update and delete) interfaces for your JPA entities with filters for a
Full customization of CRUD components: Hide or show forms, tables and buttons as requiered.
No code generation. Enterprise App provides useful and powerful components that you can extend to meet your own requirements.
Open Source (https://github.com/alejandro-du/enterprise-app).
Easy creation of reports with export capabilities to many formats (including Excel, Word, PowerPoint, PDF, OpenOffice and CSV).
Easy configuration of audit logs for all actions performed by users on the database.
Automatic configuration and startup of Quartz for scheduled jobs excecution.
HQL Query browser component.
Visit http://enterpriseapp.alejandrodu.com for more information.
Sample code
package enterpriseapp.tutorial; import com.vaadin.ui.Window; import enterpriseapp.EnterpriseApplication; import enterpriseapp.ui.crud.CrudBuilder; import enterpriseapp.ui.crud.CrudComponent; public class TutorialEnterpriseApplication extends EnterpriseApplication { @Override public void init() { super.init(); CrudComponent crud = new CrudBuilder(Person.class).build(); crud.setSizeFull(); Window mainWindow = new Window("Address Book"); mainWindow.addComponent(crud); setMainWindow(mainWindow); } }
package enterpriseapp.example.report; import java.awt.Color; import java.util.Collection; import ar.com.fdvs.dj.domain.AutoText; import ar.com.fdvs.dj.domain.Style; import ar.com.fdvs.dj.domain.builders.DynamicReportBuilder; import ar.com.fdvs.dj.domain.builders.StyleBuilder; import ar.com.fdvs.dj.domain.constants.Font; import ar.com.fdvs.dj.domain.constants.HorizontalAlign; import com.vaadin.ui.Component; import enterpriseapp.Utils; import enterpriseapp.example.container.ExampleContainerFactory; import enterpriseapp.example.dto.Person; import enterpriseapp.example.ui.Constants; import enterpriseapp.ui.reports.AbstractReport; public class CallingReport extends AbstractReport { @Override public String[] getColumnProperties() { return new String[] {"firstName", "lastName", "city", "phoneNumber"}; } @Override public Class<?>[] getColumnClasses() { return new Class<?>[] {String.class, String.class, String.class, String.class}; } @Override public String[] getColumnTitles() { return new String[] { Utils.getPropertyLabel("person", "firstName"), Utils.getPropertyLabel("person", "lastName"), Utils.getPropertyLabel("person", "city"), Utils.getPropertyLabel("person", "phoneNumber") }; } @Override public Collection<?> getData() { // here we need to return all the data to show in the report // this will be called when the "Refresh" button is clicked return ExampleContainerFactory.getInstance().getContainer(Person.class, null).listAll(); } @Override public Component getParametersComponent() { // we could add a component to add into the "Configuration" section, but we don't need one here return null; } @Override public DynamicReportBuilder getReportBuilder() { // let's override this method to add some elements to the report DynamicReportBuilder reportBuilder = super.getReportBuilder(); Style headerStyle = new StyleBuilder(true).setFont(Font.ARIAL_MEDIUM).build(); reportBuilder.addAutoText(Constants.uiForInternalUseOnly, AutoText.POSITION_HEADER, AutoText.ALIGMENT_LEFT, 200, headerStyle); reportBuilder.addAutoText(AutoText.AUTOTEXT_PAGE_X_OF_Y, AutoText.POSITION_HEADER, AutoText.ALIGNMENT_RIGHT, 200, 10, headerStyle); reportBuilder.addAutoText(Utils.getCurrentTimeAndDate(), AutoText.POSITION_HEADER, AutoText.ALIGNMENT_RIGHT, 200, headerStyle); Style titleStyle = new StyleBuilder(true).setPadding(0).setFont(Font.ARIAL_BIG_BOLD).setHorizontalAlign(HorizontalAlign.CENTER).build(); reportBuilder.setTitleStyle(titleStyle); reportBuilder.setTitleHeight(18); reportBuilder.setTitle(Constants.uiCallingReport); Style footerStyle = new StyleBuilder(true).setFont(Font.ARIAL_MEDIUM).setTextColor(Color.GRAY).build(); reportBuilder.addAutoText("Powered by Enterprise App for Vaadin", AutoText.POSITION_FOOTER, AutoText.ALIGMENT_LEFT, 200, footerStyle); return reportBuilder; } }
Links
Compatibility
Was this helpful? Need more help?
Leave a comment or a question below. You can also join
the chat on Discord or
ask questions on StackOverflow.
Version
- Released
- 2013-02-23
- Maturity
- BETA
- License
- GNU Affero General Public License v3.0
Compatibility
- Framework
- Vaadin 6.8
- Browser
- N/A