2 # # ------------------------------------------------------------------------------
4 # sub DB_INSERT_INTO_TABLE_STATUS()
6 # # my $sDocID = shift;
7 # # my $sDBDistinct = shift;
9 # my $sHostname = hostname;
11 # my $sSQL = "INSERT INTO status (docid, dbdistinct2, hostname)";
12 # $sSQL .= " VALUES ($docid, '$dbdistinct', '$sHostname')";
15 # sub DB_UPDATE_TABLE_STATUS_SET_INFO($)
17 # # my $sDocID = shift;
18 # # my $sDBDistinct = shift;
21 # # my $sHostname = hostname;
23 # my $sInsertSQL = "UPDATE status SET info='$sInfo' WHERE docid=$docid AND dbdistinct2='$dbdistinct'";
24 # ExecSQL($sInsertSQL);
27 # sub DB_UPDATE_TABLE_DOCUMENTS_SET_STATE_INFO($$)
29 # # my $sDocID = shift;
30 # my $sStatus = shift;
33 # my $sSQL = "UPDATE documents";
34 # $sSQL .= " SET state='" . $sStatus . "'";
35 # $sSQL .= ",info='" . $sError . "'";
36 # $sSQL .= " WHERE docid=$docid";
39 # sub DB_UPDATE_TABLE_STATUS_SET_STATE($)
41 # # my $sDocID = shift;
42 # my $sStatus = shift;
44 # my $sSQL = "UPDATE status";
45 # $sSQL .= " SET state='" . $sStatus . "'";
46 # $sSQL .= " WHERE docid=$docid";
50 # # sub DB_UPDATE_TABLE_STATUS_SET_STATE_FAILED()
52 # # DB_UPDATE_TABLE_STATUS_SET_STATE("FAILED-FAILED");
54 # # ------------------------------------------------------------------------------
55 # # sub getDBConnectionString()
57 # # # return "server:jakobus,db:jobs_convwatch,user:admin,passwd:admin";
58 # # return "server:unoapi,db:jobs_convwatch,user:convwatch,passwd:convwatch";
60 # # ------------------------------------------------------------------------------
61 # sub getSourceInfo($)
66 # if ( $sDBStr =~ / sourceversion='(.*?)',/ )
68 # $sSourceVersion = $1;
69 # log_print( "sSourceVersion: $sSourceVersion\n");
71 # if (! $sSourceVersion)
73 # log_print( "Error: no value for sourceversion found.\n");
77 # if ( $sDBStr =~ / sourcename='(.*?)',/ )
80 # log_print( "sSourceName: $sSourceName\n");
82 # my $sSourceCreatorType;
83 # if ( $sDBStr =~ / sourcecreatortype='(.*?)',/ )
85 # $sSourceCreatorType = $1;
86 # log_print( "sSourceCreatorType: $sSourceCreatorType\n");
88 # return $sSourceVersion, $sSourceName, $sSourceCreatorType;
90 # # ------------------------------------------------------------------------------
91 # sub getDestinationInfo($)
95 # my $sDestinationVersion;
96 # if ( $sDBStr =~ / destinationversion='(.*?)',/ )
98 # $sDestinationVersion = $1;
99 # log_print( "sDestinationVersion: $sDestinationVersion\n");
101 # if (! $sDestinationVersion)
103 # log_print( "Error: no value for destinationversion found.\n");
106 # my $sDestinationName;
107 # if ( $sDBStr =~ / destinationname='(.*?)',/ )
109 # $sDestinationName = $1;
110 # log_print( "sDestinationName: $sDestinationName\n");
112 # my $sDestinationCreatorType;
113 # if ( $sDBStr =~ / destinationcreatortype='(.*?)',/ )
115 # $sDestinationCreatorType = $1;
116 # log_print( "sDestinationCreatorType: $sDestinationCreatorType\n");
118 # return $sDestinationVersion, $sDestinationName, $sDestinationCreatorType;
120 # # ------------------------------------------------------------------------------
121 # # sub getMailAddress($)
123 # # my $sDBStr = shift;
124 # # my $sMailAddress = "";
125 # # if ( $sDBStr =~ / mailfeedback='(.*?)',/ )
127 # # $sMailAddress = $1;
128 # # log_print( "sMailAddress: $sMailAddress\n");
130 # # return $sMailAddress;
133 # # sub getDocumentInfo($)
135 # # my $sDBStr = shift;
137 # # my $sDocumentPoolPath;
138 # # if ( $sDBStr =~ / documentpoolpath='(.*?)',/ )
140 # # $sDocumentPoolPath = $1;
141 # # log_print( "sDocumentPoolPath: $sDocumentPoolPath\n");
143 # # if (! $sDocumentPoolPath)
145 # # log_print( "Error: no value for documentpoolpath found.\n");
148 # # my $sDocumentPool;
149 # # if ( $sDBStr =~ / documentpool='(.*?)',/ )
151 # # $sDocumentPool = $1;
152 # # log_print( "sDocumentPool: $sDocumentPool\n");
154 # # if (! $sDocumentPool)
156 # # log_print( "Error: no value for documentpool found.\n");
159 # # my $sDocumentName;
160 # # if ( $sDBStr =~ / name='(.*?)',/ )
162 # # $sDocumentName = $1;
163 # # log_print( "sDocumentName: $sDocumentName\n");
165 # # return $sDocumentPoolPath, $sDocumentPool, $sDocumentName;
170 # my $sDBStr = shift;
172 # if ( $sDBStr =~ / dbdistinct2='(\S*?)',/ )
175 # log_print( "dbdistinct2: $sDBDistinct\n");
177 # return $sDBDistinct;
182 # my $sDBStr = shift;
185 # my $sDBDistinct = getDistinct($sDBStr);
186 # # if ( $sDBStr =~ / dbdistinct2='(\S*?)',/ )
188 # # $sDBDistinct = $1;
189 # # log_print( "dbdistinct2: $sDBDistinct\n");
191 # if (! $sDBDistinct)
193 # log_print( "Error: no dbdistinct given.\n");
197 # if ( $sDBStr =~ / docid=(\S*?),/ )
200 # log_print( "docid: $sDocID\n");
204 # log_print( "Error: no docid given.\n");
207 # return $sDBDistinct, $sDocID;