Leonardo Vannucci
2018-09-17 13c46f877d0540f22b16f80facd7e60de74490fa
Avvio istanze URP
1 files added
8 files modified
1 files deleted
336 ■■■■ changed files
dg1cloud-core/pom.xml 9 ●●●●● patch | view | raw | blame | history
dg1cloud-core/src/main/java/it/digione/dg1cloud/config/dg1cloud.properties 12 ●●●●● patch | view | raw | blame | history
dg1cloud-core/src/main/java/it/digione/dg1cloud/controller/StartURPController.java 131 ●●●●● patch | view | raw | blame | history
dg1cloud-core/src/main/java/it/digione/dg1cloud/form/StartURPForm.java 2 ●●●●● patch | view | raw | blame | history
dg1cloud-core/src/main/java/it/digione/dg1cloud/ws/client/SOAPConnector.java 10 ●●●●● patch | view | raw | blame | history
dg1cloud-core/src/main/java/it/digione/dg1cloud/ws/client/isd/IsdConfig.java 8 ●●●● patch | view | raw | blame | history
dg1cloud-core/src/main/java/it/digione/dg1cloud/ws/client/isd/IsdProperties.java 62 ●●●●● patch | view | raw | blame | history
dg1cloud-core/src/main/java/it/digione/dg1cloud/ws/client/isd/IsdSOAPConnector.java 24 ●●●●● patch | view | raw | blame | history
dg1cloud-core/src/main/resources/application.properties 10 ●●●●● patch | view | raw | blame | history
dg1cloud-core/src/main/resources/templates/startURP.html 68 ●●●●● patch | view | raw | blame | history
dg1cloud-core/pom.xml
....@@ -68,7 +68,10 @@
6868 <artifactId>spring-boot-configuration-processor</artifactId>
6969 <optional>true</optional>
7070 </dependency>
71
-
71
+ <dependency>
72
+ <groupId>org.springframework.boot</groupId>
73
+ <artifactId>spring-boot-starter-mail</artifactId>
74
+ </dependency>
7275 <dependency>
7376 <groupId>org.springframework.ws</groupId>
7477 <artifactId>spring-ws-core</artifactId>
....@@ -136,9 +139,9 @@
136139 </includes>
137140 </resource>
138141 <resource>
139
- <directory>src/main/resource</directory>
142
+ <directory>src/main/resources</directory>
140143 <includes>
141
- <include>application.properties</include>
144
+ <include>**/*</include>
142145 </includes>
143146 </resource>
144147 </resources>
dg1cloud-core/src/main/java/it/digione/dg1cloud/config/dg1cloud.properties
....@@ -20,7 +20,7 @@
2020 google.recaptcha.key=6LfCHmkUAAAAAFa1KmVtPFecItBriBHx1qmKHcVS
2121 google.recaptcha.secret=6LfCHmkUAAAAAKXdXWO36daHnItKQwkEvXOpX6YY
2222
23
-isharedoc.ws.endpoint.instance=https://democorepa3.grupposistematica.it/isharedoc/webservices/webserviceInstance3.wsdl
23
+isharedoc.ws.endpoint.instance=https://democorepa3.grupposistematica.it/isharedoc/webservices/instanceService3/
2424 isharedoc.ws.username=admin
2525 isharedoc.ws.password=sistematica100
2626 isharedoc.ws.urp.puid=0109
....@@ -28,3 +28,13 @@
2828 isharedoc.ws.urp.storyboad=URP
2929 isharedoc.ws.urp.metaviewname=URP
3030 isharedoc.ws.urp.direction=IN
31
+isharedoc.ws.urp.transition=protocolla
32
+#solo per le gbox (todo: implementare altre tipologie)
33
+isharedoc.ws.urp.contacts[0].type=O
34
+isharedoc.ws.urp.contacts[0].referenceType=GBOX
35
+isharedoc.ws.urp.contacts[0].code=URP
36
+isharedoc.ws.urp.contacts[1].type=T
37
+isharedoc.ws.urp.contacts[1].referenceType=GBOX
38
+isharedoc.ws.urp.contacts[1].code=URP
39
+
40
+isharedoc.ws.notification-from=Dg1Cloud notifiche sviluppo <no-reply@digione.eu>
dg1cloud-core/src/main/java/it/digione/dg1cloud/controller/StartURPController.java
....@@ -1,9 +1,18 @@
11 package it.digione.dg1cloud.controller;
22
3
+import java.io.IOException;
4
+import java.text.SimpleDateFormat;
5
+
6
+import javax.activation.DataHandler;
7
+import javax.mail.internet.MimeMessage;
38 import javax.validation.Valid;
49 import javax.xml.bind.JAXBElement;
510
11
+import org.slf4j.Logger;
12
+import org.slf4j.LoggerFactory;
613 import org.springframework.beans.factory.annotation.Autowired;
14
+import org.springframework.mail.javamail.JavaMailSender;
15
+import org.springframework.mail.javamail.MimeMessageHelper;
716 import org.springframework.stereotype.Controller;
817 import org.springframework.validation.BindingResult;
918 import org.springframework.web.bind.annotation.ControllerAdvice;
....@@ -13,18 +22,28 @@
1322 import org.springframework.web.servlet.ModelAndView;
1423
1524 import it.digione.dg1cloud.form.StartURPForm;
16
-import it.digione.dg1cloud.ws.client.SOAPConnector;
17
-import it.digione.dg1cloud.ws.client.isd.IsdProperties;
1825 import it.digione.dg1cloud.ws.client.isd.IsdConfig;
26
+import it.digione.dg1cloud.ws.client.isd.IsdProperties;
27
+import it.digione.dg1cloud.ws.client.isd.IsdSOAPConnector;
1928 import it.isharedoc.schemas.instance.InstanceMessageCreateRequest;
29
+import it.isharedoc.schemas.instance.InstanceMessageCreateRequest.Attachments;
30
+import it.isharedoc.schemas.instance.InstanceMessageCreateRequest.Attachments.Attachment;
31
+import it.isharedoc.schemas.instance.InstanceMessageCreateRequest.Contacts;
32
+import it.isharedoc.schemas.instance.InstanceMessageCreateRequest.Contacts.Contact;
33
+import it.isharedoc.schemas.instance.InstanceMessageCreateRequest.Variables;
34
+import it.isharedoc.schemas.instance.InstanceMessageCreateRequest.Variables.Variable;
35
+import it.isharedoc.schemas.instance.InstanceMessageCreateResponse;
2036 import it.isharedoc.schemas.instance.ObjectFactory;
2137
2238 @ControllerAdvice
2339 @Controller
2440 public class StartURPController {
2541
42
+ private static final Logger logger = LoggerFactory.getLogger(DownloadController.class);
43
+
2644 @Autowired IsdProperties isdProperties;
2745 @Autowired IsdConfig isdConfig;
46
+ @Autowired JavaMailSender javaMailSender;
2847
2948 @ModelAttribute("startURPForm")
3049 public StartURPForm startURPForm() {
....@@ -40,22 +59,55 @@
4059 BindingResult result) {
4160
4261 ModelAndView modelAndView;
43
- if (result.hasErrors()){
62
+ //if (result.hasErrors()){
63
+ if (false) {
4464 modelAndView = new ModelAndView("startURP");
4565 modelAndView.addObject(result);
4666 modelAndView.addObject("startURPForm", form);
47
- modelAndView.addObject("message", "Impossibbile inviare la richiesta");
67
+ modelAndView.addObject("message", "Impossibile inviare la richiesta");
4868 modelAndView.addObject("alertClass", "alert-danger");
4969 return modelAndView;
5070 } else {
5171 modelAndView = new ModelAndView("startURP");
5272
5373 InstanceMessageCreateRequest imcr = createInstanceMessageCreateRequest(form);
54
- SOAPConnector soapConnector = isdConfig.soapConnector(isdConfig.marshaller(), isdConfig.wsSecurityInterceptor());
55
- System.out.println(soapConnector.callWebService(soapConnector.getDefaultUri(), imcr));
74
+ IsdSOAPConnector soapConnector = isdConfig.soapConnector(isdConfig.marshaller(), isdConfig.wsSecurityInterceptor());
5675
57
- modelAndView.addObject("message", "Richiesta inviata con successo");
58
- modelAndView.addObject("alertClass", "alert-success");
76
+ String numeroProtocollo = null;
77
+ String dataProtocollo = null;
78
+ SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
79
+ try {
80
+ InstanceMessageCreateResponse response = soapConnector.callWebService(soapConnector.getDefaultUri(), imcr);
81
+ numeroProtocollo = response.getIdentifier().getValue();
82
+ dataProtocollo = sdf.format(response.getIdentifierDate().getValue().toGregorianCalendar().getTime());
83
+ } catch (Exception e) {
84
+ logger.error("Errore invocazione servizi URP: " + e.getMessage(), e);
85
+ modelAndView.addObject(result);
86
+ modelAndView.addObject("startURPForm", form);
87
+ modelAndView.addObject("message", "Problemi nell'invio della richiesta: " + e.getMessage());
88
+ modelAndView.addObject("alertClass", "alert-danger");
89
+ return modelAndView;
90
+ }
91
+
92
+ try {
93
+ MimeMessage message = javaMailSender.createMimeMessage();
94
+ MimeMessageHelper helper;
95
+ helper = new MimeMessageHelper(message, true);
96
+ helper.setSubject("Richiesta inviata correttamente al servizio URP");
97
+ helper.setFrom(isdProperties.getNotificationFrom());
98
+ helper.setTo(form.getMittente());
99
+ helper.setText("Richiesta inviata correttamente: " + numeroProtocollo + " del " + dataProtocollo, true);
100
+ javaMailSender.send(message);
101
+
102
+ modelAndView.addObject("message", "Richiesta inviata con successo");
103
+ modelAndView.addObject("alertClass", "alert-success");
104
+ } catch (Exception e) {
105
+ modelAndView.addObject("message", "Richiesta inviata con successo, ma non รจ stato possibile inviare la conferma tramite email");
106
+ modelAndView.addObject("alertClass", "alert-warning");
107
+ }
108
+
109
+ modelAndView.addObject("appIdentifier", numeroProtocollo);
110
+ modelAndView.addObject("appIdentifierDate", dataProtocollo);
59111 return modelAndView;
60112 }
61113
....@@ -72,7 +124,68 @@
72124 request.setStoryboardCode(isdProperties.getUrp().getStoryboad());
73125
74126 request.setMetaViewName(factory.createInstanceMessageCreateRequestMetaViewName(isdProperties.getUrp().getMetaviewname()));
127
+ request.setDirection(isdProperties.getUrp().getDirection());
75128
76
- return null;
129
+ Contacts contacts = factory.createInstanceMessageCreateRequestContacts();
130
+
131
+ Contact contact = new Contact();
132
+ contact.setDescription(factory.createInstanceMessageCreateRequestContactsContactDescription(startURPForm.getMittente()));
133
+ contact.setEmail(factory.createInstanceMessageCreateRequestContactsContactEmail( startURPForm.getMittente()));
134
+ contact.setType("F");
135
+ contact.setReferenceType("AB");
136
+ contact.setSearchType("EXTID");
137
+ contact.setSearchMode("NOTFOUNDDEF");
138
+ contact.setSearchValue(startURPForm.getMittente());
139
+
140
+ contacts.getContact().add(contact);
141
+
142
+ for ( it.digione.dg1cloud.ws.client.isd.IsdProperties.Urp.Contact urpContact : isdProperties.getUrp().getContacts() ) {
143
+ contact = new Contact();
144
+ contact.setType(urpContact.getType());
145
+ contact.setReferenceType(urpContact.getReferenceType());
146
+ contact.setSearchType("CODE");
147
+ contact.setSearchValue(urpContact.getCode());
148
+ contacts.getContact().add(contact);
149
+ }
150
+
151
+ JAXBElement<Contacts> jaxbContacts = factory.createInstanceMessageCreateRequestContacts(contacts);
152
+ request.setContacts(jaxbContacts);
153
+
154
+ JAXBElement<String> jaxbSubject = factory.createInstanceMessageCreateRequestSubject(startURPForm.getOggetto());
155
+ request.setSubject(jaxbSubject);
156
+
157
+ JAXBElement<String> jaxbBody = factory.createInstanceMessageCreateRequestBody(startURPForm.getCorpo());
158
+ request.setBody(jaxbBody);
159
+
160
+ Variable variable = new Variable();
161
+ variable.setKey("transition");
162
+ variable.setType("string");
163
+ variable.setValueString(factory.createInstanceMessageCreateRequestVariablesVariableValueString(isdProperties.getUrp().getTransition()));
164
+
165
+ Variables variables = factory.createInstanceMessageCreateRequestVariables();
166
+ variables.getVariable().add(variable);
167
+ JAXBElement<Variables> jaxbVariables = factory.createInstanceMessageCreateRequestVariables(variables);
168
+
169
+ request.setVariables(jaxbVariables);
170
+
171
+ request.setStartWorkflow(factory.createInstanceMessageCreateRequestStartWorkflow(true));
172
+
173
+ Attachments attachments = new Attachments();
174
+
175
+ Attachment attachment = new Attachment();
176
+ attachment.setFilename( startURPForm.getAllegato().getOriginalFilename());
177
+ attachment.setContentType( factory.createInstanceMessageCreateRequestAttachmentsAttachmentContentType( startURPForm.getAllegato().getContentType()));
178
+ attachment.setFileset("isharedocMailAttach");
179
+ try {
180
+ attachment.setData(new DataHandler(startURPForm.getAllegato().getBytes(), startURPForm.getAllegato().getContentType()));
181
+ } catch (IOException e) {
182
+ throw new RuntimeException("Errore nella lettura dell'allegato da passare al servizio URP", e);
183
+ }
184
+ attachments.getAttachment().add(attachment);
185
+
186
+ JAXBElement<Attachments> jaxbAttachments = factory.createInstanceMessageCreateRequestAttachments(attachments);
187
+ request.setAttachments(jaxbAttachments);
188
+
189
+ return request;
77190 }
78191 }
dg1cloud-core/src/main/java/it/digione/dg1cloud/form/StartURPForm.java
....@@ -1,5 +1,6 @@
11 package it.digione.dg1cloud.form;
22
3
+import javax.validation.constraints.Email;
34 import javax.validation.constraints.NotEmpty;
45 import javax.validation.constraints.NotNull;
56
....@@ -10,6 +11,7 @@
1011 public class StartURPForm {
1112
1213 @NotEmpty
14
+ @Email
1315 private String mittente;
1416 @NotEmpty
1517 private String oggetto;
dg1cloud-core/src/main/java/it/digione/dg1cloud/ws/client/SOAPConnector.java
deleted file mode 100644
....@@ -1,10 +0,0 @@
1
-package it.digione.dg1cloud.ws.client;
2
-
3
-import org.springframework.ws.client.core.support.WebServiceGatewaySupport;
4
-
5
-public class SOAPConnector extends WebServiceGatewaySupport {
6
-
7
- public Object callWebService(String url, Object request){
8
- return getWebServiceTemplate().marshalSendAndReceive(url, request);
9
- }
10
-}
dg1cloud-core/src/main/java/it/digione/dg1cloud/ws/client/isd/IsdConfig.java
....@@ -8,8 +8,6 @@
88 import org.springframework.ws.client.support.interceptor.ClientInterceptor;
99 import org.springframework.ws.soap.security.wss4j2.Wss4jSecurityInterceptor;
1010
11
-import it.digione.dg1cloud.ws.client.SOAPConnector;
12
-
1311 @Configuration
1412 public class IsdConfig {
1513
....@@ -19,6 +17,7 @@
1917 public Jaxb2Marshaller marshaller() {
2018 Jaxb2Marshaller marshaller = new Jaxb2Marshaller();
2119 marshaller.setContextPath("it.isharedoc.schemas.instance");
20
+ marshaller.setMtomEnabled(true);
2221 return marshaller;
2322 }
2423
....@@ -30,12 +29,13 @@
3029 wss4jSecurityInterceptor.setSecurementPassword(isdProperties.getPassword());
3130 wss4jSecurityInterceptor.setSecurementPasswordType(WSConstants.PW_TEXT);
3231 wss4jSecurityInterceptor.setSecurementUsernameTokenNonce(true);
32
+ wss4jSecurityInterceptor.setSecurementUsernameTokenCreated(true);
3333 return wss4jSecurityInterceptor;
3434 }
3535
3636 @Bean
37
- public SOAPConnector soapConnector(Jaxb2Marshaller marshaller, Wss4jSecurityInterceptor wsSecurityInterceptor) {
38
- SOAPConnector client = new SOAPConnector();
37
+ public IsdSOAPConnector soapConnector(Jaxb2Marshaller marshaller, Wss4jSecurityInterceptor wsSecurityInterceptor) {
38
+ IsdSOAPConnector client = new IsdSOAPConnector();
3939 client.setDefaultUri(isdProperties.getEndpoint().getInstance());
4040 client.setMarshaller(marshaller);
4141 client.setUnmarshaller(marshaller);
dg1cloud-core/src/main/java/it/digione/dg1cloud/ws/client/isd/IsdProperties.java
....@@ -1,5 +1,7 @@
11 package it.digione.dg1cloud.ws.client.isd;
22
3
+import java.util.List;
4
+
35 import org.springframework.boot.context.properties.ConfigurationProperties;
46 import org.springframework.stereotype.Component;
57
....@@ -11,6 +13,7 @@
1113 private Urp urp;
1214 private String username;
1315 private String password;
16
+ private String notificationFrom;
1417
1518 public Endpoint getEndpoint() {
1619 return endpoint;
....@@ -36,11 +39,18 @@
3639 public void setPassword(String password) {
3740 this.password = password;
3841 }
42
+ public String getNotificationFrom() {
43
+ return notificationFrom;
44
+ }
45
+ public void setNotificationFrom(String notificationFrom) {
46
+ this.notificationFrom = notificationFrom;
47
+ }
3948 @Override
4049 public String toString() {
4150 return "IsdProperties{" +
4251 "username='" + username + "'," +
4352 "endpoint=" + endpoint + "," +
53
+ "notificationFrom=" + notificationFrom + "," +
4454 "urp=" + urp +
4555 "}";
4656 }
....@@ -70,6 +80,9 @@
7080 private String storyboad;
7181 private String metaviewname;
7282 private String direction;
83
+ private String transition;
84
+ private List<Contact> contacts;
85
+
7386 public String getPuid() {
7487 return puid;
7588 }
....@@ -100,6 +113,18 @@
100113 public void setDirection(String direction) {
101114 this.direction = direction;
102115 }
116
+ public String getTransition() {
117
+ return transition;
118
+ }
119
+ public void setTransition(String transition) {
120
+ this.transition = transition;
121
+ }
122
+ public List<Contact> getContacts() {
123
+ return contacts;
124
+ }
125
+ public void setContacts(List<Contact> contacts) {
126
+ this.contacts = contacts;
127
+ }
103128 @Override
104129 public String toString() {
105130 return "Urp{" +
....@@ -107,8 +132,43 @@
107132 "mbox='" + mbox + "'," +
108133 "storyboad='" + storyboad + "'," +
109134 "metaviewname='" + metaviewname + "'," +
110
- "direction='" + direction + "'" +
135
+ "direction='" + direction + "'," +
136
+ "transition='" + transition + "'," +
137
+ "contacts=" + contacts +
111138 "}";
112139 }
140
+
141
+ public static class Contact {
142
+ private String type;
143
+ private String referenceType;
144
+ private String code;
145
+
146
+ public String getType() {
147
+ return type;
148
+ }
149
+ public void setType(String type) {
150
+ this.type = type;
151
+ }
152
+ public String getReferenceType() {
153
+ return referenceType;
154
+ }
155
+ public void setReferenceType(String referenceType) {
156
+ this.referenceType = referenceType;
157
+ }
158
+ public String getCode() {
159
+ return code;
160
+ }
161
+ public void setCode(String code) {
162
+ this.code = code;
163
+ }
164
+ @Override
165
+ public String toString() {
166
+ return "Contacts{" +
167
+ "type='" + type + "'," +
168
+ "referenceType='" + referenceType + "'," +
169
+ "code='" + code + "'" +
170
+ "}";
171
+ }
172
+ }
113173 }
114174 }
dg1cloud-core/src/main/java/it/digione/dg1cloud/ws/client/isd/IsdSOAPConnector.java
....@@ -0,0 +1,24 @@
1
+package it.digione.dg1cloud.ws.client.isd;
2
+
3
+import org.springframework.ws.client.core.support.WebServiceGatewaySupport;
4
+import org.springframework.ws.soap.client.SoapFaultClientException;
5
+
6
+import it.isharedoc.schemas.instance.InstanceMessageCreateRequest;
7
+import it.isharedoc.schemas.instance.InstanceMessageCreateResponse;
8
+
9
+public class IsdSOAPConnector extends WebServiceGatewaySupport {
10
+
11
+ public InstanceMessageCreateResponse callWebService(String url, InstanceMessageCreateRequest request){
12
+ Object response = null;
13
+ try {
14
+ response = getWebServiceTemplate().marshalSendAndReceive(url, request);
15
+ } catch (SoapFaultClientException e) {
16
+ throw new RuntimeException(e.getFaultStringOrReason(), e);
17
+ }
18
+ if ( response instanceof InstanceMessageCreateResponse ) {
19
+ return (InstanceMessageCreateResponse) response;
20
+ } else {
21
+ throw new RuntimeException("Oggetto response di tipo errato -> " + response.getClass().getName() );
22
+ }
23
+ }
24
+}
dg1cloud-core/src/main/resources/application.properties
....@@ -21,4 +21,12 @@
2121
2222 logging.level.it.digione.dg1cloud=DEBUG
2323
24
-logging.level.org.springframework.ws=TRACE
24
+logging.level.org.springframework.ws=TRACE
25
+
26
+spring.mail.host=smtp.grupposistematica.it
27
+spring.mail.username=support-erp
28
+spring.mail.password=
29
+#spring.mail.properties.mail.smtp.auth = true
30
+#spring.mail.properties.mail.smtp.socketFactory.port = 465
31
+#spring.mail.properties.mail.smtp.socketFactory.class=javax.net.ssl.SSLSocketFactory
32
+#spring.mail.properties.mail.smtp.socketFactory.fallback = false
dg1cloud-core/src/main/resources/templates/startURP.html
....@@ -25,37 +25,45 @@
2525 method="post" role="form"
2626 enctype="multipart/form-data" >
2727 <div th:if="${message}" th:text="${message}" th:class="${'alert ' + alertClass}"></div>
28
- <div class="form-group">
29
- <label for="mittente" class="control-label">Mittente*</label>
30
- <input type="email" class="form-control" th:field="*{mittente}" required placeholder="Email mittente" />
31
- <p th:if="${#fields.hasErrors('mittente')}">Email mittente mancante</p>
28
+ <div th:th:if="${appIdentifier}">
29
+ <div th:text="${'Protocollo ' + appIdentifier + ' del ' + appIdentifierDate}" th:class="${'alert alert-info'}"></div>
30
+ <div>
31
+ <p><a th:href="@{/startURP}" class="btn btn-link"><span th:text="${'Effettua una nuova richiesta'}"></span></a></p>
32
+ </div>
3233 </div>
33
- <div class="form-group">
34
- <label for="oggetto" class="control-label">Oggetto*</label>
35
- <input type="text" class="form-control" th:field="*{oggetto}" required />
36
- <p th:if="${#fields.hasErrors('oggetto')}">Compilare l'oggetto della richiesta</p>
37
- </div>
38
- <div class="form-group">
39
- <label for="oggetto" class="control-label">Richiesta*</label>
40
- <textarea rows="5" class="form-control" th:field="*{corpo}" required ></textarea>
41
- <p th:if="${#fields.hasErrors('corpo')}">Scrivere il corpo della richiesta</p>
42
- </div>
43
- <div class="form-group">
44
- <label for="allegato" class="control-label">Allegato richiesta*</label>
45
- <input type="file" class="form-control" th:field="*{allegato}" required ></input>
46
- <p th:if="${#fields.hasErrors('allegato')}">Inserire un allegato</p>
47
- <p class="error-message"
48
- th:each="error: ${#fields.errors('allegato')}"
49
- th:text="${error}"></p>
50
- </div>
51
- <div class="form-group">
52
- <div class="g-recaptcha" th:attr="data-sitekey=${@captchaSettings.getKey()}"></div>
53
- <p class="error-message"
54
- th:each="error: ${#fields.errors('reCaptchaResponse')}"
55
- th:text="'Errore validazione reCaptcha'"></p>
56
- </div>
57
- <div class="form-group">
58
- <button name="Invia richiesta" type="submit" th:text="'Invia richiesta'"></button>
34
+ <div th:unless="${appIdentifier}">
35
+ <div class="form-group">
36
+ <label for="mittente" class="control-label">Mittente*</label>
37
+ <input type="email" class="form-control" th:field="*{mittente}" required placeholder="Email mittente" />
38
+ <p th:if="${#fields.hasErrors('mittente')}">Email mittente mancante</p>
39
+ </div>
40
+ <div class="form-group">
41
+ <label for="oggetto" class="control-label">Oggetto*</label>
42
+ <input type="text" class="form-control" th:field="*{oggetto}" required />
43
+ <p th:if="${#fields.hasErrors('oggetto')}">Compilare l'oggetto della richiesta</p>
44
+ </div>
45
+ <div class="form-group">
46
+ <label for="oggetto" class="control-label">Richiesta*</label>
47
+ <textarea rows="5" class="form-control" th:field="*{corpo}" required ></textarea>
48
+ <p th:if="${#fields.hasErrors('corpo')}">Scrivere il corpo della richiesta</p>
49
+ </div>
50
+ <div class="form-group">
51
+ <label for="allegato" class="control-label">Allegato richiesta*</label>
52
+ <input type="file" class="form-control" th:field="*{allegato}" required ></input>
53
+ <p th:if="${#fields.hasErrors('allegato')}">Inserire un allegato</p>
54
+ <p class="error-message"
55
+ th:each="error: ${#fields.errors('allegato')}"
56
+ th:text="${error}"></p>
57
+ </div>
58
+ <div class="form-group">
59
+ <div class="g-recaptcha" th:attr="data-sitekey=${@captchaSettings.getKey()}"></div>
60
+ <p class="error-message"
61
+ th:each="error: ${#fields.errors('reCaptchaResponse')}"
62
+ th:text="'Errore validazione reCaptcha'"></p>
63
+ </div>
64
+ <div class="form-group">
65
+ <button name="Invia richiesta" type="submit" th:text="'Invia richiesta'"></button>
66
+ </div>
5967 </div>
6068 </form>
6169 </div>