Tellico/pl: Difference between revisions

From KDE UserBase Wiki
(Updating to match new version of source page)
(Updating to match new version of source page)
 
Line 43: Line 43:
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 82: Line 83:
</xsl:stylesheet>
</xsl:stylesheet>
</syntaxhighlight>}}
</syntaxhighlight>}}


<span class="mw-translate-fuzzy">
<span class="mw-translate-fuzzy">

Latest revision as of 15:37, 17 June 2015

Tellico jest aplikacją do katalogowania, dzięki niej możesz w prosty sposób śledzić swoje książki, filmy, muzykę, a nawet wina i wszystko inne. Prosty i intuicyjny interfejs pokazuje okładki, grupy i każdy inny detal jakiego potrzebujesz. Pobieraj informacje z wielu popularnych źródeł internetowych takich jak IMDB.com, Amazon.com, a także bibliotek.

Tellico jest częścią projektu KDE Extragear (moduł Office).

Pierwszy rzut oka

Główne okno programu Tellico wygląda tak:

Tellico może używać różnych szablonów, umożliwiających zmianę formatowania informacji o kolekcji.

Skąd wziąć Tellico

Tellico jest dostępne dla wielu dystrybucji systemu Linux, a także posiada porty na systemy z rodziny BSD. Proszę sprawdzić menedżera pakietów, aby sprawdzić dostępność pakietu z Tellico.

Linki do wielu pakietów jest podana na stronie pobierania Tellico.

Kompilacja Tellico ze źródeł wymaga instalacji kilku pakietów deweloperskich.

Dla Ubuntu/Kubuntu nieoficjalne pakiety są dostępne tutaj.

Więcej informacji

Błędy

Błędy w Tellico możesz zgłaszać KDE's tutaj.

Pokaż wszystkie błędy w Tellico.


XSLT processing

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>


Domyślne pola do użytku w przetwarzaniu XSLT

Jeżeli chcesz rozszerzyć Telico musisz edytować jego pliki przetwarzania XSLT. Używanie domyślnych nazw dla pól czyni Twoje XSLT bardziej kompatybilnym z innymi (dla przykładu nazwy "dewey" i "loc" są używane w kilku źródłach danych).

Lista tutaj: Tellico/DefaultFields