New Sites to check out
The information below the following two links is very old. New users are encouraged to refer to the wiki or Kieran's blog linked below.
Kieran's blog:
http://homepage.mac.com/kelleherk/iblog/C183784902/index.html
WebObjects WikiBook:
http://en.wikibooks.org/wiki/Programming:WebObjects#Project_WONDER
/** Getting Started with Project WONDER */
Follow these instructions to be up and running quickly with Project WONDER.
PBX Setup
- Create a directory "Roots" in your home directory.
(This is only a suggestion for the location, it could be another directory...) - In PBX, go to Preferences->Building
- Check "Separate location for build products" and enter "~/Roots"
- Check "Put intermediate build files with build products"
- In *your own* applications and frameworks, select the top node of the project tree
- Choose Project->Show Info menu
- Check "Place build product at default location"
- Check "Place intermediate files with build products"
- Replace the ProjectBuilderJambase makefile located at:
/Developer/Makefiles/pbx_jamfiles/ProjectBuilderJambase
with our updated copy (31 k .tgz) that fixes a bug in using the Jikes compiler with ProjectBuilder. Here's a more detailed description of the bug.(Remember to make a backup of your original file.)
Do not change these settings!
For deployment, there will be a script that fixes the paths in your start script. For now, you should copy the relevant directories manually and edit your startup script to reflect the location of the copied frameworks.
Log4j initialization
To get Log4j going, you will need something akin to the following in your "WebObjects.properties" (in your home directory under WO 5.1):
For Wonder 0.9
//log4j appender and formatting
log4j.rootCategory=INFO, A1
log4j.categoryFactory=er.extensions.ERXLogger$Factory
log4j.appender.A1=org.apache.log4j.ConsoleAppender
log4j.appender.A1.layout=er.extensions.ERXPatternLayout
log4j.appender.A1.layout.ConversionPattern=%-5p %d{HH:mm:ss} (%-20c:%L)
%x -%m%n
//log4j category configuration
log4j.category.er=INFO
For Wonder 0.91
//log4j appender and formatting
log4j.rootLogger=INFO, A1
log4j.loggerFactory=er.extensions.ERXLogger$Factory
log4j.appender.A1=org.apache.log4j.ConsoleAppender
log4j.appender.A1.layout=er.extensions.ERXPatternLayout
log4j.appender.A1.layout.ConversionPattern=%-5p %d{HH:mm:ss} (%-20c:%L)
%x -%m%n
//log4j logger configuration
log4j.logger.er=INFO
ERCrypto
Using ERCrypto's methods will require a little bit of setup with JDK 1.3.
This class requires that you have JCE (javax.crypto and the Sun provider) installed. JCE is standard in the 1.4 JDK. For JDK 1.3 you can find it at http://java.sun.com/products/jce/index-122.html.
- Put the 4 JCE jars in your extensions directory (/Library/Java/Home/lib/ext on MacOS X) for ERExtensionsJava to build.
- Also, edit /Library/Java/Home/lib/security/java.security, add the following line:
security.provider.4=com.sun.crypto.provider.SunJCE
Validation
The validation should make localization of model-thrown messages much easier, however there are a few prerequisites:
- Your classes (currently) must descend from ERXGenericRecord, and your EOGenericRecord classes will be transformed to ERXGenericRecord.
- If you want to use your own ClassDescription, you must subclass from ERXEntityClassDescription
- In your model, instead of:
throw new NSValidation.ValidationException("Something went wrong!");
write
throw new ERXValidationException(eo, key, value, "somecode");
- In a "Validations.strings" file in your project, add:
somecode = "Something went wrong";
Then localize the Validation.strings and when you display it, instead of
catch (NSValidation.ValidationException ex) {
errorMessage = ex.getMessage();
}
write
catch (ERXValidationException exve) {
exve.setTargetLanguage(theCurrentLanguage); //English,German etc.
errorMessage = exve.getMessage();
} catch (NSValidation.ValidationException ex) {
errorMessage = ex.getMessage();
}
Translations of the plain model exceptions into German will be supplied shortly, in the meantime, look at the English versions in the ERDirectToWebJava framework.
Need More Help?
Check our Sourceforge project page for access to the source code (CVS repository).
Also, feel free to join the WONDER discussion list, and ask your questions there.