View Javadoc
1   package fr.paris.lutece.plugins.appcenter.modules.fastdeployapplication.business.context;
2   
3   import fr.paris.lutece.plugins.appcenter.modules.fastdeployapplication.business.FastDeployApplicationData;
4   import fr.paris.lutece.plugins.appcenter.modules.fastdeployapplication.util.ConstanteUtils;
5   import fr.paris.lutece.portal.service.util.AppPropertiesService;
6   
7   public class WorkflowDeployAppContext extends AbstractWorkflowDeployContext
8   {
9       
10      /**
11       * 
12       */
13      protected static final long serialVersionUID = 8972751702141149081L;
14      protected String _strSvnBaseSiteUrl;
15      protected boolean _bDeployDevSite;
16      protected String _strTagToDeploy;
17      protected String _strTagName;
18      protected String _strNextVersion;
19      protected String _strTagVersion;
20      protected boolean _bLuteceSite;
21      protected String _strMavenDeployCustomGoal;
22     
23      public WorkflowDeployAppContext( )
24      {
25      }
26      
27      public String getSvnBaseSiteUrl( )
28      {
29          return _strSvnBaseSiteUrl;
30      }
31  
32      public void setSvnBaseSiteUrl( String strSvnUrl )
33      {
34          _strSvnBaseSiteUrl = strSvnUrl;
35      }
36      
37      public void setNextVersion( String _strNextVersion )
38      {
39          this._strNextVersion = _strNextVersion;
40      }
41  
42      public String getNextVersion( )
43      {
44          return _strNextVersion;
45      }
46  
47      public void setTagVersion( String _strTagVersion )
48      {
49          this._strTagVersion = _strTagVersion;
50      }
51  
52      public String getTagVersion( )
53      {
54          return _strTagVersion;
55      }
56      /**
57       * Check if the dev version of the site should be deployed.
58       * 
59       * @return true if the dev version of the site should be deployed
60       */
61      public boolean isDeployDevSite( )
62      {
63          return _bDeployDevSite;
64      }
65  
66      /**
67       * Set the deploy dev site boolean
68       * 
69       * @param bDeployDevSite
70       *            the deploy dev site boolean
71       */
72      public void setDeployDevSite( boolean bDeployDevSite )
73      {
74          _bDeployDevSite = bDeployDevSite;
75      }
76  
77      public String getTagToDeploy( )
78      {
79          return _strTagToDeploy;
80      }
81  
82      public void setTagToDeploy( String strTagToDeploy )
83      {
84          _strTagToDeploy = strTagToDeploy;
85      }
86  
87      public String getTagName( )
88      {
89          return _strTagName;
90      }
91  
92      public void setTagName( String strTagName )
93      {
94          this._strTagName = strTagName;
95      }
96  
97      public boolean isLuteceSite() {
98          return _bLuteceSite;
99      }
100 
101     public void setLuteceSite( boolean bLuteceSite ) {
102        _bLuteceSite = bLuteceSite;
103     }
104 
105     @Override
106     public int getIdWorkflow( )
107     {
108         if(this._fastDeployApplicationData.getApplicationType( )!=null && this._fastDeployApplicationData.getApplicationType( ).equals( FastDeployApplicationData.APPLICATION_TYPE_ANSIBLE ))
109         {
110             
111             if ( _bLuteceSite )
112             {
113                 return AppPropertiesService.getPropertyInt( ConstanteUtils.PROPERTY_ID_WORKFLOW_PREFIX + ConstanteUtils.WORKFLOW_DEPLOY_LUTECE_ANSIBLE, -1);
114             }
115             else
116             {
117                 return  AppPropertiesService.getPropertyInt(ConstanteUtils.PROPERTY_ID_WORKFLOW_PREFIX + ConstanteUtils.WORKFLOW_DEPLOY_NON_LUTECE_ANSIBLE, -1);
118             }
119             
120         }
121         else
122         {
123             if ( _bLuteceSite )
124             {
125                 return AppPropertiesService.getPropertyInt( ConstanteUtils.PROPERTY_ID_WORKFLOW_PREFIX + ConstanteUtils.WORKFLOW_DEPLOY_LUTECE, -1);
126             }
127             else
128             {
129                 return  AppPropertiesService.getPropertyInt(ConstanteUtils.PROPERTY_ID_WORKFLOW_PREFIX + ConstanteUtils.WORKFLOW_DEPLOY_NON_LUTECE, -1);
130             }
131         }
132         
133     }
134 
135     public String getMavenDeployCustomGoal()
136     {
137         return _strMavenDeployCustomGoal;
138     }
139 
140     public void setMavenDeployCustomGoal(String strMavenDeployCustomGoal) 
141     {
142         _strMavenDeployCustomGoal = strMavenDeployCustomGoal;
143     }
144     
145     public String getPermission() {
146 		return ConstanteUtils.PERMISSION_DEPLOY_APP;
147 	}
148 
149     
150 }