Changes for page About the Properties file

Last modified by Theodore Petrosky on 2016/06/28 12:30

From version 6.1
edited by Pascal Robert
on 2007/12/15 18:30
Change comment: There is no comment for this version
To version 10.1
edited by Kieran Kelleher
on 2007/10/10 15:23
Change comment: There is no comment for this version

Summary

Details

Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.probert
1 +XWiki.kieran
Content
... ... @@ -9,7 +9,7 @@
9 9  
10 10  {{/panel}}
11 11  
12 -WebObjects manages application preferences using a similar mechanism implemented by its [[com.webobjects.foundation.NSProperties>>http://developer.apple.com/documentation/MacOSXServer/Reference/WO54_Reference/com/webobjects/foundation/NSProperties.html]] class. The file format is as per the spec. In many references you will see specs say that a certain file is in java.io.Properties file format, however if I am not mistaken, they really mean the java.util.Properties, since even as far back as Java 1.1 API, there was no such class as java.io.Properties.
12 +WebObjects manages application preferences using a similar mechanism implemented by its [[com.webobjects.foundation.NSProperties>>http://developer.apple.com/documentation/WebObjects/Reference/API/com/webobjects/foundation/NSProperties.html]] class. The file format is as per the spec. In many references you will see specs say that a certain file is in java.io.Properties file format, however if I am not mistaken, they really mean the java.util.Properties, since even as far back as Java 1.1 API, there was no such class as java.io.Properties.
13 13  
14 14  In any case, WebObjects directly supports the use of [[Java 1.4 style properties>>http://java.sun.com/j2se/1.4.2/docs/api/java/util/Properties.html]] entries in the file named Resources/Properties in the woa and framework bundle format.
15 15  
... ... @@ -29,46 +29,10 @@
29 29  
30 30  === Configurability ===
31 31  
32 -Firstly, WOnder makes useful settings available as Properties which are not available out of the box as simple Properties entries in traditional WebObjects applications.
32 +Firstly, WOnder makes many useful settings available as Properties which are not available as simple Properties entries in traditional WebObjects applications. Some examples are:
33 33  
34 -For example:
34 +{
35 35  
36 -* EOModel connection dictionary parameters for each model
37 -* log4j configuration properties
38 -* Prototype model loading order
39 -
40 40  === User Properties ===
41 41  
42 -If your user name is 'joe', then in your WebObjects application, you can create a file named Properties.joe which is read in last when joe launches his WebObjects app in his Eclipse development enviromnent. This is useful for development teams. Each team member can have properties specific to his/her own development enviromnent such as smtp server, logging properties, database connection dictionary settings, etc.
43 -
44 -=== Derived Properties ===
45 -
46 -WOnder supports the use of @@ delimiters so that certain properties can depend on previously defined properties.
47 -
48 -{{code title="Derived Properties example"}}
49 -
50 -## Set the smtp server host one time here... and the rest get it thru
51 -#+ use of derived propertiesw calculated on the fly when loaded into System properties.
52 -app.smtpserver=mail.domain.com
53 -
54 -## WebObjects smtp host setting
55 -WOSMTPHost=@@app.smtpserver@@
56 -
57 -## Setting for a log4j smtp appender named 'myMail'
58 -log4j.appender.myMail.SMTPHost=@@app.smtpserver@@
59 -
60 -## Setting for Wonder's ERJavaMail framework
61 -er.javamail.smtpHost=@@app.smtpserver@@
62 -
63 -## Setting for Sun's javamail library
64 -mail.smtp.host=@@app.smtpserver@@
65 -
66 -{{/code}}
67 -
68 -=== Accessing properties in WOnder ===
69 -
70 -Use ERXProperties static methods to get system properties from your Properties files and it offers a bunch of convenience methods to return values coerced into thyeir intended object types. It even handles arrays .... look at the source or API for ERXProperties for more details.
71 -
72 -== Conclusion ==
73 -
74 -So, simply putting application and logging properties into the Properties file means that all your configuration is in one place **and** each member of the development team can override those deployment settings with their own user based Properties files. Useful when they want to add DEBUG logging on stuff that other team members are not interested in.
38 +If your user name is 'joe', then in your WebObjects application, you can create a file named Properties.joe which is read in last when joe launches his WebObjects app in his Eclipse development enviromnent. This is useful for development teams. Each team member can have properties specific to his/her own development enviromnent such as smtp server, logging properties, databasem connection dictionary settings, etc.