Show last authors
1 1. Create a new WebObjects Application
2 [[image:Picture 9.png]]
3 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}}
4 1. Modify the Main.html by adding:
5
6 {{code title="Main.html Changes"}}
7 <WEBOBJECT NAME=JavaClientLink>click here</WEBOBJECT>
8 {{/code}}
9
10 1. Modify the Main.wod file by adding:
11
12 {{code title="Main.wod Changes"}}
13 JavaClientLink: WOHyperlink {
14 href = javaClientLink;
15 }
16 {{/code}}
17
18 1. Modify the Main.java file by adding:
19
20 {{code title="Main.java Changes"}}
21
22 public String javaClientLink() {
23 return WOJavaClientComponent.webStartActionURL(context(), "JavaClient");
24 }
25
26 {{/code}}
27
28 1. Create a WOComponent named "JavaClient".
29 [[image:Picture 11.png]][[image:Picture 10.png]]
30 This WOComponent will be what passes the specifics about your client-side application to WebObjects.
31 1. Modify the JavaClient.html replacing the contents with:
32
33 {{code title="JavaClient.html Contents"}}
34 <WEBOBJECT NAME=JavaClientComponent></WEBOBJECT>
35 {{/code}}
36
37 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.
38
39 {{code title="JavaClient.wod Contents"}}
40
41 JavaClientComponent: WOJavaClientComponent {
42 applicationClassName = "com.webobjects.eogeneration.EODynamicApplication";
43 applicationName = "D2JC WebStart Test";
44 applicationDescription = "D2JC WebStart Test";
45 downloadClientClasses = "noDownloadClientClasses";
46 vendor = "My Company";
47 }
48
49 {{/code}}
50
51 {{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}}
52
53 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.
54 1. Add the following frameworks to the project build path:
55 JavaDirectToWeb
56 JavaDTWGeneration
57 JavaEOApplication
58 JavaEOControl
59 JavaEODistribution
60 JavaEOGeneration
61 JavaEOInterface
62 JavaEOInterfaceSwing
63 JavaEOProject
64 JavaEORuleSystem
65 JavaFoundation
66 JavaJDBCAdaptor
67 JavaWebObjects
68 JavaWOExtensions
69
70 {{note title="Note!"}}
71 If you are not creating a D2JC application, then you won't need all of these, but they won't hurt anything either.
72 {{/note}}
73
74 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}}
75
76 {{code title="ClasspathClient.txt File"}}
77
78 # ApplicationClass == com.webobjects.eoapplication.client.EOClientApplicationSupport
79 # JDB == jdb
80 # JDBOptions ==
81 # JVM == java
82 # JVMOptions ==
83 APPROOT/WebServerResources/Java/WebStartJNLPTest.jar
84 /System/Library/Frameworks/JavaFoundation.framework/WebServerResources/Java/JavaFoundation.jar
85 WOROOT/Library/Frameworks/JavaEOControl.framework/WebServerResources/Java/JavaEOControl.jar
86 WOROOT/Library/Frameworks/JavaXML.framework/WebServerResources/Java/JavaXML.jar
87 WOROOT/Library/Frameworks/JavaDirectToWeb.framework/WebServerResources/Java/JavaDirectToWeb.jar
88 WOROOT/Library/Frameworks/JavaEOApplication.framework/WebServerResources/Java/JavaEOApplication.jar
89 WOROOT/Library/Frameworks/JavaEODistribution.framework/WebServerResources/Java/JavaEODistribution.jar
90 WOROOT/Library/Frameworks/JavaEOGeneration.framework/WebServerResources/Java/JavaEOGeneration.jar
91 WOROOT/Library/Frameworks/JavaEOInterface.framework/WebServerResources/Java/JavaEOInterface.jar
92 WOROOT/Library/Frameworks/JavaEOInterfaceSwing.framework/WebServerResources/Java/JavaEOInterfaceSwing.jar
93 WOROOT/Library/Frameworks/JavaEORuleSystem.framework/WebServerResources/Java/JavaEORuleSystem.jar
94 WOROOT/Library/Frameworks/JavaWOJSPServlet.framework/WebServerResources/Java/JavaWOJSPServlet_client.jar
95 HOMEROOT/Library/Java
96 LOCALROOT/Library/Java
97 WOROOT/Library/Java
98 /Network/Library/Java
99 WOROOT/Library/Frameworks/JavaVM.framework/Classes/classes.jar
100 WOROOT/Library/Frameworks/JavaVM.framework/Classes/ui.jar
101
102 {{/code}}
103
104 1. Create a javaclientbuild.xml file in root of the project and paste the follwing as contents:
105
106 {{code title="javaclientbuild.xml"}}
107
108 <project name="javaclient" default="javaclient" basedir=".">
109 <target name="setProps">
110 <property file="${user.home}${file.separator}build.properties"/>
111 <property file="build.properties"/>
112 <property file="${user.home}${file.separator}Library${file.separator}wobuild.properties"/>
113 <condition property="wo.properties.check.failed">
114 <not>
115 <and>
116 <isset property="wo.wosystemroot"/>
117 <isset property="wo.wolocalroot"/>
118 </and>
119 </not>
120 </condition>
121 <fail message="Could not find ${user.home}${file.separator}Library${file.separator}wobuild.properties." if="wo.properties.check.failed"/>
122 </target>
123 <target name="javaclient" depends="setProps">
124 <mkdir dir="build/${project.name}.woa/Contents/WebServerResources/Java"/>
125
126 <!-- project client-side classes -->
127 <copy todir="build/${project.name}.woa/Contents/WebServerResources/Java/">
128 <fileset dir="${classes.dir}">
129 <include name="**/client/**/*.class,**/common/**/*.class,**/BMGenericRecord.class"/>
130 <exclude name="**/server/**/*.class"/>
131 </fileset>
132 </copy>
133
134 <jar basedir="${classes.dir}"
135 includes="**/client/**/*.class,**/common/**/*.class,**/BMGenericRecord.class"
136 excludes="**/server/**/*.class"
137 jarfile="build/${project.name}.woa/Contents/WebServerResources/Java/${project.name}.jar">
138 </jar>
139
140 <!-- Launch Scripts and WOBootstrap.jar-->
141 <mkdir dir="build/${project.name}.woa/Contents/MacOS"/>
142 <mkdir dir="build/${project.name}.woa/Contents/UNIX"/>
143 <mkdir dir="build/${project.name}.woa/Contents/Windows"/>
144
145 <copy file="/Library/Application Support/Apple/Developer Tools/WebObjects Support/UnixLaunch.sh"
146 tofile="build/${project.name}.woa/Contents/${project.name}"/>
147 <chmod file="build/${project.name}.woa/Contents/${project.name}" perm="ugo+rx"/>
148 <copy file="/Library/Application Support/Apple/Developer Tools/WebObjects Support/WinLaunch.CMD"
149 tofile="build/${project.name}.woa/Contents/${project.name}.CMD"/>
150 <copy file="/Library/Application Support/Apple/Developer Tools/WebObjects Support/WOBootstrap.jar"
151 tofile="build/${project.name}.woa/Contents/WOBootstrap.jar"/>
152
153 <copy file="/Library/Application Support/Apple/Developer Tools/WebObjects Support/UnixLaunchClient.sh"
154 tofile="build/${project.name}.woa/Contents/MacOS/${project.name}_Client"/>
155 <chmod file="build/${project.name}.woa/Contents/MacOS/${project.name}_Client" perm="ugo+rx"/>
156 <copy file="ClasspathClient.txt" tofile="build/${project.name}.woa/Contents/MacOS/ClasspathClient.txt"/>
157
158 <copy file="/Library/Application Support/Apple/Developer Tools/WebObjects Support/WinLaunch.CMD"
159 tofile="build/${project.name}.woa/Contents/Windows/${project.name}.CMD"/>
160
161 </target>
162 </project>
163
164 {{/code}}
165
166 This file is needed to make up for the lack of Java Client application building by the WOLips Incremental Builder. Please follow the [[instructions>>Java Client-WebStart Incremental Build]] for how to create the Java Client Incremental Builder.
167
168 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"
169 [[image:Picture 12.png]]
170 1. Right-click on the project and select "Run As -> WebObjects Application"
171 [[image:Picture 13.png]]
172 1. Select your.app.Application as the Application class
173 [[image:Picture 14.png]]
174 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:
175 [[image:Picture 15.png]]
176 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/]]