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