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". This WOComponent will be what passes the specifics about your client-side application to WebObjects.
29 1. Modify the JavaClient.html replacing the contents with:
30
31 {{code title="JavaClient.html Contents"}}
32 <WEBOBJECT NAME=JavaClientComponent></WEBOBJECT>
33 {{/code}}
34
35 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.
36
37 {{code title="JavaClient.wod Contents"}}
38
39 JavaClientComponent: WOJavaClientComponent {
40 applicationClassName = "com.webobjects.eogeneration.EODynamicApplication";
41 applicationName = "D2JC WebStart Test";
42 applicationDescription = "D2JC WebStart Test";
43 downloadClientClasses = "noDownloadClientClasses";
44 vendor = "My Company";
45 }
46
47 {{/code}}
48
49 {{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}}
50
51 1. Add the following frameworks to the project build path:
52
53 {{code}}
54 JavaDirectToWeb
55 JavaDTWGeneration
56 JavaEOApplication
57 JavaEOControl
58 JavaEODistribution
59 JavaEOGeneration
60 JavaEOInterface
61 JavaEOInterfaceSwing
62 JavaEOProject
63 JavaEORuleSystem
64 JavaFoundation
65 JavaJDBCAdaptor
66 JavaWebObjects
67 JavaWOExtensions
68 {{/code}}
69
70 1. Create a ClasspathClient.txt file in the root of the project and paste the following as contents:
71
72 {{code title="ClasspathClient.txt File"}}
73
74 # ApplicationClass == com.webobjects.eoapplication.client.EOClientApplicationSupport
75 # JDB == jdb
76 # JDBOptions ==
77 # JVM == java
78 # JVMOptions ==
79 APPROOT/WebServerResources/Java/WebStartJNLPTest.jar
80 /System/Library/Frameworks/JavaFoundation.framework/WebServerResources/Java/JavaFoundation.jar
81 WOROOT/Library/Frameworks/JavaEOControl.framework/WebServerResources/Java/JavaEOControl.jar
82 WOROOT/Library/Frameworks/JavaXML.framework/WebServerResources/Java/JavaXML.jar
83 WOROOT/Library/Frameworks/JavaDirectToWeb.framework/WebServerResources/Java/JavaDirectToWeb.jar
84 WOROOT/Library/Frameworks/JavaEOApplication.framework/WebServerResources/Java/JavaEOApplication.jar
85 WOROOT/Library/Frameworks/JavaEODistribution.framework/WebServerResources/Java/JavaEODistribution.jar
86 WOROOT/Library/Frameworks/JavaEOGeneration.framework/WebServerResources/Java/JavaEOGeneration.jar
87 WOROOT/Library/Frameworks/JavaEOInterface.framework/WebServerResources/Java/JavaEOInterface.jar
88 WOROOT/Library/Frameworks/JavaEOInterfaceSwing.framework/WebServerResources/Java/JavaEOInterfaceSwing.jar
89 WOROOT/Library/Frameworks/JavaEORuleSystem.framework/WebServerResources/Java/JavaEORuleSystem.jar
90 WOROOT/Library/Frameworks/JavaWOJSPServlet.framework/WebServerResources/Java/JavaWOJSPServlet_client.jar
91 HOMEROOT/Library/Java
92 LOCALROOT/Library/Java
93 WOROOT/Library/Java
94 /Network/Library/Java
95 WOROOT/Library/Frameworks/JavaVM.framework/Classes/classes.jar
96 WOROOT/Library/Frameworks/JavaVM.framework/Classes/ui.jar
97
98 {{/code}}
99
100 1. Create a javaclientbuild.xml file in root of the project and paste the follwing as contents:
101
102 {{code title="javaclientbuild.xml"}}
103
104 <project name="javaclient" default="javaclient" basedir=".">
105 <target name="setProps">
106 <property file="${user.home}${file.separator}build.properties"/>
107 <property file="build.properties"/>
108 <property file="${user.home}${file.separator}Library${file.separator}wobuild.properties"/>
109 <condition property="wo.properties.check.failed">
110 <not>
111 <and>
112 <isset property="wo.wosystemroot"/>
113 <isset property="wo.wolocalroot"/>
114 </and>
115 </not>
116 </condition>
117 <fail message="Could not find ${user.home}${file.separator}Library${file.separator}wobuild.properties." if="wo.properties.check.failed"/>
118 </target>
119 <target name="javaclient" depends="setProps">
120 <mkdir dir="build/${project.name}.woa/Contents/WebServerResources/Java"/>
121
122 <!-- project client-side classes -->
123 <copy todir="build/${project.name}.woa/Contents/WebServerResources/Java/">
124 <fileset dir="${classes.dir}">
125 <include name="**/client/**/*.class,**/common/**/*.class,**/BMGenericRecord.class"/>
126 <exclude name="**/server/**/*.class"/>
127 </fileset>
128 </copy>
129
130 <jar basedir="${classes.dir}"
131 includes="**/client/**/*.class,**/common/**/*.class,**/BMGenericRecord.class"
132 excludes="**/server/**/*.class"
133 jarfile="build/${project.name}.woa/Contents/WebServerResources/Java/${project.name}.jar">
134 </jar>
135
136 <!-- Launch Scripts and WOBootstrap.jar-->
137 <mkdir dir="build/${project.name}.woa/Contents/MacOS"/>
138 <mkdir dir="build/${project.name}.woa/Contents/UNIX"/>
139 <mkdir dir="build/${project.name}.woa/Contents/Windows"/>
140
141 <copy file="/Library/Application Support/Apple/Developer Tools/WebObjects Support/UnixLaunch.sh"
142 tofile="build/${project.name}.woa/Contents/${project.name}"/>
143 <chmod file="build/${project.name}.woa/Contents/${project.name}" perm="ugo+rx"/>
144 <copy file="/Library/Application Support/Apple/Developer Tools/WebObjects Support/WinLaunch.CMD"
145 tofile="build/${project.name}.woa/Contents/${project.name}.CMD"/>
146 <copy file="/Library/Application Support/Apple/Developer Tools/WebObjects Support/WOBootstrap.jar"
147 tofile="build/${project.name}.woa/Contents/WOBootstrap.jar"/>
148
149 <copy file="/Library/Application Support/Apple/Developer Tools/WebObjects Support/UnixLaunchClient.sh"
150 tofile="build/${project.name}.woa/Contents/MacOS/${project.name}_Client"/>
151 <chmod file="build/${project.name}.woa/Contents/MacOS/${project.name}_Client" perm="ugo+rx"/>
152 <copy file="ClasspathClient.txt" tofile="build/${project.name}.woa/Contents/MacOS/ClasspathClient.txt"/>
153
154 <copy file="/Library/Application Support/Apple/Developer Tools/WebObjects Support/WinLaunch.CMD"
155 tofile="build/${project.name}.woa/Contents/Windows/${project.name}.CMD"/>
156
157 </target>
158 </project>
159
160 {{/code}}
161
162 1. Right-click on the javaclientbuild.xml file and select "Run As -> Ant Build"
163 1. Right-click on the project and select "Run As -> WebObjects Application"
164 1. Select your.app.Application as the Application class
165 1. Copy the Direct Connect URL from the Eclipse console and paste it into your browser. You should get a "click here" link.
166 1. Click it.