Version 15.1 by smmccraw on 2007/07/08 09:45

Show last authors
1 == Quickstart ==
2
3 Using Project WONDER is surprisingly easy. There are only a few steps to get up-and-running:
4
5 1. [[Download and install>>Programming__WebObjects-Project_WONDER-Installing]] the Project WONDER frameworks;
6 1. Add the ERJars.framework and ERExtensions.framework to your WebObjects project;
7 1. Change your Application class to extend er.extensions.ERXApplication instead of WOApplication;
8 1. Change your Application.main method to call er.extensions.ERXApplication.main instead of WOApplication.main;
9 1. Change your Session class to extend er.extensions.ERXSession instead of WOSession;
10 1. Change your DirectAction class to extend er.extensions.ERXDirectAction instead of WODirectAction;
11 1. Build.
12
13 When using Xcode out of the box, there will be an error upon launching this application (as of Feb 6, 2007):
14
15 <b>"No ERX//MARKER field in NSMutableArray found."</b>//
16
17 This means your class path is incorrect. Adjust it so that ERExtensions come before JavaFoundation. To do this, you must change the order of your classpath so that ERExtensions appears above JavaFoundation. In my default classpath, JavaFoundation appears first in the list. If you are using Xcode, follow Jerry Walker's instructions:
18
19 1. Select "Application Server" in your Active Target popdown menu at the top left of your Xcode window.
20 1. Type command-option-e or choose the Project->Edit Active Target 'Application Server' menu item. This will open a target editing window.
21 1. Select 'Link Binary With Libraries' under 'Build Phases' in the left-hand view.
22 1. You can edit the framework load order by dragging framework up or down in the list on the right. Drag the ERExtensions.framework to the top.
23 1. Rearrange these frameworks in the editing pane into any order that you desire by dragging and dropping them within the editing pane.
24 1. Set your Active Target popdown menu back to the name of your project. <b>THIS IS IMPORTANT.</b>
25 1. Clean and rebuild your app and your classpath settings should be rearranged accordingly.
26
27 This error only occurs with Xcode and, obviously, this workaround applies to Xcode and not Eclipse. Also, there is also an Xcode project template for an ERXApplication available. (from where?)
28
29 If you are using WOLips, you can create a new "Project Wonder Application" which will setup a project with these steps already performed.
30
31 That's it!You//are//now//using//Project//WONDER//and//you've//begun//your//journey//to//easier//WO//application//development.//
32
33 == Notes//from//David//Teran// ==
34
35 From//David//Teran//Dec//1//2004~://**Pointers//for//getting//your//head//around//the//frameworks//**
36
37 "PW//consists//of//different//frameworks,//the//most//important//one//is//ERExtensions,//then//for//D2W//apps//additionally//ERDirectToWeb,//some//if//not//all//people//are//using//ERCoreBusinessLogic.//The//other//frameworks//are//build//on//top//of//one//or//multiple//from//these.//
38
39 BUT:_i_would_start_reading_the_class_description_and_then_the_javadoc,//its//generated//from//the//sourcecode//with//eclipse//within//a//second//(//ok,//maybe//60...//)//and//its//read//in//about//1//-//3//hours.
40
41 Then//i//would//take//a//look//ERXApplication,//ERXSession,//ERXGenericRecord,//ERXEC//(very//interesting!), ERXThreadStorage (very interesting, too), ERExtensions, ... and the various utility classes: ERXEOControlUtilities, ERXEOAccessUtilities, ERXArrayUtilities and so on."//
42
43 == Notes from Chris Meyer ==
44
45 === Internationalization and Localization ===
46
47 Practical WebObjects outlines one technique for handling internationalization. It is incompatible with Project WONDER.
48
49 To handle internationalization in Project WONDER, delete the {{code}}takeValuesFromRequest{{/code}} from your {{code}}Session{{/code}} class (which should now be derived from {{code}}ERXSession{{/code}}). Likewise, delete the {{code}}createResponseInContext{{/code}} method from your {{code}}Application{{/code}} class (which should now be derived from {{code}}ERXApplication{{/code}}). Then add the following call to your {{code}}Application{{/code}} constructor:
50
51 {{code}}
52 ERXMessageEncoding.setDefaultEncodingForAllLanguages("UTF8");
53 {{/code}}
54
55 === Logging ===
56
57 Practical WebObjects outlines one technique for SQL logging. Project WONDER uses an entirely different technique.
58
59 In Project WONDER, put this in one of the properties files (I use ,,/WebObjects.properties),,
60
61 {{code}}{{/code}}
62
63 1. turn off annoying INFO logs
64 log4j.logger.er=INFO
65 log4j.logger.er.extensions.ERXExtensions=OFF
66
67 1. Enable delegate to emit SQL debugging info. The Logger used is
68 log4j.category.er.extensions.ERXAdaptorChannelDelegate.sqlLogging=DEBUG
69 1. put this to true if you want to log sql stuff
70 er.extensions.ERXAdaptorChannelDelegate.enabled=true
71 1. How long a statement must run to cause a log message. Messages with longer than
72 1. error also emit a stack-trace
73 er.extensions.ERXAdaptorChannelDelegate.trace.milliSeconds.debug=0
74 er.extensions.ERXAdaptorChannelDelegate.trace.milliSeconds.info=50
75 er.extensions.ERXAdaptorChannelDelegate.trace.milliSeconds.warn=1000
76 er.extensions.ERXAdaptorChannelDelegate.trace.milliSeconds.error=5000
77 1. MaxLength of the message
78 er.extensions.ERXAdaptorChannelDelegate.trace.maxLength = 30000
79 1. What entities to watch
80 er.extensions.ERXAdaptorChannelDelegate.trace.entityMatchPattern = .
81
82 {{code}}{{/code}}
83
84 === Backtracking ===
85
86 Project WONDER offers a few techniques to deal with backtracking.
87
88 My recommended way is to add a method to your WOComponent:
89
90 {{code}}
91
92 {panel}
93 /**
94 * Determine whether the user backtracked.
95 * @return true or false indicating whether the user backtracked
96 */
97 public boolean didBacktrack()
98 {
99 return ((Session)session()).didBacktrack();
100 }
101 {panel}
102
103 {{/code}}
104
105 Then anywhere a form is submitted where backtracking might be a problem, add this code to the action method:
106
107 {{code}}
108
109 {panel}
110 if (this.didBacktrack())
111 {
112 ec.revert();
113 // handle and prepare to report errors
114 // this.errors.addObject("Unable to process page after back button was pressed.");
115 return this.context().page();
116 }
117 {panel}
118
119 {{/code}}
120
121 {{code}}
122 ERXWORepetition
123 {{/code}}
124
125 also contains some code to deal with backtracking. As of Project WONDER 3.0, the code seems to work inconsistently. When the page is backtracked and the form submitted, values in the form are just passed as {{code}}null{{/code}}. This tends to cause more problems than it is worth, although your situation may be different. Also, there is an option to throw an exception when the page is backtracked, but this exception doesn't seem to be thrown consistently.
126
127 == Javadocs ==
128
129 === Prebuilt ===
130
131 * http:~/~/webobjects.mdimension.com/wonder/api
132 * http:~/~/webobjects.mdimension.com/wonder/Wonder-latest-Documentation.tar.gz
133
134 === Creating javadocs from the Wonder source (not using Eclipse) ===
135
136 If you want to create the javadoc and you haven't got Eclipse going yet:
137
138 1. Get the latest source from the nightly build server.
139 1. Once you untar it you'll have a Wonder folder created.
140 1. In the terminal app % cd to the Wonder/Build/build directory
141 1. % ant doc
142 1. Wait several minutes while some good stuff scrolls by in your terminal window (If ant gives you errors, you may have to set it to use ant 1.4 instead of 1.5 by exporting: JAVA//HOME=/System/Library/Frameworks/JavaVM.framework/Versions/1.4/Home)//
143 1. Find the new dist/wonder-2.0/Documentation/api/index.html page that has been created in the same directory as the Wonder folder was untarred in
144 1. Double click on the index.html page and the javadocs will open in your favourite browser
145
146 === Creating javadocs from the Wonder source (using Eclipse) ===
147
148 Someone else will have to fill in this section...
149
150 ----
151
152 Category:WebObjects