Changes for page Java Client and Direct To Java Client Example Project using WebStart
Last modified by David Avendasora on 2008/07/01 16:52
From version 31.1
edited by David Avendasora
on 2008/06/25 10:04
on 2008/06/25 10:04
Change comment:
There is no comment for this version
To version 32.1
edited by David Avendasora
on 2008/06/26 10:34
on 2008/06/26 10:34
Change comment:
There is no comment for this version
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -1,3 +1,7 @@ 1 +This tutorial will help you create a single Eclipse/WOLips project that contains both the client- and server-side classes of a WebObjects Java Client project, build both applications and then launch them both. 2 + 3 +You can also create a Java Client application using two separate Eclipse WebObjects projects. One for the server, and one for the client. This will make the separation between client and server much more obvious, but then you will have two Eclipse projects to maintain. 4 + 1 1 1. Create a new WebObjects Application 2 2 [[image:Picture 9.png]] 3 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}} ... ... @@ -50,6 +50,8 @@ 50 50 51 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 52 57 +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. 58 +If you don't specify a client class name for each entity, then WebObjects will automatically use EOGenericRecord as it's class. Once you want to start specifying client-side logic including default values and such, you will need to add the Client Class Name to the Entity in the EOModel, and then setup a new .eogen file in eclipse to generate the client-side classes. 53 53 1. Add the following frameworks to the project build path: 54 54 JavaDirectToWeb 55 55 JavaDTWGeneration ... ... @@ -100,70 +100,9 @@ 100 100 101 101 {{/code}} 102 102 103 - 1. Create a javaclientbuild.xmlfile in rootofthe projectandpastethe follwingascontents:109 +This file is only required by the application when it is being launched from within Eclipse. 104 104 105 -{{code title="javaclientbuild.xml"}} 106 - 107 -<project name="javaclient" default="javaclient" basedir="."> 108 - <target name="setProps"> 109 - <property file="${user.home}${file.separator}build.properties"/> 110 - <property file="build.properties"/> 111 - <property file="${user.home}${file.separator}Library${file.separator}wobuild.properties"/> 112 - <condition property="wo.properties.check.failed"> 113 - <not> 114 - <and> 115 - <isset property="wo.wosystemroot"/> 116 - <isset property="wo.wolocalroot"/> 117 - </and> 118 - </not> 119 - </condition> 120 - <fail message="Could not find ${user.home}${file.separator}Library${file.separator}wobuild.properties." if="wo.properties.check.failed"/> 121 - </target> 122 - <target name="javaclient" depends="setProps"> 123 - <mkdir dir="build/${project.name}.woa/Contents/WebServerResources/Java"/> 124 - 125 - <!-- project client-side classes --> 126 - <copy todir="build/${project.name}.woa/Contents/WebServerResources/Java/"> 127 - <fileset dir="${classes.dir}"> 128 - <include name="**/client/**/*.class,**/common/**/*.class,**/BMGenericRecord.class"/> 129 - <exclude name="**/server/**/*.class"/> 130 - </fileset> 131 - </copy> 132 - 133 - <jar basedir="${classes.dir}" 134 - includes="**/client/**/*.class,**/common/**/*.class,**/BMGenericRecord.class" 135 - excludes="**/server/**/*.class" 136 - jarfile="build/${project.name}.woa/Contents/WebServerResources/Java/${project.name}.jar"> 137 - </jar> 138 - 139 - <!-- Launch Scripts and WOBootstrap.jar--> 140 - <mkdir dir="build/${project.name}.woa/Contents/MacOS"/> 141 - <mkdir dir="build/${project.name}.woa/Contents/UNIX"/> 142 - <mkdir dir="build/${project.name}.woa/Contents/Windows"/> 143 - 144 - <copy file="/Library/Application Support/Apple/Developer Tools/WebObjects Support/UnixLaunch.sh" 145 - tofile="build/${project.name}.woa/Contents/${project.name}"/> 146 - <chmod file="build/${project.name}.woa/Contents/${project.name}" perm="ugo+rx"/> 147 - <copy file="/Library/Application Support/Apple/Developer Tools/WebObjects Support/WinLaunch.CMD" 148 - tofile="build/${project.name}.woa/Contents/${project.name}.CMD"/> 149 - <copy file="/Library/Application Support/Apple/Developer Tools/WebObjects Support/WOBootstrap.jar" 150 - tofile="build/${project.name}.woa/Contents/WOBootstrap.jar"/> 151 - 152 - <copy file="/Library/Application Support/Apple/Developer Tools/WebObjects Support/UnixLaunchClient.sh" 153 - tofile="build/${project.name}.woa/Contents/MacOS/${project.name}_Client"/> 154 - <chmod file="build/${project.name}.woa/Contents/MacOS/${project.name}_Client" perm="ugo+rx"/> 155 - <copy file="ClasspathClient.txt" tofile="build/${project.name}.woa/Contents/MacOS/ClasspathClient.txt"/> 156 - 157 - <copy file="/Library/Application Support/Apple/Developer Tools/WebObjects Support/WinLaunch.CMD" 158 - tofile="build/${project.name}.woa/Contents/Windows/${project.name}.CMD"/> 159 - 160 - </target> 161 -</project> 162 - 163 -{{/code}} 164 - 165 -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. 166 - 111 +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. 167 167 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" 168 168 [[image:Picture 12.png]] 169 169 1. Right-click on the project and select "Run As -> WebObjects Application" ... ... @@ -170,6 +170,7 @@ 170 170 [[image:Picture 13.png]] 171 171 1. Select your.app.Application as the Application class 172 172 [[image:Picture 14.png]] 118 +1. If you want to actually deploy this application, then you will also need to [[modify the build.xml file>>Java Client-Building]]. 173 173 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: 174 174 [[image:Picture 15.png]] 175 175 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/]]