Download
Esempi
Gestione remota
News
Tecnica

Calendario
Eventi







XML Binding For Java Client

JPBinding is a WebObjects framework which allows to build WebObjects Java Client (not D2JC) without the use of Interface Builder and nib files. With JPBinding framework instead of the nib file, one have to write a xml file which describes the  bindings between the view objects (buttons, tables, text fields, etc) and the model objects (EODisplayGroup, EOAssociation, etc.).

The bindings are provide in a descriptive way without programming. Such model objects are "automagically" generated in a clear way for the developer. JPBinding works under WO 5.3.3 and WO 5.4.3.

After that Apple has deprecated the Java Client Nib based applications, the developers need an alternative way to build WebObjects Java Client. The JPBinding framework is just a proposal to do this.

We can use JPBinding for free.

You can send your feedback to the author

How to use it

Database used in the examples

All the examples uses as database PostgreSQL but one can easily to port in other databases. For info about PostgreSQL jdbc driver and WONDER plugin for PostgreSQL one can look at this wiki Also one can download the PostgreSQL hexdreams plugin


Example: AdmissionJC

We have refactored the famous Apple AdmissionJC example. AdmissionJC is a very simple application and is suitable to start. In this example the bindings are done in a purely descriptive way.

First you have to install the JPBinding.framework in /Library/Frameworks/.

  • Build the binary in order to build or modify the AdmissionJC example you have to import the AdmissionJC project under eclipse + wolips. To build the binary, in eclipse Package Explorer right click over build.xml then Run As -> Ant Build.
  • How to run the AdmissionJC example (binary) the binary are in dist folder under the AdmissionJC folder. To run it:

    - open a shell. Run the server side application draging in the shell the dist/AdmissionJC.woa/AdmissionJC script and press return

    - open another shell. Run the client side application draging in the shell the dist/clientScript/Contents/MacOS/AdmissionJC_Client script, add the url of your server side application (something like http://localhost:55555/cgi-bin/WebObjects/AdmissionJC.woa) and then press return

    Obviously there are many other way to run the client side application. The script is just a quick way to test the application. Perhaps a better solution is to create a separate client side application. In this case in your client side application you need to use AdmissionJC.jar which you can find in dist/AdmissionJC.woa/Contents/WebServerResources/Java/ . Dont' forget to add in the client side application classpath, the jars in /Library/Frameworks/JPBinding.framework/WebServerResources/Java/
The examples are tested with: The binding between the gui object and eof model object are described in the
AdmissionJCSwingInterface.xml
under WebServerResources. The gui is in
admission.client.AdmissionJCSwingInterface.java
and was builded with Jigloo. It's not mandatory to use jiglo, you can use other gui builder or if you want you can manually code your gui without any tool at all

Example: AdmissionJC2

AdmissionJC2 example illustrates a nice feature which allow you in an interface window to refer a displayGroup defined in the other interface.

AdmissionJC2 example has two EOSwingInterface: AdmissionJCSwingInterface and ActivitySwingInterface. (See the image) It shows as one can built a widget which refer to a displayGroup defined elsewhere than the current EOSwingInterface, i.e. in another  EOSwingInterface.

Here a snippet from the ActivitySwingInterface.xml

	<table>
		<widget>
			aTable 
		</widget>
		<displayGroup>
			admissionJCSwingInterface.displayGroupActivities 
		</displayGroup>
		<column>
			<title>Name</title> 
			<key>
				name 
			</key>
		... ...
where the displayGroup of the aTable widget is the displayGroupActivities which is defined in the AdmissionJCSwingInterface.xml file, provided that admissionJCSwingInterface exist in the ActivitySwingInterface.java as a public instance field of the AdmissionJCSwingInterface class

Further, one can use as target of  <actionListener> another istance of EOSwingInterface provided that such other instance is defined as public instance field in the corresponding java class.  To exemplify this,  in the ActivitySwingInterface gui there is a button that call an action defined in the  AdmissionJCSwingInterface class. Here another snippet from the ActivitySwingInterface.xml

	<actionListener>
		<widget>
			testActionButton
		</widget>
		<target>
			admissionJCSwingInterface
		</target>
		<action>
			testAction 
		</action>
	</actionListener>
where admissionJCSwingInterface refers to an AdmissionJCSwingInterface public instance field which have to exist in the ActivitySwingInterface.java

Example: TreeJC

(See the image)


How to create from scratch an eclipse+wolips project for a XML Binding Java Client