I am still struggling with this. I am now at the stadium where I get a drop-down list with all the content nodes from the table I want, but I cannot control the value (field) that is displayed in the dropdownlist of the editor.

The database table has two columns that I defined: publicationtype (1 letter code) and a publication (50 chars description). Whatever I do, it always shows the 1-letter codes in the dropdown list, BUT I WANT THE 50 CHARS DESCRIPTION! (sorry) I use the following data type definition:

     <datatype base="node" xmlns="http://www.mmbase.org/xmlns/datatypes";>
         <enumeration>
<query type="publicatietype" display="publicatie" xmlns="http://www.mmbase.org/xmlns/searchquery"; />
         </enumeration>
     </datatype>

The searchquery.xsd isn't well documented, so I try several things, like providing query-attributes fields="publicatie", name="publicatie", value="publicatie" etc. I also tried to add the field-element <field name="publicatie" /> with no avail.

Can someone please help me with this, because it is costing me too much time already.

Thanks and best regards,

Dave



Michiel Meeuwissen wrote:
Dave Schoorl wrote:
I have defined the db-element and the datatype-element in the builders' publication.xml both as node. I read something about enumerations / query that I can use within the datatype-definition of the builder. But I don't understand how to do what I need to do. Below is a piece of the data type from the builder's xml-file.

<datatype base="nodenumber" xmlns="http://www.mmbase.org/xmlns/datatypes";>
         <enumeration>
             <description>get all publicationtypes</description>
             <query>
                 ????????????????????
             </query>
         </enumeration>
     </datatype>

I have no idea what to put on the place of the question marks. Can anyone please help me out or point me to a tutorial or something?

This functionality is completely new in 1.8, so documentation is a bit
behind.

The most basic syntax you have undoublty already seen in datatypes.xml:
<enumeration>
  <query type="reldef" xmlns="http://www.mmbase.org/xmlns/searchquery"; />
</enumeration>
And that is the most complex what is offered as an example (and probably
the only think actually tested) The same code though as used in the
'lucene' contribution, where it works fine, also with much complexer
queries.

The supported syntax is in an XSD, which may help too:

http://cvs.mmbase.org/viewcvs/src/org/mmbase/bridge/util/xml/query/resources/searchquery.xsd?view=markup

It is a bit like MMBase taglib.


Michiel



_______________________________________________
Developers mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/developers

Reply via email to