Blame view

src/InputOutput/IHMImpl/Config/IHMConfigClass.php 5.33 KB
22521f1c   Benjamin Renard   First commit
1
2
3
4
5
6
7
8
9
10
11
12
<?php

/**
 * @class IHMConfigClass
 * @brief Class that's contain all specific configuration of the IHM client
 * @details
 */
class IHMConfigClass
{
	private static $genericDataDir = "generic_data/";

	private static $functionsDir   = "Functions/";
f28f7c0e   Benjamin Renard   Add param info re...
13
	
22521f1c   Benjamin Renard   First commit
14
15
16
	private static $constantsFile  = "constants.xml";

	private static $functionsFile  = "functions.xml";
bf27ba04   Benjamin Renard   Add templated par...
17
18
	
	private static $paramTemplateDir = "ParamTemplate/";
22521f1c   Benjamin Renard   First commit
19

bf27ba04   Benjamin Renard   Add templated par...
20
21
22
23
	private static $paramTemplateFile = "ParamTemplateList.xml";
	
	private static $paramTemplateGenerateDir = "generateTemplateParams";
	
22521f1c   Benjamin Renard   First commit
24
25
26
27
28
29
	private static $dataDir        = "data/";

	private static $compilationDir = "compilation/";

	private static $requestDir     = "RES/";

a242857a   Benjamin Renard   Shared objects
30
31
32
	private static $sharedDir      = "shared_data/";
	
	private static $sharedTreeFile = "SharedObjectTree.xml";
22521f1c   Benjamin Renard   First commit
33
34
35
36

	private static $ttDir          = "TT/";

	private static $wsDir          = "WS/";
0b6b2080   Elena.Budnik   TT download
37
38
	
	private static $downloadTmp    = "DOWNLOAD.TEMP/";
22521f1c   Benjamin Renard   First commit
39
40

	private static $jobsDir        = "JOBS/";
944199fe   Benjamin Renard   Use table definit...
41
42
	
	private static $localBaseDir   = "DATA/";
22521f1c   Benjamin Renard   First commit
43
44
45
46
47
48
49
50
51
52

	private static $aliasesFile    = "Alias.xml";

	private static $processMgrFile = "processManager.xml";

	private static $jobsMgrFile = "jobs.xml";
	
	private static $userParamMgrFile = "WsParams.xml";

	private static $userName;
ffc5cb81   Elena.Budnik   temporary commit
53
54
55
	
	private static $userHost;
	
577d5c04   Elena.Budnik   IMPEX integration
56
57
	public static $remoteDataDir = "RemoteData/";
				
22521f1c   Benjamin Renard   First commit
58
59
60
61
62
63
64
65
66
	public static function setUserName($userName)
	{
		self::$userName = $userName;
	}

	public static function getUserName()
	{
		return self::$userName;
	}
ffc5cb81   Elena.Budnik   temporary commit
67
68
69
70
71
	
	public static function setUserHost($userHost)
	{
		self::$userHost = $userHost;
	}
22521f1c   Benjamin Renard   First commit
72

ffc5cb81   Elena.Budnik   temporary commit
73
74
75
76
77
	public static function getUserHost()
	{
		return self::$userHost;
	}
	
02024d28   Elena.Budnik   getRelativeResult...
78
79
80
81
82
83
84
	public static function getRelativeResultPath()
	{
		$userPath = self::$dataDir.self::$userName.'/'.self::$requestDir;
 
		return $userPath;
	}
	
22521f1c   Benjamin Renard   First commit
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
	public static function getUserPath()
	{
		$userPath = IHM_SRC_DIR.self::$dataDir.self::$userName.'/';

		if (!is_dir($userPath))
			mkdir($userPath);
			
		return $userPath;
	}

	public static function getProcessManagerFilePath()
	{
		return IHM_SRC_DIR.self::$dataDir.self::$processMgrFile;
	}

	public static function getConstantsFilePath()
	{
		return IHM_SRC_DIR.self::$genericDataDir.self::$functionsDir.self::$constantsFile;
	}

	public static function getFunctionsFilePath()
	{
		return IHM_SRC_DIR.self::$genericDataDir.self::$functionsDir.self::$functionsFile;
	}
	
bf27ba04   Benjamin Renard   Add templated par...
110
111
112
113
114
115
116
117
118
119
	public static function getParamTemplateFilePath($fileName)
	{
		return IHM_SRC_DIR.self::$genericDataDir.self::$paramTemplateDir.$fileName.".xml";
	}
	
