Hi Derek,<br><br>I've wanted this functionality for a while, too, but I haven't been importing very many books so I usually just added Dewey & LC numbers manually.  Thanks for giving me a reason to look into it again!<br>

<br>Unfortunately, I think you'll have to re-build Tellico to get this.  With any luck, I'm mistaken and someone can point out an easier way :) but, if not, here's what I did with the 2.2 source:<br><br>src/collections/bookcollection.cpp in BookCollection::defaultFields() I added the fields I wanted (Dewey and LCC):<br>

<br>  field = new Field(QLatin1String("dewey-class"), i18n("Dewey Class"), Field::Para);<br>  field->setCategory(i18n(book_general));<br>  list.append(field);<br><br>  field = new Field(QLatin1String("loc-classification"), i18n("LOC Classification"), Field::Para);<br>

  field->setCategory(i18n(book_general));<br>  list.append(field);<br><br>I put them at the end of the function, right after 'comments'.  The names 'dewey-class' and 'loc-classification' already existed in my Tellico file -- to get the equivalent for your file, export it (at least one record) to XML, and look for 'dewey' or whatever you called the field, and get the 'name'.  Here's that line from my .xml file:<br>

   <field title="Dewey Class" flags="0" category="General" format="4" type="1" name="dewey-class"/><br><br><br>A useful thing for someone to do would be to research these fields and propose "correct" names, if we hope to get this functionality included in the Tellico source in the future.<br>

<br><br>In src/fetch/srufetcher.cpp's SRUFetcher::allOptionalFields you can add lines like:<br>  hash[QLatin1String("dewey-class")] = i18n("Dewey Class"); // Dewey Decimal<br>if you want to disable the fetching of the Dewey value at runtime (by unchecking the box in Settings | Configure Tellico... | Data Sources | Library of Congress | Available Fields).<br>

<br><br>Add lines like these to xslt/mods2tellico.xsl, changing e.g. 'dewey-class' to match your own field name (leave 'ddc' alone: it is the string in the query result returned from the LoC servers):<br>
<br>
<xsl:template match="mods:classification"><br> <xsl:choose><br>  <xsl:when test="@authority='lcc'"><br>   <loc-classification><br>    <xsl:value-of select="."/><br>

   </loc-classification><br>  </xsl:when><br>   <xsl:when test="@authority='ddc'"><br>   <dewey-class><br>    <xsl:value-of select="."/><br>   </dewey-class><br>

  </xsl:when><br> </xsl:choose><br></xsl:template><br><br>I put those just above the 'xsl:template match="mods:identifier"> line for isbn/lccn/doi/issn/uri (search for 'doi' which doesn't occur anywhere else in that file).<br>

If you are going to 'make install', then that .xsl file *should* get installed to the right place.  If not (i.e. you run 'src/tellico' after building, instead of installing over your existing tellico package), you'll need to put it in the right place, per <a href="http://tellico-project.org/faq#n1552">http://tellico-project.org/faq#n1552</a> .  For me, that was ~/.kde/share/apps/tellico/mods2tellico.xsl<br>

<br><br>Dewey appears to have an 'edition' field that the code above isn't returning (and I don't understand XSL well enough to include it); for example the LoC web page <a href="http://lccn.loc.gov/96008131">http://lccn.loc.gov/96008131</a> will show Dewey Class Number as "155.9/6 20" but in the returned MODS query it is "<classification authority="ddc" edition="20">155.9/6</classification>" and the code I wrote only returns the "155.9/6".  I don't know enough about Dewey to know if that field is important.<br>

<br><br>I noticed that SubTitle isn't being fetched; and that subjects/keywords that should be dashed are being treated as separate subjects (e.g. a book with "Research --Psychological aspects" and "Space flight --Psychological aspects" gets imported as "Research; Psychological aspects; Space flight; Psychological aspects") so I might try to look into those two issues, too.  I'll reply back here if I get anywhere.<br>

<br><br>It may be useful to sniff the packets so you can see the raw data Tellico is getting; I put, in srufetcher.cpp after "modsResult = result;", a "printf("modsResult = %s\n", modsResult.toStdString().c_str());", but instead of recompiling just for debug info you might prefer:<br>

sudo tcpdump -i wlan0 -s 1514 -X host 140.147.249.38 -w ~/tcpdump.txt<br>(eth0 instead of wlan0 if you have a wired connection, or whatever else is appropriate; 140.147.249.38 was the <a href="http://loc.gov">loc.gov</a> server I connected to (I got the address from a wireshark log))<br>

(do the search, then control-c after it completes)<br>tcpick -yP -r ~/tcpdump.txt<br><br><br>I did all my testing with the book 'Bold Endeavors' which had the advantages of having a fairly unique title, having LCC and DDC data, and is a book I have so I could easily verify the data I got.<br>

<br><br>A couple notes for Robby:<br>- the instructions in 'COMPILING' were very helpful.  This was my first time using cmake so I really appreciated them.<br>- if I go to <a href="http://tellico-project.org/">http://tellico-project.org/</a>, mouse over 'Help' and then click on 'Handbook,' I am taken to a blank page <a href="http://docs.kde.org/development/en/extragear-office/tellico/index.html">http://docs.kde.org/development/en/extragear-office/tellico/index.html</a>.  View Source on that page also opens up an empty window.  Ubuntu (GNOME) 10.04 64-bit, Firefox 3.6.6, if it matters.<br>

- after adding the same book a few times (don't know if that was important or not), if I double-clicked on the entry to bring up the edit view, sometimes some (but never all) of the data fields (like title, author; seemed to change every time) would be blank. The data was still there; pressing escape, then enter to re-open the edit view usually would result in all the data being shown.  Sorry I don't have better replication instructions; I was doing this inside my main .tc file (saved in Tellico 2.1.1) with ~250 entries.<br>

<br><br><br>Drew<br><br clear="all">---<br>Drew Bennett<br><a href="mailto:drewbenn@gmail.com">drewbenn@gmail.com</a><br>
<br><br><div class="gmail_quote">On Wed, Jul 7, 2010 at 5:57 PM, Derek Tombrello <span dir="ltr"><<a href="mailto:mrmagnet@bellsouth.net">mrmagnet@bellsouth.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">




  
  

<div>
Hi... <br>
<br>
I love the Tellico program, but there is one thing that I need that either I am overlooking or is not available. I know how to add a Dewey Decimal field, but is there anyway that the program can automatically update this field? I used to use Collectorz.com software before switching to Linux - which would pull the Dewey number from the Library of Congress database. <br>


<br>
Thanks...<br>
<br>
<table cellpadding="0" cellspacing="0" width="100%">
<tbody><tr>
<td>
<pre>-- 
Derek Tombrello
<a href="http://www.RobotsAndComputers.com" target="_blank">www.RobotsAndComputers.com</a>
</pre>
<br>
<br>
</td>
</tr>
</tbody></table>
</div>

<br>_______________________________________________<br>
tellico-users mailing list<br>
<a href="mailto:tellico-users@kde.org">tellico-users@kde.org</a><br>
<a href="https://mail.kde.org/mailman/listinfo/tellico-users" target="_blank">https://mail.kde.org/mailman/listinfo/tellico-users</a><br>
<br></blockquote></div><br>