개정판 2bbea412
프로젝트 ReadMe.txt 추가
Change-Id: I730b5c24072f5de1cbe60365fc447aa6a244275f
ConvertService/ServiceBase/Markus.Service.DataBase/ConvertDatabase.cs | ||
---|---|---|
274 | 274 |
/// <summary> |
275 | 275 |
/// 오류나 wait으로 남아 있는 데이터베이스의 Item을 StatusCodeType.None으로 복구 |
276 | 276 |
/// </summary> |
277 |
/// <param name="aliveItems"></param>
|
|
278 |
/// <param name="TakeCount"></param>
|
|
277 |
/// <param name="convertID">StatusCodeType을 변경하고자 하는 ConvertItem의 ID</param>
|
|
278 |
/// <param name="ReConvert">ReConvert가 2이면 다시 Convert를 시도 안하기 때문에 기존 값으로 유지 하고 계속 시도 할수 있도록 0을 주는 경우가 있다.</param>
|
|
279 | 279 |
/// <returns></returns> |
280 | 280 |
public int SetCleanUpItem(string convertID,int ReConvert) |
281 | 281 |
{ |
ConvertService/ServiceBase/Markus.Service.Station/ServiceStation.cs | ||
---|---|---|
121 | 121 |
// PDF 임시 다운로드 폴더 |
122 | 122 |
DownloadTempFolder = config.GetValue(CONFIG_DEFINE.SERVICE, CONFIG_DEFINE.DOWNLOAD_TEMP_FOLDER,"C:\\temp"); |
123 | 123 |
|
124 |
// pThraed를 이용한 컨버팅 설정. |
|
125 |
//최대 페이지가 MultiThreadMaxPages설정까지 pThread를 적용하여 컨버팅함. |
|
124 | 126 |
MultiThreadMaxPages = System.Convert.ToInt16(config.GetValue(CONFIG_DEFINE.SERVICE, CONFIG_DEFINE.MULTI_TRHEAD_MAX_PAGE, "500")); |
125 | 127 |
|
128 |
// 서비스 상태 Log 저장간격 |
|
126 | 129 |
SaveStatusInterval = System.Convert.ToInt16(config.GetValue(CONFIG_DEFINE.SERVICE, CONFIG_DEFINE.SAVE_STATUS_INTERVAL, "5")); |
127 | 130 |
|
131 |
//PDF에 폰트가 최소 폰트 사이즈보다 작은 사이증의 폰트가 있으면 해상도를 높여서 컨버팅함. |
|
128 | 132 |
MinFontSize = System.Convert.ToInt16(config.GetValue(CONFIG_DEFINE.SERVICE, CONFIG_DEFINE.MIN_FONT_SIZE, "10")); |
129 | 133 |
|
134 |
// 사용자 설정의 해상도 |
|
135 |
// MinFontSize를 -1로 하고 UseResolution를 설정하면 해당 해상도로 컨버팅됨 |
|
130 | 136 |
UseResolution = System.Convert.ToInt16(config.GetValue(CONFIG_DEFINE.SERVICE, CONFIG_DEFINE.USE_RESOLUTION, "0")); |
131 | 137 |
|
138 |
// 각 프로세스의 최대 메모리 사용량 |
|
132 | 139 |
var workingMemory = System.Convert.ToDouble(config.GetValue(CONFIG_DEFINE.SERVICE, CONFIG_DEFINE.RELEASE_WORK_MEMORY, "1.5")); |
133 | 140 |
|
134 | 141 |
ReleaseWorkMemory = MathBytes.Bytes(workingMemory, DataSizeType.GB); |
135 | 142 |
|
143 |
// 서비스 사용 프로젝트 |
|
136 | 144 |
var projectList = config.GetValue(CONFIG_DEFINE.SERVICE, CONFIG_DEFINE.FITER_PROCECT,""); |
137 | 145 |
|
138 | 146 |
if(!projectList.IsNullOrEmpty()) |
... | ... | |
150 | 158 |
gServiceHostAddress = UriHelper.UriCreate($"http://localhost:{port}/{endpointName}"); |
151 | 159 |
} |
152 | 160 |
|
161 |
// 각 ConvertService의 원격 관리를 위한 서비스 설정 로드 |
|
153 | 162 |
using (Markus.Service.DataBase.ConvertDatabase db = new Markus.Service.DataBase.ConvertDatabase(MarkusDBConnectionString)) |
154 | 163 |
{ |
155 | 164 |
ServiceProperty = db.GetServiceProperties(ServiceID); |
... | ... | |
173 | 182 |
logger.Error("ServiceStation Start Error - ", ex); |
174 | 183 |
} |
175 | 184 |
} |
176 |
|
|
177 |
private void Timer_Elapsed(object sender, ElapsedEventArgs e) |
|
178 |
{ |
|
179 |
|
|
180 |
//System.Diagnostics.Debug.WriteLine("timer : " + e?.SignalTime); |
|
181 |
//try |
|
182 |
//{ |
|
183 |
// if (!IsReleaseItems) |
|
184 |
// { |
|
185 |
// ReleaseItems(); |
|
186 |
// } |
|
187 |
|
|
188 |
// if ((DateTime.Now - logTime) >= new TimeSpan(0, 5, 0)) |
|
189 |
// { |
|
190 |
// logTime = DateTime.Now; |
|
191 |
// logger.Info("StationService Alive Check"); |
|
192 |
// } |
|
193 |
//} |
|
194 |
//catch (Exception ex) |
|
195 |
//{ |
|
196 |
// logger.Error("Timer Error " ,ex); |
|
197 |
//} |
|
198 |
|
|
199 |
//System.Threading.Thread.SpinWait(1000); |
|
200 |
|
|
201 |
//timer.Start(); |
|
202 |
} |
|
203 |
|
|
185 |
|
|
204 | 186 |
/// <summary> |
205 | 187 |
/// alivequeue와 process를 비교하여 정리하고 |
206 | 188 |
/// 대기중인 아이템을 분배한다. |
... | ... | |
282 | 264 |
public bool StartService() |
283 | 265 |
{ |
284 | 266 |
|
267 |
/// 서비스 설정 로드 |
|
285 | 268 |
try |
286 | 269 |
{ |
287 | 270 |
this.GetApplicationConfig(); |
... | ... | |
302 | 285 |
throw new Exception("StartService Error. ", e); |
303 | 286 |
} |
304 | 287 |
|
288 |
/// pThread.dll을 리소스에서 Service 실행 디렉토리로 복사. |
|
305 | 289 |
try |
306 | 290 |
{ |
307 | 291 |
// MarkusPDF.dll에서 pThread lib 사용을 위해 Insatll |
... | ... | |
321 | 305 |
throw new Exception("Stop Installer Error. ", e); |
322 | 306 |
} |
323 | 307 |
|
308 |
/// 컨버터 프로세스가 실행중인 경우 모두 중지 시킨다. |
|
324 | 309 |
try |
325 | 310 |
{ |
326 | 311 |
// 기존에 실행 중이던 프로세스 종료 |
... | ... | |
332 | 317 |
throw new Exception("Stop Process Error. ", e); |
333 | 318 |
} |
334 | 319 |
|
320 |
/// wcf 서비스 실행 |
|
335 | 321 |
try |
336 | 322 |
{ |
337 | 323 |
// WCF 실행 |
ConvertService/ServiceBase/ReadMe.txt | ||
---|---|---|
1 |
1. Config ???? |
|
2 |
1) ?????????? Salaros.ConfigParser?? ??????. |
|
3 |
- https://www.nuget.org/packages/Salaros.ConfigParser/0.3.4-preview1 |
|
4 |
1) ServiceStation.ini |
|
5 |
- ?????? ?????? ???????? |
|
6 |
- Markus.Service.Station.csproj?? ServiceStation.ini?? ??????? ????? ????????? ServiceStation.ini?? ?????? LINK???????. |
|
7 |
- LINKK???? ???? https://blogs.msdn.microsoft.com/jjameson/2009/04/02/linked-files-in-visual-studio-solutions/ |
|
8 |
|
|
9 |
2) Plugin.ini |
|
10 |
- ??????????? ?????? ???? ???? |
|
11 |
_________________________ |
|
12 |
[PlugInName] |
|
13 |
SettingKey=value |
|
14 |
------------------------- |
|
15 |
|
|
16 |
2. ??? ?? ???? ??? |
|
17 |
1) MarkusPDF.dll?? ?????? ???? ???? WindowSDK?????? ?????? ??? ????? ???. |
|
18 |
- Managed C++?? ????? DLL?? ?????????? SDK |
|
19 |
- Windows SDK for Windows Store Managed Apps Libs-x86_en-us |
|
20 |
- Windows SDK Signing Tools-x86_en-us |
|
21 |
|
|
22 |
2) MakrusDB?? SERVICE_PROPERTIES ???? |
|
23 |
- ID : ?????? GUID |
|
24 |
- SERVICET_TYPE : ???????? ??????? ????? 2?? ??? |
|
25 |
- SERVICE_ADDRESS : WCF ???? ?????? ??? |
|
26 |
- SERVICE_PORT : ??????. |
|
27 |
- HOST_NAME : ?????? ??????? |
|
28 |
- PROCESS_COUNT |
|
29 |
(1) CPU?? Core?????? 70?????????? ????. |
|
30 |
(2) ??? ?????? ????????? ??????? ?????? ?? Window?? ???????? ??????? ??? ???????? ????????? ???. |
|
31 |
|
|
32 |
3) MakrusDB?? RUN_PROJECTS ???? |
|
33 |
- ConvertService?? ?????? Project |
|
34 |
- ServiceStation.ini???? ??????? ?????? ?????? ????????? ???? Ini?? ????????????? ???? ?? ???? |
|
35 |
|
|
36 |
4) MakrusDB?? PROPERTIES ???? |
|
37 |
- Type????? 'TileSorcePath', PROPERTY?? Project No, VALUE?? ??????? ?????? ???? ???? ???? |
|
38 |
|
|
39 |
4) ServiceStation.ini?? STATAION_ADDRESS ???? |
|
40 |
- ?????? WCF ???? ???. |
|
41 |
- ???????? PC?? ????? ??? ??? ??? ??? ???? ?? ???? ????? ???????. |
|
42 |
|
|
43 |
5) ServiceStation.ini?? SERVICE_ID |
|
44 |
- ??? ???? ?????? Service ID?? ?????? GUID?? ???? |
|
45 |
|
|
46 |
6) ServiceStation.ini?? SERVICE_LIST |
|
47 |
- ??? ???? ????? ??? |
|
48 |
- ??????? ','?? ???. |
|
49 |
- ex) SERVICE_LIST = 0AC6FD8E-5060-4B0F-9E6B-A7380B9FCF7B,0AC6FD8E-5060-4B0F-9E6B-A7380B9FCF9B |
|
50 |
|
|
51 |
7) ServiceStation.ini?? ConnectionString ???? |
|
52 |
- ???? ????? ??? Database?? Connection string?? ??????? ????? ??? ???? ??????? |
|
53 |
ConnectionStringBuild?? ????? ???? ?? ?? 1.1?? ServiceStation.ini?? MarkusDataBaseConnectionString Section?? ???? |
|
54 |
|
|
55 |
8) ServiceStation.ini?? FITER_PROCECT |
|
56 |
- MakrusDB?? RUN_PROJECTS?? ???? Project No?? ??? |
|
57 |
- ??????? ','?? ???. |
|
58 |
- ex) FITER_PROCECT = 111111,000000,130351,150052 |
|
59 |
|
|
60 |
9) ServiceStation.ini?? WCF_ENDPOINT Section |
|
61 |
- STATION_PORT = ???? ??? |
|
62 |
- STATION_SERVICE_NAME = WCF EndPoint?? |
|
63 |
|
|
64 |
3. ???? |
|
65 |
1) ServiceTestApp |
|
66 |
- ?????? ??? ?????? ?? ?? ???. |
ConvertService/ServiceBase/ServiceBase.sln | ||
---|---|---|
103 | 103 |
DefaultWebSiteLanguage = "Visual C#" |
104 | 104 |
EndProjectSection |
105 | 105 |
EndProject |
106 |
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{550E3333-9B36-4B0F-A411-93EDA2D75CF4}" |
|
107 |
ProjectSection(SolutionItems) = preProject |
|
108 |
ReadMe.txt = ReadMe.txt |
|
109 |
EndProjectSection |
|
110 |
EndProject |
|
106 | 111 |
Global |
107 | 112 |
GlobalSection(SolutionConfigurationPlatforms) = preSolution |
108 | 113 |
Debug|Any CPU = Debug|Any CPU |
ConvertService/ServiceBase/StationRestTest/HtmlPage.html | ||
---|---|---|
1 |
<!DOCTYPE html> |
|
2 |
<html> |
|
3 |
<head> |
|
4 |
<meta charset="utf-8" /> |
|
5 |
<title></title> |
|
6 |
</head> |
|
7 |
<body> |
|
8 |
<script type="text/javascript"> |
|
9 |
function post_to_url(path, params, method) { |
|
10 |
method = method || "post"; |
|
11 |
|
|
12 |
var form = document.createElement("form"); |
|
13 |
|
|
14 |
//Move the submit function to another variable |
|
15 |
//so that it doesn't get overwritten. |
|
16 |
form._submit_function_ = form.submit; |
|
17 |
|
|
18 |
form.setAttribute("method", method); |
|
19 |
form.setAttribute("action", path); |
|
20 |
|
|
21 |
for(var key in params) { |
|
22 |
var hiddenField = document.createElement("input"); |
|
23 |
hiddenField.setAttribute("type", "hidden"); |
|
24 |
hiddenField.setAttribute("name", key); |
|
25 |
hiddenField.setAttribute("value", params[key]); |
|
26 |
|
|
27 |
form.appendChild(hiddenField); |
|
28 |
} |
|
29 |
|
|
30 |
document.body.appendChild(form); |
|
31 |
form._submit_function_(); //Call the renamed function. |
|
32 |
} |
|
33 |
|
|
34 |
post_to_url("http://localhost:9101/StationService/Rest/GetConvertItem", { ProjectNo: "111111", DocumentID:"2833409804" } ); |
|
35 |
</script> |
|
36 |
|
|
37 |
</body> |
|
38 |
</html> |
내보내기 Unified diff