You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

The Structure of the Reader Application of the dLibra System

The Basic Concepts Related to the Functioning of the Reader Application

Pages – the reader application consists of many pages (views), for example, the home page, the object page, or the contact page. They are the basis of navigation. Every page has its own, unique identifier, for example:

IdentifierPageSample address
mainhomehttp://demo.dl.psnc.pl/dlibra
publicationobject information pagehttp://demo.dl.psnc.pl/dlibra/publication/1000
contactcontact pagehttp://demo.dl.psnc.pl/dlibra/contact

Each of those pages is defined in the pages.xml file by section <page>...</page>, for example:

Identifier

Sample definition

main
pages.xml - main
<page name="main" layout="home_layout" inherits="base-page">
...
</page>
publication
pages.xml - publication
<page name="publication" layout="home_layout" inherits="base-page">
...
</page>
contact
pages.xml - contact
<page name="contact" layout="home_layout" secure="true" inherits="base-page">
...
</page>

Page tags have three different fields:

name – the identifier of a page, for example: “main”, “publication”, or “contact”;

layout – the name of a layout (a graphic layout of a page) in which all components of a page will be set; and

 inherits – the identifier of a page (it can be abstract) from which the page which is being defined will take components (apart from its own components); for example: the “contact” page is defined in the “contact” section and contains the ContactComponent component, but the “inherits” field has the “base-page” value, so the contact page will also contain all the components defined for the “base-page” section;

Components – correspond to particular elements of a page; for example, the section with recently added objects on the home page is a separate component; components can be displayed in various places on a page; the components to be displayed on a page ought to be specified in the descriptor of the page, in the pages.xml file; the method of defining a component is presented below:The “component” tag is characterized with the use of the following attributes:

pages.xml - component
<component name="...">
	<place>...</place>
	<position>...</position>
</component>

The “component” tag is characterized with the use of the following attributes:

name – the full name of a component;

place – the name of the position of a component in a layout; and

position – the position in which the component should be put in a place; if there is another component in the same place, the position must have a unique value.

One example of a component is the component on the contact page. That page is defined in the page contact element. It uses the home_layout layout. It has a component which is defined in the following manner:

pages.xml
<components>
	<component name="pl.psnc.dlibra.web.comp.pages.components.ContactComponent">
		<place>main</place>
			<position>1</position>
	</component>
</components>

It means that the content of the ContactComponent component in the  /WEB-INF/components/templates/ContactComponent.vm file is rendered in the /WEB-INF/layouts/templates/home_layout.vm distribution template, in a loop:

home_layout.vm
#foreach( $comp in $main)
	$!{comp.RenderedTemplate}
#end

Every component consists of three elements:

  • a Java class (for example, pl.psnc.dlibra.web.comp.pages.components.IndexSearchComponent),
  • a template file, which is named the same as the Java class, for example, IndexSearchComponent.vm ; and
  • files with various language versions, for example, IndexSearchComponent_xx.xml).

in version 6, all components are located in the dcore-webapp-components-6.x.x.jar archive, in the /WEB-INF/lib directory. The Java class is in the directory which corresponds to its package name (in this case, /pl/psnc/dlibra/web/comp/pages/components/), and the remaining files of the component – in the root directory of that archive.

The default files from the JAR archive (dcore-webapp-components-6.x.x.jar) can be “covered” with the user’s own, changed files. For that purpose, it is best to unpack the template files which are to be changed, to an appropriate directory. In the case of  .vm files, it is the  /WEB-INF/components/templates directory, and in the case of *.xml language files, it is the /WEB-INF/components/resources directory.

Files unpacked in that way can be changed, and the original content of the files left in the JAR archive will be overwritten with the new data. The changes in the *.vm files will be visible immediately after they have been saved. The changes in the *.xml files will also be taken into account immediately if they were already unpacked when the Tomcat server was being started up. Otherwise, the Tomcat server should be restarted.

Moreover, in some component templates, macros defined in the components_library.vm or layout_library.vm file are used. File componentsjibrary.vm  is in the dcore-web-components-6.x.x.jar archive. The user’s own macros and modified macros should be placed, appropriately, in files /WEB-INF/components/templates/custom_library.vm or /WEB-INF/layout/custom_templates/custom_layout_library.vm). The changes in those files will also be takes into account immediately after they have been saved if the macro edited by the user was available when the Tomcat server was being started up.

A Description of the Configuration Files of the Reader Application of the 6.0 Version of the dLibra System

It should be remembered that configuration files should be edited with the use of an editor which supports UTF-8 encoding and does not place the BOM tag at the beginning of a file – for example, with the use of the free JEdit editor.

