View Single Post
Old 07-09-2011, 09:15 AM   #3
Silek
Junior Member
Silek began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Jul 2011
Device: color nook
Thanks for the reply.

The rendering problem you mention may be why I am not seeing the GUI entries. I am using the "multiple text, show in tag browser" column type.

What my script is doing is (with perl XML:Simple and JSON) slurping a template.opf from an empty book, and in the case of custom columns, using JSON to decode the string, alter the resultant perl structure, and then encode and put the changed string back in the XML.

The XML format is somewhat different, but looks similar enough. I have even taken the "content" field out and cut and pasted it into the template and that also has not worked.

Now the order of the JSON fields is different, but I thought that would not matter.

The template entry for a custom field is:

<meta name="calibre:user_metadata:#characters" content="{&quot;is_category&quot;: true, &quot;#extra#&quot;: null, &quot;kind&quot;: &quot;field&quot;, &quot;is_custom&quot;: true, &quot;is_csp&quot;: false, &quot;colnum&quot;: 16, &quot;column&quot;: &quot;value&quot;, &quot;rec_index&quot;: 25, &quot;search_terms&quot;: [&quot;#characters&quot;], &quot;link_column&quot;: &quot;value&quot;, &quot;is_multiple2&quot;: {&quot;cache_to_list&quot;: &quot;|&quot;, &quot;list_to_ui&quot;: &quot; &amp; &quot;, &quot;ui_to_list&quot;: &quot;&amp;&quot;}, &quot;is_multiple&quot;: &quot;|&quot;, &quot;datatype&quot;: &quot;text&quot;, &quot;#value#&quot;: [], &quot;category_sort&quot;: &quot;value&quot;, &quot;table&quot;: &quot;custom_column_16&quot;, &quot;is_editable&quot;: true, &quot;label&quot;: &quot;characters&quot;, &quot;display&quot;: {&quot;is_names&quot;: true}, &quot;name&quot;: &quot;Characters&quot;}"/>


My entry is:

<meta>
<name>calibre:user_metadata:#characters</name>
<content>{&quot;link_column&quot;:&quot;value&quot ;,&quot;is_csp&quot;:false,&quot;table&quot;:&quot ;custom_column_16&quot;,&quot;search_terms&quot;:[&quot;#characters&quot;],&quot;rec_index&quot;:25,&quot;display&quot;:{&qu ot;is_names&quot;:true},&quot;is_custom&quot;:true ,&quot;is_category&quot;:true,&quot;kind&quot;:&qu ot;field&quot;,&quot;#value#&quot;:&quot;[ Sasha Hammer, Iron Man, War Machine, Dum Dum Dugan, Pepper Potts, Maria Hill, Ezekiel Stane ]&quot;,&quot;colnum&quot;:16,&quot;is_editable&quo t;:true,&quot;category_sort&quot;:&quot;value&quot ;,&quot;column&quot;:&quot;value&quot;,&quot;name& quot;:&quot;Characters&quot;,&quot;is_multiple2&qu ot;:{&quot;ui_to_list&quot;:&quot;&amp;&quot;,&quo t;cache_to_list&quot;:&quot;|&quot;,&quot;list_to_ ui&quot;:&quot; &amp; &quot;},&quot;#extra#&quot;:null,&quot;label&quot; :&quot;characters&quot;,&quot;is_multiple&quot;:&q uot;|&quot;,&quot;datatype&quot;:&quot;text&quot;} </content>
</meta>

Due to the rendering problem, I do not have a good idea of what the entry is supposed to look like. I figure the #value# entry is wrong, but I am not getting an error from calibredb set_metadata. Since I did not get an error, I did not know to dig in to the format (or even, where in the format to look).

Any pointers on what is wrong with the JSON above, or where to look for either helpful error messages or a sample of a working XML snippet would be greatly appreciated.

I am using this data type because I wanted these entries to show in the tag browser. I suppose I could use dc:subject tags and add then specifically as tags, and leave them as one long comma delimited string in a text field, but that feels kludgy.

Thanks again.

Lawrence
Silek is offline   Reply With Quote