Skip to content

Commit 85c21ca

Browse files
committed
Updated handler
1 parent 4ff8636 commit 85c21ca

12 files changed

Lines changed: 1413 additions & 33 deletions

File tree

modules/os2forms_fordelingskomponent_examples/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,10 @@ Test the newly exported config by reinstalling the `os2forms_fordelingskomponent
2626
drush pm:uninstall os2forms_fordelingskomponent_examples
2727
drush pm:install os2forms_fordelingskomponent_examples
2828
```
29+
30+
Alternatively, import a single webform, e.g.
31+
32+
``` shell
33+
drush config:set --input-format=yaml webform.webform.os2_fdk_kp_anmoding '?' - < config/install/webform.webform.os2_fdk_kp_anmoding.yml
34+
# drush config:get webform.webform.os2_fdk_kp_anmoding
35+
```

modules/os2forms_fordelingskomponent_examples/config/install/webform.webform.os2_fdk_kp_anmoding.yml

Lines changed: 158 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -266,14 +266,14 @@ handlers:
266266
sf2900:
267267
kle_emne: 01.01.01
268268
handling_facet: G87
269-
attachment_element: afsend_content_pdf
269+
attachment_element: attachment
270270
brugervendt_noegle: "What is “Brugervendt nøgle”?"
271271
titel: "Your document"
272272
beskrivelse: "This is a very important document"
273273

274-
distribution_type: DISTRIBUTION_DOKUMENT_TYPE
275-
# DISTRIBUTION_JOURNAL_POST_TYPE
276-
# DISTRIBUTION_FORMULAR_TYPE
274+
# distribution_type: JOURNALPOST
275+
# distribution_type: DOKUMENT
276+
distribution_type: FORMULAR
277277

