ENUMERATION in builder in MMBAse 1.9

9 views
Skip to first unread message

aschwin

unread,
Feb 1, 2011, 11:17:10 AM2/1/11
to mmbase-discuss
Hi Guys,

In some examples I found a way to get a list in my builders. See
http://www.mmbase.org/mmdocs/informationanalysts/datatypes.html#enumerations

I used it in my code:
<editor>
<positions>
<!-- position in the input
area of the editor -->
<input>6</input>
<!-- position in the list area of the editor -->
<list>6</list>
<!-- position in the search area of the editor -->
<search>6</search>
</positions>
</editor>
<datatype base="long" xmlns="http://www.mmbase.org/xmlns/
datatypes">
<enumeration>
<entry value="Man" />
<entry value="Vrouw" />
</enumeration>
</datatype>
<!-- database related -->
<db>
<!-- name of the field in the database -->
<name xml:lang="nl">gender</name>
<!-- MMBase datatype and demands on it -->
<type key="false" notnull="false" size="1024"
state="persistent">STRING</type>
</db>

But then my app won't deploy , I get the following error messages:
17:07:57,988 ERR mmbase.util.xml.ErrorHandler - file:/D:/VWL_DEV/
tomcat/webapps/nib/WEB-INF/config/builders/applications/users.xml line:
142 column:77: class org.xml.sax.SAXParseException Element type
"datatype" must be declared.
17:07:57,988 ERR mmbase.util.xml.ErrorHandler - file:/D:/VWL_DEV/
tomcat/webapps/nib/WEB-INF/config/builders/applications/users.xml line:
143 column:17: class org.xml.sax.SAXParseException Element type
"enumeration" must be declared.
17:07:57,988 ERR mmbase.util.xml.ErrorHandler - file:/D:/VWL_DEV/
tomcat/webapps/nib/WEB-INF/config/builders/applications/users.xml line:
144 column:28: class org.xml.sax.SAXParseException Element type
"entry" must be declared.
17:07:57,988 ERR mmbase.util.xml.ErrorHandler - file:/D:/VWL_DEV/
tomcat/webapps/nib/WEB-INF/config/builders/applications/users.xml line:
145 column:30: class org.xml.sax.SAXParseException Element type
"entry" must be declared.
17:07:57,988 ERR mmbase.util.xml.ErrorHandler - file:/D:/VWL_DEV/
tomcat/webapps/nib/WEB-INF/config/builders/applications/users.xml line:
155 column:15: class org.xml.sax.SAXParseException The content of
element type "field" must match "(descriptions?,gui?,editor?,db)".
17:07:57,988 ERR mmbase.util.xml.ErrorHandler - file:/D:/VWL_DEV/
tomcat/webapps/nib/WEB-INF/config/builders/applications/users.xml line:
284 column:77: class org.xml.sax.SAXParseException Element type
"datatype" must be declared.
17:07:57,988 ERR mmbase.util.xml.ErrorHandler - file:/D:/VWL_DEV/
tomcat/webapps/nib/WEB-INF/config/builders/applications/users.xml line:
285 column:16: class org.xml.sax.SAXParseException Element type
"enumeration" must be declared.
17:07:57,988 ERR mmbase.util.xml.ErrorHandler - file:/D:/VWL_DEV/
tomcat/webapps/nib/WEB-INF/config/builders/applications/users.xml line:
286 column:31: class org.xml.sax.SAXParseException Element type
"entry" must be declared.
17:07:57,988 ERR mmbase.util.xml.ErrorHandler - file:/D:/VWL_DEV/
tomcat/webapps/nib/WEB-INF/config/builders/applications/users.xml line:
287 column:34: class org.xml.sax.SAXParseException Element type
"entry" must be declared.
17:07:57,988 ERR mmbase.util.xml.ErrorHandler - file:/D:/VWL_DEV/
tomcat/webapps/nib/WEB-INF/config/builders/applications/users.xml line:
297 column:15: class org.xml.sax.SAXParseException The content of
element type "field" must match "(descriptions?,gui?,editor?,db)".
17:07:58,113 WAR mmbase.util.xml.BuilderReader - Using both deprecated
'gui/guitype' and 'datatype' subelements in field tag for field
'gender', ignoring the first one.
17:07:58,113 WAR mmbase.util.xml.BuilderReader - Using both deprecated
'gui/guitype' and 'datatype' subelements in field tag for field
'isactive', ignoring the first one.

