Objectwiz : documentation

Install Objectwiz in your app

1. Download objectwiz.zip

Clic here to download the zip file from sourceforge.

2. Unzip the file

You get the following files and dirs :

  • objectwiz.jar: the jar file to be added to your project libraries
  • objectwiz: the directory containing the jsf pages and gif that make the user interface
  • README: this file
  • LICENCE: Objectwiz licence file

3. Add the objectwiz.jar and required dependencies to your project

If you are using maven:

  • add the following repository
  •       <repository>
                <name>Objectwiz Maven repository</name>  
  • and add the dependency in your pom
  •         <dependency>

4. Add the required Objectwiz dependencies to your project (versions can be different)

Objectwiz needs the following jars: primefaces, el-api, commons-collections, commons-beanutils, commons-lang, guava, log4j

For maven users:


5. Add the 'objectwiz' directory in your web directory

Copy the 'objectwiz' directory (the one with index.xhtml and ejbClient.xhtml) to your web directory (where the jsf pages are)

6. (Optional) Secure the Objectwiz pages

The configuration varies from one JEE server to another, but the url pattern to secure will be the same : /objectwiz/*

7. Prepare your entity beans:

Objectwiz make an intensive use of toString() methods on your entity beans.
Therefore, if you want an entity bean to be displayed in Objectwiz you must override its toString() method.
NOTE : html tags are not escaped.

8. (Optional) Prepare your session beans:

By default none of the methods of the target application is displayed.
If you want to display one particular method you can add the following annotation:

  @MethodVisibility(visible = false).

By default Objectwiz simply displays the name of the method.
You can give your method a more friendly name and a description using the following annotation:

  @MethodFriendlyDescription(name="a more friendly name",
                             description="description of what the method does and the arguments it expects")
e.g. The webapp running objectwiz.org has an utility method that allows the admin to create a new translation (EntityTranslation.class) for a given page (PageEntity.class).
This method has been made available in the Objectwiz UI thanks to the @MethodVisibility annotation and its display has been customized with the following:
 @MethodFriendlyDescription(name="Create new translation entry",
            description="Creates a new instance of EntityTranslation and WebPageProperties  for the given PageEntity.<br/>
            Arguments are: <ul>
            <li>arg[0] - PageEntity: the page entity for which we create the translation</li>
            <li>arg[1] - VersionLanguage: the locale of the translation (FR, EN, ZH)</li>
            <li>arg[2] - String: the name translation</li>
            <li>arg[3] - String: the short description translation</li></ul>")

9. Access the Objectwiz page of your application

Deploy the application and go to Objectwiz index page: http://your_application/objectwiz/index.jsf

Use Objectwiz

When you access http://your_application/objectwiz/index.jsf you get the following page:

Click on the Objectwiz logo to access the grid:

In every first cell of a row, the core functions of Objectwiz are proposed.
The other cells are used to display the results of the user actions on the grid.
Every action performed in a cell results in the filling of the cell next to this calling cell.
There is always one extra row to allow the user to call one of Objectwiz core functions.

The four kinds of cells

Core functions cell

This is the first cell of every row. It has a light blue header.

Call function cell

This cell is used to display a form for calling a method. It has a dark blue header.

This method is either a method from the target application or from Objectwiz (but not a core function).
The signature of the method is displayed or a more friendly description if @MethodFriendlyDescription has been added to the method.
Below the signature, the cell proposes one input for every argument of the method.

Result cell

This cell is used to display the result of a method call. It has a green header.

Pick a class cell

This cell is used to propose the user to choose a class for one of the core functions that expects a class as argument. It has a yellow header.

Editing an entity bean

If the selected row on a result table is recognized as an entity bean Objectwiz proposes to edit the bean.

Editing boolean, Boolean

Fill the input field with: 'true', 'false' or nothing (for null)

Editing 'Date' attribute

You can use one of the following formats: 
  • yyyy-MM-dd
  • yyyy-MM-dd HH:mm

Editing 'Enum'

Fill the input field with one the name of the required Enum type

Editing association

You can edit @ManyToOne and @OneToOne association. The input field expects the id of hte entity bean.

This means that: 
  1. to modify a @OneToMany association you will have to edit the bean that holds the @ManyToOne side of the association
  2. to modify a @ManyToMany association you will have to code your own method that you can then invoque from Objectwiz

Navigating between the entity beans

Every assocation (@ManyToOne, @OneToMany, @OneToOne, @ManyToMany) is displayed with a 'Go' button that makes Objectwiz load the associated beans.

Execute a query

Clic on the corresponding button in the core functions cell and follow the instructions.

NOTE: If you do not specify how many results you want to retrieve (by letting the second field blank)  Objectwiz will set the number of results to 100.

Execute a method from the target application

A method can be invoked either from the core functions cell of from a selected line in a result dataset.

Filling the form for a method is done in the same way as filling the form for editing an entity bean (see above).

From the core functions cell

From a selected entity bean

In that case part of the form will be pre-filled with the selected bean.

2013-04-18 - Objectwiz 1.1 released