Commit dc9cff1d authored by Guillaume Lépine's avatar Guillaume Lépine
Browse files

FORMS-702 : LocalDatabaseFileService name moved to spring config

parent e70665f9
......@@ -34,13 +34,13 @@
<dependency>
<groupId>fr.paris.lutece</groupId>
<artifactId>lutece-core</artifactId>
<version>[7.0.0-RC-08,7.0.0-RC-09]</version>
<version>[7.0.0-SNAPSHOT,)</version>
<type>lutece-core</type>
</dependency>
<dependency>
<groupId>fr.paris.lutece.plugins</groupId>
<artifactId>plugin-genericattributes</artifactId>
<version>[2.3.2,2.3.3]</version>
<version>[2.3.4-SNAPSHOT,)</version>
<type>lutece-plugin</type>
</dependency>
<dependency>
......@@ -52,7 +52,7 @@
<dependency>
<groupId>fr.paris.lutece.plugins</groupId>
<artifactId>plugin-filegenerator</artifactId>
<version>[2.1.0,2.1.2]</version>
<version>[2.1.3-SNAPSHOT,)</version>
<type>lutece-plugin</type>
</dependency>
<dependency>
......
/*
* Copyright (c) 2002-2021, City of Paris
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright notice
* and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice
* and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* 3. Neither the name of 'Mairie de Paris' nor 'Lutece' nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* License 1.0
*/
package fr.paris.lutece.plugins.forms.service.download;
import fr.paris.lutece.portal.service.file.IFileDownloadUrlService;
import fr.paris.lutece.portal.service.file.IFileRBACService;
import fr.paris.lutece.portal.service.file.implementation.LocalDatabaseFileService;
public class FormDatabaseFileService extends LocalDatabaseFileService
{
private static final long serialVersionUID = -5737231818071574668L;
public FormDatabaseFileService( IFileDownloadUrlService fileDownloadUrlService, IFileRBACService fileRBACService )
{
super( fileDownloadUrlService, fileRBACService );
}
public static final String FILE_STORE_PROVIDER_NAME = "formsDatabaseFileStoreProvider";
@Override
public String getName( )
{
return FILE_STORE_PROVIDER_NAME;
}
}
......@@ -35,7 +35,6 @@ package fr.paris.lutece.plugins.forms.service.entrytype;
import java.util.List;
import fr.paris.lutece.plugins.forms.service.download.FormDatabaseFileService;
import fr.paris.lutece.plugins.genericattributes.business.Entry;
import fr.paris.lutece.plugins.genericattributes.business.Response;
import fr.paris.lutece.plugins.genericattributes.service.entrytype.AbstractEntryTypeComment;
......@@ -114,6 +113,6 @@ public class EntryTypeComment extends AbstractEntryTypeComment implements IRespo
@Override
protected IFileStoreServiceProvider getFileStoreServiceProvider( )
{
return FileService.getInstance( ).getFileStoreServiceProvider( FormDatabaseFileService.FILE_STORE_PROVIDER_NAME );
return FileService.getInstance( ).getFileStoreServiceProvider( "formsDatabaseFileStoreProvider" );
}
}
......@@ -51,7 +51,6 @@ import fr.paris.lutece.plugins.forms.business.FormResponse;
import fr.paris.lutece.plugins.forms.business.FormResponseHome;
import fr.paris.lutece.plugins.forms.business.Question;
import fr.paris.lutece.plugins.forms.business.QuestionHome;
import fr.paris.lutece.plugins.forms.service.download.FormDatabaseFileService;
import fr.paris.lutece.plugins.forms.service.entrytype.EntryTypeComment;
import fr.paris.lutece.plugins.forms.util.FormsConstants;
import fr.paris.lutece.plugins.forms.web.admin.MultiviewFormResponseDetailsJspBean;
......@@ -128,7 +127,7 @@ public abstract class GenericFormsProvider implements IProvider
if ( fieldFile != null )
{
IFileStoreServiceProvider fileStoreprovider = FileService.getInstance( )
.getFileStoreServiceProvider( FormDatabaseFileService.FILE_STORE_PROVIDER_NAME );
.getFileStoreServiceProvider( "formsDatabaseFileStoreProvider" );
Map<String, String> additionnalData = new HashMap<>( );
additionnalData.put( FileService.PARAMETER_RESOURCE_ID, String.valueOf( entry.getIdResource( ) ) );
......
......@@ -56,7 +56,6 @@ import fr.paris.lutece.plugins.forms.business.Question;
import fr.paris.lutece.plugins.forms.business.Step;
import fr.paris.lutece.plugins.forms.service.IFormDatabaseService;
import fr.paris.lutece.plugins.forms.service.IFormDisplayService;
import fr.paris.lutece.plugins.forms.service.download.FormDatabaseFileService;
import fr.paris.lutece.plugins.forms.service.entrytype.EntryTypeCheckBox;
import fr.paris.lutece.plugins.forms.service.entrytype.EntryTypeComment;
import fr.paris.lutece.plugins.forms.service.entrytype.EntryTypeDate;
......@@ -161,8 +160,8 @@ public abstract class AbstractFormQuestionJspBean extends AbstractJspBean
// Others
protected static final int INTEGER_MINUS_ONE = -1;
private IFileStoreServiceProvider _fileStoreProvider = FileService.getInstance( )
.getFileStoreServiceProvider( FormDatabaseFileService.FILE_STORE_PROVIDER_NAME );
protected IFileStoreServiceProvider _fileStoreProvider = FileService.getInstance( )
.getFileStoreServiceProvider( "formsDatabaseFileStoreProvider" );
private IFormDatabaseService _formDatabaseService;
private IFormDisplayService _formDisplayService;
......
......@@ -56,7 +56,6 @@ import fr.paris.lutece.plugins.forms.service.FormDisplayService;
import fr.paris.lutece.plugins.forms.service.FormService;
import fr.paris.lutece.plugins.forms.service.IFormDatabaseService;
import fr.paris.lutece.plugins.forms.service.IFormDisplayService;
import fr.paris.lutece.plugins.forms.service.download.FormDatabaseFileService;
import fr.paris.lutece.plugins.forms.util.FormsConstants;
import fr.paris.lutece.plugins.forms.util.FormsEntryUtils;
import fr.paris.lutece.plugins.forms.web.ICompositeDisplay;
......@@ -114,8 +113,6 @@ public class FormQuestionJspBean extends AbstractFormQuestionJspBean
private static final String WARNING_CONFIRM_REMOVE_GROUP_ANY_QUESTIONS_FORM_ACTIVE = "forms.warning.deleteComposite.confirmRemoveGroup.formActive";
private static final FormService _formService = SpringContextService.getBean( FormService.BEAN_NAME );
private IFileStoreServiceProvider _fileStoreProvider = FileService.getInstance( )
.getFileStoreServiceProvider( FormDatabaseFileService.FILE_STORE_PROVIDER_NAME );
private Form _form;
......
......@@ -40,7 +40,6 @@ import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import fr.paris.lutece.plugins.forms.business.Form;
import fr.paris.lutece.plugins.forms.service.download.FormDatabaseFileService;
import fr.paris.lutece.plugins.genericattributes.business.Entry;
import fr.paris.lutece.plugins.genericattributes.business.Field;
import fr.paris.lutece.plugins.genericattributes.service.entrytype.IEntryTypeService;
......@@ -65,7 +64,7 @@ public class EntryTypeCommentDisplayService extends EntryTypeDefaultDisplayServi
if ( fieldFile != null )
{
IFileStoreServiceProvider fileStoreprovider = FileService.getInstance( )
.getFileStoreServiceProvider( FormDatabaseFileService.FILE_STORE_PROVIDER_NAME );
.getFileStoreServiceProvider( "formsDatabaseFileStoreProvider" );
Map<String, String> additionnalData = new HashMap<>( );
additionnalData.put( FileService.PARAMETER_RESOURCE_ID, String.valueOf( entry.getIdResource( ) ) );
......
......@@ -490,10 +490,11 @@
<bean id="forms.formsFileDownloadUrlService" class="fr.paris.lutece.plugins.forms.service.download.FormsFileDownloadService" />
<bean id="forms.formsFileRBACService" class="fr.paris.lutece.plugins.forms.service.download.FormsFileRBACService" />
<bean id="forms.formsDatabaseFileService" class="fr.paris.lutece.plugins.forms.service.download.FormDatabaseFileService" >
<bean id="forms.formsDatabaseFileService" class="fr.paris.lutece.portal.service.file.implementation.LocalDatabaseFileService" >
<constructor-arg ref="forms.formsFileDownloadUrlService" />
<constructor-arg ref="forms.formsFileRBACService" />
<property name="default" value="false" />
<property name="name" value="formsDatabaseFileStoreProvider" />
</bean>
<!-- Anonymization -->
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment