summaryrefslogtreecommitdiff
path: root/testgraphical/source/dbhelper.pm
blob: 0f5c0d5bb5ea814f04e846cbb0d1283b5f5aa56a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
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
#
# # ------------------------------------------------------------------------------
#
# sub DB_INSERT_INTO_TABLE_STATUS()
# {
#     # my $sDocID = shift;
#     # my $sDBDistinct = shift;
#
#     my $sHostname = hostname;
#
#     my $sSQL = "INSERT INTO status (docid, dbdistinct2, hostname)";
#     $sSQL .= "  VALUES ($docid, '$dbdistinct', '$sHostname')";
#     ExecSQL($sSQL);
# }
# sub DB_UPDATE_TABLE_STATUS_SET_INFO($)
# {
#     # my $sDocID = shift;
#     # my $sDBDistinct = shift;
#     my $sInfo = shift;
#
#     # my $sHostname = hostname;
#
#     my $sInsertSQL = "UPDATE status SET info='$sInfo' WHERE docid=$docid AND dbdistinct2='$dbdistinct'";
#     ExecSQL($sInsertSQL);
# }
#
# sub DB_UPDATE_TABLE_DOCUMENTS_SET_STATE_INFO($$)
# {
#     # my $sDocID = shift;
#     my $sStatus = shift;
#     my $sError = shift;
#
#     my $sSQL = "UPDATE documents";
#     $sSQL .= " SET state='" . $sStatus . "'";
#     $sSQL .= ",info='" . $sError . "'";
#     $sSQL .= " WHERE docid=$docid";
#     ExecSQL($sSQL);
# }
# sub DB_UPDATE_TABLE_STATUS_SET_STATE($)
# {
#     # my $sDocID = shift;
#     my $sStatus = shift;
#
#     my $sSQL = "UPDATE status";
#     $sSQL .= " SET state='" . $sStatus . "'";
#     $sSQL .= " WHERE docid=$docid";
#     ExecSQL($sSQL);
# }
#
# # sub DB_UPDATE_TABLE_STATUS_SET_STATE_FAILED()
# # {
# #     DB_UPDATE_TABLE_STATUS_SET_STATE("FAILED-FAILED");
# # }
# # ------------------------------------------------------------------------------
# # sub getDBConnectionString()
# # {
# #     # return "server:jakobus,db:jobs_convwatch,user:admin,passwd:admin";
# #     return "server:unoapi,db:jobs_convwatch,user:convwatch,passwd:convwatch";
# # }
# # ------------------------------------------------------------------------------
# sub getSourceInfo($)
# {
#     my $sDBStr = shift;
#
#     my $sSourceVersion;
#     if ( $sDBStr =~ / sourceversion='(.*?)',/ )
#     {
#         $sSourceVersion = $1;
#         log_print( "sSourceVersion: $sSourceVersion\n");
#     }
#     if (! $sSourceVersion)
#     {
#         log_print( "Error: no value for sourceversion found.\n");
#         return;
#     }
#     my $sSourceName;
#     if ( $sDBStr =~ / sourcename='(.*?)',/ )
#     {
#         $sSourceName = $1;
#         log_print( "sSourceName: $sSourceName\n");
#     }
#     my $sSourceCreatorType;
#     if ( $sDBStr =~ / sourcecreatortype='(.*?)',/ )
#     {
#         $sSourceCreatorType = $1;
#         log_print( "sSourceCreatorType: $sSourceCreatorType\n");
#     }
#     return $sSourceVersion, $sSourceName, $sSourceCreatorType;
# }
# # ------------------------------------------------------------------------------
# sub getDestinationInfo($)
# {
#     my $sDBStr = shift;
#
#     my $sDestinationVersion;
#     if ( $sDBStr =~ / destinationversion='(.*?)',/ )
#     {
#         $sDestinationVersion = $1;
#         log_print( "sDestinationVersion: $sDestinationVersion\n");
#     }
#     if (! $sDestinationVersion)
#     {
#         log_print( "Error: no value for destinationversion found.\n");
#         return;
#     }
#     my $sDestinationName;
#     if ( $sDBStr =~ / destinationname='(.*?)',/ )
#     {
#         $sDestinationName = $1;
#         log_print( "sDestinationName: $sDestinationName\n");
#     }
#     my $sDestinationCreatorType;
#     if ( $sDBStr =~ / destinationcreatortype='(.*?)',/ )
#     {
#         $sDestinationCreatorType = $1;
#         log_print( "sDestinationCreatorType: $sDestinationCreatorType\n");
#     }
#     return $sDestinationVersion, $sDestinationName, $sDestinationCreatorType;
# }
# # ------------------------------------------------------------------------------
# # sub getMailAddress($)
# # {
# #     my $sDBStr = shift;
# #     my $sMailAddress = "";
# #     if ( $sDBStr =~ / mailfeedback='(.*?)',/ )
# #     {
# #         $sMailAddress = $1;
# #         log_print( "sMailAddress: $sMailAddress\n");
# #     }
# #     return $sMailAddress;
# # }
#
# # sub getDocumentInfo($)
# # {
# #     my $sDBStr = shift;
# #
# #     my $sDocumentPoolPath;
# #     if ( $sDBStr =~ / documentpoolpath='(.*?)',/ )
# #     {
# #         $sDocumentPoolPath = $1;
# #         log_print( "sDocumentPoolPath: $sDocumentPoolPath\n");
# #     }
# #     if (! $sDocumentPoolPath)
# #     {
# #         log_print( "Error: no value for documentpoolpath found.\n");
# #         return;
# #     }
# #     my $sDocumentPool;
# #     if ( $sDBStr =~ / documentpool='(.*?)',/ )
# #     {
# #         $sDocumentPool = $1;
# #         log_print( "sDocumentPool: $sDocumentPool\n");
# #     }
# #     if (! $sDocumentPool)
# #     {
# #         log_print( "Error: no value for documentpool found.\n");
# #         return;
# #     }
# #     my $sDocumentName;
# #     if ( $sDBStr =~ / name='(.*?)',/ )
# #     {
# #         $sDocumentName = $1;
# #         log_print( "sDocumentName: $sDocumentName\n");
# #     }
# #     return $sDocumentPoolPath, $sDocumentPool, $sDocumentName;
# # }
#
# sub getDistinct($)
# {
#     my $sDBStr = shift;
#     my $sDBDistinct;
#     if ( $sDBStr =~ / dbdistinct2='(\S*?)',/ )
#     {
#         $sDBDistinct = $1;
#         log_print( "dbdistinct2: $sDBDistinct\n");
#     }
#     return $sDBDistinct;
# }
#
# sub getIDInfo($)
# {
#     my $sDBStr = shift;
#     # my $dbdistinct;
#
#     my $sDBDistinct = getDistinct($sDBStr);
#     # if ( $sDBStr =~ / dbdistinct2='(\S*?)',/ )
#     # {
#     #     $sDBDistinct = $1;
#     #     log_print( "dbdistinct2: $sDBDistinct\n");
#     # }
#     if (! $sDBDistinct)
#     {
#         log_print( "Error: no dbdistinct given.\n");
#         return;
#     }
#     my $sDocID;
#     if ( $sDBStr =~ / docid=(\S*?),/ )
#     {
#         $sDocID = $1;
#         log_print( "docid: $sDocID\n");
#     }
#     if (! $sDocID)
#     {
#         log_print( "Error: no docid given.\n");
#         return;
#     }
#     return $sDBDistinct, $sDocID;
# }
#