Skip to content

Commit 7834162

Browse files
felixdupriezryahiaoui
authored andcommitted
FORMS-817 : Add bookmarks (creation date, update date, status, status update date)
1 parent ffba3c2 commit 7834162

File tree

1 file changed

+32
-2
lines changed

1 file changed

+32
-2
lines changed

src/java/fr/paris/lutece/plugins/forms/service/provider/GenericFormsProvider.java

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,17 +66,23 @@
6666
import fr.paris.lutece.portal.service.file.IFileStoreServiceProvider;
6767
import fr.paris.lutece.portal.service.i18n.I18nService;
6868
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;
7070
import fr.paris.lutece.util.url.UrlItem;
7171

7272
public abstract class GenericFormsProvider implements IProvider
7373
{
7474
// MESSAGE
7575
private static final String MESSAGE_DESCRIPTION = "forms.marker.provider.url.detail.reponse.description";
7676

77+
// PROPERTY
78+
private static final String PROPERTY_LUTECE_ADMIN_PROD_URL = "lutece.admin.prod.url";
7779
// MARKS
7880
private static final String MARK_POSITION = "position_";
7981
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";
8086
// PARAMETERS
8187
public static final String PARAMETER_VIEW_FORM_RESPONSE_DETAILS = "view_form_response_details";
8288
public static final String PARAMETER_ID_FORM_RESPONSES = "id_form_response";
@@ -157,11 +163,20 @@ public Collection<InfoMarker> provideMarkerValues( )
157163
result.addAll( markers.values( ) );
158164

159165
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 );
161167
url.addParameter( FormsConstants.PARAMETER_TARGET_VIEW, PARAMETER_VIEW_FORM_RESPONSE_DETAILS );
162168
url.addParameter( PARAMETER_ID_FORM_RESPONSES, _formResponse.getId( ) );
163169
notifyMarkerUrl.setValue( url.getUrl( ) );
164170
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( ) );
165180
return result;
166181
}
167182

@@ -187,6 +202,21 @@ public static Collection<InfoMarker> getProviderMarkerDescriptions( Form form )
187202
InfoMarker notifyMarkerURl = new InfoMarker( MARK_URL_ADMIN_RESPONSE );
188203
notifyMarkerURl.setDescription( I18nService.getLocalizedString( MESSAGE_DESCRIPTION, I18nService.getDefaultLocale( ) ) );
189204
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+
190220
return collectionNotifyMarkers;
191221
}
192222

0 commit comments

Comments
 (0)