Entries Tagged as coldspring
In the
previous post I introduced
Event Validation, which on a simple level validates the input from forms in a Model-Glue request against a set of rules that you define in a ColdSpring tag.
Simple so far?
Well, its all very well getting a resultant ErrorCollection back from the server, but you will still need to display the errors, which is another load of work that the Event Validation plugin can help you with. To enable this you simply need to add two things to your view template, another cfimport (apart from the main mv one) and another attribute to your mv:setup tag:
[Read more →]
Tags:
coldfusion · coldspring · EventValidation
EventValidation is another Action Pack for
Model-Glue designed towards the validation of forms, but can be used to validate any value within a Model-Glue event.
It provides a way to tag up your form and for it to be validated, both client side and server side, which is something that I find very neat, since I hate repeating CF code in the backend with JavaScript code in the front end.
Let me walk you through a simple installation and setup of EventValidation.
INSTALLATION
Simply extract the EventValidation Action Pack to a secure part of your webserver and create a ColdFusion mapping to "/EventValidation". Then in your model glue file add the following at the top before any other controllers etc:
< include template="/EventValidation/config/EventValidation.xml"/>
You will be defining the rules to validate an event against in EventValidation/config/ColdSpring.xml, so import it into your application's ColdSpring.xml, using a relative path to the resource (I think there is a bug here with ColdSpring but I need to clarify this with
Chris Scott) :
<import resource="../../EventValidation/config/ColdSpring.xml" />
The next thing to do, is in the form that you want to validate, is to add an cfimport declaration at the top:
<cfimport prefix="ev" taglib="/EventValidation/taglib">
This will allow you to setup your form with a custom tag as follows:
<h1>Register</h1>
<cfimport prefix="ev" taglib="/EventValidation/taglib">
<cfoutput>
<form action="#ViewState.getValue("myself")#register.action" method="post" >
<ev:setup id="ev_Register" successEvent="register.action">
<div>
<label for="email">email:</label>
<input type="text" name="email" id="email" value="#ViewState.getValue("email")#">
<label for="password">password:</label>
<input type="password" name="password" id="password" value="#ViewState.getValue("password")#">
</div>
<div>
<input type="submit">
</div>
</form>
What is happening here? well, using ev:setup we have said that the id if the bean that will do our validation is called ev_Register, and that the success event will be register.action, this form is a normal form, with only the
added.
Now, lets define what we need in this form to be validated, in the EventValidation/config/ColdSpring.xml I have the following bean:
<bean id="ev_Register" class="EventValidation.model.EventValidator">
<constructor-arg name="rules">
<list>
<map>
<entry key="field"><value>email</value></entry>
<entry key="rule"><value>required</value></entry>
</map>
<map>
<entry key="field"><value>email</value></entry>
<entry key="rule"><value>email</value></entry>
</map>
<map>
<entry key="field"><value>password</value></entry>
<entry key="rule"><value>required</value></entry>
</map>
</list>
</constructor-arg>
</bean>
The id matches the id in our ev:setup tag, and then we have a list of maps, or in CF it would be an array of structs, so the first entry says, that the field email is required, then we say that email should match the "email" rule, which is using ColdFusion's internal isValid() list of attributes. Then we do the same thing for the password.
What will happen now when you submit your form, is that an ErrorCollection object will be added to the Event. If there are any errors in the collection, it will return to the event that the form is in and you then do ViewState.getValue("errorCollection").getErrorCollection() to get an array of errors.
So that is a simple way to get started with validation, but this is not the end of what EventValidator can do for you, in the next post I shall examine how to add different styles to the error fields and how to add error descriptions to each element (it does it automagically!)
UPDATE: you can see a simple demo here
Tags:
coldfusion · coldspring · EventValidation
Just a quick update that if you are interested in the EventGuard project, want to make some additions/modifications or even if you have found some bugs, I have just checked in the code and posted the zip over at the
EventGuard Project page on
RiaForge
Any feedback is appreciated!
Tags:
coldfusion · coldspring · frameworks
EventGuard is an Action Pack for the
Model-Glue framework that allows you to secure your events based whether a user is logged in or using a user's assigned roles.
On a simple level, it allows you to define which event-handler you will use to carry out the login, and then put a list of event-handler names that you want to protect. EventGuard also allows to define which event-handlers you want to exclude in your security check so that you can perform a blanket wide inclusion using "*".
[Read more →]
Tags:
coldfusion · coldspring · frameworks
As you may know from my previous posts, I am a bit into
Model-Glue. Besides giving tips on using it I have talked at a couple of ColdFusion User Groups about the framework and try and pass on any knowledge I can, since I think its a nice brief framework that in conjunction with
ColdSpring and
Reactor (or
Transfer) can really help your application development.
The problem with just giving tips, is that if you have a whole development team to get up to speed, you need more formal training to really get up to speed.
If you are in the USA, I found out recently that
Alagad,Inc that über development company (run by Reactor supremo
Doug Hughes, with none other than
Jared Rypka-Hauer and
Scott Stroz amongst others!) has started offering training courses in Model-Glue!
The four day course based in Arlington VA seems to cover anything you need to get your team up to date, and, for a hands-on four day course doesn't seem expensive at all (ok, that might be because the pound is strong against the dollar, but then again, its still pretty cheap).
Check out the details on
Alagad's site
(Tell them I sent you and I am sure they will make you a cup of tea!)
Tags:
coldfusion · coldspring · frameworks · model-glue · reactor
As some people might have noticed, its got so busy round here that I haven't been blogging as much as I used to and basically been keeping my head down and eyes on coding for the last few months.
To aliviate this situation,
Design UK, the company I work for is desperately seeking a couple of ColdFusion contractors to work in our London offices for a minimum of 2 weeks (could be up till XMas).
No, you can't do the work remotely, sorry, don't ask. No, really... just don't.
Also, if you are an agency,
don't call me or email me. Just don't, really, you WILL get abuse, and I am sure you don't want that.
The pay is dependent on experience (hey, I want to pay nothing, you want a lot, we compromise). The kind of experience that we are seeking is:
- 2 years minimum ColdFusion (obviously)
- Experience of Frameworks especially Model-Glue and ColdSpring are a massive plus
- SQL Server knowledge
- HTML, JavaScript and CSS (yep, there is front end work to do too!)
- XML (generating and parsing)
- Subversion and Trac knowledge is also a plus
Start date is as soon as possible, so if you are available and want some work, let me know by emailing me your CV to .
Tags:
coldfusion · coldspring · jobs · model-glue
A comment posted in my entry about
Model Glue Tips Part 1: Separate out your Model-Glue file reminded me that I should continue with some of those postings.
One of the things that happens when you start building larger applications is that you get a lot of objects that you are managing with ColdSpring. This means that the file can get rather large, and again that is a bad thing right (I keep going on about this to lots of people that write CF, the same goes for your XML files).
There are other reasons to split out the ColdSpring file, apart from a neatness. One of our applications actually creates other ModelGlue applications. And each one of these has separate configurations and in fact available objects (they are automatically written out) as well as maybe some custom configurations.
The problem would be that if you update the core code, that is, objects that are core to the system, you dont want to be messing about with merging these files together, so I tend to split things out something like:
- ColdSpring.xml <- Main (Core) ColdSpring File
- ColdSpring_Config.xml <- Automatically written file that has our DSN, reactor and other site specific settings
- ColdSpring_Custom.xml <- Custom settings and mappings for the application
All these files are complete ColdSpring files in themselves (that is, they start with <beans>) and are imported into the main ColdSpring file as imports:
<beans>
<import requires="config/ColdSpring_Config.xml" />
<import requires="config/ColdSpring_Custom.xml" />
....
</beans>
Once you have done this, beans in the external files are loaded as normal.
A quick note, and I haven't checked this properly, but this works in the bleeding edge version of ColdSpring which you can get through CVS following the instructions here:
http://www.coldspringframework.org/index.cfm?objectid=2DD5F8AF-DD05-F8C8-7860429E21850D7E
Tags: ColdSpring, ColdFusion, ModelGlue
Tags:
coldfusion · coldspring
September 14, 2007 · 7 Comments
Hello, yes, I am back, from outer space, well, not exactly. I have taken a month or so away from development of CFEclipse and my other projects (including this blog!) which has been great. Of course one of the reasons for this has been that I have been very busy at work, and that kind of takes it out of you. This is normal for me, but the work has been rather oppressive rather than creative so my brain needed a bit of space.
Some news:
I shall be speaking at
Adobe MAX in Barcelona in October! I am very excited about this as I shall be demonstrating not only CFEclipse but the ColdFusion Extensions for CF8 (something I love using by the way) as well as hopefully the debugging capabilities that you now have with CF8.
With regards to CFEclipse, I am currently taking a bit of a hard look at features and fixes that will make it into the next version. I am working on a complete re-design of the interface, basically following the rule of making actions available (no more hidden menus etc) so that access stuff easier. Apart from that, I am looking at re-compiling and coding the plugin so its compatible with Java 1.4.x since, even though I much prefer Java 5, it seems that is the most common error that people are getting (by looking at the Trac bugs!)
On a final side-note: I have started a course each week in Film Directing! I did my first class last night and its absolutely awesome! We read a number of screenplays (Thelma and Louise and Brazil being the main ones) and dissected them to get a feel for the responsibility of a Director with regards to examining and expanding on the ideas within a script. Don't worry tho, Hollywood is still safe (after all, I only have done one class so far!)
Well, that is it for the moment, I hear there has been lots of exciting news in the community whilst I have been away (I havent been reading blogs or news) but I just like to state that I took this vacation away from development without consulting the
ColdFusion Weekly guys, it seems they have started up again after the summer!
Tags:
CFConferences · cfeclipse · coldspring · max · personal
Do you need someone to present at your CFUG? Well, I have been doing a lot of presentations lately, which can be seen over in my
Presentations page, which means I have a lot of content I can present on. If you have a specific topic (including
CFEclipse of course!) Why not
email me with your proposal and I shall see what I can do.
I am based in London, England so unless there is a nice budget to fly me out, I can also do remote presentations using Adobe Connect. I am available in the evenings mostly so let me know if you ever need an extra presenter at your CFUG or company.
Tags:
ajax · cfeclipse · coldfusion · coldspring · frameworks · model-glue · presentations · ukcfug
I am sure lots of people use google analytics on their site to track usage. Its very good for conversion funnels and what have you but it doesn't really have the immediate effect of reporting that I like for blog posts.
I have to admit, I am a nosey bugger. I want to know when people are coming to my blog and what they are looking at. I want to know WHO is on my site, I know you dont mind, of course, its only me knowing this stuff right.... right?
So, I have been using a service called
reInvorate for a long while. It was beta, closed down, become beta again. It has a great feature of showing you who is on your site at the present moment, which is fine if you like knowing that everyone is called "X88893-333-5555"... but if you are using Ray "The Jedi" Camden's BlogCFC, people can ask for the website to remember their details.
Now on a tangent, ReInvigorate have released a little tool for Windows and Mac called
Snoop which simply displays people coming onto your site.
The problem is that they are still pretty anonymous, but I checked something out over at the ReInvigorate site about adding
names to these sessions
And it turns out that its pretty easy to do it in BlogCFC, you just have to add the following code before the call to ReInvigorate:
<cfif isDefined("cookie.blog_name")>
var re_name_tag = "#blog_name#";
</cfif>
<cfif isDefined("cookie.blog_email")>
var re_context_tag="mailto:#cookie.blog_email#";
</cfif>
re_("your_reInvigorate_id");
And then you can finally see who is coming to your site.
Nice to see you again too! :)
Tags:
blogging · coldspring · webdev