Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Attribute views facilitate editors’ work – only those attributes are displayed in the attribute editor which are important for them. The attribute definition should be put in the XML file the URL for which has been configured in the generalConfig.properties file, in attributesViews.url.

The structure of the XML file which defines attribute views is presented in the example below

Widoki atrybutów służą do ułatwiania pracy redaktorom poprzez wyświetlanie w edytorze atrybutów tylko tych atrybutów, które są dla nich istotne. Definicję atrybutów należy umieścić w pliku xml, do którego URL został zdefiniowany w pliku generalConfig.properties we właściwości attributesViews.url.

...

:

Code Block
<attributesViewsList>
   <attributesView fullView="true">
      <name lang="pl"><![CDATA[Wszystkie atrybuty]]></name>
      <name lang="en"><![CDATA[All attribures]]></name>
   </attributesView>

   <attributesView>
      <name lang="pl"><![CDATA[Tytuł, autor i opis]]></name>
      <attribute required="true">Title</attribute>
      <attribute>Creator</attribute>
      <attribute descendantRequired="true" showAllDescendants="true">Description</attribute>
   </attributesView>
</attributesViewsList>

...

Info

Słowo ''atrybut'' można rozumieć jako podstawowy składnik opisu bibliograficznego lub jako element dodawany do znacznika xml. Aby uniknąć niejasności, zawsze gdy słowo jest używane w drugim z tych znaczeń, zostanie podkreślone, że chodzi o xml.

Głównym znacznikiem pliku konfiguracyjnego jest <attributesViewsList>. W jego wnętrzu umieszczane są znaczniki <attributesView>, z których każdy definiuje jeden widok atrybutów. Można wprowadzić następujące informacje na temat widoku:

The main tag of the configuration file is <attributesViewsList>. Inside, there are <attributesView> tags which define one attribute view each. The user can enter the following information about the view:

  • name: put in <name> tags with the lang XML tag, which defines the language (a two-letter symbol in accordance with the ISO 639 standard) of the displayed name; names should be put in the CDATA section, to make it possible to use any Unicode characters; for every view, a name must be defined in at least one language; it is recommended that names be entered for every language available in the “View” menu of the Editor Application; and
  • visible attributes: for determining which attributes are to be displayed in a view;  <attribute> tags should be used; a tag should contain the RDF name of the attribute; it is worth noting that <attribute>tags should not create a hierarchy which corresponds to the hierarchy of attributes in the system – all tags should be added directly inside the <attributesView> tag; optional XML attributes which change the behavior of the view can be used for every tag:
    • required: a true/false value, the default value is false; when value true is set, the attribute will be deemed to be required, and it will be marked with an asterisk; in such a case, when a standard and planned publication description is edited, the application will require that the user enters at least one attribute value in each available language or a language-independent value.
    • descendantRequired: a true/false value, the default value is false; when value true is set, it will be required that the user fill in the attribute or any of its visible subordinate attributes (at any depth of the hierarchy); such an attribute will be marked with two asterisks; just like above, the requirement will only concern standard and planned publications for all languages or, at least, a language-independent value; since the condition enforced by the required XML attribute is stronger than descendantRequired, there is no point in using both for one attribute; in such a case, descendantRequired will be ignored;
    • showAllDescendants: a true/false value, the default value is false; when value true is set, all subordinate attributes of the given attribute (at any depth of the hierarchy) will also be visible; subordinate attributes can still be added in separate XML tags, for example, to determine the required attributes;
  • for a whole view, the fullview XML attribute can be added (a true/false value, the default value is false); when value true is set, all attributes will be visible in that view; it will still be possible to add attribute tags, for example, to determine the required attributes
  • nazwa: umieszczana w znacznikach <name>, opatrzonych atrybutem xml lang określającym język (symbol dwuliterowy, zgodnie ze standardem ISO 639), w którym ma być wyświetlana nazwa. Nazwę należy umieszczać w sekcji CDATA (umożliwia to wykorzystanie dowolnych znaków Unicode). Dla każdego widoku musi być zdefiniowana nazwa w przynajmniej jednym języku. Zalecane jest, by wprowadzić nazwy we wszystkich językach dostępnych w aplikacji redaktora w menu Widok.
  • widoczne atrybuty: do określania, które atrybuty mają być wyświetlane w widoku, należy zastosować znaczniki <attribute>. Wewnątrz znacznika powinna znaleźć się nazwa RDF atrybutu. Warto zwrócić uwagę, że znaczniki <attribute> nie powinny tworzyć hierarchii odpowiadającej hierarchii atrybutów w systemie - wszystkie znaczniki powinny być dodawane bezpośrednio wewnątrz znacznika <attributesView>. Dla każdego znacznika można zastosować opcjonalne atrybuty xml, zmieniające zachowanie widoku:
    • required: wartość typu prawda/fałsz, domyślnie fałsz. Po ustawieniu na true, atrybut zostanie uznany za wymagany i oznaczony gwiazdką. W takim przypadku, przy edycji opisu publikacji normalnej i planowanej aplikacja będzie wymuszała wpisanie przynajmniej jednej wartości atrybutu w każdym z dostępnych języków lub wartości niezależnej od języka.
    • descendantRequired: wartość typu prawda/fałsz, domyślnie fałsz. Po ustawieniu na true, wymagane będzie uzupełnienie danego atrybutu lub dowolnego z jego widocznych atrybutów podrzędnych (na dowolnej głębokości hierarchii). Atrybut taki zostanie oznaczony dwiema gwiazdkami. Podobnie jak wyżej, wymuszanie dotyczy to tylko publikacji normalnych i planowanych oraz wszystkich języków lub przynajmniej wartości niezależnej od języka. Ponieważ warunek wymuszany przez atrybut xml required jest silniejszy od descendantRequired, nie ma sensu stosować ich obu dla jednego atrybutu. W takim przypadku descendantRequired zostanie zignorowany.
    • showAllDescendants: wartość typu prawda/fałsz, domyślnie fałsz. Po ustawieniu na true, wszystkie atrybuty podrzędne danego atrybutu (na dowolnej głębokości hierarchii) będą również widoczne. Atrybuty podrzędne nadal mogą być dodane w osobnych znacznikach xml, na przykład w celu określenia atrybutów wymaganych.
  • dla całego widoku można dodać atrybut xml fullView (wartość typu prawda/fałsz, domyślnie fałsz). Po ustawieniu na true, wszystkie atrybuty będą widoczne w tym widoku. Nadal można dodać znaczniki attribute, na przykład w celu określenia atrybutów wymaganych.