{"id":9763,"date":"2025-05-16T12:37:50","date_gmt":"2025-05-16T10:37:50","guid":{"rendered":"https:\/\/pomoc.comarch.pl\/cee\/?post_type=ht_kb&#038;p=9763"},"modified":"2025-05-16T12:38:20","modified_gmt":"2025-05-16T10:38:20","slug":"definicje-hook-contract-wyszukaj-i-dodaj-pozycje","status":"publish","type":"ht_kb","link":"https:\/\/pomoc.comarch.pl\/cee\/index.php\/documentation\/definicje-hook-contract-wyszukaj-i-dodaj-pozycje\/","title":{"rendered":"Definicja Hook Contract: Wyszukaj i dodaj pozycje"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 ez-toc-wrap-left counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Spis tre\u015bci<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Prze\u0142\u0105cznik Spisu Tre\u015bci\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/pomoc.comarch.pl\/cee\/index.php\/documentation\/definicje-hook-contract-wyszukaj-i-dodaj-pozycje\/#Wprowadzenie\" >Wprowadzenie<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/pomoc.comarch.pl\/cee\/index.php\/documentation\/definicje-hook-contract-wyszukaj-i-dodaj-pozycje\/#Grupa_docelowa\" >Grupa docelowa<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/pomoc.comarch.pl\/cee\/index.php\/documentation\/definicje-hook-contract-wyszukaj-i-dodaj-pozycje\/#Opis\" >Opis<\/a><ul class='ez-toc-list-level-4' ><li class='ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/pomoc.comarch.pl\/cee\/index.php\/documentation\/definicje-hook-contract-wyszukaj-i-dodaj-pozycje\/#Rozszerzanie_istniejacej_konwersji\" >Rozszerzanie istniej\u0105cej konwersji<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/pomoc.comarch.pl\/cee\/index.php\/documentation\/definicje-hook-contract-wyszukaj-i-dodaj-pozycje\/#Dokument_zrodlowy_i_hook_do_konwersji\" >Dokument \u017ar\u00f3d\u0142owy i hook do konwersji<\/a><ul class='ez-toc-list-level-5' ><li class='ez-toc-heading-level-5'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/pomoc.comarch.pl\/cee\/index.php\/documentation\/definicje-hook-contract-wyszukaj-i-dodaj-pozycje\/#Dokument_zrodlowy\" >Dokument \u017ar\u00f3d\u0142owy<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-5'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/pomoc.comarch.pl\/cee\/index.php\/documentation\/definicje-hook-contract-wyszukaj-i-dodaj-pozycje\/#Hook_do_konwersji\" >Hook do konwersji<\/a><\/li><\/ul><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h3 id=\"wprowadzenie\" ><span class=\"ez-toc-section\" id=\"Wprowadzenie\"><\/span>Wprowadzenie<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Za pomoc\u0105 definicji hook contract: Wyszukaj i dodaj pozycje mo\u017cna wp\u0142ywa\u0107 na funkcjonalno\u015b\u0107 <em>Wyszukaj i dodaj pozycje<\/em> poprzez implementacj\u0119 hooka. Dotyczy poni\u017cszych aplikacji:<\/p>\n<ul>\n<li>Zapytania ofertowe zakupu<\/li>\n<li>Oferty zakupu<\/li>\n<li>Zam\u00f3wienia zakupu<\/li>\n<li>Dokumenty szybkiej rejestracji sprzeda\u017cy<\/li>\n<li>Zapytania ofertowe sprzeda\u017cy<\/li>\n<li>Oferty sprzeda\u017cy<\/li>\n<li>Zam\u00f3wienia sprzeda\u017cy<\/li>\n<li>Zlecenia dystrybucji<\/li>\n<\/ul>\n<p class=\"\" data-start=\"0\" data-end=\"60\">W ramach nast\u0119puj\u0105cych funkcjonalno\u015bci oferowane s\u0105 hooki:<\/p>\n<ul>\n<li>nowe \u017ar\u00f3d\u0142o z konwersj\u0105 z dokumentu \u017ar\u00f3d\u0142owego na dokument docelowy w jednej z wymienionych aplikacji. Opcjonalnie mo\u017cna zapewni\u0107 ustawienia do wyszukiwania danych \u017ar\u00f3d\u0142owych i\/lub do konwersji.<\/li>\n<\/ul>\n<p>Standardowa funkcjonalno\u015b\u0107 jest r\u00f3wnie\u017c konwertowana do odpowiednich implementacji hook\u00f3w i dlatego mo\u017ce by\u0107 u\u017cywana jako przyk\u0142ad.<\/p>\n<ul>\n<li>kopiowanie w\u0142asnych atrybut\u00f3w. Opcjonalnie mo\u017cna poda\u0107 ustawienia do konwersji w\u0142asnych atrybut\u00f3w.<\/li>\n<\/ul>\n<p>W tej artykule opisano, jakie rozszerzenia mo\u017cna wprowadzi\u0107 za pomoc\u0105 definicji hook contract oraz jakie ograniczenia nale\u017cy wzi\u0105\u0107 pod uwag\u0119.<\/p>\n<p>Szczeg\u00f3\u0142owe informacje na temat metod zadeklarowanych w interfejsach mo\u017cna znale\u017a\u0107 w powi\u0105zanych klasach Java.<\/p>\n<p>Informacje na temat infrastruktury hook\u00f3w mo\u017cna znale\u017a\u0107 w artykule\u00a0<a href=\"https:\/\/pomoc.comarch.pl\/cee\/index.php\/documentation\/hook-contracts\/\"><em>Hook Contracts<\/em><\/a>.<\/p>\n<h3 id=\"grupa-docelowa\" ><span class=\"ez-toc-section\" id=\"Grupa_docelowa\"><\/span>Grupa docelowa<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<ul>\n<li>Deweloperzy<\/li>\n<\/ul>\n<h3 id=\"opis\" ><span class=\"ez-toc-section\" id=\"Opis\"><\/span>Opis<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<article class=\"text-token-text-primary w-full\" dir=\"auto\" data-testid=\"conversation-turn-164\" data-scroll-anchor=\"false\">\n<div class=\"text-base my-auto mx-auto py-5 [--thread-content-margin:--spacing(4)] @[37rem]:[--thread-content-margin:--spacing(6)] @[72rem]:[--thread-content-margin:--spacing(16)] px-(--thread-content-margin)\">\n<div class=\"[--thread-content-max-width:32rem] @[34rem]:[--thread-content-max-width:40rem] @[64rem]:[--thread-content-max-width:48rem] mx-auto flex max-w-(--thread-content-max-width) flex-1 text-base gap-4 md:gap-5 lg:gap-6 group\/turn-messages focus-visible:outline-hidden\" tabindex=\"-1\">\n<div class=\"group\/conversation-turn relative flex w-full min-w-0 flex-col agent-turn\">\n<div class=\"relative flex-col gap-1 md:gap-3\">\n<div class=\"flex max-w-full flex-col grow\">\n<div class=\"min-h-8 text-message relative flex w-full flex-col items-end gap-2 text-start break-words whitespace-normal [.text-message+&amp;]:mt-5\" dir=\"auto\" data-message-author-role=\"assistant\" data-message-id=\"d4ec9888-ecd4-4968-8022-8e78a5a05bc5\" data-message-model-slug=\"gpt-4o\">\n<div class=\"flex w-full flex-col gap-1 empty:hidden first:pt-[3px]\">\n<div class=\"markdown prose dark:prose-invert w-full break-words light\">\n<p class=\"\" data-start=\"0\" data-end=\"342\">W pierwszym podrozdziale, na przyk\u0142adzie <em>Oferta sprzeda\u017cy \u2192 Zam\u00f3wienie sprzeda\u017cy\u00a0<\/em>opisano, w jaki spos\u00f3b za pomoc\u0105 implementacji hooka mo\u017cna rozszerzy\u0107 istniej\u0105c\u0105 konwersj\u0119 <em>Wyszukaj i dodaj pozycje<\/em> o kopiowanie w\u0142asnych atrybut\u00f3w. Opcjonalnie mo\u017cna r\u00f3wnie\u017c wprowadzi\u0107 ustawienia konwersji dla tych atrybut\u00f3w.<\/p>\n<p class=\"\" data-start=\"344\" data-end=\"482\">W kolejnym podrozdziale opisano, w jaki spos\u00f3b mo\u017cna doda\u0107 w\u0142asne \u017ar\u00f3d\u0142o lub w\u0142asn\u0105 konwersj\u0119 w aplikacji, kt\u00f3ra udost\u0119pnia odpowiedni hook.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/article>\n<h4 id=\"rozszerzanie-istniejacej-konwersji\" ><span class=\"ez-toc-section\" id=\"Rozszerzanie_istniejacej_konwersji\"><\/span>Rozszerzanie istniej\u0105cej konwersji<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p class=\"\" data-start=\"0\" data-end=\"215\">Wszystkie dost\u0119pne w standardzie konwersje <em>Wyszukaj i dodaj pozycje<\/em>\u00a0mog\u0105 zosta\u0107 rozszerzone za pomoc\u0105 implementacji hooka o kopiowanie w\u0142asnych atrybut\u00f3w.<\/p>\n<p class=\"\" data-start=\"217\" data-end=\"442\">Poni\u017csza tabela zawiera dla ka\u017cdego dokumentu docelowego odpowiedni hook contract oraz list\u0119 dokument\u00f3w \u017ar\u00f3d\u0142owych dost\u0119pnych w standardzie, dla kt\u00f3rych istnieje w\u0142asny interfejs hooka umo\u017cliwiaj\u0105cy rozszerzenie konwersji:<\/p>\n<p data-start=\"217\" data-end=\"442\"><strong>Zakup<\/strong><\/p>\n<table style=\"width: 100%; height: 394px;\">\n<thead>\n<tr style=\"height: 46px;\">\n<th style=\"height: 46px; border-style: outset;\"><strong>Dokument docelowy\u00a0<\/strong><\/th>\n<th style=\"height: 46px; border-style: outset;\"><strong>Hook Contract<\/strong><\/th>\n<th style=\"height: 46px; border-style: outset;\"><strong>Dokumenty \u017ar\u00f3d\u0142owe<\/strong><\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr style=\"height: 116px;\">\n<td style=\"height: 116px; border-style: outset;\">Zapytanie ofertowe zakupu<\/td>\n<td style=\"height: 116px; border-style: outset;\"><code>com.cisag.app.purchasing.request.ui.insertdetail.ConverterExtension<\/code><\/td>\n<td style=\"height: 116px; border-style: outset;\">Zapytanie ofertowe zakupu,<br \/>\nOferta zakupu, Zam\u00f3wienie zakupu, Oferta sprzeda\u017cy, Zam\u00f3wienie sprzeda\u017cy<\/td>\n<\/tr>\n<tr style=\"height: 116px;\">\n<td style=\"height: 116px; border-style: outset;\">Oferta zakupu<\/td>\n<td style=\"height: 116px; border-style: outset;\"><code>com.cisag.app.purchasing.proposal.ui.insertdetail.ConverterExtension<\/code><\/td>\n<td style=\"height: 116px; border-style: outset;\">Zapytanie ofertowe zakupu,<br \/>\nOferta zakupu, Zam\u00f3wienie zakupu, Oferta sprzeda\u017cy, Zam\u00f3wienie sprzeda\u017cy<\/td>\n<\/tr>\n<tr style=\"height: 116px;\">\n<td style=\"height: 116px; border-style: outset;\">Zam\u00f3wienie zakupu<\/td>\n<td style=\"height: 116px; border-style: outset;\"><code>com.cisag.app.purchasing.proposal.ui.insertdetail.ConverterExtension<\/code><\/td>\n<td style=\"height: 116px; border-style: outset;\">Zapytanie ofertowe zakupu,<br \/>\nOferta zakupu, Zam\u00f3wienie zakupu, Oferta sprzeda\u017cy, Zam\u00f3wienie sprzeda\u017cy<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>Sprzeda\u017c<\/strong><\/p>\n<table style=\"width: 107.347%; height: 533px;\">\n<thead>\n<tr style=\"height: 46px;\">\n<th style=\"height: 46px; width: 27.3836%; border-style: outset;\"><strong>Dokument docelowy\u00a0<\/strong><\/th>\n<th style=\"height: 46px; width: 54.6563%; border-style: outset;\"><strong>Hook Contract<\/strong><\/th>\n<th style=\"height: 46px; width: 16.8514%; border-style: outset;\"><strong>Dokumenty \u017ar\u00f3d\u0142owe\u00a0<\/strong><\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr style=\"height: 116px;\">\n<td style=\"height: 116px; width: 27.3836%; border-style: outset;\">Dokument szybkiego wprowadzania<\/td>\n<td style=\"height: 116px; width: 54.6563%; border-style: outset;\"><code>com.cisag.app.sales.rapid.ui.insertdetail.ConverterExtension<\/code><\/td>\n<td style=\"height: 116px; width: 16.8514%; border-style: outset;\">Dokumenty szybkiej rejestracji,<br \/>\nZapytanie ofertowe sprzeda\u017cy,<br \/>\nOferta sprzeda\u017cy, Zam\u00f3wienia sprzeda\u017cy,<br \/>\nFaktura sprzeda\u017cy<\/td>\n<\/tr>\n<tr style=\"height: 93px;\">\n<td style=\"height: 93px; width: 27.3836%; border-style: outset;\">Zapytanie ofertowe sprzeda\u017cy<\/td>\n<td style=\"height: 93px; width: 54.6563%; border-style: outset;\"><code>com.cisag.app.sales.request.ui.insertdetail.ConverterExtension<\/code><\/td>\n<td style=\"height: 93px; width: 16.8514%; border-style: outset;\">Dokumenty szybkiej rejestracji,<br \/>\nZapytanie ofertowe sprzeda\u017cy,<br \/>\nOferta sprzeda\u017cy, Zam\u00f3wienia sprzeda\u017cy<\/td>\n<\/tr>\n<tr style=\"height: 116px;\">\n<td style=\"height: 116px; width: 27.3836%; border-style: outset;\">Oferta sprzeda\u017cy<\/td>\n<td style=\"height: 116px; width: 54.6563%; border-style: outset;\"><code>com.cisag.app.sales.proposal.ui.insertdetail.ConverterExtension<\/code><\/td>\n<td style=\"height: 116px; width: 16.8514%; border-style: outset;\">Dokumenty szybkiej rejestracji,<br \/>\nZapytanie ofertowe sprzeda\u017cy,<br \/>\nOferta sprzeda\u017cy, Zam\u00f3wienia sprzeda\u017cy,<br \/>\nFaktura sprzeda\u017cy<\/td>\n<\/tr>\n<tr style=\"height: 116px;\">\n<td style=\"height: 116px; width: 27.3836%; border-style: outset;\">Zam\u00f3wienia sprzeda\u017cy<\/td>\n<td style=\"height: 116px; width: 54.6563%; border-style: outset;\"><code>com.cisag.app.sales.order.ui.insertdetail.ConverterExtension<\/code><\/td>\n<td style=\"height: 116px; width: 16.8514%; border-style: outset;\">Dokumenty szybkiej rejestracji,<br \/>\nZapytanie ofertowe sprzeda\u017cy,<br \/>\nOferta sprzeda\u017cy, Zam\u00f3wienia sprzeda\u017cy,<br \/>\nFaktura sprzeda\u017cy<\/td>\n<\/tr>\n<tr style=\"height: 46px;\">\n<td style=\"height: 46px; width: 27.3836%; border-style: outset;\">Zlecenie dystrybucji<\/td>\n<td style=\"height: 46px; width: 54.6563%; border-style: outset;\"><code>com.cisag.app.multiorg.order.ui.insertdetail.ConverterExtension<\/code><\/td>\n<td style=\"height: 46px; width: 16.8514%; border-style: outset;\">Zlecenie dystrybucji, Faktura sprzeda\u017cy<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"\" data-start=\"0\" data-end=\"104\">Konkretne rozszerzenie zostanie wyja\u015bnione na przyk\u0142adzie <em>Oferta sprzeda\u017cy \u2192 Zam\u00f3wienie sprzeda\u017cy<\/em>.<\/p>\n<p class=\"\" data-start=\"106\" data-end=\"238\">Prosta implementacja hooka do bezwarunkowego, dodatkowego kopiowania atrybutu <em>ado_orders_partner<\/em> mog\u0142aby wygl\u0105da\u0107 nast\u0119puj\u0105co:<\/p>\n<p><strong>XML:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"xml\">&lt;?xml version=\u201d1.0\u2033 encoding=\u201dUTF-16\u2033?&gt;\n&lt;HookContract xmlns:xsi=\u201dhttp:\/\/www.w3.org\/2001\/XMLSchema-instance\u201d xsi:noNamespaceSchemaLocation=\u201dHookXMLSchema.xsd\u201d&gt;\n\n&lt;!\u2013 Don\u2019t change this line and the lines above! \u2013&gt;\n\n&lt;HOOK_IMPLEMENTATION&gt;\n\n&lt;contract&gt;com.cisag.app.sales.order.ui.insertdetail.ConverterExtension&lt;\/contract&gt;\n&lt;!\u2013 extension: sales proposal detail ==&gt; sales order detail  \u2013&gt;\n\n&lt;hook&gt;\n\n&lt;interface&gt;com.cisag.app.sales.order.ui.insertdetail.hook.SalesProposalConverterExtensionHook&lt;\/interface&gt;\n&lt;implementation&gt;com.ado.ext.app.orders.sales.order.ui.insertdetail.SalesProposalConverterExtensionHookImpl&lt;\/implementation&gt;\n&lt;\/hook&gt;\n\n&lt;\/HOOK_IMPLEMENTATION&gt;\n&lt;\/HookContract&gt;<\/pre>\n<p><strong>Java:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"java\">\u2026\n\n\/** \u2026 *\/\n\npublic class SalesProposalConverterExtensionHookImpl implements SalesProposalConverterExtensionHook {\n\n\u00a0\u00a0\u00a0 \/** {@inheritDoc} *\/\n\n@Override\n\npublic void convertSalesProposalDetail(CustomerProposalDetailView srcDetailView,\n\nSalesProposalConverterExtensionHook.Context detailConversionContext,\n\nTargetSource&lt;SalesOrderDetailView&gt; trgSource) {\n\ntrgSource.setValue(SalesOrderDetailView.Attribute.$ado_orders_partner,\n\nsrcDetailView.getAdo_orders_partner());\n\n}\n\n}\n\nW razie potrzeby setValue mo\u017ce by\u0107 warunkowane przy u\u017cyciu danych \u017ar\u00f3d\u0142owych lub kontekstu dokumentu docelowego.\nJe\u015bli niestandardowe ustawienia maj\u0105 by\u0107 r\u00f3wnie\u017c obs\u0142ugiwane, wymagane jest dalsze kodowanie - np:\n\n\u2026\n\n\/** \u2026 *\/\n\npublic class SalesProposalConverterExtensionHookImpl \u2026 {\n\n\u2026\n\n\u00a0\u00a0\u00a0 \/** {@inheritDoc} *\/\n\n@Override\n\npublic ConverterPropertiesExtensionImpl createConverterPropertiesExtension() {\n\nreturn new ConverterPropertiesExtensionImpl();\n\n}\n\n\n\n\nprivate static class ConverterPropertiesExtensionImpl implements\n\nConverterPropertiesExtension&lt;SalesOrderView&gt; {\n\nprivate static final String MSG_PATH = ConverterPropertiesExtensionImpl.class.getName();\n\n\n\n\nprivate static final int MSG_ONE = 1;\n\nprivate static final int MSG_TWO = 2;\n\n\n\n\nprivate final TextField fieldOne = new TextField(Guid.AUTOGUID, \u2026);\n\nprivate final TextField fieldTwo = new TextField(Guid.AUTOGUID, \u2026);\n\n\n\n\nprivate ConverterPropertiesExtensionImpl() {\n\nfieldOne.registerMessage(MSG_PATH, MSG_ONE);\n\nfieldTwo.registerMessage(MSG_PATH, MSG_TWO);\n\n}\n\n\n\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/** {@inheritDoc} *\/\n\n@Override\n\npublic List&lt;VisualElement&gt; getVisualElements() {\n\nreturn Arrays.&lt;VisualElement&gt; asList(fieldOne, fieldTwo);\n\n}\n\n\n\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/** {@inheritDoc} *\/\n\n@Override\n\npublic void init(SalesOrderView header) {\n\nfieldOne.setValue(\u2026);\n\nfieldTwo.setValue(\u2026);\n\n}\n\n\n\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/** {@inheritDoc} *\/\n\n@Override\n\npublic void validate() {\n\nCisMessageManager mm = CisEnvironment.getInstance().getMessageManager();\n\nmm.pushProgramMessagePath(MSG_PATH);\n\ntry {\n\nif (fieldOne.getValue().trim().isEmpty()) {\n\nmm.setProgramMessageId(MSG_ONE);\n\nmm.sendMessage(\u2026);\n\n}\n\nif (fieldTwo.getValue().trim().isEmpty()) {\n\nmm.setProgramMessageId(MSG_TWO);\n\nmm.sendMessage(\u2026);\n\n}\n\n} finally {\n\nmm.popProgramMessagePath();\n\n}\n\n}\n\n\n\n\n}\n\n\u2026\n\n}<\/pre>\n<section class=\"document-alert-box warning\"><div class=\"document-alert-title\">Uwaga<\/div><div class=\"document-alert-content\">W szczeg\u00f3lno\u015bci wzorzec obs\u0142ugi komunikat\u00f3w ze \u015bcie\u017ck\u0105 komunikatu powinien by\u0107 u\u017cywany jako wzorzec.<\/div><\/section>\n<p>Je\u015bli istniej\u0105 wi\u0119cej ni\u017c cztery ustawienia konwersji, automatycznie u\u017cywana jest p\u00f3\u0142ka (shelf) dla ustawie\u0144 konwersji.<\/p>\n<p>Istniej\u0105ce standardowe atrybuty nie mog\u0105 by\u0107 kopiowane przy u\u017cyciu hooka <em>ConverterExtension<\/em>; nie mog\u0105 one r\u00f3wnie\u017c wp\u0142ywa\u0107 na zachowanie kopiowania w standardzie &#8211; w razie potrzeby nale\u017cy u\u017cy\u0107 w\u0142asnej implementacji hook konwertera i przypisa\u0107 unikaln\u0105 nazw\u0119 w celu ich rozr\u00f3\u017cnienia.<\/p>\n<h4 id=\"dokument-zrodlowy-i-hook-do-konwersji\" ><span class=\"ez-toc-section\" id=\"Dokument_zrodlowy_i_hook_do_konwersji\"><\/span>Dokument \u017ar\u00f3d\u0142owy i hook do konwersji<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<h5 id=\"dokument-zrodlowy\" ><span class=\"ez-toc-section\" id=\"Dokument_zrodlowy\"><\/span>Dokument \u017ar\u00f3d\u0142owy<span class=\"ez-toc-section-end\"><\/span><\/h5>\n<p>Funkcja <em>Wyszukaj i dodaj pozycje<\/em> opiera si\u0119 przede wszystkim na udost\u0119pnieniu jednego lub kilku \u017ar\u00f3de\u0142, kt\u00f3re spe\u0142niaj\u0105 interfejs <em>Source <\/em>w przestrzeni nazw <em>com.cisag.app.general.order.ui.insertdetail.hook.<\/em><br \/>\nOpcjonalnie \u017ar\u00f3d\u0142o mo\u017ce dostarcza\u0107 ustawienia wyboru za po\u015brednictwem <em>SourcePropertiesRetriever<\/em> (np. <em>Kopiuj ceny<\/em> ogranicza wyb\u00f3r zgodnie z walut\u0105 w dokumencie docelowym) &#8211; s\u0105 one nast\u0119pnie dost\u0119pne w menu <em>Wykonaj<\/em> wyszukiwania.<br \/>\nOpcjonalnie mo\u017cna zapewni\u0107 dzia\u0142ania w celu wst\u0119pnego przypisania p\u00f3l wyszukiwania za po\u015brednictwem <em>SourceActionsRetriever<\/em> (np. szablon zam\u00f3wienia w zam\u00f3wieniu sprzeda\u017cy).<br \/>\nStandardowo dost\u0119pne s\u0105 nast\u0119puj\u0105ce implementacje \u017ar\u00f3de\u0142:<br \/>\n<strong>Zakup:<\/strong><\/p>\n<table style=\"width: 106.276%; height: 278px;\">\n<thead>\n<tr style=\"height: 46px;\">\n<th style=\"height: 46px; border-style: outset;\"><strong>Dokument \u017ar\u00f3d\u0142owy\u00a0<\/strong><\/th>\n<th style=\"height: 46px; border-style: outset;\"><strong>Implementacja \u017ar\u00f3d\u0142a<\/strong><\/th>\n<th style=\"height: 46px; border-style: outset;\"><strong>Uwagi<\/strong><\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr style=\"height: 46px;\">\n<td style=\"height: 46px; border-style: outset;\">Zapytanie ofertowe zakupu<\/td>\n<td style=\"height: 46px; border-style: outset;\"><code>com.cisag.app.purchasing.request.ui.insertdetail.PurchaseRequestSource<\/code><\/td>\n<td style=\"height: 46px; border-style: outset;\">&#8211;<\/td>\n<\/tr>\n<tr style=\"height: 93px;\">\n<td style=\"height: 93px; border-style: outset;\">Oferta zakupu<\/td>\n<td style=\"height: 93px; border-style: outset;\"><code>com.cisag.app.purchasing.proposal.ui.insertdetail.PurchaseProposalSource<\/code><\/td>\n<td style=\"height: 93px; border-style: outset;\">Przyk\u0142ad ustawienia <em>Kopiuj ceny<\/em><\/td>\n<\/tr>\n<tr style=\"height: 93px;\">\n<td style=\"height: 93px; border-style: outset;\">Zam\u00f3wienie zakupu<\/td>\n<td style=\"height: 93px; border-style: outset;\"><code>com.cisag.app.purchasing.order.ui.insertdetail.PurchaseOrderSource<\/code><\/td>\n<td style=\"height: 93px; border-style: outset;\">Przyk\u0142ad ustawienia <em>Kopiuj ceny<\/em> oraz akcji<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>Sprzeda\u017c:<\/strong><\/p>\n<table style=\"width: 100%; height: 442px;\">\n<thead>\n<tr style=\"height: 46px;\">\n<th style=\"border-style: outset; height: 46px;\"><strong>Dokument \u017ar\u00f3d\u0142owy\u00a0<\/strong><\/th>\n<th style=\"border-style: outset; height: 46px;\"><strong>Implementacja \u017ar\u00f3d\u0142a<\/strong><\/th>\n<th style=\"border-style: outset; height: 46px;\"><strong>Uwagi<\/strong><\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr style=\"height: 70px;\">\n<td style=\"border-style: outset; height: 70px;\"><strong>Dokument szybkiego wprowadzania\u00a0<\/strong><\/td>\n<td style=\"border-style: outset; height: 70px;\"><code>com.cisag.app.sales.rapid.ui.insertdetail.SalesRapidSource<\/code><\/td>\n<td style=\"border-style: outset; height: 70px;\">Przyk\u0142ad ustawienia <em>Kopiuj ceny<\/em><\/td>\n<\/tr>\n<tr style=\"height: 70px;\">\n<td style=\"border-style: outset; height: 70px;\"><strong>Zapytanie ofertowe sprzeda\u017cy<\/strong><\/td>\n<td style=\"border-style: outset; height: 70px;\"><code>com.cisag.app.sales.request.ui.insertdetail.SalesRequestSource<\/code><\/td>\n<td style=\"border-style: outset; height: 70px;\">&#8211;<\/td>\n<\/tr>\n<tr style=\"height: 70px;\">\n<td style=\"border-style: outset; height: 70px;\"><strong>Oferta sprzeda\u017cy\u00a0<\/strong><\/td>\n<td style=\"border-style: outset; height: 70px;\"><code>com.cisag.app.sales.proposal.ui.insertdetail.SalesProposalSource<\/code><\/td>\n<td style=\"border-style: outset; height: 70px;\">Przyk\u0142ad ustawienia <em>Kopiuj ceny<\/em><\/td>\n<\/tr>\n<tr style=\"height: 93px;\">\n<td style=\"border-style: outset; height: 93px;\"><strong>Zam\u00f3wienie sprzeda\u017cy<\/strong><\/td>\n<td style=\"border-style: outset; height: 93px;\"><code>com.cisag.app.sales.order.ui.insertdetail.SalesOrderSource<\/code><\/td>\n<td style=\"border-style: outset; height: 93px;\">Przyk\u0142ad ustawienia <em>Kopiuj ceny<\/em> oraz akcji<\/td>\n<\/tr>\n<tr style=\"height: 93px;\">\n<td style=\"border-style: outset; height: 93px;\"><strong>Zlecenie dystrybucji<\/strong><\/td>\n<td style=\"border-style: outset; height: 93px;\"><code>com.cisag.app.multiorg.order.ui.insertdetail.DistributionOrderSource<\/code><\/td>\n<td style=\"border-style: outset; height: 93px;\">Przyk\u0142ad ustawienia <em>Kopiuj ceny<\/em> oraz akcji<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h5 id=\"hook-do-konwersji\" ><span class=\"ez-toc-section\" id=\"Hook_do_konwersji\"><\/span>Hook do konwersji<span class=\"ez-toc-section-end\"><\/span><\/h5>\n<p class=\"\" data-start=\"0\" data-end=\"165\">Ka\u017cda z opisanych tutaj standardowych aplikacji dokument\u00f3w udost\u0119pnia kontrakt hooka, kt\u00f3ry zawiera dwa nast\u0119puj\u0105ce interfejsy hooka:<\/p>\n<ul data-start=\"167\" data-end=\"316\">\n<li class=\"\" data-start=\"167\" data-end=\"233\">\n<p class=\"\" data-start=\"169\" data-end=\"233\"><strong data-start=\"169\" data-end=\"231\">cisag.app.general.order.ui.insertdetail.hook.ConverterHook<\/strong><\/p>\n<\/li>\n<li class=\"\" data-start=\"234\" data-end=\"316\">\n<p class=\"\" data-start=\"236\" data-end=\"316\"><strong data-start=\"236\" data-end=\"314\">cisag.app.general.order.ui.insertdetail.hook.ConverterSupportIndicatorHook<\/strong><\/p>\n<\/li>\n<\/ul>\n<p class=\"\" data-start=\"318\" data-end=\"401\">Poni\u017csza tabela zawiera dla ka\u017cdego dokumentu docelowego odpowiedni hook kontrakt:<\/p>\n<p><strong>Zakup<\/strong><\/p>\n<table>\n<thead>\n<tr>\n<th style=\"border-style: outset;\"><strong>Dokument docelowy\u00a0<\/strong><\/th>\n<th style=\"border-style: outset;\"><strong>Hook Contract<\/strong><\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"border-style: outset;\">Zapytanie ofertowe zakupu<\/td>\n<td style=\"border-style: outset;\"><code>com.cisag.app.purchasing.request.ui.insertdetail.Converter<\/code><\/td>\n<\/tr>\n<tr>\n<td style=\"border-style: outset;\">Oferta zakupu<\/td>\n<td style=\"border-style: outset;\"><code>com.cisag.app.purchasing.proposal.ui.insertdetail.Converter<\/code><\/td>\n<\/tr>\n<tr>\n<td style=\"border-style: outset;\">Zam\u00f3wienie zakupu<\/td>\n<td style=\"border-style: outset;\"><code>com.cisag.app.purchasing.proposal.ui.insertdetail.Converter<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>Sprzeda\u017c<\/strong><\/p>\n<table style=\"width: 100%; height: 161px;\">\n<thead>\n<tr style=\"height: 23px;\">\n<th style=\"height: 23px; border-style: outset;\"><strong>Dokument docelowy<\/strong><\/th>\n<th style=\"height: 23px; border-style: outset;\"><strong>Hook Contract<\/strong><\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr style=\"height: 46px;\">\n<td style=\"height: 46px; border-style: outset;\">Dokument szybkiego wprowadzania<\/td>\n<td style=\"height: 46px; border-style: outset;\"><code>com.cisag.app.sales.rapid.ui.insertdetail.Converter<\/code><\/td>\n<\/tr>\n<tr style=\"height: 23px;\">\n<td style=\"height: 23px; border-style: outset;\">Zapytanie ofertowe sprzeda\u017cy<\/td>\n<td style=\"height: 23px; border-style: outset;\"><code>com.cisag.app.sales.request.ui.insertdetail.Converter<\/code><\/td>\n<\/tr>\n<tr style=\"height: 23px;\">\n<td style=\"height: 23px; border-style: outset;\">Oferta sprzeda\u017cy<\/td>\n<td style=\"height: 23px; border-style: outset;\"><code>com.cisag.app.sales.proposal.ui.insertdetail.Converter<\/code><\/td>\n<\/tr>\n<tr style=\"height: 23px;\">\n<td style=\"height: 23px; border-style: outset;\">Zam\u00f3wienie sprzeda\u017cy<\/td>\n<td style=\"height: 23px; border-style: outset;\"><code>com.cisag.app.sales.order.ui.insertdetail.Converter<\/code><\/td>\n<\/tr>\n<tr style=\"height: 23px;\">\n<td style=\"height: 23px; border-style: outset;\">Zlecenie dystrybucji<\/td>\n<td style=\"height: 23px; border-style: outset;\"><code>com.cisag.app.multiorg.order.ui.insertdetail.Converter<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"\" data-start=\"0\" data-end=\"287\">W standardzie dla ka\u017cdego hook contract istnieje dok\u0142adnie jedna implementacja hook contract, kt\u00f3ra zawiera implementacj\u0119 <em>ConverterHook <\/em>dla wszystkich obs\u0142ugiwanych dokument\u00f3w \u017ar\u00f3d\u0142owych (np. dla zam\u00f3wienia sprzeda\u017cy: <em>com.cisag.app.sales.order.ui.insertdetail.ConverterImpl).<\/em><\/p>\n<p class=\"\" data-start=\"289\" data-end=\"368\">Zazwyczaj sama implementacja interfejsu <em>ConverterHook <\/em>jest wystarczaj\u0105ca.<\/p>\n<p class=\"\" data-start=\"370\" data-end=\"584\"><em>ConverterSupportIndicatorHook <\/em>mo\u017ce by\u0107 opcjonalnie u\u017cyty do wykluczenia \u017ar\u00f3d\u0142a w dokumencie docelowym w okre\u015blonych warunkach \u2013 przyk\u0142adem mo\u017ce by\u0107 implementacja dla zlecenia dystrybucji.<\/p>\n<p class=\"\" data-start=\"586\" data-end=\"690\">Implementacje standardowe mog\u0105 s\u0142u\u017cy\u0107 jako wz\u00f3r do tworzenia w\u0142asnych implementacji ConverterHook.<\/p>\n<p class=\"\" data-start=\"692\" data-end=\"802\"><section class=\"document-alert-box warning\"><div class=\"document-alert-title\">Uwaga<\/div><div class=\"document-alert-content\">Poniewa\u017c zazwyczaj w\u0142asny hook nie wymaga ConverterExtension, kod mo\u017cna odpowiednio upro\u015bci\u0107.<\/div><\/section><\/p>\n","protected":false},"author":28,"comment_status":"closed","ping_status":"closed","template":"","format":"standard","meta":{"footnotes":""},"class_list":["post-9763","ht_kb","type-ht_kb","status-publish","format-standard","hentry","ht_kb_category-definicje-hook-contract"],"_links":{"self":[{"href":"https:\/\/pomoc.comarch.pl\/cee\/index.php\/wp-json\/wp\/v2\/ht_kb\/9763","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pomoc.comarch.pl\/cee\/index.php\/wp-json\/wp\/v2\/ht_kb"}],"about":[{"href":"https:\/\/pomoc.comarch.pl\/cee\/index.php\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/pomoc.comarch.pl\/cee\/index.php\/wp-json\/wp\/v2\/users\/28"}],"replies":[{"embeddable":true,"href":"https:\/\/pomoc.comarch.pl\/cee\/index.php\/wp-json\/wp\/v2\/comments?post=9763"}],"version-history":[{"count":5,"href":"https:\/\/pomoc.comarch.pl\/cee\/index.php\/wp-json\/wp\/v2\/ht_kb\/9763\/revisions"}],"predecessor-version":[{"id":30713,"href":"https:\/\/pomoc.comarch.pl\/cee\/index.php\/wp-json\/wp\/v2\/ht_kb\/9763\/revisions\/30713"}],"wp:attachment":[{"href":"https:\/\/pomoc.comarch.pl\/cee\/index.php\/wp-json\/wp\/v2\/media?parent=9763"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}