Changes for page Create a WebObjects Framework
Last modified by Pascal Robert on 2007/12/15 18:15
To version 16.1
edited by Pascal Robert
on 2007/12/15 18:13
on 2007/12/15 18:13
Change comment:
There is no comment for this version
Summary
-
Page properties (2 modified, 0 added, 0 removed)
Details
- Page properties
-
- Author
-
... ... @@ -1,1 +1,1 @@ 1 -XWiki. ianjoyner1 +XWiki.probert - Content
-
... ... @@ -1,6 +1,8 @@ 1 +{{toc}}{{/toc}} 2 + 1 1 = Introduction = 2 2 3 -So, you have built the mother of all WebObjects apps in XCode or Eclipse with everything in the default package (or not ;)). The time has come where you want a make a new WebObjects application that re-uses some of the functionality you have already created in bigApp.woa. 5 +So, you have built the mother of all WebObjects apps in XCode or Eclipse with everything in the default package (or not ;-) ). The time has come where you want a make a new WebObjects application that re-uses some of the functionality you have already created in bigApp.woa. 4 4 This article explains how to create a framework in Eclipse that can be used with your WebObjects projects. The resulting framework can be used in WOLips or XCode projects. In this example a framework is created that consists of class(es) that were in the default package of a WebObjects application and the 3rd party jar dependencies that were originally in /Library/WebObjects/Extensions. The resulting framework bundle will encompass the 3rd party jar and the custom java classes that are moved from the original WO project. 5 5 Disclaimer: I am still relatively new to Eclipse, so if you see a smarter way to do this, then feel free to edit this wiki page 6 6 Also, at the time of writing this article I was using Eclipse 3.2.1 with WOLips build #3769. ... ... @@ -35,20 +35,20 @@ 35 35 36 36 == Bundling 3rd Party Jars in your Framework == 37 37 38 -Next add any 3rd party jar files to your project that you want bundled with this framework. This is probably the "best practice" way to make 3rd party jars available to your WebObjects apps rather than stuffing them into /Library/WebObjects/Extensions. 40 +Next add any 3rd party jar files to your project that you want bundled with this framework. This is probably the "best practice" way to make 3rd party jars available to your WebObjects apps rather than stuffing them into /Library/WebObjects/Extensions, or even worse, putting them in /Library/Java/Extensions, which can lead to deployment hassles later. 39 39 40 40 To do this simply locate the jar in the Finder and drag and drop it on the Libraries folder in your project as shown here: 41 41 [[image:dragJarToLibraries.jpg]] 42 42 43 -Next ,edit the build pathso thatit sees the classesin this jar. Right-click on theproject>Build Path >ConfigureBuild Path.45 +Next simply right-click on the jar file itself and select Build Path > Add to Build Path. 44 44 45 -[[image: configureBuildPath.jpg]]47 +[[image:Picture 7.jpg]] 46 46 47 -Click on the Libraries tab. 48 -Click the Add Jars button and navigate to the jar inside your project. 49 -Select the jar and click OK. 50 -[[image:buildPath-jarSelection.jpg]] 49 +IMPORTANT: 51 51 51 +* Next right-click on the project and select Build Path > Configure Build Path... 52 +* Then to to the Order and Export tab and turn ON the checkbox next to the jar that you just added to the build path. By doing this, the jars in the framework are automatically available to any WebObjects apps/frameworks that depend on this framework in your workspace. 53 + 52 52 Adding dependencies on other frameworks can be done at this stage if you wish. The procedure is the same as for adding framework dependencies to a WOApplication which also has a tutorial. Keep in mind that the WOnder Framework wizard adds default framework links which you can adjust and turn off easily (right-click WOFrameworks icon and select Configure) 53 53 54 54 == Create a package (or packages) for your reusable classes. ==