View Javadoc
1   package fr.paris.lutece.plugins.appcenter.modules.fastdeployapplication.service;
2   
3   import java.util.Locale;
4   
5   import javax.servlet.http.HttpServletRequest;
6   
7   import fr.paris.lutece.plugins.appcenter.modules.fastdeployapplication.business.FastDeployApplicationData;
8   import fr.paris.lutece.plugins.appcenter.modules.fastdeployapplication.business.FastDeployApplicationDemand;
9   import fr.paris.lutece.plugins.appcenter.modules.fastdeployapplication.business.FastDeployApplicationsData;
10  import fr.paris.lutece.plugins.appcenter.modules.fastdeployapplication.util.DeploymentUtils;
11  import fr.paris.lutece.plugins.appcenter.modules.sources.business.SourceUserData;
12  import fr.paris.lutece.plugins.appcenter.modules.sources.business.SourceUserDemand;
13  import fr.paris.lutece.plugins.appcenter.modules.sources.business.SourcesData;
14  import fr.paris.lutece.plugins.appcenter.modules.sources.business.SourcesDatas;
15  import fr.paris.lutece.plugins.appcenter.modules.sources.business.SourcesDemand;
16  import fr.paris.lutece.plugins.appcenter.service.task.AppCenterTaskFunctional;
17  import fr.paris.lutece.plugins.appcenter.service.task.AppcenterTask;
18  import java.util.ArrayList;
19  
20  public class FastDeployApplicationTask extends AppcenterTask
21  {
22  
23      //PARAMS
24      private static final String PARAM_LUTECE_SITE = "lutece_site";
25      
26  
27      @Override
28      public String getTitle( Locale locale )
29      {
30          // TODO
31          return "FastDeploy Application Task";
32      }
33  
34      @Override
35      public void processTask( int nIdResourceHistory, HttpServletRequest request, Locale locale )
36      {
37      	 AppCenterTaskFunctional<FastDeployApplicationData, FastDeployApplicationsData, FastDeployApplicationDemand> funct=( requestParam,  localeParam, applicationDataParam, applicationDatasParam,demandParam)-> addSiteLutece(requestParam,applicationDataParam,demandParam);
38           super.processTask(nIdResourceHistory, request, locale, FastDeployApplicationData.class, FastDeployApplicationsData.class, FastDeployApplicationDemand.class,funct);
39  
40      }
41      
42      
43      
44      public void addSiteLutece(HttpServletRequest request, FastDeployApplicationData fastDeployData,FastDeployApplicationDemand demand )
45      {
46      	boolean isLuteceSite = ( request.getParameter( PARAM_LUTECE_SITE ) != null );
47          fastDeployData.setLuteceSite( isLuteceSite );
48          fastDeployData.setArtifactId( DeploymentUtils.getVCSService( fastDeployData.getRepoType( ) ).getArtifactId( fastDeployData.getUrlSite() ) );
49      }
50  }