Tellico/uk: Difference between revisions

From KDE UserBase Wiki
No edit summary
(Updating to match new version of source page)
Line 42: Line 42:
Tellico use XSL files for templates, reports, import, processing data source and export. XSL files apply on XML data.
Tellico use XSL files for templates, reports, import, processing data source and export. XSL files apply on XML data.
The Tellico's DTD will give you the exact name of fields (because Tellico displays translated titles instead of names). Common places for this file are /usr/share/tellico/tellico.dtd or /usr/share/kde4/apps/tellico/tellico.dtd
The Tellico's DTD will give you the exact name of fields (because Tellico displays translated titles instead of names). Common places for this file are /usr/share/tellico/tellico.dtd or /usr/share/kde4/apps/tellico/tellico.dtd
Beware that Tellico use [http://xmlsoft.org/XSLT/index.html libxslt1.1] which implement [http://www.w3.org/TR/xpath XPath 1.0] functions only. Fortunately, you can use [http://www.exslt.org EXSLT] extensions.


== Basical XSLT for transforming export ==
== Basical XSLT for transforming export ==


First, do an XML export. The file will serve as a reference for testing.
First, do an XML export. The file will serve as a reference for testing.
It will help if you install an XSLT processor ([http://xmlsoft.org/XSLT/xsltproc2.html xsltproc] is available on every distribution).
Testing will be easier if you install an XSLT processor ([http://xmlsoft.org/XSLT/xsltproc2.html xsltproc] is available on every distribution).
Then write an xsl stylesheet. Here's a basic one :
Then write an xsl stylesheet. Here's a basic one :


Line 81: Line 82:
</xsl:stylesheet>
</xsl:stylesheet>
</syntaxhighlight>}}
</syntaxhighlight>}}


= Типові поля, що використовуються для імпортування =
= Типові поля, що використовуються для імпортування =

Revision as of 15:37, 17 June 2015

Other languages:
За допомогою Tellico ви зможете полегшити собі керування вашими книгами, відеозаписами, музичними записами або іншою вашою власністю, навіть колекцією вин. За допомогою простого та інтуїтивно зрозумілого інтерфейсу програми ви зможете переглядати обкладинки книг, жанр та інші їх параметри. Програма може звантажувати дані щодо книг з багатьох популярних інтернет-сайтів, зокрема IMDB.com, Amazon.com та більшості бібліотечних сайтів.

Tellico є частиною офісного модуля KDE Extragear.

Перший погляд

Головне вікно Tellico виглядає так:

У Tellico передбачено декілька шаблонів для зміни форматування відомостей щодо збірки.

Як встановити Tellico

Пакунки Tellico є у більшості дистрибутивів Linux, а також у сховищах портів xBSD. Будь ласка, скористайтеся для встановлення пакунків з програмою інструментом керування пакунками вашої системи.

Посилання на пакунки з програмою можна знайти на сторінці звантаження Tellico.

Для збирання Tellico з кодів програми слід встановити декілька пакунків для розробки.

Для Ubuntu/Kubuntu передбачено неофіційні пакунки у PPA.

Додаткові відомості

Вади

Щоб повідомити про ваду у Tellico, скористайтеся системою стеження за вадами у KDE.

Список вад у Tellico.


Обробка за допомогою XSLT

Tellico use XSL files for templates, reports, import, processing data source and export. XSL files apply on XML data. The Tellico's DTD will give you the exact name of fields (because Tellico displays translated titles instead of names). Common places for this file are /usr/share/tellico/tellico.dtd or /usr/share/kde4/apps/tellico/tellico.dtd Beware that Tellico use libxslt1.1 which implement XPath 1.0 functions only. Fortunately, you can use EXSLT extensions.

Basical XSLT for transforming export

First, do an XML export. The file will serve as a reference for testing. Testing will be easier if you install an XSLT processor (xsltproc is available on every distribution). Then write an xsl stylesheet. Here's a basic one :

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:tc="http://periapsis.org/tellico/"
                version="1.0">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>

<xsl:template match="/">
  <xsl:apply-templates select="tc:tellico"/>
</xsl:template>

<xsl:template match="tc:tellico">
  <xsl:apply-templates select="tc:collection"/>
</xsl:template>

<!-- about your collection -->
<xsl:template match="tc:collection">
<books><!-- sample xml  output -->
<xsl:apply-templates select="tc:entry"/>
<books>
</xsl:template>

<!-- transform each entry -->
<xsl:template match="tc:entry">
<book><!-- sample xml  output -->
<title><xsl:value-of select="title"/></title>
<!-- other fields -->
</book>
</xsl:template>

</xsl:stylesheet>


Типові поля, що використовуються для імпортування

Якщо ви хочете розширити можливості Tellico, вам слід буде змінити файли XSLT, що використовуються для обробки даних. Використання типових назв полів зробить ваші файли сумісними із файлами інших користувачів (наприклад, «dewey» і «loc» використовуються для декількох джерел даних).

Список полів наведено на сторінці Tellico/DefaultFields