README.md 2.39 KB
Newer Older
bbaer's avatar
bbaer committed
1
2
3
Zora Reader
===========

bbaer's avatar
bbaer committed
4
Read the XML stream, generated by the UZH Zora API (publist).
bbaer's avatar
bbaer committed
5
Optionally the stream will be cached.
bbaer's avatar
bbaer committed
6

bbaer's avatar
bbaer committed
7
The output is customizable by a template.
bbaer's avatar
bbaer committed
8
9
10
11

Requirements
------------

bbaer's avatar
bbaer committed
12
13
 * Linux Webserver (Apache2 oder nginx)
 * PHP 5.5+
Carsten  Rose's avatar
Carsten Rose committed
14
 * php5-cli (only for caching)
bbaer's avatar
bbaer committed
15
 * jQuery
bbaer's avatar
bbaer committed
16
17
18
19
 
Installation
------------

Carsten  Rose's avatar
Carsten Rose committed
20
 * Move the files zora.php, zora_fill_cache.php and config.ini to a directory on your webserver.
bbaer's avatar
bbaer committed
21
 * Adjust config.ini to your needs.
22
 * Check that zora_fill_cache is executable.
bbaer's avatar
bbaer committed
23
 * Upload the js folder.
Carsten  Rose's avatar
Carsten Rose committed
24
 * Try to access the zora.php from your Web Browser: zora.php?name=Bisaz
bbaer's avatar
bbaer committed
25
26
27
28
29
30
31
32
 * Simplest implementation:

```html
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.2/jquery.min.js" type="text/javascript"></script>
bbaer's avatar
bbaer committed
33
    <script src="js/zoralib.min.js" type="text/javascript"></script>
bbaer's avatar
bbaer committed
34
35
36
37
38
39
</head>
<body>

<ul id="zoraList">
</ul>
<script>
bbaer's avatar
bbaer committed
40
41
42
43
44
45
46
47
    var zoraTemplate = "<li class=\"zora-element\">" +
            "((citation))"
            + "<br> <a href=\"http://www.zora.uzh.ch/" +
            "((id))" +
            "/\" class=\"zora-link\">Zora</a> " +
            "((type))" +
            "</li>";

Benjamin Baer's avatar
Benjamin Baer committed
48
    zoraLib("https://w20.math.uzh.ch/zora_xml_reader/zora.php?name=Bisaz&op=AND&PY=2008-2012", zoraTemplate);
bbaer's avatar
bbaer committed
49
50
51
</script>
</body>
</html>
bbaer's avatar
bbaer committed
52
53
```

bbaer's avatar
bbaer committed
54
An online example can be viewed at:
Benjamin Baer's avatar
Benjamin Baer committed
55
https://w20.math.uzh.ch/zora_xml_reader/zora_test.html
bbaer's avatar
bbaer committed
56

bbaer's avatar
bbaer committed
57
58
59
60
61
62
63
Template
--------

The template is created as a variable that you have to pass to the zoraLib.

The variable parts are tokens in the form of ((token)).

bbaer's avatar
bbaer committed
64
Following tokens can currently be placed:
bbaer's avatar
bbaer committed
65

66
| Token        | Description                                                              |
bbaer's avatar
bbaer committed
67
| ------------ |:------------------------------------------------------------------------ |
68
69
70
71
72
73
| ((id))       | Internal Zora id. Used to build Zora links.                              |
| ((author))   | Name of first author                                                     |
| ((title))    | Title of the work, if supplied. Also appears in Citation.                |
| ((citation)) | Full zora citation string, includes all authors, title, book name, pages |
| ((type))     | Type of the publication (Article, Book Section, Dissertation, etc.)      |
| ((pubDate))  | Formatted date of original publication.                                  |
Benjamin Baer's avatar
Benjamin Baer committed
74
| ((coins))    | Coins, can be put in span elements for search engines.                   |