Примеры шаблонов для генерации документов (устаревшее)
Материал из BiTel WiKi
(Различия между версиями)
(→Карта учётных данных) |
|||
| (8 промежуточных версий не показаны.) | |||
| Строка 1: | Строка 1: | ||
| + | <font color='red'>Примеры в данном разделе используют устаревшую технологию генерации документов с использованием XSLT преобразования.</font> | ||
| + | |||
== Карта учётных данных == | == Карта учётных данных == | ||
{| | {| | ||
|- valign=top | |- valign=top | ||
| - | | [[Изображение: | + | | [[Изображение:card_ufa_in_common_contract.png|thumb|300px|В едином договоре]] |
| - | | [[Изображение: | + | | [[Изображение:card_ufa_view.png|thumb|300px|Внешний вид]] |
|} | |} | ||
| - | XSL шаблон: [[Файл: | + | XSL шаблон: [[Файл:card_ufa.xsl]] |
| - | PDF | + | PDF форма : [[Файл:card_ufa.pdf]] |
Конфигурация: | Конфигурация: | ||
| Строка 23: | Строка 25: | ||
</source> | </source> | ||
| - | == Заказ == | + | == Заказ == |
| + | {| | ||
| + | |- valign=top | ||
| + | | [[Изображение:zakaz_ufa_in_common_contract.png|thumb|300px|В едином договоре]] | ||
| + | | [[Изображение:zakaz_ufa_view.png|thumb|300px|Внешний вид]] | ||
| + | |} | ||
| + | |||
| + | XSL шаблон: [[Файл:zakaz_ufa.xsl]] | ||
| + | |||
| + | PDF форма : [[Файл:zakaz_ufa.pdf]] | ||
| + | |||
| + | JSP c доп. параметрами генерации документа '''zakaz_parameters.jsp''': | ||
| + | <pre> | ||
| + | <%@ page contentType="text/html; charset=UTF-8"%> | ||
| + | <%@ include file="/WEB-INF/jspf/taglibs.jsp"%> | ||
| + | |||
| + | <c:set var="uiid" value="${u:uiid()}"/> | ||
| + | <jsp:useBean id="curdate" class="java.util.Date"/> | ||
| + | <fmt:formatDate value="${curdate}" pattern="dd.MM.yyyy" var="curdate"/> | ||
| + | с даты | ||
| + | <input type="text" value="${curdate}" id="${uiid}" name="activeDate" style="width: 80px;text-align:center"/> | ||
| + | <script> | ||
| + | $('input[name=activeDate]').datepicker(); | ||
| + | </script> | ||
| + | </pre> | ||
| + | |||
| + | Конфигурация: | ||
| + | <source lang="bash"> | ||
| + | document:pattern.44.title=Уфа заказ | ||
| + | document:pattern.44.scope=bgbilling-commonContract | ||
| + | document:pattern.44.script=ru.bgcrm.plugin.document.docgen.CommonDocumentGenerator | ||
| + | document:pattern.44.additionalParametersJsp=/WEB-INF/jspf/user/plugin/document/custom/zakaz_parameters.jsp | ||
| + | document:pattern.44.titleRegexp=^72\d{6} | ||
| + | document:pattern.44.file=docpattern/zakaz_ufa.pdf | ||
| + | document:pattern.44.xslt=docpattern/zakaz_ufa.xsl | ||
| + | document:pattern.44.type=pdfForm | ||
| + | document:pattern.44.documentTitle=Уфа заказ.pdf | ||
| + | document:pattern.44.flattening=1 | ||
| + | </source> | ||
| + | |||
| + | == Рабочая карта процесса == | ||
| + | {| | ||
| + | |- valign=top | ||
| + | | [[Изображение:work_card.png|thumb|300px|В едином процессе]] | ||
| + | | [[Изображение:work_card_view.png|thumb|300px|Внешний вид]] | ||
| + | |} | ||
| + | |||
| + | XSL шаблон: [[Файл:work_card.xsl]] | ||
| + | |||
| + | DOCX шаблон : [[Файл:work_card.docx]] | ||
| + | |||
| + | Конфигурация: | ||
| + | <source lang="bash"> | ||
| + | document:pattern.8.title=Рабочая карта | ||
| + | document:pattern.8.scope=process | ||
| + | document:pattern.8.script=ru.bgcrm.plugin.document.docgen.CommonDocumentGenerator | ||
| + | document:pattern.8.file=docpattern/work_card.docx | ||
| + | document:pattern.8.xslt=docpattern/work_card.xsl | ||
| + | document:pattern.8.type=docxForm | ||
| + | document:pattern.8.documentTitle=Рабочая карта.docx | ||
| + | </source> | ||
| + | |||
| + | == Для документов карточки договора == | ||
| + | Конфигурация: | ||
| + | <source lang="bash"> | ||
| + | document:pattern.602.title=Карточка договора | ||
| + | document:pattern.602.scope=bgbilling-contract | ||
| + | document:pattern.602.script=ru.bgcrm.plugin.document.docgen.CommonDocumentGenerator | ||
| + | document:pattern.602.type=xsltHtml | ||
| + | document:pattern.602.xslt=docpattern/card_contract.xsl | ||
| + | document:pattern.602.documentTitle=card_contract.html | ||
| + | </source> | ||
| + | |||
| + | XSL пример пустого шаблона | ||
| + | <pre><!DOCTYPE xsl:stylesheet [ | ||
| + | <!ENTITY nbsp " "> | ||
| + | <!ENTITY copy "©"> | ||
| + | <!ENTITY reg "®"> | ||
| + | <!ENTITY trade "™"> | ||
| + | <!ENTITY mdash "—"> | ||
| + | <!ENTITY ldquo "“"> | ||
| + | <!ENTITY rdquo "”"> | ||
| + | <!ENTITY pound "£"> | ||
| + | <!ENTITY yen "¥"> | ||
| + | <!ENTITY euro "€"> | ||
| + | ]> | ||
| + | <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | ||
| + | xmlns:xs="http://www.w3.org/2001/XMLSchema" | ||
| + | xmlns:bgcrm="http://bgcrm.ru/saxon-extension" | ||
| + | exclude-result-prefixes="bgcrm" | ||
| + | version="2.0"> | ||
| + | <xsl:variable name="months"> | ||
| + | <month num="01" imen="" rod="января" /> | ||
| + | <month num="02" imen="" rod="февраля" /> | ||
| + | <month num="03" imen="" rod="марта" /> | ||
| + | <month num="04" imen="" rod="апреля" /> | ||
| + | <month num="05" imen="" rod="мая" /> | ||
| + | <month num="06" imen="" rod="июня" /> | ||
| + | <month num="07" imen="" rod="июля" /> | ||
| + | <month num="08" imen="" rod="августа" /> | ||
| + | <month num="09" imen="" rod="сентября" /> | ||
| + | <month num="10" imen="" rod="октября" /> | ||
| + | <month num="11" imen="" rod="ноября" /> | ||
| + | <month num="12" imen="" rod="декабря" /> | ||
| + | </xsl:variable> | ||
| + | <xsl:template match="/event"> | ||
| + | <data> | ||
| + | <xsl:variable name="commonContract" select="bgcrm:bgbilling-commonContract(@objectId)" /> | ||
| + | <xsl:variable name="customerId" select="$commonContract/data/bgbilling_common_contract/@customer_id" /> | ||
| + | <xsl:copy-of select="$commonContract" /> | ||
| + | </data> | ||
| - | + | </xsl:template> | |
| + | </xsl:transform></pre> | ||
Текущая версия на 19:59, 24 марта 2016
Примеры в данном разделе используют устаревшую технологию генерации документов с использованием XSLT преобразования.
Содержание |
Карта учётных данных
XSL шаблон: Файл:Card ufa.xsl
PDF форма : Файл:Card ufa.pdf
Конфигурация:
document:pattern.4.title=Уфа карта учетных данных document:pattern.4.scope=bgbilling-commonContract document:pattern.4.script=ru.bgcrm.plugin.document.docgen.CommonDocumentGenerator document:pattern.4.titleRegexp=^72\d{6} document:pattern.4.file=docpattern/card_ufa.pdf document:pattern.4.xslt=docpattern/card_ufa.xsl document:pattern.4.type=pdfForm document:pattern.4.documentTitle=Уфа карта учетных данных.pdf document:pattern.4.flattening=1
Заказ
XSL шаблон: Файл:Zakaz ufa.xsl
PDF форма : Файл:Zakaz ufa.pdf
JSP c доп. параметрами генерации документа zakaz_parameters.jsp:
<%@ page contentType="text/html; charset=UTF-8"%>
<%@ include file="/WEB-INF/jspf/taglibs.jsp"%>
<c:set var="uiid" value="${u:uiid()}"/>
<jsp:useBean id="curdate" class="java.util.Date"/>
<fmt:formatDate value="${curdate}" pattern="dd.MM.yyyy" var="curdate"/>
с даты
<input type="text" value="${curdate}" id="${uiid}" name="activeDate" style="width: 80px;text-align:center"/>
<script>
$('input[name=activeDate]').datepicker();
</script>
Конфигурация:
document:pattern.44.title=Уфа заказ document:pattern.44.scope=bgbilling-commonContract document:pattern.44.script=ru.bgcrm.plugin.document.docgen.CommonDocumentGenerator document:pattern.44.additionalParametersJsp=/WEB-INF/jspf/user/plugin/document/custom/zakaz_parameters.jsp document:pattern.44.titleRegexp=^72\d{6} document:pattern.44.file=docpattern/zakaz_ufa.pdf document:pattern.44.xslt=docpattern/zakaz_ufa.xsl document:pattern.44.type=pdfForm document:pattern.44.documentTitle=Уфа заказ.pdf document:pattern.44.flattening=1
Рабочая карта процесса
XSL шаблон: Файл:Work card.xsl
DOCX шаблон : Файл:Work card.docx
Конфигурация:
document:pattern.8.title=Рабочая карта document:pattern.8.scope=process document:pattern.8.script=ru.bgcrm.plugin.document.docgen.CommonDocumentGenerator document:pattern.8.file=docpattern/work_card.docx document:pattern.8.xslt=docpattern/work_card.xsl document:pattern.8.type=docxForm document:pattern.8.documentTitle=Рабочая карта.docx
Для документов карточки договора
Конфигурация:
document:pattern.602.title=Карточка договора document:pattern.602.scope=bgbilling-contract document:pattern.602.script=ru.bgcrm.plugin.document.docgen.CommonDocumentGenerator document:pattern.602.type=xsltHtml document:pattern.602.xslt=docpattern/card_contract.xsl document:pattern.602.documentTitle=card_contract.html
XSL пример пустого шаблона
<!DOCTYPE xsl:stylesheet [
<!ENTITY nbsp " ">
<!ENTITY copy "©">
<!ENTITY reg "®">
<!ENTITY trade "™">
<!ENTITY mdash "—">
<!ENTITY ldquo "“">
<!ENTITY rdquo "”">
<!ENTITY pound "£">
<!ENTITY yen "¥">
<!ENTITY euro "€">
]>
<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:bgcrm="http://bgcrm.ru/saxon-extension"
exclude-result-prefixes="bgcrm"
version="2.0">
<xsl:variable name="months">
<month num="01" imen="" rod="января" />
<month num="02" imen="" rod="февраля" />
<month num="03" imen="" rod="марта" />
<month num="04" imen="" rod="апреля" />
<month num="05" imen="" rod="мая" />
<month num="06" imen="" rod="июня" />
<month num="07" imen="" rod="июля" />
<month num="08" imen="" rod="августа" />
<month num="09" imen="" rod="сентября" />
<month num="10" imen="" rod="октября" />
<month num="11" imen="" rod="ноября" />
<month num="12" imen="" rod="декабря" />
</xsl:variable>
<xsl:template match="/event">
<data>
<xsl:variable name="commonContract" select="bgcrm:bgbilling-commonContract(@objectId)" />
<xsl:variable name="customerId" select="$commonContract/data/bgbilling_common_contract/@customer_id" />
<xsl:copy-of select="$commonContract" />
</data>
</xsl:template>
</xsl:transform>
