Professional Documents
Culture Documents
com
3. JRapid web-based Designer ....................................................................................................................18 3.1 Components......................................................................................................................................18 3.1.1 Toolbar .......................................................................................................................................19 3.1.2 Perspectives: Main and Files......................................................................................................20 3.2 Generation Modes: Dirty Mode vs. Real Mode ................................................................................20 3.3 The Project Stats ...............................................................................................................................21 3.4 Validation: Syntax and semantic.......................................................................................................22 3.4.1 Syntax validation........................................................................................................................22 3.4.2 Semantic validation....................................................................................................................22 3.4.3 Keyboard Shortcuts....................................................................................................................22 3.5 Perspectives and Views.....................................................................................................................23 3.5.1 Main perspective .......................................................................................................................23 3.5.2 Files view....................................................................................................................................26 4. Basic Tutorial...........................................................................................................................................27 4.1 Creating an entity..............................................................................................................................27 4.2 Generated files..................................................................................................................................29 4.3 Entering data.....................................................................................................................................29 4.3.1 Inserting the first company........................................................................................................30 4.3.2 Inserting more companies .........................................................................................................30 4.4 Adding some useful features ............................................................................................................31 4.4.1 Data types, widgets, and basic type validation..........................................................................31 4.4.2 Validation rules ..........................................................................................................................32 4.4.3 Default values ............................................................................................................................33 4.4.4 Autosuggest ...............................................................................................................................34 4.5 Previewing the application ...............................................................................................................35 4.6 Looking ahead: connecting entities ..................................................................................................35 4.6.1 More information ......................................................................................................................35 4.6.2 Scalability ...................................................................................................................................36 5. JRapid Elements ......................................................................................................................................37
5.1 Listing ................................................................................................................................................37 5.2 Condition / Restriction......................................................................................................................38 5.3 Filter ..................................................................................................................................................39 5.4 Subset................................................................................................................................................40 5.5 Action ................................................................................................................................................41 5.6 Defaultset..........................................................................................................................................42 5.7 Transient Entities: Implementing more than CRUD use cases .........................................................42 5.7.1 Use case process ........................................................................................................................43 5.7.2 Implementation .........................................................................................................................44 5.8 Embedded Listing..............................................................................................................................44 5.9 Report ............................................................................................................................................... 45 6. Intermediate Tutorial..............................................................................................................................46 6.1 Collections.........................................................................................................................................48 6.1.1 Collection properties..................................................................................................................48 6.1.2 Embedded collections................................................................................................................52 6.2 Adding filters to listings ....................................................................................................................53 6.2.1 Property filter.............................................................................................................................53 6.2.2 Other filters................................................................................................................................54 6.3 Implementing a Prizes use case (NOT FOR SHARED SERVERS)......................................................55 6.3.1 Adding elements ........................................................................................................................55 6.3.2 Implementing Java Service.........................................................................................................58 6.3.3 Running the use case .................................................................................................................59 6.4 Looking ahead: more server side programming ...............................................................................61 6.4.1 Server side validation.................................................................................................................61 6.4.2 Access level ................................................................................................................................61 6.4.3 Custom pages.............................................................................................................................61 6.4.4 Front end calculations................................................................................................................61 7. JRapid Architecture .................................................................................................................................62 7.1 Generated architecture.....................................................................................................................62
7.1.1 Presentation tier: HTML + JavaScript.........................................................................................62 7.1.2 Logic tier.....................................................................................................................................63 7.1.3 Data tier .....................................................................................................................................67 7.1.4 Modifiable and read-only files ...................................................................................................68 7.1.5 Extending presentation layer.....................................................................................................68 7.1.6 Extending Java classes................................................................................................................69 7.2. Languages.........................................................................................................................................69 7.2.1 F-Path: Forms X-Path .................................................................................................................69 7.2.2 Expression Language (EL)...........................................................................................................69 7.2.3 HQL.............................................................................................................................................70 7.3 JRapid runtime library.......................................................................................................................70 7.3.1 Controller: Request processing cycle.........................................................................................70 7.3.2 RESTful web services API ...........................................................................................................71 7.3.3 Entities .......................................................................................................................................72 7.3.4 Exceptions ..................................................................................................................................72 7.3.5 Data Access Objects (DAO) ........................................................................................................73 7.3.6 Session .......................................................................................................................................74 7.3.7 Stereotypes ................................................................................................................................74 7.4. More about third party frameworks................................................................................................75 7.4.1 Hibernate ...................................................................................................................................75 7.4.2 jQuery.........................................................................................................................................75 7.4.3 Castor XML .................................................................................................................................75 7.4.4 Log4J...........................................................................................................................................76 7.4.5 Apache XMLRpc .........................................................................................................................76 8. Advanced Tutorial ...................................................................................................................................77 8.1 Writing advanced expressions ..........................................................................................................77 8.1.1 Default using EL and built-in function........................................................................................77 8.1.2 CalculatedValue .........................................................................................................................78 8.1.3. DynamicValue ...........................................................................................................................78
8.2 Writing application logic ...................................................................................................................78 8.2.1 ServiceException ........................................................................................................................78 8.2.2 ConfirmationException ..............................................................................................................79 9. Add-Ons...................................................................................................................................................81 9.1 Views.................................................................................................................................................81 9.1.1 The underlying concept .............................................................................................................82 9.1.2 Using views ................................................................................................................................83 9.2 Widgets .............................................................................................................................................83 9.2.1 The underlying concept .............................................................................................................84 9.2.2 Using widgets .............................................................................................................................84 9.3 Templates..........................................................................................................................................85 9.3.1 The underlying concept .............................................................................................................85 9.3.2 Using templates .........................................................................................................................85 9.3.3 Developing templates ................................................................................................................86 9.4 Transformers.....................................................................................................................................86 9.4.1 Using Transformers....................................................................................................................87 9.4.2 Developing Transformers...........................................................................................................87 10. Reports..................................................................................................................................................88 10.1 About Jasper Reports......................................................................................................................88 10.2 Integration modes...........................................................................................................................88 10.2.1 Application ...............................................................................................................................88 10.2.2 Repository ................................................................................................................................91 10.3 Parameterized reports ....................................................................................................................93
1. Introduction
The construction of AJAX web applications usually takes along unnecessary repetition of code. This happens even more frequently when the applications are based on large data models and most of the functionality is performing CRUDs. When modeling the data, some frequently repeated patterns (n-n relations, calculated fields, relations between fields) have to be coded again and again. This takes to greater developing times, greater costs, and undesired bugs. Code generation is the answer to this issue. Another fact is that every day, skills required to design, develop and maintain these applications are higher, and the variety of languages and frameworks so huge that the task turns into something unreachable. New frameworks and tools often ask the developer to spend hours setting up such a complex development environment just to see the first screen working. Easy-to-use web based development tools resolve this problem. There is also a big final barrier for developers when the deployment stage comes: the complexity of preparing server environments, the time spent publishing each version and the availability of the resulting application for final users are a considerable headache too. JRapid addresses all these currently unresolved issues in web applications: building high quality, maintainable, fault tolerant and scalable software while minimizing developing and deploying time, through an easy-to-use web base IDE.
And everyone who wishes to build enterprise level web applications easily, fast, but with no need of a programming background.
Chapters summary
The book is organized to help the reader learn gradually the necessary concepts and be able to jump to the platform. It is based on three main tutorials; before each one of them, the necessary background is provided to make the experience easier and totally natural.
Chapter 1 introduces the platform, explaining the motivation, advantages of use and main characteristics of the resulting applications. Chapter 2 explains the basic concepts the user must understand before creating applications with JRapid. These concepts are easy and strongly related with well known ideas from Domain-drive design, Object Oriented Programming and relational databases. Chapter 3 introduces JRapid web-based Designer. The reader will understand the few steps needed to get applications running, along with the underneath code generation, compilation and publishing processes. It also describes the different toolbars, views and panels available. Chapter 4 takes the reader -from this moment on, the user- to the platform, experiencing a full development cycle for the first JRapid application, proving how easy is to design, implement and publish the creations. Chapter 5 goes a bit deeper on JRapid concepts, explaining functional patterns. These patterns are highlevel behaviors that exist in almost every application, and that were almost never seriously considered before JRapid appeared. Chapter 6 takes the user one step forward, introducing the use of functional patterns. Firstly, it drives the user to the problem and it finally suggests the mentioned patterns as a solution, also including JRapid code for implementing it. Chapter 7 describes JRapid architecture, which consists of generated file structure, Java packages, thirdparty libraries and mainly, JRapid runtime library. It finally explains the way generated application server processes requests from the interface. Understanding what happens under the hood is necessary to take full advantage of JRapid benefits. Chapter 8 advanced tutorial puts the reader in front of real world and in consequence, real applications- requirements. It teaches how to simply implement use cases, integrate reports, and many other common tasks that frequently appear when working in enterprise-level applications. Chapter 9 is about JRapid Community Chapter 10 introduces Jasper Reports integration with JRapid applications.
1.2 Overview
The platform is composed of a powerful code generator JRapid CodeGen- , a web based IDE, and an innovative 'cluster of clusters' cloud hosting. JRapid CodeGen is a tool that generates Java web applications ready to be used, starting from a system model. Its core takes a definition of the desired application (as a diagram similar to an ERD), and generates all the necessary files (HTML, Java Classes, XML, SQL) to get the application running. The resulting piece of software can then be extended to add complex business logic. It can also be regenerated after customization, as it takes advantage of the inheritance OOP principle to keep generated and custom code perfectly separated.
JRapid is targeted towards AJAX web developers both advanced or newbies- aiming to build fault tolerant and scalable applications. Customers may vary among freelancers, ISVs, corporations and software factories. And for all of them JRapid has a unique value proposition. Even as revolutionary as its technology is JRapids way of use: it's consumed as a service, entering in www.jrapid.com or on behalf of many of the favorites IDE in the market -e.g. Eclipse-. One of the most important features is that JRapid is just a tool that helps developers to get their own Java web applications in a better way, and it doesnt force anybody to learn a new language nor creates dependence. Source files are yours and are easily legible and understandable. JRapid success relies on some key features of its code generator that make it unique:
Productivity
JRapid CodeGen improves productivity. Applications with hundreds of tables and complex data models can be developed in a few hours with a robust architecture. In a few seconds, new fully functional screens can be added to existing applications, driving to efficient iterative development methods.
Quality
JRapid CodeGen results in quality. The applications are obtained from a generated code that has been thoroughly tested in existing applications. Resulting application consists in two big levels of code. Generated code is error-proof and its quality is guaranteed by JRapid.
Domain-driven design
Domain-driven design provides a natural way of defining systems, focusing on the domain and domain logic, instead of focusing on the specific technology. JRapid provides off-the-shelf technology, and the developer concentrates on the model that represents the complex domain.
Complex applications
JRapid allows the generation of applications with complex business logic, which means much more than simple CRUDs. Its powerful Java architecture with BPM support guarantees base technology for the development of enterprise level systems.
Desktop-like interfaces
JRapid creates AJAX/RIA applications with desktop-like interfaces. Users forget that they are working online, thanks to the revolutionary look & feel that it provides.
AJAX / Web
The applications are AJAX web based, meaning that they don't need to be installed, are multiplatform, and can be accessed remotely. This results in benefits to the developers and the applications users.
Multitenancy
Multitenancy is an architectural principle where a single instance of software running on a server allows different clients to access their data separately. As a consequence the developer can scale while minimizing the need for resources.
10
Open
The Java source code of applications is completely legible and available to the programmer. Additionally, its architecture is based on open source frameworks allowing the programmer to have at his disposal every line of code that makes up his application and giving the possibility of modifying them as needed.
Multi Database
JRapid modularity allows its applications to use any database, including open source databases (MySQL, PostgreSQL) and proprietary databases (Oracle, SQL Server, DB2, Informix, Sybase, etc).
Self Documented
JRapid is not limited to code generation; it also generates all of the system's documentation: user manuals, UML diagrams, data specifications, etc.
11
2. Concepts
In order to start using JRapid, it is necessary to understand the key concepts upon which its functioning relies: entity and property. Afterwards, these concepts are taken to the platform and the system is implemented through the development cycle, obtaining as a result a system made of multiple layers: the first visible layer is the user interface.
projects: these are the web apps the user creates. modules: modules are a single part of a project. Each module is compiled separately. entities: entities belong to a module and they represent the objects in the model. properties: properties describe the data and behavior of the entities.
Note that the same convention of Java Classes and properties is used. Entities begin with capital letter; properties begin with lower case, and then camel case.
12
There are different software modeling languages that work with the concepts of entity and property (or analogies). Among them are ERD and UML Class Diagrams. JRapid incorporates some of the characteristics of these modeling languages and adds some new ones needed to define behaviors, entity relations, validations and permissions, among others. Additionally, JRapid defines special transient entities that are not persistent. This concept may be used to model the verbs that define an application (i.e. creating transient entities to model SendMail, ApproveBudget or PaySalaries). There is a direct analogy between transient entities and UML use cases, EJB Session Beans, etc. The next picture shows an example of JRapid entity diagram where each box is an entity and inside the box their properties are listed.
13
For the design stage, the user has visual tools such as the interactive entity diagram- for doing the system definition. Self documented windows pop up and guide the user through the creation of the different components of the application. The implementation and deployment phase, which in common apps can take days, is started by clicking the desired generation mode, in the generation menu. The implementation stage is done partially or totally by JRapid CodeGen. Deployments are also transparent. After generation Java classes are compiled, and a few seconds later, the application is automatically deployed to the development server.
2.3.1 Forms
An entity form includes all the visible properties defined for an entity, so it allows the user to load completely a new instance of the entity to the system, and so to edit an existing one. The properties appear in the order that they were defined, and can be organized in tabs, columns and rows. This organization becomes necessary when an entity starts having too many properties to be displayed in a single screen.
14
Each property is presented according to the available widgets for its type. For example, a date property will be shown as an input box which will display a calendar when clicked or focused. Alternately, it can be shown as a set of three select boxes for day, month and year.
2.3.2 Listings
An entity listing is a screen where the instances for an entity are shown, so the user can select a specific one and take some action: edit it, delete it, use it for something, etc. For example, user selects some companies from the list and clicks in assign to salesman, which will open a user defined form where these companies already loaded. Listings use filters to adjust the results shown, helping the user to find specific stored entities. Developers can also define different layouts and views for lists. These views are the way the results are displayed: table-like, basic-HTML, big rows including pictures, matrix disposition including pictures, etc.
15
2.3.3 Panels
Panels work as an integration tool for lists and forms. They provide some organization to the generated application, and convert it from a big set of windowed lists and forms to an understandable application with modules oriented by its functional meaning. For example, the developer can create a contact manager panel that gathers client, contact and appointment lists and forms.
The database type where it will be stored: bit, integer, timestamp, etc. The widget to be shown: textbox, textarea, datepicker, timepicker, etc. The front-end default validation: valid integer, valid email, valid date, etc.
Some of the most important types are: double, float, integer, long, boolean, string, text, longtext, richtext, enum, date, time, datetime, timerange, timequantity, file, password, image, email, phone, url, id.
16
For example, instead of having just Strings, as Java has, there are four possibilities: string, text, longtext and richtext. The difference between them can be related to the database type that they finally rely on string uses varchar and text a CLOB or TEXT-, and so in the default widget that is shown to the user string shows an HTML input box, text an HTML textarea, and richtext a WYSIWYG editorSome built-in types use the same database type but they show completely different widgets (e.g. email, phone and password). A complete table of default database types and widgets for each JRapid built-in type is available in JRapid documentation. JRapid also includes the enumeration concept. Enumerations come in handy when some properties may adopt one or more values out of a fixed set (e.g. male / female, single / married / divorced). These are treated just as a specific type called enum; the compiler asks the developer to define the set of possible values.
17
3.1 Components
The web-based designer was developed to handle the creation and development of projects. When a project is created the user can access the IDE to edit that particular project. The IDE screen has the following components: Toolbar Perspectives o Views/Panes
Edit Windows
18
Each perspective is useful for some specific purpose, like generating code, or modifying the generated files. Perspectives are made of different views. Many of the views inside a perspective can be resized to suit the user's preferences by dragging its borders to the desired position, and can also be maximized double clicking its top border (then they can be restored to its original size by another double click).
3.1.1 Toolbar
JRapid toolbar links to the main tasks for each stage of JRapid development process:
Create o o o o o Create entity Create other project elements: Panel, Enumset, Report Database Reverse Engineering Import from Excel Import from CSV
19
Entities Tree Preview Pane Designer Pane Entity Diagram XML Source Editor Project Monitor Generation Console
Files perspective acts as a visual interface of the current file structure of the application, showing both generated and user files. All the available views are: Files tree File editor
20
These concepts are important for keeping track of the projects size: Current/Historical Entities: All new entities that have been once created and perhaps deletedcount for the historical entities quota. Active entities that can be accessed through the Entities Tree or Entities Diagram- count as current entities. Developers: Current assigned number of developers 21
However, if the user wants to generate with syntax errors, the application will not let him continue until these errors are solved. The following message appears if the user wants to run a generation:
22
When the developer works with the code, there are some shortcuts available Ctrl-space: (from editors) autocomplete suggestion Ctrl-S: (from editors) save changes
Entity tree: Entities for the current module. Expanding an entity on the tree shows a list of all of its sub-elements distinguished by different icons: A click on an entity has two consequences: it refreshes the preview pane with the information for this entity, and it positions the XML source editor in the selected entity. A click on one of its sub-elements opens up a window to edit that sub-element visually.
23
XML Source Editor: This panel shows the xml code of the module. This editor offers some features for easier development such as: syntax highlighting, word suggestion (activated as you type or manually with a keyboard shortcut), syntax validation and semantic validation.
Preview pane: The preview pane shows the different HTML files generated for the selected entity. These can be navigated clicking on the links at the top of the panel. The preview pane works together with the designer pane to allow the modification of the CSS style of each view. When viewing an HTML file, clicking on its different elements loads the CSS style information for that element on the designer panel. Using the designer pane the style of each element can be customized.
Entity diagram: The entity diagram offers a view of the entities and other elements of the module. The boxes in the diagram can be moved around
24
Elements can be added and edited through this diagram (as with the entity tree). Entities may be created by clicking on the "New Entity" link at the top right corner. Other elements like Enumset, Panel and Report can be created from that toolbar too. When adding sub-elements, the add button inside each box can be used. A context menu will be displayed:
In the entity diagram, clicking on an existing element also opens up the property editor for editing through its Edit Window. Project Monitor : Summarizes all the logging information in a visual way, grouping by the log type:
25
o o o o
Compile errors Runtime Info logs Runtime Debug logs Javascript Errors
Generation Console Displays information on generation of code. While code is generated, all the actions taken by the generator are logged to the console, and all error will show up here so that the user can debug.
26
4. Basic Tutorial
Throughout this tutorial, you will learn how to create a basic company CRUD application with JRapid.
27
Entity Diagram and Class tree: they show Company entity, including all properties. Each property shows its JRapid type. We will click on industry property in the entity diagram- to define the enum values.
When we click in OK the form preview shows the list of industries with the recently created values.
28
You may click on each link to preview the HTML files, and select an option to check out the sources in the Files Perspective.
29
(Chrysler, 1000 Chrysler Drive, Auburn Hills MI, 60000, 01/03/2008, Car Manufacturers) (Cargill, , 152,600, 01/01/2008, Food)
The generated form preview panel can be used for entering data. To enter each company, the fields must be filled in and then Ok button must be pressed. Another way of accessing this form is pressing Add button in the list.
30
Click on the column header to order the list alphabetically. Click again to do a descendent ordering.
However, default widgets can be overridden. JRapids Date type offers an alternative widget called selectdate. Open Edit Property window to change it.
31
As totalEmployees was entered as an integer, JRapid provides a basic client side type validation that will prevent the user to enter non-integer values.
32
There are simple client-side validations that can be done without posting information to the server. These validations are expressed in FPath language, as all the information available is already at the clients browser. So we will add a validation for totalEmployees property, asking that this should be zero or positive. This value should be entered in Client Conditionals tab, Check if field.
Note that we created an OR validation (FPATH language), so we admit the null value. Otherwise, the form would appear in red when opened and that does not look nice (You may try it by yourself leaving only the positive condition) As a result, when opening the form and trying to save with no name, or entering a negative value, we get a client-side validation error.
33
After submitting the form, we need to regenerate all layers. The reason is that default values come from server side (They are expressed as ELs). We could open the web service that feeds this form to check that the changes applied to the server side.
4.4.4 Autosuggest
Finally, we will tune up the city field of our Company form, by setting the autosuggest feature. Autosuggest is triggered when filling the field, and provides a list of similar values already entered in the database, helping the end user to enter values just as other users entered before.
34
Again, as this change requires new server-side code, we need a generation of all layers.
35
4.6.2 Scalability
With the current definition, the data is a little difficult to find. Considering the case of having 10.000 companies instead of 3, the only way of finding a company would be to order the list and start navigating the pages. In case of having a name filter, this task would be much simpler.
36
5. JRapid Elements
Although Entity, Property and Panel are the main building blocks, there are other elements that help the developer in the road to building a successful JRapid Application: Listing, Subset, Filter, Action, Defaultset, Transient Entities, Embedded Listing, Report
5.1 Listing
Listings are the way of showing the existing instances of an entity in the database. They provide access to the whole dataset also allowing filtering, ordering and action execution on each instance. Each entity has an auto-generated listing, but its possible to create additional listings indicating what elements to display and how to display them. Each entity may have more than one listing.
37
Depending on the user that accesses the system, the information listed by the system should vary. The developer may need to define different group of properties to be shown (projection) as columns, depending, for instance, on the users role. For example, a user from sales department wants to see the client account status in the search results, but perhaps a marketing user prefers to have the address and phone at first-sight. This can be achieved creating custom listings for each user role. Listings selection rules can be predefined (using Subsets) and specified at runtime (using Filters). Both Filters and Subsets rely on conditions to define the way they select the information. JRapids IDE Edit Listing window includes: Name: name of the listing. Subset: subset used. View: type of view (table, thumbnails, icons). Display properties: overrides default displayable properties (must be included in subsets definition). Display filters: overrides default displayable filters.
38
Conditions and Restrictions can be combined, creating new Conditions. Combination is achieved with logic operators (AND, OR).
SQL WHERE firstName = John WHERE startDate >= 2008-12-01 WHERE city = San Francisco OR city = Los Angeles WHERE EXISTS (SELECT * FROM Employee WHERE Employee.company = id)
Condition / Restriction Condition(firstName,John) Condition(startDate,2008-12-01,DAO.GE) Or (Condition(city,San Franscisco) , Condition(city,Los Angeles) ) Restriction(EXISTS FROM Employee WHERE Employee.company.id = me.id)
5.3 Filter
Filters let end users specify restrictions to listings (selection). They provide all the necessary programming structure (UI elements, server side code and web services). Filters work as the most important tool when searching for data. They can be combined to create specific queries and access in a few seconds to the desired information. Simplest filters are defined specifying the property which they restrict. More advanced filters can be obtained combining conditions and restrictions. JRapids IDE Edit Filter window includes: Name: filters name Mode: (auto or basic/advanced/mixed) o o o o Auto: a property-filter is set, requiring property name and flag used Basic: generates conditions Advanced: generates restrictions Mixed: generates both conditions and restrictions
39
5.4 Subset
A subset is a restricted collection of instances (records) of an entity. The selection can be parameterized using Conditions and Restrictions. Each subset will provide an associated web service that will include only the specified instances showing specified properties. When showing the available information of the system, developers usually need to filter some way the instances shown. For example, when displaying employees of a company in a select box, it is not desired to display all the historic database of former employees, listing only the active ones. This can be achieved by defining a subset with a condition (active,true), and providing a name (onlyActive). Then, when referring to Employee entity, subset onlyActive can be specified. JRapids IDE Edit Subset window includes: Name: subsets name Mode: (basic/advanced/mixed) o o o Basic: generates conditions Advanced: generates restrictions Mixed: generates both conditions and restrictions
40
5.5 Action
Actions link entities and properties to elements of the system: other entities, listings, JavaScript calls, reports, etc. Action (and its multiple uses) is the key element that distinguishes a JRapid application from a plain database web interface, by connecting screens with some level of intelligence. Actions can be of three types: JRapids IDE Edit Action window includes: Javascript: calls a custom javascript function sending information of the selected instance (row) as a parameter. The programmed function always receives the ID of the selected entity/s as the first parameter. Related-entity: opens another entitys form sending the selected instance as a parameter. The related entity must define a Defaultset expecting this parameter. Report: opens a Report sending information of the selected instance.
JRapids IDE Edit Action window includes: Name: actions name Type: (javascript/relatedentity/report) Location: (button/select/local/form) o o o o Button: button in the button bar of listings Select: select box in the button bar of listings Local: located inside views of listings Form: located in the button bar of forms
41
5.6 Defaultset
Defaultsets assign a set of default values when creating an entity. They can be parameterized, so becoming some sort of "dynamic initializers" of entities. Developers find out that they need to define, for a specific entity, default values for each property. So when the application user wants to add a new instance of that entity to the system, these properties appear with a default value (e.g. when creating a new client company, set the current date as the default client company association date). JRapids IDE Edit Defaultset window includes: Name: defaultsets name Parameters: (optional) objects received that will then be used in expression for values Values: fixed or dynamic values (EL) to be set each time the entity is opened through the defaultset
42
Having this abstraction, most complex use cases can be resolved by composition implementing simpler ones.
43
5.7.2 Implementation
Although the architecture was still not properly presented, it will be enough by now to say that each transient entity will have a service class called EntityNameServices.java where find() and store() methods can be found. Find() method is called before the form is shown, and the object returned is the one which feeds the contents of the screen. When the form is submitted, the values are mapped to a Value Object class, and this is received as a parameter by store() method. These two simple methods provide the communications between the front and back end and allow the developer to complete the process described in the previous section. For example, transient entities can be used for selecting parameters of complex processes to be started. Another typical case is that of critical or massive updates: a transient entity with a collection of entities to be updated is shown, asking for confirmation before committing changes.
44
5.9 Report
Reports help JRapid developers including Jasper Report files, generating the connection to the applications database and an associated web service for easy access. Usually an action is used to open the report and send any parameters the report needs. JRapids IDE Edit Report window includes: Name: reports name Location: o o Application: jasper file will be uploaded in the application file structure Repository: jasper file will be uploaded to the files repository
45
6. Intermediate Tutorial
This tutorial is intended for giving users a first real contact with the concepts described in the previous chapter, and how easy it is to implement them with JRapid. Before starting, a preliminary step. Lets create 2 new entities: Employee and Industry Employee - firstName (display: primary) - lastName (display:primary) - company (type: Company) - gender (type: enum) We have to pay attention in the creation of this entity:
Company will not be of built-in type and it will be of entity-type. Type/Entity list shows all built-in types followed by the entities of the system. Gender will be of type enum. However, we will create a reusable Enumset and reference it. After creating the Entity, Click on Add Enumset button.
46
Finally, open gender property and point to the recently created Enumset.
Industry - name (display: primary) - description (type: text) Now the application has 3 entities and looks a little bit like this:
47
6.1 Collections
JRapid allows definition of collection properties for multi-valued attributes of an Entity.
48
Now we remove the industry property from entity and create a new one called industries.
The form now appears with a new box that will hold all the industries:
We can apply a CSS style to set a fixed width to this box. If you click on the box inside the preview panel, youll find that in the designer pane, the elements ID appears in a select box as all the parent elements.
49
Enter width: 145px and youll see how the form changes its appearance
Now you can edit the companies you have and add industries. Use Add link and double click Industries in the pop-up window. Enter the following industries for each of our 3 Companies:
50
51
A little more make up changes: edit the new property and indicate position: fieldset.
When we check the Employees listing, we see the employees created from the Company form.
52
The Edit Filter window will pop up. Leave default mode (auto). Select name property. Selecting no flag will create a Begins-with filter.
53
After generating all layers, we can test the filter in the preview pane, choosing List in company.
If you enter all the industries as suggested before, you can try this filter out and test the different results. For example, if you enter Food you get the 2 companies in Food industry. If you enter Candies, you get just the only one related.
54
You may also combine filters, specifying criteria for 2 filters at a same time:
We create a new entity named Prize with properties: name and points (integer and required).
Shared servers do not allow manual edition of files. This section applies to projects created in dedicated servers. If moving from a shared server, you can copy-and-paste the source XML to migrate the application.
55
And we enter 3 prizes: Gold: adds 30 points Silver: adds 20 points Bronze: adds 10 points
We want to add a new Transient Entity named AwardAPrize and an Action button named awardAPrize to the Company listing that will open the entitys form. We use a transient entity because we just need the UI form and the skeleton in the server where to insert our custom programming.
56
We need to create a Defaultset for this entity that will receive a company as a parameter
And finally the Action that connects the listing with the transient entity
57
If we generate all layers, we can select companies and click in the button
58
The Java Code means that we get objects from database (Through DAO layer) and we increase the company points by the amount indicated in the selected prize. As the find method of Companys DAO returns a persistent object, we dont need to call the store method.
59
After finishing this tutorial, lets review some of the concepts we applied in this section: An Action of related entity type was added A Transient entity was added A Defaultset for this entity was defined Java Code was entered through the files view
We strongly encourage the user to have a look at the generated Java method (for example, AwardAPrizeAbstract.java, findForCompany method) to get a better understanding of how the design decisions affect the underlying code.
60
61
62
JRapid includes a JavaScript runtime library which handles all the user interaction: makes all AJAX requests and handles all responses too. It provides all the necessary programming that make JRapid apps run smoothly.
- Entities: Java Beans that include all defined properties as getter/setters to access them. For Industry entity, the resulting class Industry.java will be:
63
private String name; public String getName() { return name; } public void setName(String name) { this.name = name; } public static DAO<Industry> DAO() { return MainDAOLocator.get().getIndustryDAO(); } @Override protected com.prodasoftware.prd.dao.DAO<? extends Entity> myDAO() { return Industry.DAO(); } @Override public String toString() { StringBuffer buf = new StringBuffer(); buf.append(name + " "); return buf.toString(); } }
- Services: Service classes provide methods for managing entities such as find(), store() and remove(). They have also methods that return collections, implementing default listing services, subsets, etc. Most of their methods are mapped to REST web services. For Industry entity, the resulting class IndustryServices.java will be:
package com.basic.services; public class IndustryServices extends IndustryServicesAbstract { }
64
package com.basic.services; import ; public abstract class IndustryServicesAbstract extends com.prodasoftware.prd.services.Services { public Boolean remove(String id) { } public Boolean removeMany(Collection<String> ids) { } public Industry find(String id) throws ELException { } public Long store(String id, Industry voobj) { } public Collection<Industry> findPage(String storedFilter, String page, String pattern, String order) { } protected interface ListFilter { public List<Restriction> getRestrictions(DAO<Industry> dao, String param); } }
- XML (Castor files): Files needed for marshalling / unmarshalling Java objects to XML files returned by web services and vice versa. The contents of these files determine which properties from the Java files will be included in the XML results and the way they will be shown and formatted. Different handlers are defined according to each propertys data type. These handlers are helper classes included in JRapid runtime library. For Industry entity, the resulting file IndustryFull.xml will be:
<?xml version="1.0" encoding="UTF-8"?> <mapping xmlns:str="http://exslt.org/strings" xmlns:exsl="http://exslt.org/common"> <class name="com.prodasoftware.prd.entities.Entity"> <field name="id" type="long">
65
<bind-xml name="id" node="attribute"/> </field> </class> <class name="com.basic.entities.Industry"> <field type="long" name="id"> <bind-xml node="attribute" name="id"/> </field> <field type="string" name="name" handler="com...castor.StringHandler"/> </class> </mapping>
- DAO (Hibernate files): Files used by Hibernate framework to accomplish Java objects persistence. Object types and relations are present here, and the mapped database table and column names. For Industry entity, the resulting file Industry.hbm.xml will be:
<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> <hibernate-mapping package="com.basic.entities"> <class lazy="true" table="industry" name="Industry"> <id type="long" name="id"> <generator class="native"/> </id> <property type="string" column="name" name="name"/> </class> </hibernate-mapping>
- Controller: Includes the application main controller class. Users should work with this class when customizing the application adding new services through code. For an application consisting in just an entity named Industry, the resulting MainController.java file will be:
package com.basic.controller; import ; public class MainController extends MainControllerAbstract { @Override public void init(ServletConfig config) throws ServletException { super.init(config);
66
public class MainControllerAbstract extends FrontController { @Override public void init(ServletConfig config) throws ServletException { super.init(config); this.init(this); } @Override protected void init(FrontController controller) { controller.registerXmlRpcService(IndustryServices.class, "removeMany", "Industry.remove"); controller.registerXmlService(GET, "/Industry(?:)?", IndustryServices.class, "findPage", "com/basic/xml/default.xml"); controller.registerXmlService(POST, /Industry/(\\d+),validate", IndustryServices.class, "validate", "com/basic/xml/IndustryFull.xml"); controller.registerXmlService(GET, "/Industry/(\\d+)", IndustryServices.class, "find", "com/basic/xml/IndustryFull.xml"); controller.registerXmlService(POST, "/Industry/(\\d+)", IndustryServices.class, "store", "com/basic/xml/IndustryFull.xml"); } }
67
Once modifiable files are generated, they will never be overwritten again by the generator. Users can work on them, adding custom code. On the contrary, read-only files are generated each time and any changes made by the developer in them will be lost. For each layer, JRapid has a different approach. Presentation files: Forms and Lists HTMLs are overwritten on each generation. Server files: For server classes, JRapid Codegen takes advantage of OOP inheritance principle to keep two sets of classes: modifiable and read-only. Users will work on modifiable classes, overriding methods from super classes (named as *Abstract.java).
68
7.2. Languages
It often becomes necessary to write expressions in JRapid tags to indicate behavior. To define these expressions three different languages are used depending on the context: FPath EL HQL
<property name="totalPrice" calculated="sum(sale.lines[*].price)" /> <property name="finalPrice" calculated="totalPrice * 1.21" /> <property name="product" entity="Product" subset="forPriceList" subsetparams="priceList" />
69
<property name="state" default="DefaultParams:find(1).defaultState" /> <subset name="forContact"> <subsetparam name="contact" entity="Contact" /> <condition field="company" value="contact.company" /> </subset>
The functions find(), findOneBy(), findManyBy() and findAll() are available to be used in EL expressions.
<property name="companies" default="Company:findAll()" /> <property name="type" default="Params:find(1).defaultType" /> <property name="companies" default="Company:findManyBy('user','paul')" />
7.2.3 HQL
HQL is a SQL based language used by Hibernate to make queries on the database.
70
XML server: Handles entity services that accept or return an object, and in consequence, a marshaled xml. Some common services with these characteristics are the Entity/find services (return the instance as an XML) or the Entity/store services (receive the instance to store). XMLRpc server: Handles services that accept or return simple or void values, like an entity primary key. Examples of these services are the deletion services, where all the information needed is the key of that or those entities. Repository server: Handles the file management needs of applications. Automates the storing and retrieving of files (documents, pictures, etc.) uploaded to the server through file/image-type properties.
Services are registered in the controller class when it is initialized, stored in a services map, and then, when a request arrives, they are retrieved from there through its URL. JRapid CodeGen will register automatic services to feed the presentation layer lists and forms. These services return collections -for the lists- and single objects for the forms-. For an application consisting of an entity called Company, MainControllerAbstract.java will contain these lines in the init() method:
71
The first service registered feeds the opening of a form. The regular expression just expects a number (the entity id), passing it to find() method in CompanyServices.class services class, and finally return the results marshaled through com/myapp/xml/CompanyFull.xml Castor mapping file. The next service feeds the list. The complexity of the regular expression is due to the different parameters needed when preparing data for a list (e.g. filtering, ordering, paging). All URLs matching the regular expression included will invoke findPage() method of CompanyServices.class services class, sending the matching groups as params, and finally return the results marshaled through com/myapp/xml/default.xml Castor mapping file. It also registers services that listen for POST requests, for the action of storing an entity, and receive the XML describing it as a part of the POST packet. When the developer works from Java, XML is never seen, as it properly marshals and unmarshals in the beginning and the end of the transaction, in a transparent way.
Attention When posting an entity from a form, an XML is sent to the server, including only the information that is available at the presentation layer. That is why generated store() method as a parameter named Value Object. Many developers get confused when inspecting this object because they not find deep information. Surely, if it represents a stored instance, they need to retrieve it from the database using the included primary key, and consider the information of the V.O. as the modified presentation layer updates.
7.3.3 Entities
The most important class in JRapid architecture, as it is the super class for all generated entities, is included in the runtime library. Entity: Entity class defines some general behavior methods for all entity beans, such as getId(), store() and remove(). It also overrides equals(), hashCode() and compareTo() methods to simplify the programming task defining that two entity objects are equal when their primary key is equal.
7.3.4 Exceptions
There are also Exception classes used to communicate easily exception messages to the presentation layer. JRapid provides the structure necessary to communicate this kind of exceptions to the end user and filters internal or unexpected exceptions caused by errors in the programming.
72
ServiceException: Intended to inform exceptions that appear when applying business rules. For example, when validating inserted entities, when attempting to take unauthorized actions, etc. Because of their exception nature, they interrupt the transaction, so no changes are saved when they are thrown. ConfirmationException: They have a special behavior as, although they interrupt the transaction, they ask a confirmation from the end user, starting again another request including the answer. By managing a confirmations map, the code flow can take a different path, changing the result of the transaction. A very common example of use is the confirmation of storing entities where suspicious information was found.
EntityName.DAO()
This obtains the corresponding DAO from a generated DAO Locator class.
DAO Interface: It includes read-only methods, that return collections and single instances of entities: FindAll(), FindById(), FindByIds(), FindManyBy(), FindOneBy(), findAdvanced(), etc. It also includes some methods for counting like in a SQL count() query-instances that fulfill a criteria. Finally, it has write methods as store() and remove(). Some of these methods use the concept of restriction Order: Order class is used in DAO advanced methods, when there is a need of specifying the order of the retrieved records.
73
Filter: Use filters to indicate restrictions to your queries done through DAO interface.
Attention Find methods return Hibernate persistent classes (See Hibernate manual chapter 4). This means that when you do changes to these objects (for instance, you use setters of properties), this changes will be persisted, even though you never call store() method of the Entity class.
7.3.6 Session
Runtime library contains a core class named Session that encapsulates information related to the user currents session: current Locale and current JRapids application user id if logged-. It is especially important in SaaS oriented applications, as it also stores the specific schema where the user is logged in. Finally, it also provides the current HTTPSession. It includes also some formatting methods that automatically get the current locale. These are very useful when formatting dates and numbers for users coming from different countries where they have different conventions. Usually, Session class is used for getting the HTTPSession (and then taking some action with it, as storing an object).
Session.getMySession().getHttpSession()
7.3.7 Stereotypes
After developing several applications it becomes clear that certain entities with specific behaviors are used repeatedly. Such is the case of entities created to manage users and their privileges and email management. JRapid provides stereotypes, which special of entities, to help the developer in the construction of these entities and to set a standard way to handle them. If you specify an entity to be of a stereotype, the generated readonly entity (*Abstract.java) will inherit from a superclass which implements methods that the developer will surely need for custom programming. For example, Email stereotype provides a send() method in its Entity superclass; User Services superclass provides login() and logout() methods. (See JRapid Server Library Reference for full specification).
74
The developer may indicate that an entity implements stereotypes with the stereotype attribute of the entity element:
When an entity sets a stereotype, it must include all the properties needed for the functionality of that stereotype. If it doesn't follow the predefined template the developer will be warned about the missing properties. The entity may add extra properties besides the required ones to fulfill the stereotype template. This feature is not exposed to the user in recent versions. If you are new to JRapid and want to integrate Email and User Management, use Template add-ons instead.
7.4.2 jQuery
jQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development.
75
Castor XML is an XML databinding framework It can marshal almost any bean-like Java Object to and from XML. In most cases the marshalling framework uses a set of ClassDescriptors and FieldDescriptors to describe how an Object should be marshalled and unmarshalled from XML For those not familiar with the terms "marshal" and "unmarshal", it's simply the act of converting a stream (sequence of bytes) of data to and from an Object. The act of marshalling consists of converting an Object to a stream, and unmarshalling from a stream to an Object.
7.4.4 Log4J
Log4J is a logging service. It equips the developer with detailed context for application failures. It helps testing, and so provides quality assurance and confidence in the developed applications.
76
8. Advanced Tutorial
In the final tutorial some of JRapid boundaries will be explored and the advanced tools will be presented. Then, it is expected that, with the help of JRapid spec and real-world needs, the reader will go on using and discovering the platform and the infinite possibilities that it provides.
Enter the unique entry for this entity, with value 3000
Open salary property from Employee entity and go to default field. Enter the following expression.
77
This expression is an EL expression. It references defaultSalary of the object returned by the function DefaultValues:find(1)
When created the default in chapter 6, fixed 3000 value was used, take it from default in employees company. Explain Company:find().
8.1.2 CalculatedValue
In JRapid site http://www.jrapid.com you will find lots of articles about calculated values.
8.1.3. DynamicValue
In JRapid site http://www.jrapid.com you will find lots of articles about dynamic values.
8.2.1 ServiceException
Edit CompanyServices.java, overriding store() method, so it throws a ServiceException, that will be passed through to the interface and shown as an alert box:
78
So when a company with an existing name is entered, the user will receive the message:
8.2.2 ConfirmationException
This is perhaps more restrictive that the desired behaviour, supposing that maybe the system should allow more than two companies with the same name that differ in the address (for example two branches of the same big company). In this case, instead of throwing a service exception, it should throw a confirmation exception, which will open a confirm box instead of an alert box.
79
This time, when the user tries to save, it will be given the chance to go on anyway or abort.
80
9. Add-Ons
JRapid users can create their own elements and share them at JRapid community site. There are 4 main types of add-ons in this kind of "free market place": Views, Widgets, Templates and Transformers.
9.1 Views
Views are new choices for displaying listings in JRapid applications. JRapid offers (between the built-in features) only 2 kinds of listings named table and thumbnails. For example, if a given Entity defines a property named address, it would be interesting to have a listing which presents the results of a search inside a map. Another case that appears frequently is having an Entity defining a date -e.g. date of an event- and the need of showing the results in a calendar.
81
Some views, using jQuery Calendar, Google Maps and Google Charts.
Both the filters and the actionbar sections modify the results shown in the view actionbar, as they define user parameters that restrict the query. These parameters could be filter definitions, a page selection (e.g., results from the 51st to the 100th) or just the addition or removal of an existing record. Defining a new listing view is just replacing the view section with a custom one, where results are presented in a specific way.
82
Once you choose the view to import, click on Import. If you look at the Entity Diagram, you will find the view inside the configuration box. This means that you will have the view available for any of your listings. Create or edit a listing and you will see the recently added view as an option. Views can also add required JavaScript libraries to the project. They are copied to the project structure and automatically added to the configuration box.
9.2 Widgets
Widgets are new options for offering easy data input/presentation in JRapid application forms. JRapid offers a number of built-in form widgets: input boxes, checkbox, radiobutton, textarea, etc. They generally map to standard HTML elements. Some widgets like selectdate and the default image and file widgets are composites of standard HTMLs.
83
The web is full of great widget frameworks that offer a variety of mechanisms for entering information in user-friendly ways: Rich text editors, spinners, calculator widgets, masked inputs, password strengthners, etc. JRapid developers may include these widgets in their apps through widgets. Widgets act as some kind of connector that allow replacing the HTML part that would normally correspond to a property with arbitrary contents, defined by the widget. Widgets can also add required JavaScript libraries to the project. They are copied to the project structure and automatically added to the configuration box.
Once you choose the widget to import, click on Import. If you look at the Entity Diagram, you will find the widget inside the config box. This means that you will have the widget available for any of your properties or filters. Create or edit a property and you will see the recently added widget as an option.
84
9.3 Templates
Templates are Entity definitions that the user can simply add to each application. After adding a template, JRapid users can customize them. They turn out to be helpful when implementing common application patterns, for example User Management, Audit, Email administration, etc.
85
Once you choose the template to import, click on Import. If you look at the Entity Diagram, you will find the recently imported entities that compose the template
9.4 Transformers
Transformers are the way all developers can take advantage of the powerful code generator provided by JRapid. A transformer is a XSL transformation that will be applied to JRapid source.
86
Any type of text file can be generated: HTML pages, Java files, XML, etc. For example, the community site provides transformers for generating UML diagrams, JUnit classes, HTML help files, etc. There are 2 kinds of transformers: all entities transformers and single entity transformers. UML diagram transformer creates a single file containing a class diagram with all the entities of the application. JUnit class transformer creates a single JUnit for each entity, and places them in the java sources folder of the web application.
Once you choose the transformer to import, click on Import. After this, each time an full (all-layers) generation is run, the transformer will be applied and the files, overwritten.
87
10. Reports
JRapid provides integration with reporting tools. Initially, it allows developers to easily include reports designed for Jasper Reports. These reports can be fully parameterized through JRapid generated screens. This feature is much stronger when developing SaaS applications, because it allows managing a model where reports are deployed for each tenant.
10.2.1 Application
When working in single-tenant applications, with a limited scope of reports, application reports are the best option in seek of quick inclusion and easiness of administration. The way of deploying these reports is copying the compiled .jasper4 file to the web application. The most simple method is just adding a new folder reports/ in WEB-INF directory and saving the file there. Finally, committing changes in that folder through SVN will put the file in the server. Example After creating a report called companies with the report design tool, showing two fields (name and address) from a record set that is the result of bringing all the companies of the database.
Compiled .jasper files can be obtained using open source tools like iReport (http://ireport.sf.net)
88
<?xml version="1.0" encoding="UTF-8"?> <jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="report name" pageWidth="595" pageHeight="842" columnWidth="535" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20"> <queryString> <![CDATA[select c.name, c.address from company c]]> </queryString> <field name="name" class="java.lang.String"> <fieldDescription><![CDATA[]]></fieldDescription> </field> <field name="address" class="java.lang.String"> <fieldDescription><![CDATA[]]></fieldDescription> </field> <background> <band/> </background> <title> <band height="35"> <staticText> <reportElement x="50" y="0" width="151" height="20"/> <textElement> <font size="14" isBold="true" isItalic="true" isUnderline="false"/> </textElement> <text><![CDATA[Companies report]]></text> </staticText> </band> </title> <pageHeader> <band/> </pageHeader> <columnHeader> <band height="24">
89
<staticText> <reportElement x="84" y="0" width="100" height="20"/> <textElement> <font isBold="true" isItalic="true"/> </textElement> <text><![CDATA[Name]]></text> </staticText> <staticText> <reportElement x="184" y="0" width="298" height="20"/> <textElement> <font isBold="true" isItalic="true"/> </textElement> <text><![CDATA[Address]]></text> </staticText> </band> </columnHeader> <detail> <band height="33"> <textField hyperlinkType="None"> <reportElement x="84" y="8" width="100" height="20"/> <textElement/> <textFieldExpression class="java.lang.String"> <![CDATA[$F{name}]]> </textFieldExpression> </textField> <textField hyperlinkType="None"> <reportElement x="184" y="8" width="298" height="20"/> <textElement/> <textFieldExpression class="java.lang.String"> <![CDATA[$F{address}]]> </textFieldExpression> </textField> </band> </detail> <columnFooter> <band/> </columnFooter> <pageFooter> <band/> </pageFooter> <summary> <band/> </summary> </jasperReport>
The report can be previewed from the development tool with the datasource of the tutorial of chapters 4,6 and 8, resulting in:
90
In order to include the report inside the tutorial application, the compiled companies.jasper file must be uploaded. If WEB-INF is chosen as the containing folder, when adding the report through New > Report this folder should be specified. The following pop-up will appear.
Since this moment, the report can be accessed through the URL
http://SERVER_NAME.jrapid.com/APP_NAME/report/REPORT_NAME
Although this mode allows including reports really quickly, it is quite limited as the reports must be deployed by the developers of the system (new versions of the jasper file must be put in the same folders as the code) and also there is only one version of the report for all tenants (for all schemas of the application).
10.2.2 Repository
When there is a need for a custom version of reports for each schema, or it is just necessary letting the administrator to upload new versions, the repository integration mode turns useful. The way of activating this integration mode is choosing location = repository in the edit report window.
91
After defining the jasper name, it can be uploaded for each repository. This means that it can have a design that varies for each tenant. If the application is sold as a service (SaaS) for 2 clients, and each one wants a custom design for the company list, these custom designs can be kept inside each ones own repository. So, in a multi-tenant application, there can be two different designs coexisting inside the application, as they are uploaded for each schema: Client 1 Schema. Client 1 has 3 companies in the database and a black & white design that just shows name & address (companies1.jasper in client 1 repository).
Client 2 Schema. Client 2 has 2 companies in the database, and uses a colorful design (companies2.jasper in client 2 repository).
92
<entity name="GetCompanyReportParams" label="Companies report parameters" transient="transient"> <property name="fromEmployees" label="From Employees" type="integer"/> <next report="AllCompanies"/> </entity
So the resulting parameters window should look like any other transient entity, with the difference that when it is submitted, the values are converted to report parameters and they are sent automatically.
93