Below, there is a description of the most important configuration files for the reader application of the dLibra system. Changes made in some files require a restart of the reader application. Those files are marked with (R) directly after their names. Files not included in the breakdown below should not be modified without prior consultation with the creators of the dLibra system.

  • actions.xml – that file contains additional configuration parameters for actions, including:
    • the addressee email address for messages sent by users through the contact form and the format of those messages (plain text or HTML);
    • the configuration of the protections of the mechanism which allows users to propose key words (only for implementations with dedicated solutions for that):
      • whether the proposals are to be rejected or accepted by default,
      • the maximum and minimum length of the proposals of key words, and
      • the maximum number of proposals which can be entered by a user in a given period of time (by default, the maximum is five proposals during 30 minutes);
    • the maximum and minimum length of the login entered by a user during registration; and
    • the metadata fields which the user will be able to use for sorting search results.
  • components.xml – additional configuration parameters for particular components; in that file, the following elements should be changed:
    • the collection identifier and “Recommended”,
    • for the index component – the list of tokens which, as prefixes of value indexes, will not be taken into account during sorting;
    • the maximum length of the search query;
    • the possibility of displaying a form with the question about access to a protected publication;
    • the possibility of filtering by collections, group publications, and accessibility in the search results;
    • the names of the attributes which should not be searchable;
    • the number of elements displayed on the home page for the recommended, recently added, and most popular publications and news;
    • identifiers of collections which are not to be displayed in the collection structure and whether the collection structure is to be a complete tree;
    • the names of the attributes which are to be displayed in the index component;
    • the email address of the person responsible for the administration of the OAI repository; and
    • the basic attributes in the digital object information view; the possibility of identifier an OAI identifier;
  • ignored_ips.txt i ignored_agents.txt (R) – those files are related to computing the visit statistics; in the first file, the IP addresses to be counted (for example, the computers on which editors work) should be entered; every entery is treated as a regular expression, so complete ranges of IP addresses can be entered; the file contains a sample entry for 127.0.0.1; before adding a new regular expression, it is worth checking if it is correct, with the use of free tools available online, for example, http://regexpal.com/.

The ignored_agents.txt functions in a similar manner: regular expressions for the “user-agents” field should be placed here. The field is a part of the heading of a HTTP request. It is a sequence of characters which identify the program used for browsing a page (for example, an Internet browser or a browser bot). If the value of the sequence is adapted to the given model, the programs identifying with the use of that sequence will not be counted for the statistics of visits and impressions of publication content. The file contains a sample entry for Googlebot. The list of “user agents” identifiers can be found online.

  • pages.xml – that file contains the definition of the pages displayed by the reader application of the dLibra system; it must be modified when:
    • the order of the components displayed on a given page is changed;
    • dodawania nowego komponentu do konkretnej strony,
    • tworzenia nowej strony w ramach aplikacji czytelnika.
      Zagadnienia związane z wykonywaniem zmian w tym pliku zostaną szczegółowo omowione w rozdziałach : "Dostosowywanie wyglądu aplikacji Czytelnika" oraz
      "Najczęściej zadawane pytania".
  • pages_titles.xml (R) - W pliku tym określamy tytuły i pod tytuły poszczególnych stron.
  • templates.properties (R) - Zawiera parametry konfiguracyjne dostępne z poziomu wszystkich szablonów.
  • periodic.xml (R) - Plik ten zawiera definicje zadań okresowych wykonywanych przez aplikacje czytelnika. Konfigurujemy w nim:
    • czas wykonywania kopii zapasowej JCR, ścieżkę w której ma być przechowywana kopia zapasowa JCR oraz liczbę przechowywanych uprzednio stworzonych kopii,
    • mechanizmu importu wiadomości z zewnętrznego kanału RSS,
    • czas generowania i zapisu a także generowania widoków prezentacyjnych statystyk, identyfikatory atrybutów na podstawie których generowane są statystyki wartości atrybutów
    • czas wysyłania biuletynów z ostatnio dodanymi publikacjami,
    • położenie katalogu do którego zapisywane są informacje o zapytaniach wyszukiwawczych wydawanych przez użytkowników aplikacji czytelnika,
    • czas i mechanizm tworzenia mapy strony.
  • pliki dlibra-webapp\WEB-INF\components\resources\WEBAPP_xx.xml - Gdzie xx oznacza wersję jezykową (np. pl) w pliku tym znajdują sie najczęściej modyfikowane etykiety tekstowe dla każdej z zainstalowanych wersji językowych.
  • dlibra-webapp\WEB-INF\components\templates\custom_library.vm - Zawiera dodatkowe makra języka VTL stworzone przez administratorów danej biblioteki dla komponentów. Informacje o tworzeniu makr jęzka VTL można znaleźć na stronach projektu Velocity.
  • dlibra-webapp\WEB-INF\layout\custom_templates\custom_layout_library.vm - Zawiera dodatkowe makra języka VTL stworzone przez administratorów danej biblioteki dla szablonów rozmieszczeń. Informacje o tworzeniu makr jęzka VTL można znaleźć na stronach projektu Velocity.
  • Pliki dlibra-webapp\WEB-INF\layout\resources\layout_xx.xml - Gdzie xx oznacza wersję jezykową (np. pl) w pliku tym znajdują się etykiety
    tekstowe używane w szablonach rozmieszczeń.
  • Katalog dlibra-webapp\WEB-INF\formats - zawiera konfiguracje wszystkich rozszerzeń związanych z prezentacją treści publikacji. Szczegółowy jej opis znajduję się w rozdziale "Konfiguracja prezentacja treści w aplikacji czytelnika".