I remember I used the same sort of code in MMBase 1.8 ! Is there a
"new" way of doing this in MMBase 1.9? Or am I doing it wrong all the
way?
hope you have enough information to help me on this


Regards Aschwin

Michiel Meeuwissen

unread,
Feb 2, 2011, 5:01:02 AM2/2/11
to mmbase-...@googlegroups.com
2011/2/1 aschwin <aver...@gmail.com>:

> In some examples I found a way to get a list in my builders. See
> http://www.mmbase.org/mmdocs/informationanalysts/datatypes.html#enumerations


>


> But then my app won't deploy , I get the following error messages:
> 17:07:57,988 ERR mmbase.util.xml.ErrorHandler - file:/D:/VWL_DEV/
> tomcat/webapps/nib/WEB-INF/config/builders/applications/users.xml line:
> 142 column:77: class org.xml.sax.SAXParseException Element type
> "datatype" must be declared.

You must use the builder XSD. So your XML must start something like this:
<?xml version="1.0" ?>
<builder
xmlns="http://www.mmbase.org/xmlns/builder"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.mmbase.org/xmlns/builder
http://www.mmbase.org/xmlns/builder.xsd"
name="<builder name>" extends="object" maintainer="mmbase.org" version="0">
..


Perhaps you are using one which still uses a DTD?

Michiel


--
mihxil'  http://meeuw.org
nl_NL eo_XX en_US

aschwin

unread,
Feb 2, 2011, 5:05:52 AM2/2/11
to mmbase-discuss
Yes that is correct,

We are still using the XML that uses a DTD. This is auto generated
from UML2MMBase

thx for your answer

On Feb 2, 11:01 am, Michiel Meeuwissen <michiel.meeuwis...@gmail.com>
wrote:
> 2011/2/1 aschwin <avers...@gmail.com>:
>
> > In some examples I found a way to get a list in my builders. See
> >http://www.mmbase.org/mmdocs/informationanalysts/datatypes.html#enume...
>
> > But then my app won't deploy , I get the following error messages:
> > 17:07:57,988 ERR mmbase.util.xml.ErrorHandler - file:/D:/VWL_DEV/
> > tomcat/webapps/nib/WEB-INF/config/builders/applications/users.xml line:
> > 142 column:77: class org.xml.sax.SAXParseException Element type
> > "datatype" must be declared.
>
> You must use the builder XSD. So your XML must start something like this:
> <?xml version="1.0" ?>
> <builder
>     xmlns="http://www.mmbase.org/xmlns/builder"
>     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>     xsi:schemaLocation="http://www.mmbase.org/xmlns/builderhttp://www.mmbase.org/xmlns/builder.xsd"

Nico Klasens

unread,
Feb 2, 2011, 5:14:09 AM2/2/11
to mmbase-...@googlegroups.com
Hello Aschwin ,

When you have to convert many files, have a look at https://scm.mmbase.org/CMSContainer/trunk/CMSContainer/builderConverter/. This is used a long time ago, to convert all CMS container builders to the new format. Not all cases for conversion are in there, but it easy enough to modify.

Kind Regards

Nico


2011/2/2 aschwin <aver...@gmail.com>
--
You received this message because you are subscribed to the Google Groups "mmbase-discuss" group.
To post to this group, send email to mmbase-...@googlegroups.com.
To unsubscribe from this group, send email to mmbase-discus...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mmbase-discuss?hl=en.


Reply all
Reply to author
Forward
0 new messages