coldfusion
Eclipse / CFEclipse - local history feature
Submitted by Doug Sims on Fri, 2006-08-18 18:25. CFeclipse | coldfusionThis may be old news to some, but I just stumbled upon it. Several co-workers and I have recently switched to CFEclipse, in prep for some JAVA crosstraining. I just stumbled upon the local history feature, that functions like a little local source repository. Every time you save a file, a snapshot is taken. to browse history on any specific file, right-click on it in the navigator and choose team > compare to local history.
By default this history is only maintained for 7 days, 50 entries per file, or 1 meg backup file size. If you want to use this for long term history, you would need to adjust those in:
Window > Preferences > General > Workspace > Local History
Reactor mixed case gotcha
Submitted by Doug Sims on Mon, 2006-07-24 18:11. coldfusion | reactorIt has come up on the Reactor mailing list that since the Coldfusion XML functions are all case specific,
extra care has to be taken to be sure the db fields and the reacor.xml <object> definitions and subtags all match in case.
Care must also be taken when throwing custom validation messages.
<CFSET arguments.ErrorCollection.addError("emailAddress.emailAddress.NoAtSign") />Is different from:
<CFSET arguments.ErrorCollection.addError("EmailAddress.emailAddress.NoAtSign") />Which ever variation does not exactly match the dictionary.xml file for that object will throw an exception:
Message An error occured while Transforming an XML document.
Detail Empty expression!So after painstakingly making sure all the DB fields (dev and production) matched the object tags, that matched the validation error definitions, that matched the case in the dictionary.xml files, I mysteriously received the error again. But this time it worked in one place in the app, and not in another, both using almost identical code. The only difference was what the reactorfactory was passed as the object name.
Reactor.createRecord("emailAddress") />is not the same as:
Reactor.createRecord("EmailAddress") />I currenly develop mainly in coldfusion/IIS, but these three mixed case gotchas have really gotten me thinking about becoming more aware of case no matter what I am coding. Maybe I can make make case consistancy second nature before I switch languages/platforms and really need it.
Reactor - Using the field tag to to alias duplicate columns
Submitted by Doug Sims on Wed, 2006-07-19 15:55. coldfusion | reactorIt is mentioned in the Reactor docs that the <field> tag can be used within your object definitions to pretty up ugly column names such as txt_lastname or strCity, but it should also be noted it can be used to diferentiate between two tables which both have fields with the same name.
for example, if all my tables have a modified date timestamp
<object name="User">
<field name="ModifiedDate" alias="UserModifiedDate" />
<hasMany name="Task">
<relate from="Taskid" to="Taskid" />
</hasMany>
</object>
<object name="Task">
<field name="ModifiedDate" alias="TaskModifiedDate" />
<hasOne name="User">
<relate from="UserId" to="UserId" />
</hasOne>
</object>Then, when I am doing a join later, I can reference the modified dates correctly.


delicious
digg
reddit
technorati