[Hippo-cms7-user] CMS validator

Wilson de Paula Pedro Junior wppjunior at gmail.com
Thu Sep 2 15:12:11 CEST 2010


Hi Frank,

Thanks for your answer and I'm sorry for the late response.

Yes, I'm using compound types.

I did some experiments in the cms to reproduce this problem:

1) With the latest archtype I build a clean cms 7.4 project.

2) I've changed the element "title" from textdocument content type to be
required.
Updated all contents and validation works fine.

3) I made a new compound type named "Metadata" with a required string
element named "description".
Updated all contents and validation works fine.

4) If I add the compound type "Metadata" in the textdocument document type,
then the following warning appears:
WARN  [org.hippoecm.frontend.editor.plugins.field.FieldItem.<init>():96]
Template supports validation, but container does not provide validator model

We can see that it is some misconfiguration when using compound type with
document type.
Any idea how I can solve it?

Thanks,

Wilson


2010/8/25 Frank van Lankvelt <f.vanlankvelt at onehippo.com>

> your configuration seems to be correct.  There are no compound types being
> used?
> If you're using a customized cms-editor plugin cluster, make sure to
> include the validator.id property in the editorPlugin configuration.
>
> It should be possible to include the field name in the message using a
> custom validation plugin (note that the field should already indicate it
> itself).  Then, you can use the ModelPath's from the Violation to retrieve
> the field names.  (this is a path since an error might be triggered by a
> nested compound)
>
> cheers, Frank
>
> On Wed, Aug 25, 2010 at 4:06 PM, Wilson de Paula Pedro Junior <
> wppjunior at gmail.com> wrote:
>
>> Hi,
>>
>> I'm having some problems implementing the cms validation properly.
>> When I open a document, the following warning appears many times:
>>
>> WARN  [org.hippoecm.frontend.editor.plugins.field.FieldItem.<init>():96]
>> Template supports validation, but container does not provide validator
>> model.
>>
>> Any ideas? Am I missing some nodes?
>>
>> - nodetype
>>
>>             <sv:node sv:name="title">
>>                 <sv:property sv:name="jcr:primaryType" sv:type="Name">
>>                     <sv:value>hipposysedit:field</sv:value>
>>                 </sv:property>
>>                 <sv:property sv:name="hipposysedit:mandatory"
>> sv:type="Boolean">
>>                     <sv:value>false</sv:value>
>>                 </sv:property>
>>                 <sv:property sv:name="hipposysedit:multiple"
>> sv:type="Boolean">
>>                     <sv:value>false</sv:value>
>>                 </sv:property>
>>                 <sv:property sv:name="hipposysedit:ordered"
>> sv:type="Boolean">
>>                     <sv:value>false</sv:value>
>>                 </sv:property>
>>                 <sv:property sv:name="hipposysedit:path" sv:type="String">
>>                     <sv:value>myproject:title</sv:value>
>>                 </sv:property>
>>                 <sv:property sv:name="hipposysedit:primary"
>> sv:type="Boolean">
>>                     <sv:value>false</sv:value>
>>                 </sv:property>
>>                 <sv:property sv:name="hipposysedit:type" sv:type="String">
>>                     <sv:value>String</sv:value>
>>                 </sv:property>
>>                 <sv:property sv:name="hipposysedit:validators"
>> sv:type="String">
>>                     <sv:value>non-empty</sv:value>
>>                     <sv:value>required</sv:value>
>>                 </sv:property>
>>             </sv:node>
>>
>> - editor:templates:
>>     <sv:node sv:name="editor:templates">
>>         <sv:property sv:name="jcr:primaryType" sv:type="Name">
>>             <sv:value>editor:templateset</sv:value>
>>         </sv:property>
>>         <sv:node sv:name="_default_">
>>             <sv:property sv:name="jcr:primaryType" sv:type="Name">
>>                 <sv:value>frontend:plugincluster</sv:value>
>>             </sv:property>
>>             <sv:property sv:name="frontend:properties" sv:type="String">
>>                 <sv:value>mode</sv:value>
>>             </sv:property>
>>             <sv:property sv:name="frontend:references" sv:type="String">
>>                 <sv:value>wicket.model</sv:value>
>>                 <sv:value>engine</sv:value>
>>                 <sv:value>validator.id</sv:value>
>>             </sv:property>
>>             <sv:property sv:name="frontend:services" sv:type="String">
>>                 <sv:value>wicket.id</sv:value>
>>                 <sv:value>validator.id</sv:value>
>>             </sv:property>
>>             <sv:property sv:name="type" sv:type="String">
>>                 <sv:value>myproject:BaseMetadata</sv:value>
>>             </sv:property>
>>             <sv:node sv:name="root">
>>                 <sv:property sv:name="jcr:primaryType" sv:type="Name">
>>                     <sv:value>frontend:plugin</sv:value>
>>                 </sv:property>
>>                 <sv:property sv:name="item" sv:type="String">
>>                     <sv:value>${cluster.id}.field</sv:value>
>>                 </sv:property>
>>                 <sv:property sv:name="plugin.class" sv:type="String">
>>
>> <sv:value>org.hippoecm.frontend.service.render.ListViewPlugin</sv:value>
>>                 </sv:property>
>>                 <sv:property sv:name="wicket.id" sv:type="String">
>>                     <sv:value>${wicket.id}</sv:value>
>>                 </sv:property>
>>             </sv:node>
>>             <sv:node sv:name="title">
>>                 <sv:property sv:name="jcr:primaryType" sv:type="Name">
>>                     <sv:value>frontend:plugin</sv:value>
>>                 </sv:property>
>>                 <sv:property sv:name="translator.id" sv:type="String">
>>                     <sv:value>myproject.translator</sv:value>
>>                 </sv:property>
>>                 <sv:property sv:name="engine" sv:type="String">
>>                     <sv:value>${engine}</sv:value>
>>                 </sv:property>
>>                 <sv:property sv:name="field" sv:type="String">
>>                     <sv:value>title</sv:value>
>>                 </sv:property>
>>                 <sv:property sv:name="mode" sv:type="String">
>>                     <sv:value>${mode}</sv:value>
>>                 </sv:property>
>>                 <sv:property sv:name="plugin.class" sv:type="String">
>>
>> <sv:value>org.hippoecm.frontend.editor.plugins.field.PropertyFieldPlugin</sv:value>
>>                 </sv:property>
>>                 <sv:property sv:name="validator.id" sv:type="String">
>>                     <sv:value>${validator.id}</sv:value>
>>                 </sv:property>
>>                 <sv:property sv:name="wicket.id" sv:type="String">
>>                     <sv:value>${cluster.id}.field</sv:value>
>>                 </sv:property>
>>                 <sv:property sv:name="wicket.model" sv:type="String">
>>                     <sv:value>${wicket.model}</sv:value>
>>                 </sv:property>
>>                 <sv:node sv:name="cluster.options">
>>                     <sv:property sv:name="jcr:primaryType" sv:type="Name">
>>                         <sv:value>frontend:pluginconfig</sv:value>
>>                     </sv:property>
>>                 </sv:node>
>>             </sv:node>
>>
>>
>> Other question, when validating I get some error messages like:
>> A required field is not present
>> A string value is empty
>>
>> Can I change this messages, including the name of the field?
>> Or I have to write my own validator plugin to achieve this?
>>
>>
>> Thank you!
>>
>> Wilson
>>
>>
>>
>>
>> _______________________________________________
>> Hippo-cms7-user mailing list and forums
>> http://www.onehippo.org/cms7/support/forums.html
>>
>
>
> _______________________________________________
> Hippo-cms7-user mailing list and forums
> http://www.onehippo.org/cms7/support/forums.html
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.onehippo.org/pipermail/hippo-cms7-user/attachments/20100902/e02083c6/attachment.htm>


More information about the Hippo-cms7-user mailing list