Version 34.1 by David Avendasora on 2008/06/25 10:18

Hide last authors
David Avendasora 34.1 1 This tutorial will help you get a new Java Client or Direct To Java Client Application setup in Eclipse/WOLips and get it building properly.
David Avendasora 32.1 2
David Avendasora 14.1 3 1. Create a new WebObjects Application
4 [[image:Picture 9.png]]
5 1. Name it "WebStartJNLPTest" in Eclipse with a package of "your.app" {{note title="Note!"}}If you change the Project name or packages, then you'll need to make additional changes in the subsequent steps.{{/note}}
David Avendasora 1.1 6 1. Modify the Main.html by adding:
7
8 {{code title="Main.html Changes"}}
9 <WEBOBJECT NAME=JavaClientLink>click here</WEBOBJECT>
10 {{/code}}
11
12 1. Modify the Main.wod file by adding:
13
14 {{code title="Main.wod Changes"}}
15 JavaClientLink: WOHyperlink {
16 href = javaClientLink;
17 }
18 {{/code}}
19
20 1. Modify the Main.java file by adding:
21
22 {{code title="Main.java Changes"}}
23
24 public String javaClientLink() {
25 return WOJavaClientComponent.webStartActionURL(context(), "JavaClient");
26 }
27
28 {{/code}}
29
David Avendasora 24.1 30 1. Create a WOComponent named "JavaClient".
31 [[image:Picture 11.png]][[image:Picture 10.png]]
32 This WOComponent will be what passes the specifics about your client-side application to WebObjects.
David Avendasora 1.1 33 1. Modify the JavaClient.html replacing the contents with:
34
David Avendasora 14.1 35 {{code title="JavaClient.html Contents"}}
David Avendasora 1.1 36 <WEBOBJECT NAME=JavaClientComponent></WEBOBJECT>
37 {{/code}}
38
David Avendasora 23.1 39 1. Paste the following as the contents of the JavaClient.wod file. Feel free to change the applicationName, applicationDescription and vendor parameters to anything you wish.
David Avendasora 1.1 40
41 {{code title="JavaClient.wod Contents"}}
42
43 JavaClientComponent: WOJavaClientComponent {
44 applicationClassName = "com.webobjects.eogeneration.EODynamicApplication";
David Avendasora 23.1 45 applicationName = "D2JC WebStart Test";
46 applicationDescription = "D2JC WebStart Test";
David Avendasora 1.1 47 downloadClientClasses = "noDownloadClientClasses";
48 vendor = "My Company";
49 }
50
51 {{/code}}
52
David Avendasora 23.1 53 {{note title="Note!"}}If you are not creating a Direct To Java Client (D2JC) application, then you will need to replace the applicationClassName parameter (com.webobjects.eogeneration.EODynamicApplication) with the name of your client-side application class. Your non-D2JC client-side Application class *must* subclass EOApplication.{{/note}}
54
David Avendasora 32.1 55 1. If you didn't add an EOModel file to the project when you created it, do it now. Drop any existing EOModel in the Resources directory, or create one from scratch.
David Avendasora 22.1 56 1. Add the following frameworks to the project build path:
David Avendasora 1.1 57 JavaDirectToWeb
58 JavaDTWGeneration
59 JavaEOApplication
60 JavaEOControl
61 JavaEODistribution
62 JavaEOGeneration
63 JavaEOInterface
64 JavaEOInterfaceSwing
65 JavaEOProject
66 JavaEORuleSystem
67 JavaFoundation
68 JavaJDBCAdaptor
69 JavaWebObjects
70 JavaWOExtensions
71
David Avendasora 24.1 72 {{note title="Note!"}}
73 If you are not creating a D2JC application, then you won't need all of these, but they won't hurt anything either.
74 {{/note}}
David Avendasora 14.1 75
David Avendasora 24.1 76 1. Create a ClasspathClient.txt file in the root of the project and paste the following as contents:{{note title="Note!"}}If you changed the applicaton name in Step 2 above, make sure you change the name of the Client-Side .jar file in the first classpath line below (WebStartJNLPTest.jar). Also be sure to match the case of the project. Client-Side .jar filenames are CamelCase instead of all lowercase as server-side .jar filenames are.{{/note}}
77
David Avendasora 1.1 78 {{code title="ClasspathClient.txt File"}}
79
80 # ApplicationClass == com.webobjects.eoapplication.client.EOClientApplicationSupport
81 # JDB == jdb
82 # JDBOptions ==
83 # JVM == java
84 # JVMOptions ==
85 APPROOT/WebServerResources/Java/WebStartJNLPTest.jar
86 /System/Library/Frameworks/JavaFoundation.framework/WebServerResources/Java/JavaFoundation.jar
87 WOROOT/Library/Frameworks/JavaEOControl.framework/WebServerResources/Java/JavaEOControl.jar
88 WOROOT/Library/Frameworks/JavaXML.framework/WebServerResources/Java/JavaXML.jar
89 WOROOT/Library/Frameworks/JavaDirectToWeb.framework/WebServerResources/Java/JavaDirectToWeb.jar
90 WOROOT/Library/Frameworks/JavaEOApplication.framework/WebServerResources/Java/JavaEOApplication.jar
91 WOROOT/Library/Frameworks/JavaEODistribution.framework/WebServerResources/Java/JavaEODistribution.jar
92 WOROOT/Library/Frameworks/JavaEOGeneration.framework/WebServerResources/Java/JavaEOGeneration.jar
93 WOROOT/Library/Frameworks/JavaEOInterface.framework/WebServerResources/Java/JavaEOInterface.jar
94 WOROOT/Library/Frameworks/JavaEOInterfaceSwing.framework/WebServerResources/Java/JavaEOInterfaceSwing.jar
95 WOROOT/Library/Frameworks/JavaEORuleSystem.framework/WebServerResources/Java/JavaEORuleSystem.jar
96 WOROOT/Library/Frameworks/JavaWOJSPServlet.framework/WebServerResources/Java/JavaWOJSPServlet_client.jar
97 HOMEROOT/Library/Java
98 LOCALROOT/Library/Java
99 WOROOT/Library/Java
100 /Network/Library/Java
101 WOROOT/Library/Frameworks/JavaVM.framework/Classes/classes.jar
102 WOROOT/Library/Frameworks/JavaVM.framework/Classes/ui.jar
103
104 {{/code}}
105
David Avendasora 32.1 106 This file is only required by the application when it is being launched from within Eclipse.
David Avendasora 1.1 107
David Avendasora 32.1 108 1. Create a Java Client Incremental Builder by following the [[instructions>>Java Client-WebStart Incremental Build]]. This file is needed to make up for the lack of Java Client application building by the WOLips Incremental Builder. It also copies the client launch scripts into the project so that the application will auto-launch when you run it from within Eclipse.
David Avendasora 24.1 109 1. If you did not setup the Java Client Incremental Builder, then right-click on the javaclientbuild.xml file and select "Run As -> Ant Build"
110 [[image:Picture 12.png]]
David Avendasora 1.1 111 1. Right-click on the project and select "Run As -> WebObjects Application"
David Avendasora 24.1 112 [[image:Picture 13.png]]
David Avendasora 1.1 113 1. Select your.app.Application as the Application class
David Avendasora 24.1 114 [[image:Picture 14.png]]
David Avendasora 32.1 115 1. If you want to actually deploy this application, then you will also need to [[modify the build.xml file>>Java Client-Building]].
David Avendasora 24.1 116 This is it. WebStart should automatically download your client application and launch it. If you are creating a D2JC application and did not put an EOModel file in the Resources directory of your project, then you'll see something like this:
117 [[image:Picture 15.png]]
David Avendasora 30.1 118 If you don't want a D2JC application, then you are on your own for creating the user interface for it. Your client-side application can be a command-line or GUI application. If you want a Swing GUI, then I **highly** recommend Florijan Stamenkovic's [[JBND Framework>>http://web.mac.com/flor385/JBND/]]