66
66
import fr .paris .lutece .portal .service .file .IFileStoreServiceProvider ;
67
67
import fr .paris .lutece .portal .service .i18n .I18nService ;
68
68
import fr .paris .lutece .portal .service .util .AppLogService ;
69
- import fr .paris .lutece .portal .service .util .AppPathService ;
69
+ import fr .paris .lutece .portal .service .util .AppPropertiesService ;
70
70
import fr .paris .lutece .util .url .UrlItem ;
71
71
72
72
public abstract class GenericFormsProvider implements IProvider
73
73
{
74
74
// MESSAGE
75
75
private static final String MESSAGE_DESCRIPTION = "forms.marker.provider.url.detail.reponse.description" ;
76
76
77
+ // PROPERTY
78
+ private static final String PROPERTY_LUTECE_ADMIN_PROD_URL = "lutece.admin.prod.url" ;
77
79
// MARKS
78
80
private static final String MARK_POSITION = "position_" ;
79
81
private static final String MARK_URL_ADMIN_RESPONSE = "url_admin_forms_response_detail" ;
82
+ private static final String MARK_CREATION_DATE = "creation_date" ;
83
+ private static final String MARK_UPDATE_DATE = "update_date" ;
84
+ private static final String MARK_STATUS = "status" ;
85
+ private static final String MARK_STATUS_UPDATE_DATE = "update_date_status" ;
80
86
// PARAMETERS
81
87
public static final String PARAMETER_VIEW_FORM_RESPONSE_DETAILS = "view_form_response_details" ;
82
88
public static final String PARAMETER_ID_FORM_RESPONSES = "id_form_response" ;
@@ -157,11 +163,20 @@ public Collection<InfoMarker> provideMarkerValues( )
157
163
result .addAll ( markers .values ( ) );
158
164
159
165
InfoMarker notifyMarkerUrl = new InfoMarker ( MARK_URL_ADMIN_RESPONSE );
160
- UrlItem url = new UrlItem ( AppPathService . getBaseUrl ( _request ) + MultiviewFormResponseDetailsJspBean .CONTROLLER_JSP_NAME_WITH_PATH );
166
+ UrlItem url = new UrlItem ( AppPropertiesService . getProperty ( PROPERTY_LUTECE_ADMIN_PROD_URL ) + MultiviewFormResponseDetailsJspBean .CONTROLLER_JSP_NAME_WITH_PATH );
161
167
url .addParameter ( FormsConstants .PARAMETER_TARGET_VIEW , PARAMETER_VIEW_FORM_RESPONSE_DETAILS );
162
168
url .addParameter ( PARAMETER_ID_FORM_RESPONSES , _formResponse .getId ( ) );
163
169
notifyMarkerUrl .setValue ( url .getUrl ( ) );
164
170
result .add ( notifyMarkerUrl );
171
+
172
+ InfoMarker creationDateMarker = new InfoMarker ( MARK_CREATION_DATE );
173
+ creationDateMarker .setValue ( _formResponse .getCreation ( ).toString ( ) );
174
+ InfoMarker updateDateMarker = new InfoMarker ( MARK_UPDATE_DATE );
175
+ updateDateMarker .setValue ( _formResponse .getCreation ( ).toString ( ) );
176
+ InfoMarker statusMarker = new InfoMarker ( MARK_STATUS );
177
+ statusMarker .setValue ( String .valueOf ( _formResponse .isPublished ( ) ) );
178
+ InfoMarker updateStatusDateMarker = new InfoMarker ( MARK_STATUS_UPDATE_DATE );
179
+ updateStatusDateMarker .setValue ( _formResponse .getUpdateStatus ( ).toString ( ) );
165
180
return result ;
166
181
}
167
182
@@ -187,6 +202,21 @@ public static Collection<InfoMarker> getProviderMarkerDescriptions( Form form )
187
202
InfoMarker notifyMarkerURl = new InfoMarker ( MARK_URL_ADMIN_RESPONSE );
188
203
notifyMarkerURl .setDescription ( I18nService .getLocalizedString ( MESSAGE_DESCRIPTION , I18nService .getDefaultLocale ( ) ) );
189
204
collectionNotifyMarkers .add ( notifyMarkerURl );
205
+
206
+ InfoMarker creationDateMarker = new InfoMarker ( MARK_CREATION_DATE );
207
+ creationDateMarker .setDescription ( "Date de creation" );
208
+ InfoMarker updateDateMarker = new InfoMarker ( MARK_UPDATE_DATE );
209
+ updateDateMarker .setDescription ( "Date de mise à jour" );
210
+ InfoMarker statusMarker = new InfoMarker ( MARK_STATUS );
211
+ statusMarker .setDescription ( "Status" );
212
+ InfoMarker updateStatusDateMarker = new InfoMarker ( MARK_STATUS_UPDATE_DATE );
213
+ updateStatusDateMarker .setDescription ( "Date de mise à jour du status" );
214
+
215
+ collectionNotifyMarkers .add ( creationDateMarker );
216
+ collectionNotifyMarkers .add ( updateDateMarker );
217
+ collectionNotifyMarkers .add ( statusMarker );
218
+ collectionNotifyMarkers .add ( updateStatusDateMarker );
219
+
190
220
return collectionNotifyMarkers ;
191
221
}
192
222
0 commit comments