278278
xml_template: |
279279
<?xml version="1.0" encoding="UTF-8"?>
@@ -299,16 +299,151 @@ handlers:
299299
</Underskriftsoplysninger>
300300
</Anmodning>
301301
302-
xsd_url: module://os2forms_fordelingskomponent_examples/resources/xsd/Anmodning.xsd
302+
xsd_url: module://os2forms_fordelingskomponent_examples/resources/SP/SF2900_XSD/Anmodning.xsd
303+
304+
os2forms_fordelingskomponent_sf2900_malformed_xml:
305+
id: os2forms_fordelingskomponent_sf2900
306+
handler_id: os2forms_fordelingskomponent_sf2900_malformed_xml
307+
label: "Fordelingskomponent (sf2900) (malformed XML)"
308+
notes: ""
309+
status: true
310+
conditions: {}
311+
weight: 0
312+
settings:
313+
sf2900:
314+
kle_emne: 01.01.01
315+
handling_facet: G87
316+
attachment_element: attachment
317+
brugervendt_noegle: "What is “Brugervendt nøgle”?"
318+
titel: "Your document"
319+
beskrivelse: "This is a very important document"
320+
321+
# distribution_type: JOURNALPOST
322+
# distribution_type: DOKUMENT
323+
distribution_type: FORMULAR
324+
325+
xml_template: |
326+
<?xml version="1.0" encoding="UTF-8"?>
327+
<Anmodning xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
328+
<Header>
329+
<Myndighed>urn:oio:cvr-nr:{{ handler.settings.sf2900.cvr|default(module.settings.sf2900.sender_id|default("")) }}</Myndighed>
330+
<ModtagetDato>{{ submission.completed.value|date("Y-m-d") }}</ModtagetDato>
331+
<KLE>{{ handler.settings.sf2900.kle_emne }}</KLE>
332+
<AnsoegerOplysninger>
333+
<Ansoeger>
334+
<Fornavn>{{ submission.data.fornavn }}</Fornavn>
335+
<Efternavn>{{ submission.data.efternavn }}</Efternavn>
336+
<Personnummer>urn:oio:cpr:0000000000</Personnummer>
337+
</Ansoeger>
338+
</AnsoegerOplysninger>
339+
<Sagstype>
340+
<AlmindeligtHelbredstillaeg>Medicin</AlmindeligtHelbredstillaeg>
341+
</Sagstype>
342+
<Underskriftsoplysninger>
343+
<Underskrift>Underskrift0</Underskrift>
344+
<Underskriftsdato>{{ submission.completed.value|date("Y-m-d") }}</Underskriftsdato>
345+
</Underskriftsoplysninger>
346+
</Anmodning>
347+
348+
xsd_url: module://os2forms_fordelingskomponent_examples/resources/SP/SF2900_XSD/Anmodning.xsd
349+
350+
os2forms_fordelingskomponent_sf2900_invalid_twig:
351+
id: os2forms_fordelingskomponent_sf2900
352+
handler_id: os2forms_fordelingskomponent_sf2900_invalid_twig
353+
label: "Fordelingskomponent (sf2900) (invalid Twig)"
354+
notes: ""
355+
status: true
356+
conditions: {}
357+
weight: 0
358+
settings:
359+
sf2900:
360+
kle_emne: 01.01.01
361+
handling_facet: G87
362+
attachment_element: attachment
363+
brugervendt_noegle: "What is “Brugervendt nøgle”?"
364+
titel: "Your document"
365+
beskrivelse: "This is a very important document"
366+
367+
# distribution_type: JOURNALPOST
368+
# distribution_type: DOKUMENT
369+
distribution_type: FORMULAR
370+
371+
xml_template: |
372+
<?xml version="1.0" encoding="UTF-8"?>
373+
<Anmodning xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
374+
<Header>
375+
<Myndighed>urn:oio:cvr-nr:{{ handler.settings.sf2900.cvr|default(module.settings.sf2900.sender_id|default("")) }}</Myndighed>
376+
<ModtagetDato>{{ submission.completed.value|date("Y-m-d") }}</ModtagetDato>
377+
<KLE>{{ handler.settings.sf2900.kle_emne </KLE>
378+
</Header>
379+
<AnsoegerOplysninger>
380+
<Ansoeger>
381+
<Fornavn>{{ submission.data.fornavn }}</Fornavn>
382+
<Efternavn>{{ submission.data.efternavn }}</Efternavn>
383+
<Personnummer>urn:oio:cpr:0000000000</Personnummer>
384+
</Ansoeger>
385+
</AnsoegerOplysninger>
386+
<Sagstype>
387+
<AlmindeligtHelbredstillaeg>Medicin</AlmindeligtHelbredstillaeg>
388+
</Sagstype>
389+
<Underskriftsoplysninger>
390+
<Underskrift>Underskrift0</Underskrift>
391+
<Underskriftsdato>{{ submission.completed.value|date("Y-m-d") }}</Underskriftsdato>
392+
</Underskriftsoplysninger>
393+
</Anmodning>
394+
395+
xsd_url: module://os2forms_fordelingskomponent_examples/resources/SP/SF2900_XSD/Anmodning.xsd
396+
397+
os2forms_fordelingskomponent_sf2900_invalid_xml:
398+
id: os2forms_fordelingskomponent_sf2900
399+
handler_id: os2forms_fordelingskomponent_sf2900_invalid_xml
400+
label: "Fordelingskomponent (sf2900) (invalid XML)"
401+
notes: ""
402+
status: true
403+
conditions: {}
404+
weight: 0
405+
settings:
406+
sf2900:
407+
kle_emne: 01.01.01
408+
handling_facet: G87
409+
attachment_element: attachment
410+
brugervendt_noegle: "What is “Brugervendt nøgle”?"
411+
titel: "Your document"
412+
beskrivelse: "This is a very important document"
413+
414+
# distribution_type: JOURNALPOST
415+
# distribution_type: DOKUMENT
416+
distribution_type: FORMULAR
417+
418+
xml_template: |
419+
<?xml version="1.0" encoding="UTF-8"?>
420+
<Anmodning xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
421+
<Header>
422+
<Myndighed>urn:oio:cvr-nr:{{ handler.settings.sf2900.cvr|default(module.settings.sf2900.sender_id|default("")) }}</Myndighed>
423+
<ModtagetDato>{{ submission.completed.value|date("Y-m-d") }}</ModtagetDato>
424+
<KLE>{{ handler.settings.sf2900.kle_emne }}</KLE>
425+
</Header>
426+
<AnsoegerOplysninger>
427+
<Ansoeger>
428+
<Fornavn>{{ submission.data.fornavn }}</Fornavn>
429+
<Efternavn>{{ submission.data.efternavn }}</Efternavn>
430+
<Personnummer>urn:oio:cpr:0000000000</Personnummer>
431+
</Ansoeger>
432+
</AnsoegerOplysninger>
433+
<Sagstype>
434+
<AlmindeligtHelbredstillaeg>Medicin</AlmindeligtHelbredstillaeg>
435+
</Sagstype>
436+
<Underskriftsoplysninger>
437+
<Underskrift>Underskrift0</Underskrift>
438+
<Underskriftsdato>{{ submission.completed.value|date("Y-m-d") }}</Underskriftsdato>
439+
</Underskriftsoplysninger>
440+
</Anmodning>
441+
442+
xsd_url: module://os2forms_fordelingskomponent_examples/resources/SP/SF2900_XSD/SP501.xsd
303443

304444
variants: {}
305445

306446
elements: |-
307-
afsend_content_pdf:
308-
'#type': 'entity_print_attachment:pdf'
309-
'#title': 'Fordelingskomponent (PDF)'
310-
'#display_on': view
311-
'#filename': hat-og-briller.pdf
312447
ansoeger_oplysninger:
313448
'#type': fieldset
314449
'#title': AnsoegerOplysninger
@@ -344,3 +479,16 @@ elements: |-
344479
Kiropraktik: Kiropraktik
345480
Psykologhjaelp: Psykologhjaelp
346481
Hoereappartbehandling: Hoereapparatbehandling
482+
afsend_content_pdf:
483+
'#type': 'entity_print_attachment:pdf'
484+
'#title': 'Fordelingskomponent (PDF) hest'
485+
'#display_on': view
486+
'#filename': hat-og-briller.pdf
487+
attachment:
488+
'#type': os2forms_attachment
489+
'#title': attachment
490+
'#export_type': pdf
491+
'#digital_signature': 0
492+
'#excluded_elements': { }
493+
'#exclude_empty': 0
494+
'#exclude_empty_checkbox': 0

modules/os2forms_fordelingskomponent_examples/resources/xsd/Anmodning.xsd renamed to modules/os2forms_fordelingskomponent_examples/resources/SP/SF2900_XSD/Anmodning.xsd

File renamed without changes.
Lines changed: 180 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,180 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!-- edited with XMLSpy v2012 rel. 2 (x64) (http://www.altova.com) by Christian Hundborg Liboriussen (Netcompany A/S) -->
3+
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:altova="http://www.altova.com/xml-schema-extensions" elementFormDefault="qualified" attributeFormDefault="unqualified">
4+
<xs:element name="SP241">
5+
<xs:annotation>
6+
<xs:documentation>Ansoegning om helbredstillaeg</xs:documentation>
7+
</xs:annotation>
8+
<xs:complexType>
9+
<xs:sequence>
10+
<xs:element name="Header">
11+
<xs:complexType>
12+
<xs:sequence>
13+
<xs:element name="Myndighed" type="myndighedstype"/>
14+
<xs:element name="ModtagetDato" type="xs:date"/>
15+
<xs:element name="KLE" type="max_laengde_strings_200"/>
16+
<xs:element name="Dokumenter" minOccurs="0" maxOccurs="30">
17+
<xs:complexType>
18+
<xs:sequence>
19+
<xs:element name="Dokumentnavn" type="max_laengde_strings_200"/>
20+
<xs:element name="Dokumenttype" type="dokumenttype">
21+
<xs:annotation>
22+
<xs:documentation>- Overslag
23+
- Faktura
24+
- Bilag
25+
</xs:documentation>
26+
</xs:annotation>
27+
</xs:element>
28+
</xs:sequence>
29+
</xs:complexType>
30+
</xs:element>
31+
</xs:sequence>
32+
</xs:complexType>
33+
</xs:element>
34+
<xs:element name="AnsoegerOplysninger">
35+
<xs:complexType>
36+
<xs:choice>
37+
<xs:element name="Ansoeger">
38+
<xs:annotation>
39+
<xs:documentation>Ved ansoegning med login</xs:documentation>
40+
</xs:annotation>
41+
<xs:complexType>
42+
<xs:sequence>
43+
<xs:element name="Fornavn" type="max_laengde_strings_200"/>
44+
<xs:element name="Mellemnavn" type="max_laengde_strings_200" minOccurs="0"/>
45+
<xs:element name="Efternavn" type="max_laengde_strings_200"/>
46+
<xs:element name="Personnummer" type="personnummer"/>
47+
<xs:element name="Telefonnummer" type="telefonnummer" minOccurs="0"/>
48+
</xs:sequence>
49+
</xs:complexType>
50+
</xs:element>
51+
<xs:element name="AnsoegningUdenLogin">
52+
<xs:annotation>
53+
<xs:documentation>Ved ansoegning uden login</xs:documentation>
54+
</xs:annotation>
55+
<xs:complexType>
56+
<xs:sequence>
57+
<xs:element name="Fornavn" type="max_laengde_strings_200" minOccurs="0"/>
58+
<xs:element name="Mellemnavn" type="max_laengde_strings_200" minOccurs="0"/>
59+
<xs:element name="Efternavn" type="max_laengde_strings_200" minOccurs="0"/>
60+
<xs:element name="Personnummer" type="personnummer" minOccurs="0"/>
61+
<xs:element name="Telefonnummer" type="telefonnummer" minOccurs="0"/>
62+
</xs:sequence>
63+
</xs:complexType>
64+
</xs:element>
65+
</xs:choice>
66+
</xs:complexType>
67+
</xs:element>
68+
<xs:element name="Sygeforsikring" minOccurs="0">
69+
<xs:annotation>
70+
<xs:documentation>Medlem af Sygeforsikringen »danmark«</xs:documentation>
71+
</xs:annotation>
72+
<xs:complexType>
73+
<xs:sequence>
74+
<xs:element name="Gruppe">
75+
<xs:annotation>
76+
<xs:documentation>- Gruppe 1
77+
- Gruppe 2
78+
- Gruppe 5
79+
- Gruppe E
80+
- Gruppe N
81+
- Gruppe S
82+
- Gruppe Basis</xs:documentation>
83+
</xs:annotation>
84+
<xs:simpleType>
85+
<xs:restriction base="sygesikringstype"/>
86+
</xs:simpleType>
87+
</xs:element>
88+
</xs:sequence>
89+
</xs:complexType>
90+
</xs:element>
91+
<xs:element name="Erklaering" type="accept">
92+
<xs:annotation>
93+
<xs:documentation>Kender rettigheder og pligter om behandling af personoplysninger</xs:documentation>
94+
</xs:annotation>
95+
</xs:element>
96+
<xs:element name="Underskriftsoplysninger">
97+
<xs:complexType>
98+
<xs:sequence>
99+
<xs:element name="Underskrift" type="max_laengde_strings_200"/>
100+
<xs:element name="Underskriftsdato" type="xs:date"/>
101+
</xs:sequence>
102+
</xs:complexType>
103+
</xs:element>
104+
<xs:element name="Fuldmagt" minOccurs="0">
105+
<xs:complexType>
106+
<xs:sequence>
107+
<xs:element name="FuldmagtDokumentnavn" type="max_laengde_strings_200"/>
108+
<xs:element name="FuldmagthaversPersonnummer" type="personnummer"/>
109+
</xs:sequence>
110+
</xs:complexType>
111+
</xs:element>
112+
</xs:sequence>
113+
</xs:complexType>
114+
</xs:element>
115+
<xs:simpleType name="personnummer">
116+
<xs:annotation>
117+
<xs:documentation>Personnummer</xs:documentation>
118+
</xs:annotation>
119+
<xs:restriction base="xs:string">
120+
<xs:length value="22"/>
121+
<xs:pattern value="urn:oio:cpr:\d+"/>
122+
</xs:restriction>
123+
</xs:simpleType>
124+
<xs:simpleType name="telefonnummer">
125+
<xs:annotation>
126+
<xs:documentation>Telefonnummer</xs:documentation>
127+
</xs:annotation>
128+
<xs:restriction base="xs:string">
129+
<xs:pattern value="\d+"/>
130+
</xs:restriction>
131+
</xs:simpleType>
132+
<xs:simpleType name="accept">
133+
<xs:annotation>
134+
<xs:documentation>Tilkendegiver accept</xs:documentation>
135+
</xs:annotation>
136+
<xs:restriction base="xs:string">
137+
<xs:pattern value="Accepteret"/>
138+
</xs:restriction>
139+
</xs:simpleType>
140+
<xs:simpleType name="dokumenttype">
141+
<xs:annotation>
142+
<xs:documentation>Angiver dokumenttype</xs:documentation>
143+
</xs:annotation>
144+
<xs:restriction base="xs:string">
145+
<xs:enumeration value="Overslag"/>
146+
<xs:enumeration value="Faktura"/>
147+
<xs:enumeration value="Bilag"/>
148+
</xs:restriction>
149+
</xs:simpleType>
150+
<xs:simpleType name="sygesikringstype">
151+
<xs:annotation>
152+
<xs:documentation>Angiver sygesikringstype</xs:documentation>
153+
</xs:annotation>
154+
<xs:restriction base="xs:string">
155+
<xs:enumeration value="GRUPPE_1"/>
156+
<xs:enumeration value="GRUPPE_2"/>
157+
<xs:enumeration value="GRUPPE_5"/>
158+
<xs:enumeration value="GRUPPE_E"/>
159+
<xs:enumeration value="GRUPPE_N"/>
160+
<xs:enumeration value="GRUPPE_S"/>
161+
<xs:enumeration value="GRUPPE_BASIS"/>
162+
</xs:restriction>
163+
</xs:simpleType>
164+
<xs:simpleType name="max_laengde_strings_200">
165+
<xs:annotation>
166+
<xs:documentation>Angiver generell max længde for strænger</xs:documentation>
167+
</xs:annotation>
168+
<xs:restriction base="xs:string">
169+
<xs:maxLength value="200"/>
170+
</xs:restriction>
171+
</xs:simpleType>
172+
<xs:simpleType name="myndighedstype">
173+
<xs:annotation>
174+
<xs:documentation>Myndighedstype</xs:documentation>
175+
</xs:annotation>
176+
<xs:restriction base="xs:string">
177+
<xs:pattern value="urn:oio:cvr-nr:[0-9]{8}"/>
178+
</xs:restriction>
179+
</xs:simpleType>
180+
</xs:schema>

0 commit comments

Comments
 (0)