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 36.1
edited by David Avendasora
on 2008/07/01 16:52
on 2008/07/01 16:52
Change comment:
There is no comment for this version
To version 39.1
edited by David Avendasora
on 2023/11/13 11:57
on 2023/11/13 11:57
Change comment:
Renamed from xwiki:documentation.Java Client and Direct To Java Client Example Project using WebStart
Summary
-
Page properties (2 modified, 0 added, 0 removed)
-
Attachments (0 modified, 7 added, 0 removed)
Details
- Page properties
-
- Parent
-
... ... @@ -1,0 +1,1 @@ 1 +Java Client - Content
-
... ... @@ -3,83 +3,40 @@ 3 3 You can also create a Java Client application using two separate Eclipse projects. One for the server (a WOLips project), and one for the client (most likely a plain Java project). This will make the separation between client and server much more obvious, but then you will have two Eclipse projects to maintain. The approach described in this tutorial is most appropriate for WebStart based client app distribution. 4 4 5 5 1. Create a new WebObjects Application 6 -[[image:Picture 9.png]] 7 -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}} 8 -1. Modify the Main.html by adding: 9 - 10 -{{code title="Main.html Changes"}} 11 -<WEBOBJECT NAME=JavaClientLink>click here</WEBOBJECT> 12 -{{/code}} 13 - 14 -1. Modify the Main.wod file by adding: 15 - 16 -{{code title="Main.wod Changes"}} 17 -JavaClientLink: WOHyperlink { 6 +[[image:attach:Picture 9.png]] 7 +1. Name it "WebStartJNLPTest" in Eclipse with a package of "your.app" 8 +1. {{note title="Note!"}}If you change the Project name or packages, then you'll need to make additional changes in the subsequent steps.{{/note}}Modify the Main.html by adding: 9 +1. {{code 0="html" title="Main.html Changes"}}<WEBOBJECT NAME=JavaClientLink>click here</WEBOBJECT>{{/code}}Modify the Main.wod file by adding: 10 +1. {{code title="Main.wod Changes"}}JavaClientLink: WOHyperlink { 18 18 href = javaClientLink; 19 -} 20 -{{/code}} 21 - 22 -1. Modify the Main.java file by adding: 23 - 24 -{{code title="Main.java Changes"}} 25 - 12 +}{{/code}}Modify the Main.java file by adding: 13 +1. {{code 0="java" title="Main.java Changes"}} 26 26 public String javaClientLink() { 27 27 return WOJavaClientComponent.webStartActionURL(context(), "JavaClient"); 28 28 } 29 - 30 -{{/code}} 31 - 32 -1. Create a WOComponent named "JavaClient". 33 -[[image:Picture 11.png]][[image:Picture 10.png]] 34 -This WOComponent will be what passes the specifics about your client-side application to WebObjects. 35 -1. Modify the JavaClient.html replacing the contents with: 36 - 37 -{{code title="JavaClient.html Contents"}} 38 -<WEBOBJECT NAME=JavaClientComponent></WEBOBJECT> 39 -{{/code}} 40 - 41 -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. 42 - 43 -{{code title="JavaClient.wod Contents"}} 44 - 45 -JavaClientComponent: WOJavaClientComponent { 46 - applicationClassName = "com.webobjects.eogeneration.EODynamicApplication"; 47 - applicationName = "D2JC WebStart Test"; 48 - applicationDescription = "D2JC WebStart Test"; 49 - downloadClientClasses = "noDownloadClientClasses"; 50 - vendor = "My Company"; 51 -} 52 - 53 -{{/code}} 54 - 55 -{{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}} 56 - 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. 17 +{{/code}}Create a WOComponent named "JavaClient". 18 + [[image:attach:Picture 11.png]][[image:attach:Picture 10.png]] 19 +This WOComponent will be what passes the specifics about your client-side application to WebObjects. 20 +1. Modify the JavaClient.html replacing the contents with: 21 +1. {{code 0="html" title="JavaClient.html Contents"}}<WEBOBJECT NAME=JavaClientComponent></WEBOBJECT>{{/code}}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. 22 +1. {{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}}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. 23 + 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. 59 59 1. Add the following frameworks to the project build path: 60 -JavaDirectToWeb 61 -JavaDTWGeneration 62 -JavaEOApplication 63 -JavaEOControl 64 -JavaEODistribution 65 -JavaEOGeneration 66 -JavaEOInterface 67 -JavaEOInterfaceSwing 68 -JavaEOProject 69 -JavaEORuleSystem 70 -JavaFoundation 71 -JavaJDBCAdaptor 72 -JavaWebObjects 73 -JavaWOExtensions 74 - 75 -{{note title="Note!"}} 76 - If you are not creating a D2JC application, then you won't need all of these, but they won't hurt anything either. 77 -{{/note}} 78 - 79 -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}} 80 - 81 -{{code title="ClasspathClient.txt File"}} 82 - 25 + JavaDirectToWeb 26 + JavaDTWGeneration 27 + JavaEOApplication 28 + JavaEOControl 29 + JavaEODistribution 30 + JavaEOGeneration 31 + JavaEOInterface 32 + JavaEOInterfaceSwing 33 + JavaEOProject 34 + JavaEORuleSystem 35 + JavaFoundation 36 + JavaJDBCAdaptor 37 + JavaWebObjects 38 + JavaWOExtensions 39 +1. {{note title="Note!"}}If you are not creating a D2JC application, then you won't need all of these, but they won't hurt anything either.{{/note}}Create a ClasspathClient.txt file in the root of the project and paste the following as contents: {{code title="ClasspathClient.txt File"}} 83 83 # ApplicationClass == com.webobjects.eoapplication.client.EOClientApplicationSupport 84 84 # JDB == jdb 85 85 # JDBOptions == ... ... @@ -103,19 +103,15 @@ 103 103 /Network/Library/Java 104 104 WOROOT/Library/Frameworks/JavaVM.framework/Classes/classes.jar 105 105 WOROOT/Library/Frameworks/JavaVM.framework/Classes/ui.jar 106 - 107 -{{/code}} 108 - 109 -This file is only required by the application when it is being launched from within Eclipse. 110 - 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. 63 +{{/code}} This file is only required by the application when it is being launched from within Eclipse. 64 +1. Create a Java Client Incremental Builder by following the [[instructions>>doc: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. 112 112 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" 113 -[[image:Picture 12.png]] 66 +[[image:attach:Picture 12.png]] 114 114 1. Right-click on the project and select "Run As -> WebObjects Application" 115 -[[image:Picture 13.png]] 68 +[[image:attach:Picture 13.png]] 116 116 1. Select your.app.Application as the Application class 117 -[[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-WebStart Distribution Building]]. 119 -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: 120 -[[image:Picture 15.png]] 121 -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/]] 70 +[[image:attach:Picture 14.png]] 71 +1. If you want to actually deploy this application, then you will also need to [[modify the build.xml file>>doc:Java Client-WebStart Distribution Building]]. 72 + 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: 73 + [[image:attach:Picture 15.png]] 74 +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>>url:http://web.mac.com/flor385/JBND/||shape="rect"]]
- Picture 10.png
-
- Author
-
... ... @@ -1,0 +1,1 @@ 1 +XWiki.XWikiGuest - Size
-
... ... @@ -1,0 +1,1 @@ 1 +113.1 KB - Content
- Picture 11.png
-
- Author
-
... ... @@ -1,0 +1,1 @@ 1 +XWiki.XWikiGuest - Size
-
... ... @@ -1,0 +1,1 @@ 1 +54.7 KB - Content
- Picture 12.png
-
- Author
-
... ... @@ -1,0 +1,1 @@ 1 +XWiki.XWikiGuest - Size
-
... ... @@ -1,0 +1,1 @@ 1 +17.2 KB - Content
- Picture 13.png
-
- Author
-
... ... @@ -1,0 +1,1 @@ 1 +XWiki.XWikiGuest - Size
-
... ... @@ -1,0 +1,1 @@ 1 +22.2 KB - Content
- Picture 14.png
-
- Author
-
... ... @@ -1,0 +1,1 @@ 1 +XWiki.XWikiGuest - Size
-
... ... @@ -1,0 +1,1 @@ 1 +61.3 KB - Content
- Picture 15.png
-
- Author
-
... ... @@ -1,0 +1,1 @@ 1 +XWiki.XWikiGuest - Size
-
... ... @@ -1,0 +1,1 @@ 1 +25.6 KB - Content
- Picture 9.png
-
- Author
-
... ... @@ -1,0 +1,1 @@ 1 +XWiki.XWikiGuest - Size
-
... ... @@ -1,0 +1,1 @@ 1 +55.1 KB - Content