Skip to content

Instantly share code, notes, and snippets.

@isergey
Created October 22, 2014 22:20
Show Gist options
  • Save isergey/ad370057151f62b1ac3d to your computer and use it in GitHub Desktop.
Save isergey/ad370057151f62b1ac3d to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="UTF-8" ?>
<schema>
<characteristics>
<!--
id - идентификатор характеристики
title - название характеристики человекочитаемое
type - тип значение (по умолчанию string). Может быть string|float|int|boolean|date
reference - идентификатор справочника (может быть не указан, если значение не выбирается из справочника)
-->
<characteristic id="Город" title="Город" type="string" reference="Город" />
<characteristic id="ТипОбъекта" title="Тип объекта" type="string" reference="ТипОбъекта">
<!--
filter - если присутвует, то характеристика появится в фильтре
group - номер групп
order - порядок вывода в группе
default - значение, которое будет отмечено в фильтре по умолчанию
-->
<filter group="1" order="1" default="1"></filter>
</characteristic>
<characteristic id="ТипУслуги" title="Тип услуги" type="string" reference="ТипУслуги">
<filter group="1" order="1" default="1"></filter>
</characteristic>
<characteristic id="Срок" title="Срок" type="string" reference="Срок">
<filter group="1" order="1" default="1"></filter>
</characteristic>
<characteristic id="Стоимость" title="Стоимость" type="decimal" unit="р">
<!--
input - тип ввода. По умолчанию text.
unitLabel - название еденицы измерения
fromLable - обозначение начала диапазона
toLable - обозначение конца диапазона
-->
<filter group="1" order="1" input="range" unitLabel="р" fromLable="от" toLable="до"></filter>
</characteristic>
<characteristic id="Санузел" title="Санузел" type="boolean">
<filter group="2" order="1">
<!--
showOn - перечисление значений других характеристик, при которых нужно показывать характеристику
-->
<showOn>
<!--
id - идентификатор характеристики
-->
<characteristic id="ТипОбъекта">
<!--
value - Значние характеристики
-->
<value>1</value>
<value>2</value>
</characteristic>
</showOn>
<!-- Так же как и с showOn только наоборот -->
<hideOn></hideOn>
</filter>
</characteristic>
<characteristic id="ТипСанузла" title="Тип санузла" type="string" reference="ТипСанузла">
<filter group="2" order="1">
<showOn>
<characteristic id="Санузел">
<value>true</value>
</characteristic>
</showOn>
</filter>
</characteristic>
<characteristic id="Метро" title="Метро" type="string" reference="Метро">
<filter group="2" order="1" multilple="true">
<showOn>
<characteristic id="Санузел">
<value>true</value>
</characteristic>
</showOn>
</filter>
</characteristic>
</characteristics>
<!-- Справочники -->
<references>
<!--
id - идентификатор справочника.
-->
<reference id="ТипОбъекта">
<!-- Значние справочника -->
<item id="1" title="Квартира"></item>
<item id="2" title="Комната"></item>
<item id="3" title="Офис"></item>
</reference>
<reference id="ТипУслуги">
<item id="1" title="Аренда"></item>
<item id="2" title="Продажа"></item>
</reference>
<reference id="Срок">
<item id="1" title="Длительно"></item>
<item id="2" title="Посуточно"></item>
</reference>
<reference id="ТипСанузла">
<item id="1" title="Слитный"></item>
<item id="2" title="Раздельный"></item>
</reference>
<reference id="Метро">
<item id="1" title="Лесная">
<!--
if - указывает, при каком значении характеристики отображать значние справочника
-->
<if characteristic="Город">
<value>1</value>
</if>
</item>
<item id="2" title="Академическая">
<if characteristic="Город">
<value>1</value>
</if>
</item>
<item id="3" title="Охтный ряд" city="2">
<if characteristic="Город">
<value>2</value>
</if>
</item>
</reference>
<reference id="Город">
<item id="1" title="Санкт-Петербург"></item>
<item id="2" title="Москва"></item>
</reference>
</references>
</schema>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment