Changes for page Embedding WOFrameworks

Last modified by Gavin Eadie on 2011/07/29 18:09

From version 34.1
edited by David Holt
on 2009/09/02 11:20
Change comment: There is no comment for this version
To version 35.1
edited by Kieran Kelleher
on 2007/03/30 15:58
Change comment: There is no comment for this version

Summary

Details

Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.dholt
1 +XWiki.kieran
Content
... ... @@ -1,133 +1,5 @@
1 -== WOLips 3.4.x, and later, Side-note ==
1 +**Caveat:** This example assumes that each framework you want to embed has an ant build.xml file with a buildAndCompile target. For frameworks you create yourself using WOLips, you will have this, but for a case where you are checking out individual Wonder framework projects from CVS, then you probably will not have such a build.xml file, so this approach is not quick to implement in that case unless you want to spend a lot of time working on ant build files to resolve the missing build.xml having a buildAndCompile target for those external projects. (KK 3/30/2007)
2 2  
3 -{{warning}}
4 -If you are updating an older project, make sure you get the latest build.xml file. Create a new project, then copy/paste the contents of the fresh build.xml file into your project's build.xml file.
5 -{{/warning}}
6 -
7 -For WOLips 3.4.x and later, while embedding is built-in, it's not enabled by default. To enable embedding:
8 -
9 -* make sure you are in the WO Explorer view
10 -* right-click your project folder, select Properties, select WOLips Deployment
11 -* check the related, if not all, options under Embed Frameworks
12 -
13 -To create a versioned/dated bundle of your app and resources:
14 -
15 -* make sure you are in the Navigator view
16 -* edit build.properties, and add:
17 -* ##build.app.name=MyApp-2009-07-14##
18 -
19 -There is a known bug with WO 5.4.x (for those not using the latest Wonder release) regarding proper linking to your web server resources within the embedded frameworks. The WOFrameworksBaseURL isn't set correctly. To do this you'll need to programmatically set this within your Application constructor:
20 -
21 -* ##setFrameworksBaseURL("/WebObjects/MyApp-2009-07-14.woa/Frameworks");##
22 -
23 -Within build.properties (I may need to be corrected on this), the best approach to linking your embedded framework's web server resources automatically is to include (however the bug noted above breaks this):
24 -
25 -* ##frameworksBaseURL=/WebObjects/$build.app.name.woa/Frameworks##
26 -
27 -And finally, there is a bug in the build.xml file that you may need to clean-up:
28 -[[http://issues.objectstyle.org/jira/browse/WOL-979]]
29 -
30 -== Introduction ==
31 -
32 -Below is outlined "simple embedding" concepts, however __full embedding__ **and** __split-installing__ are really recommended. This provides fully versioned self-contained bundles of both the application deployment bundle and the webserver deployment bundle. Read the docs on that technique for more **advantages**. This technique fully explained along with a ready-to-use ant build script is available at:
33 -
34 -[[Alternative Ant Build Script for Fully Embedded and Split Install Bundles]]
35 -
36 -== Simple Approach ==
37 -
38 -This simple approach can be used to embed frameworks already **installed** on your development machine right into the app.woa bundle.
39 -
40 -Open your build.xml project file and change embed="false" to embed="true" for the appropriate directory paths in this section of the build.xml file inside the woapplication task
41 -
42 -{{code title="Default build.xml snippet"}}
43 -
44 -<frameworks root="${wo.wolocalroot}" embed="false">
45 - <patternset>
46 - <includesfile name="woproject/ant.frameworks.wo.wolocalroot" />
47 - </patternset>
48 -</frameworks>
49 -<frameworks root="${user.home}" embed="false">
50 - <patternset>
51 - <includesfile name="woproject/ant.frameworks.user.home" />
52 - </patternset>
53 -</frameworks>
54 -<frameworks root="${wo.wosystemroot}" embed="false">
55 - <patternset>
56 - <includesfile name="woproject/ant.frameworks.wo.wosystemroot" />
57 - </patternset>
58 -</frameworks>
59 -
60 -{{/code}}
61 -
62 -The most common choice is to embed locally installed WOnder and 3rd party frameworks that your app references by setting embed="true" on the wolocalroot frameworks dir as shown below:
63 -
64 -{{code title="Changes to build.xml to embed frameworks installed in /Library/Frameworks dir"}}
65 -
66 -<frameworks root="${wo.wolocalroot}" embed="true">
67 - <patternset>
68 - <includesfile name="woproject/ant.frameworks.wo.wolocalroot" />
69 - </patternset>
70 -</frameworks>
71 -<frameworks root="${user.home}" embed="false">
72 - <patternset>
73 - <includesfile name="woproject/ant.frameworks.user.home" />
74 - </patternset>
75 -</frameworks>
76 -<frameworks root="${wo.wosystemroot}" embed="false">
77 - <patternset>
78 - <includesfile name="woproject/ant.frameworks.wo.wosystemroot" />
79 - </patternset>
80 -</frameworks>
81 -
82 -{{/code}}
83 -
84 -The various dirs referenced in the build.xml from which you can select the embed option are:
85 -
86 -|= dir name |= Description
87 -| wo.wolocalroot | /Library/Frameworks/
88 -\\Embedding these is most useful especially if you the codebase for these, like WOnder frameworks or your own, is frequently updated
89 -| user.home | /Library/Frameworks/
90 -| wo.systemroot | /System/Library/Frameworks/
91 -\\This is where Apple's WebObjects frameworks are installed and if your WebObjects version is consistent between your deployment and development platforms, then embedding these is not of much benefit.
92 -
93 -{{note title="Remember to..." bgColor="#FFFFCE"}}
94 -
95 -If you are working with framework source in your Eclipse workspace (which you should be\!), then it is critical that you build and install all frameworks before building the deployment bundles to ensure that the embedded frameworks are the same as the source you have been developing and testing with. See next subsection for one approcah to automating this.
96 -
97 -{{/note}}
98 -
99 -=== Pre-installing Workspace Frameworks Before Embedded Build ===
100 -
101 -You could write a task to install the frameworks directly from the workspace, for example:
102 -
103 -{{code}}
104 -
105 - <!-- Install my own dependent frameworks in final local install location before embedding -->
106 - <target name="installMyFrameworks">
107 - <ant dir="../WKDemography" target="install" inheritall="false" />
108 - <ant dir="../WKEmailData" target="install" inheritall="false" />
109 - <ant dir="../WKEOFExtensions" target="install" inheritall="false" />
110 - <ant dir="../WKFoundation" target="install" inheritall="false" />
111 - <ant dir="../WKPrototypes" target="install" inheritall="false" />
112 - <ant dir="../WKRemoteClient" target="install" inheritall="false" />
113 - <ant dir="../WKReports" target="install" inheritall="false" />
114 - <ant dir="../WKWebObjects" target="install" inheritall="false" />
115 - </target>
116 -
117 -{{/code}}
118 -
119 -... and then you could put a depends attribute on the build target to ensure the frameworks are installed before the embedded build task is executed:
120 -
121 -{{code}}
122 -
123 - <target name="build.woapp" depends="installMyFrameworks">
124 -
125 -{{/code}}
126 -
127 -== Advanced Approach ==
128 -
129 -**Caveat:** This example assumes that each framework you want to embed has an ant "build.xml" file with a "compileAndBuild" target. For frameworks you create yourself using WOLips, you will have this, but for a case where you are checking out individual Wonder framework projects from CVS, then you probably will not have such a build.xml file, so this approach is not quick to implement in that case unless you want to spend a lot of time working on ant build files to resolve the missing build.xml having a compileAndBuild target for those external projects. (KK 3/30/2007)
130 -
131 131  ----
132 132  
133 133  See also [[FrameworkSet>>WOProject-FrameworkSet]] documentation.