Создать схему
Описать тип данных, которые будут формировать информацию о регистрацииСхема
<?xml version='1.0' encoding='UTF-8'?> <schemas xmlns="http://www.intertrust.ru/schema/palette/tn-schema"> <schema name="ShowRegInfoTask"> <!--Текст "№"--> <string name="number" temporal="true"> <calc-values> <script event="open" lang="SPEL"><![CDATA['№']]></script> </calc-values> </string> <!--Номер документа--> <string name="regnumber" temporal="true"> <calc-values> <script event="open" lang="SPEL"><![CDATA[#parentnode == null || #parentnode.registration == null || #parentnode.registration.number==null ? '' : #parentnode.registration.number.prefix+#parentnode.registration.number.number+#parentnode.registration.number.suffix]]></script> </calc-values> </string> <!--Текст "от" --> <string name="from" temporal="true"> <calc-values> <script event="open" lang="SPEL"><![CDATA['от']]></script> </calc-values> </string> <!--Дата регистрации--> <date name="date" temporal="true"> <calc-values> <script event="open" lang="SPEL"><![CDATA[T(ru.intertrust.cmj.af.misc.AFDate).fromJavaDate(#parentnode.date, false)]]></script> </calc-values> </date> </schema> </schemas>
Создать форму
Описать расположение данных и их визуализацию в UIФорма
<?xml version='1.0' encoding='UTF-8'?> <ui xmlns="http://www.intertrust.ru/schema/palette/tn-ui"> <form schema-ref="ShowRegInfoTask" id="ShowRegInfoTask" projection="default" group="true"> <properties> <hide condition-union="AND"> <negative-condition-ref ref="edit"/> <negative-condition-ref ref="read"/> </hide> </properties> <component> <section id="ShowRegInfoTask_row" group="true"> <appearance field-layout="horizontal"/> <component> <field attribute-ref="number"> <properties> <read-only condition-union="AND"> <condition>true</condition> </read-only> </properties> <appearance align="left" importance="normal"> <label-style field-width="1" field-unit="symbol"/> </appearance> </field> <field attribute-ref="regnumber"> <properties> <read-only condition-union="AND"> <condition>true</condition> </read-only> </properties> <appearance align="left" importance="normal"> <label-style field-width="5" field-unit="symbol"/> </appearance> </field> <field attribute-ref="from"> <properties> <read-only condition-union="AND"> <condition>true</condition> </read-only> </properties> <appearance align="left" importance="normal"> <label-style field-width="2" field-unit="symbol"/> </appearance> </field> <field attribute-ref="date"> <properties> <read-only condition-union="AND"> <condition>true</condition> </read-only> </properties> <appearance align="left" importance="normal"> <label-style field-width="15" field-unit="symbol"/> </appearance> </field> </component> </section> </component> </form> </ui>
Подключить схему как объект к схеме поручения
Подключение схемы
<schemas xmlns="http://www.intertrust.ru/schema/palette/tn-schema"> <schema name="ResolutionTasksResource" recalc="true"> <!--....--> <schema-ref name="showRegInfo" ref="ShowRegInfoTask" temporal="true"/> <!--....--> </schema> </schemas>
Вывести новое поле на форму
Отображение поля на форме
<?xml version='1.0' encoding='UTF-8'?> <ui xmlns="http://www.intertrust.ru/schema/palette/tn-ui"> <form schema-ref="ResolutionTasksResource" id="ResolutionTasksResourceForm" projection="default" showtabs="true"> <component> <!--....--> <field attribute-ref="showRegInfo"> <appearance location="subform" importance="normal"/> </field> <!--....--> </component> </form> </ui>