Pliki konfiguracyjne znajdujące się w katalogu dlibra-webapp/WEB-INF/conf

Aplikacja czytelnika korzysta ze swojej lokalnej bazy danych, jest to baza zupełnie nie związana z bazą dnaych wykorzystywaną przez serwerem dLibry. Na konfiguracje tej bazy składają się poza omówionymi poniżej dwoma plikami również pliki jcr-init.properties oraz jcr-repository.xml. Nie powinny być one jednak pod żadnym pozorem modyfikowane.

  • jcr-init-desc.xml (R) - specyfikacja podstawowej zawartości (wartości domyślne), która jest umieszczna w bazie danych podczas pierwszego startu aplikacji czytelnika.
  • jcr.properties (R) - konfiguracja podstawowych parametrów dostępowych do bazy danych aplikacji czytelnika. W przypadku gdy katalog roboczy aplikacji czytelnika zostanie przeniesiony należy uaktualnić ścieżkę do bazy danych, która znajduję się w tym pliku.
  • services.properties (R) - parametry połączeniowe do serwera dLibry. W przypadku gdy serwer dLibry zostanie przeniesiony na inną maszynę należy uaktualnić znajdujący się w tym pliki adres serwer.
  • smtp.properties (R) - parametry dostępowe do serwera SMTP. Parametry te wykorzystywane są przez aplikacje czytelnika do wysyłania wiadomości email.
  • cache.properties (R) - zawiera ustawienia pamięci podręcznej (cache) aplikacji czytelnika. Użycie cache znacznie przyspiesza działanie aplikacji czytelnika wykorzystanie pamięci podręcznej jest niezbędne w przypadku bibliotek posiadającej powyżej 1000 publikacji.
  • exlibris.xml - treść tego pliku zawiera konfigurację mechanizmu exlibris. Więcej na temat konfiguracji exlibris
    można dowiedzieć się w sekcji konfiguracji Aplikacji Czytelnika.
  • pubcreator.properties - plik podstawowych parametrów konfiguracji mechanizmu Self-Archiving. Więcej na temat konfiguracji Self-Archiving można znaleźć w sekcji konfiguracji Aplikacji Czytelnika. Dotyczy dedykowanych wdrożeń z włączoną funkcją Self-Archiving.
  • pubc-metadata.xml - zawiera konfigurację formularza atrybutów dla funkcjonalności Self-Archiving. Więcej na ten temat można znaleźć w sekcji konfiguracji Aplikacji Czytelnika. Dotyczy dedykowanych wdrożeń z włączoną funkcją Self-Archiving.

Opis struktury pod dlibra-webapp\style

W katalogu dlibra-webapp\style znajduję się większość grafik i arkuszy stylów css używanych w aplikacji czytelnika.

Dodatkowe elementy

Poza standardowymi odwołaniami do stron zdefiniowanych w aplikacji czytelnika istnieją również zasoby dostępne z głównego poziomu:

  • http://demo.dl.psnc.pl/Content - odpowiedzialny za dostęp do treści publikacji.
    • Wywołanie /Content/2952/ powoduje przejście do treści głównego pliku wydania o identyfikatorze 2952.
    • Wywołanie /Content/2952/directory.djvu powoduje pobranie pliku directory.djvu z wydania o identyfikatorze 2952.
  • http://demo.dl.psnc.pl/zipContent - odpowiedzialny za dostęp do treści publikacji w postaci
    archiwów ZIP. Wywołanie /zipContent/2952/ powoduje pobranie treści całego wydanie o identyfikatorze 2952 jako pliku zip.
  • http://demo.dl.psnc.pl/image - odpowiedzialny za dostęp do miniaturek wydań.Wywołanie /image?id=2940 powoduje pobraniu miniaturki wydania o identyfikatorze 2940.
  • http://demo.dl.psnc.pl/ka - odpowiedzialny za szyfrowanie publikacji zabezpieczonych,
  • http://demo.dl.psnc.pl/dlibra/dlibra-app.jnlp - wpisując ten adres do przeglądarki uruchamiamy Aplikację Redaktora/Admnistratora.
  • http://demo.dl.psnc.pl/dlibra/publication/81/content - odnośnik do treści publikacji o identyfikatorze 81, jeżeli publikacja posiada więcej niż jedno wydanie wyświetlona zostanie lista wydań danej publikacji. W przypadku publikacji grupowej wyświetlona zostanie struktura publikacji grupowej.
  • http://demo.dl.psnc.pl/dlibra/publication/81/ - odnośnik do opisu publikacji o identyfikatorze 81, jeżeli publikacja posiada więcej niż jedno wydanie wyświetlona zostanie lista wydań danej publikacji.
  • No labels