	public static function getTemplateParamGeneratePath()
	{
		return self::getUserPath().self::$paramTemplateGenerateDir;
	}
	
0b6b2080   Elena.Budnik   TT download
120
121
122
123
124
	public static function getDownloadTmpPath()
	{
		return self::getUserPath().self::$downloadTmp;
	}
	
bf27ba04   Benjamin Renard   Add templated par...
125
126
127
128
129
	public static function getParamTemplateListFilePath()
	{
		return IHM_SRC_DIR.self::$genericDataDir.self::$paramTemplateDir.self::$paramTemplateFile;
	}
	
0b6b2080   Elena.Budnik   TT download
130
131
132
	public static function getUserParamManagerFilePath()
	{
		return self::getUserWSPath().self::$userParamMgrFile;
22521f1c   Benjamin Renard   First commit
133
	}
286f7924   Benjamin Renard   Derived parameter...
134
135
136
137
138
	
	public static function getUserDerivedParamFilePath($paramId)
	{
		return self::getUserWSPath().$paramId.".xml";
	}
944199fe   Benjamin Renard   Use table definit...
139
140
141
142
143
	
	public static function getUserUploadedParamFilePath($paramId)
	{
		return self::getUserWSPath().$paramId.".xml";
	}
22521f1c   Benjamin Renard   First commit
144
145
146
147
148

	public static function getLocalParamDBPath()
	{
		return PARAMS_LOCALDB_DIR;
	}
f28f7c0e   Benjamin Renard   Add param info re...
149
150
151
152
153
	
	public static function getLocalParamInfoPath()
	{
		return PARAMS_LOCALINFO_DIR;
	}
22521f1c   Benjamin Renard   First commit
154

a242857a   Benjamin Renard   Shared objects
155
156
157
158
159
160
	public static function getSharedPath()
	{
		return IHM_SRC_DIR.self::$sharedDir;
	}
	
	public static function getSharedTreeFilePath()
22521f1c   Benjamin Renard   First commit
161
	{
a242857a   Benjamin Renard   Shared objects
162
		return self::getSharedPath().self::$sharedTreeFile;
22521f1c   Benjamin Renard   First commit
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
	}

	public static function getUserTTPath()
	{
		return self::getUserPath().self::$ttDir;
	}

	public static function getUserWSPath()
	{
		return self::getUserPath().self::$wsDir;
	}

	public static function getUserJobsPath()
	{
		$jobsPath = self::getUserPath().self::$jobsDir;

		if (!is_dir($jobsPath))
			mkdir($jobsPath,0755);

		return $jobsPath;
	}

	public static function getUserJobsFile()
	{
		return self::getUserJobsPath().self::$jobsMgrFile;
	}


	public static function getUserAliasesFilePath()
	{
		return self::getUserWSPath().self::$aliasesFile;
	}

	public static function getCompilationPath()
	{
		$compilationPath = self::getUserPath().self::$compilationDir;

		if (!is_dir($compilationPath))
		{
			if (mkdir($compilationPath))
			{
				mkdir($compilationPath."src/");
				mkdir($compilationPath."lib/");
			}
		}
			
		return $compilationPath;
	}

944199fe   Benjamin Renard   Use table definit...
212
213
214
215
216
217
218
219
220
221
	public static function getLocalBasePath()
	{
		$localBasePath = self::getUserPath().self::$localBaseDir;
		
		if (!is_dir($localBasePath))
			mkdir($localBasePath);
			
		return $localBasePath;
	}
	
ffc5cb81   Elena.Budnik   temporary commit
222
223
224
	public static function getRemoteParamsFile()
	{
		$remoteBasePath = self::getUserPath().self::$wsDir;
577d5c04   Elena.Budnik   IMPEX integration
225
				 			
ffc5cb81   Elena.Budnik   temporary commit
226
227
228
		return $remoteBasePath.'RemoteParams.xml';
	}
			
22521f1c   Benjamin Renard   First commit
229
230
231
232
233
234
235
236
237
	public static function getRequestPath()
	{
		$requestPath = self::getUserPath().self::$requestDir;

		if (!is_dir($requestPath))
			mkdir($requestPath);
			
		return $requestPath;
	}
577d5c04   Elena.Budnik   IMPEX integration
238
239
240
241
242
243
244
245
	
	public static function getRemoteDataPath()
	{
		$remoteDataPath = IHM_SRC_DIR.self::$genericDataDir.self::$remoteDataDir;
		
		return $remoteDataPath;
	}
	
22521f1c   Benjamin Renard   First commit
246
247
248
}

?>