Re: Abouts automatics forms and validation of fields ...
Serge Huber <[email protected]>
| Newsgroups | gmane.comp.cms.jahia.template |
|---|---|
| Message-ID | <[email protected]> |
Hi Benjamin, Interesting proposal indeed. The one thing to be cautious about is that it is the container definition that describes which fields will be presented in the edition engine. Also, when adding a new container, it is not created in the DB until the user actually clicks "OK". There are also multiple values possible as you may enter multiple values for multiple languages. In the engines, we use a JahiaContentContainerFacade object that regroups a collection of JahiaContainer objects for each language. All this is not trivial but if you can map to that you might be able to fit it. Otherwise maybe you could do something using Servlet filters on the edition URLs ? Regards, Serge Huber. [email protected] wrote: > > This is a very disturbing issue for us, too. We are developing an > e-Business Portal based on Jahia and have some container fields, which > should be either mandatory or limited in length or in a particular > format, but according to the message > http://article.gmane.org/gmane.comp.cms.jahia.template/1328, there is > no support for plugable validators in Jahia. There are just a few > fixed validations for bigtext-fields, mandatory languages,... > > Plugable validation support is only promised in the long run, after > Jahia engines shift to JavaServerFaces technology. > > As our testers are heavily complaining about this problem, it looks > that I have to find a solution in the "short run". I was looking into > using the Apache Commons Validator framework to validate Jahia > Containers. The resources, which are validated by the Validator > framework should be JavaBeans. > > First I thought I could simply let this beans be populated out of the > request parameters and then call the validation before engine > processing, but then I found out that Jahia does not use the constant > defined field names for the HTML input fields, but uses numbers as the > HTML input field name, according to the position of the field. > > As second I looked into the source code of the Validator framework. A > second possible solution would be deriving from the Validator > framework to allow passing a Jahia container instead of a JavaBean and > then retrieve the fields with getFieldValue() instead of calling the > getter-Method of the bean property. > > Before starting, I would like to ask the community if it makes sense > to do it this way? Has somebody already started or tried to solve this > issue? > > Regards, > Benjamin Papez > > news <[email protected]> wrote on 10.12.2004 15:24:16: > > > Hi, > > > > I appreciate the fact there is a motor of forms into JAHIA, but it seems > > there is no validation of fields while commiting the form.... > > > > If so, how to do it? > > > > Thanks. > >